/*!
 * © 2025 パソコンサロンゆうらく (Pasokon Salon Yuuraku). All rights reserved.
 * Project: ゆうらく学習トレーニングポータルYuuraku Leaning station
 * File: typing
 * BUILD_ID: YR-2025-0826-K3                 // ← 公開用の可視ビルドID
 * CANARY_ZW
 * SPDX-License-Identifier: LicenseRef-Yuuraku-Proprietary
 * Contact: yuurakunomori@gmail.com  |  URL: https://yuurakus.jp/
 *
 * 重要
 * 
* [日本語 / Japanese]
 * 本スタイルシートおよび関連ファイルの著作権（著作権法上の権利）は、パソコンサロンゆうらくに専属します。
 * 法令で明示的に認められる場合を除き、当社の事前の書面許諾なく、複製・複写・転載・転用・編集・改変・翻案・
 * 逆コンパイル／リバースエンジニアリング・再配布・商用利用・公衆送信（Webへのアップロードを含む）・
 * 自動取得／スクレイピング等の二次利用を固く禁じます。侵害が判明した場合、警告なく直ちに
 * 差止請求・損害賠償請求等の法的措置を厳格に行います。
 * 【重要】本スタイルシートには検証用のBUILD IDおよび不可視の「カナリア文字（ウォーターマーク）」が埋め込まれ、
 * ソースには識別用IDが隠されています。これらの削除・改変は契約違反・不正競争・著作権侵害等として追及します。
 *
 * [English]
 * Copyright in this stylesheet and related files is owned exclusively by
 * Pasokon Salon Yuuraku unless otherwise stated. Except as expressly permitted by law,
 * any reproduction, modification, adaptation, reverse engineering, redistribution,
 * commercial use, public transmission (including posting on the web), or automated
 * collection/scraping without prior written permission is strictly prohibited.
 * Upon detection of infringement, we will immediately pursue legal remedies including
 * injunctive relief and damages. IMPORTANT: This stylesheet embeds a verifiable BUILD ID
 * and invisible “canary” watermark characters, and an identification ID is hidden in the source.
 * Removal or alteration will be treated as a violation and strictly enforced.
 *
 * [中文 / Chinese (Simplified)]
 * 本样式表及相关文件之著作权，除非另有说明，专属于「Pasokon Salon Yuuraku」。
 * 未经事先书面许可，严禁复制、转载、修改、改编、逆向工程、再分发、商业使用、
 * 公开传播（含上传至网络）及自动抓取/爬取等二次利用。一经发现侵权，将立即采取包括
 * 禁令与损害赔偿在内的法律措施。重要：本样式表内已嵌入可验证的BUILD ID与不可见
 * “金丝雀”水印字符，且源代码中隐藏有识别用ID。擅自删除或篡改将被视为违规并依法追究。
 *
 * [한국어 / Korean]
 * 본 스타일시트 및 관련 파일의 저작권은 별도 고지가 없는 한
 * ‘파소콘 살롱 유우라쿠(Pasokon Salon Yuuraku)’에 전속됩니다.
 * 사전 서면 허가 없이 복제, 전재, 전용, 수정, 각색, 리버스 엔지니어링,
 * 재배포, 상업적 이용, 공중송신(웹 게시 포함), 자동 수집·스크래핑 등의 2차 이용을 엄격히 금합니다.
 * 위반 시 예고 없이 즉시 금지청구 및 손해배상 청구 등 법적 조치를 취합니다.
 * 중요: 본 스타일시트에는 검증 가능한 BUILD ID와 보이지 않는 ‘카나리아(워터마크) 문자’가 포함되며,
 * 소스 내부에는 식별용 ID가 숨겨져 있습니다. 이를 삭제·변조하는 행위는 위반으로 간주되어 엄정 대응합니다.
 */

/*==================================================================
  style.css — ローマ字タイピング 用スタイル（最終版 / Refactored）
  - 重複削除、最終意図を1箇所に集約
==================================================================*/

