:root {
  --bg: #0e1726;
  --bg2: #16233a;
  --panel: #1d2c47;
  --accent: #ff7a59;
  --accent2: #ffd166;
  --ok: #38d39f;
  --ng: #ff5d73;
  --text: #f4f7fb;
  --muted: #9fb0c9;
  --belt: #2b3b59;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1c2c49, var(--bg)) fixed;
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.topbar { text-align: center; margin-bottom: 18px; }
.logo { font-size: 2rem; margin: 0; letter-spacing: 1px; }
.tagline { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }

.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  text-align: center;
}
.panel h2 { margin: 0 0 18px; font-size: 1.4rem; }

.courses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.course {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 12px; border-radius: 14px; cursor: pointer;
  border: 2px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03); color: var(--text);
  transition: transform .12s, border-color .12s, background .12s;
}
.course:hover, .course:focus-visible { transform: translateY(-3px); border-color: var(--accent); background: rgba(255,122,89,.12); outline: none; }
.course-name { font-size: 1.3rem; font-weight: 700; }
.course-detail { color: var(--muted); font-size: .85rem; }

.hint { color: var(--muted); font-size: .85rem; margin-top: 18px; }

/* HUD */
.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.hud-item {
  background: var(--bg2); border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px; padding: 10px; text-align: center;
}
.hud-label { display: block; color: var(--muted); font-size: .72rem; }
.hud-value { font-size: 1.3rem; font-weight: 700; }

/* ステージ・ベルト */
.stage { margin: 8px 0 18px; }
.belt {
  position: relative; height: 150px; border-radius: 16px; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, var(--belt) 0 28px, #33476b 28px 56px);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 -12px 24px rgba(0,0,0,.35);
}
.eat-zone {
  position: absolute; left: 8%; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--accent2), transparent);
  box-shadow: 0 0 18px var(--accent2); opacity: .65;
}
.plate {
  position: absolute; top: 50%; left: 100%;
  transform: translate(-50%, -50%);
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff, #d7e0ee 70%, #aab8d0);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 14px rgba(0,0,0,.35);
}
.sushi-emoji { font-size: 3rem; line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.plate.eaten { animation: eaten .4s ease forwards; }
@keyframes eaten {
  to { transform: translate(-50%, -180%) scale(.4); opacity: 0; }
}
.plate.missed { animation: missed .4s ease forwards; }
@keyframes missed {
  to { transform: translate(-50%, 60%) rotate(-20deg); opacity: 0; }
}

/* タイピング表示 */
.typing-area { text-align: center; }
.word-jp { font-size: 2.4rem; font-weight: 700; letter-spacing: 2px; }
.word-romaji { font-size: 1.6rem; letter-spacing: 3px; margin-top: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.word-romaji .done { color: var(--ok); }
.word-romaji .todo { color: var(--muted); }
.word-jp.flash-ng { animation: shake .2s; color: var(--ng); }
@keyframes shake { 0%,100%{transform:none} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.mobile-hint { display: flex; gap: 8px; align-items: center; justify-content: center; }
#mobile-input {
  width: 1px; height: 1px; opacity: 0; position: absolute; pointer-events: none;
}

/* 結果 */
.result-money { font-size: 3rem; font-weight: 800; color: var(--accent2); margin: 6px 0; }
.result-judge { font-size: 1.2rem; margin-bottom: 18px; }
.result-judge.win { color: var(--ok); }
.result-judge.lose { color: var(--ng); }
.result-stats { list-style: none; padding: 0; margin: 0 0 20px; text-align: left; }
.result-stats li { display: flex; justify-content: space-between; padding: 8px 6px; border-bottom: 1px dashed rgba(255,255,255,.12); }
.result-stats span { color: var(--muted); }

.primary-btn {
  background: linear-gradient(180deg, var(--accent), #e85f3f);
  color: #fff; border: none; border-radius: 12px;
  padding: 14px 28px; font-size: 1.05rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 22px rgba(232,95,63,.35);
  transition: transform .12s;
}
.primary-btn:hover { transform: translateY(-2px); }

.footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 28px; }

@media (max-width: 560px) {
  .logo { font-size: 1.5rem; }
  .courses { grid-template-columns: 1fr; }
  .word-jp { font-size: 1.9rem; }
  .hud-value { font-size: 1.05rem; }
  .belt { height: 120px; }
  .plate { width: 76px; height: 76px; }
  .sushi-emoji { font-size: 2.3rem; }
}