/* ================================================================
   1) Design Tokens / Base
================================================================ */
:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --border:#e6ebf2;
  --ink:#0f172a;
  --muted:#6b7280;
  --primary:#2563eb;
  --accent:#f7f9ff;

  /* ランキング列幅（お好みで変更） */
  --rank-name-w: 72%;
  --rank-score-w: 28%;
  --rank-gap: 2px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans JP","Hiragino Sans","Yu Gothic","Yu Gothic","Meiryo",sans-serif;
  color:var(--ink);
  background:var(--bg);
}

h1{ font-size:28px; margin:0; }

/* ================================================================
   2) Buttons / Small Utilities
================================================================ */
.btn{
  border:1px solid var(--border);
  background:#fff;
  padding:8px 14px;
  border-radius:10px;
  cursor:pointer;
}
.btn.primary{ background:var(--primary); color:#fff; border-color:var(--primary); }
.btn.link{
  background:#fff;
  color:var(--primary);
  border-color:var(--primary);
  text-decoration:none;
  display:inline-block;
}
.btn.outline{ background:#fff; }

.mt8{ margin-top:8px; }

/* ================================================================
   3) Topbar / Name
================================================================ */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 16px;
}
.lang-portal{ display:flex; gap:8px; align-items:center; }
.nameWrap{ display:flex; gap:6px; align-items:center; }
.nameWrap input{
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:8px;
}

/* ================================================================
   4) Layout / Cards / Form
================================================================ */
.layout{
  display:grid;
  grid-template-columns: 1fr 380px;
  gap:16px;
  padding:8px 16px;
}
.leftPane{ display:flex; flex-direction:column; gap:16px; }
.rightPane{ display:flex; flex-direction:column; gap:16px; }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
}

.label{
  font-size:14px;
  color:var(--muted);
  margin-bottom:6px;
}

select{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}

/* ================================================================
   5) Rows / Grids
================================================================ */
.row{ display:grid; gap:16px; }
.cols-3{ grid-template-columns:repeat(3,1fr); }

/* 左列を約20%減（既存意図維持） */
.cols-2-3-2{
  grid-template-columns: 2.4fr 2fr;
  gap:16px;
  column-gap: 6px; /* キーボード枠と指枠の“間”だけ狭める（最終値） */
}

.subRow{
  margin-top:10px;
  display:flex;
  gap:8px;
  align-items:center;
}

/* ================================================================
   6) Status (Final: Inline Chips)
================================================================ */
.status .cap{ color:var(--muted); }

/* 数値表示（チップ化） */
.card.status{ display:block; }
.card.status .label{ margin-bottom:6px; }

.status .statRow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  background:var(--accent);
  border-radius:12px;
  padding:6px 10px;
  margin-right:8px;
  margin-bottom:8px;
}
.status .statRow .cap{ margin-right:4px; }
.status .statRow > span:last-child{
  font-weight:600;
  font-variant-numeric:tabular-nums;
}

/* ボタン列 */
.status .btnRow{
  display:flex;
  gap:8px;
  margin-top:6px;
}

/* ================================================================
   7) Prompt / Runner
================================================================ */
.prompt{ position:relative; min-height:170px; }

.runner{
  position:absolute;
  left:14px; right:14px; top:10px;
  height:120px;
  overflow:hidden;
  font-size:60px;
  line-height:60px;
  white-space: nowrap;
}

.centerText{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  height:140px;
}

.kanaBig{
  font-size:72px;
  letter-spacing:6px;
  color:#1a73e8; /* 好きなカラーに変更 */
}

/* --- season badge (kigo word list) ------------------------------------ */
.kanaBig{
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:12px;
}
.kanaBig .seasonBadge{
  display:inline-block;
  font-size:24px;
  letter-spacing:0;
  padding:2px 12px;
  border-radius:999px;
  background:rgba(15,23,42,.72);
  color:#fff;
  border:1px solid rgba(255,255,255,.35);
  text-shadow:0 1px 2px rgba(0,0,0,.9); /* 小さめの黒ドロップシャドウ */
  box-shadow:0 2px 6px rgba(0,0,0,.25);
}
/* --------------------------------------------------------------------- */


/* 最終仕様：kanaRoma は 16px + 赤 */
.kanaRoma{
  margin-top:2px;
  font-size:16px;
  color:#e81a1a; /* 好きなカラーに変更 */
}

/* 正解済みの文字は見えなくする（幅は保持してレイアウトは崩さない） */
#romaTrack .runnerDone{ visibility:hidden; }

/* ================================================================
   8) Keyboard
================================================================ */
.keyboardWrap .keyboard{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  transform: scale(0.92);
  transform-origin: top center;
}

.krow{ display:flex; gap:10px; justify-content:center; }

.key{
  min-width:42px;
  height:48px;
  border:1px solid var(--border);
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 1px 0 #eef1f6 inset;
  background:#fff;
  font-weight:500;
}

/* JS側でSPACEキーを生成するケース用（ただし最終的に非表示化する運用） */
.key.space{
  min-width:60%;
  width:60%;
  height:56px;
  margin:2px auto;
  font-weight:700;
  letter-spacing:2px;
}

.key.on{ outline:3px solid #ffd66b; background:#fff8d6; }

/* === hotfix: keyboard & fingers layout (non-destructive) ================= */
.keyboardWrap .spaceRow{ display:flex; justify-content:center; } /* hide duplicated SPACE in HTML */
/* JIS-like row offsets */
.keyboard .krow:nth-child(2){ margin-left:20px; }
.keyboard .krow:nth-child(3){ margin-left:32px; }
.keyboard .krow:nth-child(4){ margin-left:52px; }

/* HTML側spaceRowを採用するため、JS側spaceは非表示 */
.keyboard .krow .key.space{ display:none; }
/* ======================================================================== */

/* キーボード枠を少し細く（グリッド内で中央寄せ） */
.card.keyboardWrap{
  width:95%;
  justify-self:center;
  margin-inline:auto;
}

/* ================================================================
   9) Fingers (Final Layout)
================================================================ */
.fingersWrap{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

/* 最終：1列10本、下揃え、gap 7 */
.fingers{
  display:grid;
  grid-template-columns:repeat(10, 1fr);
  grid-auto-flow:column;
  gap:7px;
  align-items:end;
}

/* flatten 2 hands -> 10 fingers in one row */
.fingers .hand{ display: contents; }

.finger{
  height:108px;
  border:1px solid var(--border);
  background:#fbeb8c;
  border-radius:18px 18px 12px 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-weight:600;
  color:#63634b;
  line-height:1.1;
  font-size:18px;
  text-align:center;
}
.finger.on{ outline:3px solid #1351e4; background:#c5fffe; }
.fingers .thumb{ height:60px; }

/* ================================================================
   10) Ranking (Top 10)
================================================================ */
.rankList{ padding-left:18px; margin:8px 0 12px; }

.shareCol{ display:flex; gap:8px; margin:8px 0; }

.rank-row{
  display:flex;
  align-items:baseline;
  gap:var(--rank-gap);
  justify-content:flex-start; /* space-between を使わず列幅で制御 */
}

.rank-name{
  flex:0 0 var(--rank-name-w);
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rank-score{
  flex:0 0 var(--rank-score-w);
  margin-left:auto;
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.rank-meta{
  margin-top:2px;
  display:flex;
}

.rank-key{
  margin-left:auto;
  text-align:right;
  width:100%;
  font-size:.82em;
}

/* ================================================================
   11) Modal
================================================================ */
.modal{
  position:fixed;
  inset:0;
  background:rgba(20,22,30,.4);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:60;
}
.modal .modalInner{
  width:min(810px,84.6vw);
  background:#fff;
  border-radius:16px;
  border:1px solid var(--border);
  overflow:hidden;
}
.modal .modalActions{
  display:flex;
  justify-content:center;
  gap:12px;
  padding:12px;
}
.modal .certPaper{
  position:relative;
  background:#fff6cc;
  min-height:468px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:29px;
}
.modal .certText{ max-width:80%; font-size:18px; line-height:1.6; }
.modal.hidden{ display:none; }
.modal:not(.hidden){ display:flex; }

/* === patch: modal cert background (use rank.jpg) ======================= */
.modal .certPaper{
  background-image:url('rank.jpg');
  background-size:80% auto;
  background-repeat:no-repeat;
  background-position:center;
}
/* ====================================================================== */

/* ================================================================
   12) Compact Top Cards
================================================================ */
.row.cols-3 .card{ padding:8px 10px; }
.row.cols-3 .label{ margin-bottom:4px; }
.row.cols-3 select{ padding:8px 10px; }

/* ================================================================
   13) Hit FX: typing explosion
================================================================ */
.fxLayer{ position:absolute; inset:0; pointer-events:none; overflow:visible; z-index:9; }

.hit-ring{
  position:absolute;
  width:16px; height:16px;
  border:4px solid #ffd66b;
  border-radius:50%;
  transform:translate(-50%,-50%) scale(.6);
  animation:hit-ring .6s ease-out forwards;
  mix-blend-mode:screen;
}
@keyframes hit-ring{
  to{ opacity:0; transform:translate(-50%,-50%) scale(3); }
}

.particle{
  position:absolute;
  width:8px; height:8px;
  border-radius:50%;
  background:currentColor;
  transform:translate(-50%,-50%);
  animation:fly var(--dur,700ms) cubic-bezier(.2,.8,.2,1) forwards;
  box-shadow:0 0 10px currentColor;
}
@keyframes fly{
  to{
    transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)));
    opacity:.12;
  }
}

.flash{
  position:absolute;
  inset:0;
  background:#fff;
  opacity:.6;
  animation:flash .18s ease-out forwards;
}
@keyframes flash{ to{ opacity:0; } }

.prompt.shake{ animation:shake .22s linear 1; }
@keyframes shake{
  10%{transform:translate(-1px,-1px)}
  20%{transform:translate(1px,0)}
  30%{transform:translate(0,1px)}
  40%{transform:translate(1px,-1px)}
  50%{transform:translate(-1px,1px)}
  60%{transform:translate(1px,0)}
  70%{transform:translate(0,-1px)}
  80%{transform:translate(-1px,1px)}
  90%{transform:translate(1px,0)}
  100%{transform:translate(0,0)}
}

/* ================================================================
   14) Countdown overlay
================================================================ */
.countdown{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-size:120px; font-weight:800;
  color:var(--primary);
  background:rgba(255,255,255,.82);
  text-shadow:0 6px 12px rgba(0,0,0,.12);
  z-index:50;
}
.countdown.hidden{ display:none; }

@keyframes pop{
  0%{ transform:scale(.6); opacity:0; }
  40%{ transform:scale(1.1); opacity:1; }
  100%{ transform:scale(1); opacity:1; }
}
.countdown.pop{ animation:pop .36s ease-out; }

/* ================================================================
   15) Responsive
================================================================ */
@media (max-width: 640px){
  .cols-2-3-2{ column-gap:12px; }
}

/* ================================================================
   16) OPTIONAL SWITCHES（後でカード幅調整に入るためのスイッチ）
   ※ 使うときだけコメントアウト解除してください
================================================================ */

/* [OPTION A] ランキング“カード（白い箱）”の横幅を%で調整（ボックスそのもの） */
/*
#rankCol > .card{
  width: 86%;
  max-width: 520px;
  margin: 0 auto;  // 中央寄せ
}
*/

/* [OPTION B] 右カラム全体を細くする（ランキング列そのもの） */

.layout{
  grid-template-columns: 1fr 240px;
}

/* [OPTION C] 「スコア」と「日付」の左右の間隔を詰めたい場合（見た目変わります） */
/*
.rank-meta{
  justify-content:flex-end;
}
.rank-key{
  width: var(--rank-score-w);
  max-width: var(--rank-score-w);
}
*/
