:root {
  --navy: #0a2540;
  --navy-deep: #061a2d;
  --blue: #4186f6;
  --blue-soft: #dbe9ff;
  --ink: #102943;
  --muted: #64748b;
  --line: #dbe5f0;
  --surface: #ffffff;
  --good: #138a62;
  --good-bg: #e6f7f0;
  --bad: #c24157;
  --bad-bg: #fff0f2;
  --shadow: 0 18px 50px rgba(10, 37, 64, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #eef4fa; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 50% -15%, #204d78 0, var(--navy) 40%, var(--navy-deep) 100%);
}
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100% - 32px, 920px); margin: 0 auto; padding: 30px 0 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: white; margin-bottom: 25px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid rgba(255,255,255,.42); border-radius: 15px; color: white; font-size: 24px; font-weight: 800; transform: rotate(-6deg); }
.eyebrow { margin: 0 0 3px; color: #a9c9f5; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.035em; }
.restart-link { border: 1px solid rgba(255,255,255,.28); border-radius: 10px; padding: 9px 12px; color: white; background: rgba(255,255,255,.08); font-size: 14px; font-weight: 700; }
.restart-link:hover, .restart-link:focus-visible { background: rgba(255,255,255,.17); }
.mode-tabs { display: flex; gap: 7px; padding: 6px; border: 1px solid rgba(255,255,255,.19); border-radius: 15px; background: rgba(0,0,0,.16); }
.mode-tab { flex: 1; border: 0; border-radius: 10px; padding: 12px 10px; color: #c4d5ea; background: transparent; font-weight: 750; transition: .18s ease; }
.mode-tab span { margin-right: 7px; color: #7eabeb; }
.mode-tab:hover { color: white; background: rgba(255,255,255,.08); }
.mode-tab.active { color: var(--navy); background: white; box-shadow: 0 4px 14px rgba(0,0,0,.16); }
.mode-tab.active span { color: var(--blue); }
.stats { display: flex; align-items: center; justify-content: center; gap: clamp(26px, 8vw, 78px); margin: 24px 0 18px; color: white; text-align: center; }
.stat { position: relative; display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; }
.stat-label { grid-column: 1 / -1; color: #a9c9f5; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.stat strong { font-size: 25px; line-height: 1.2; }
.stat-suffix { font-size: 16px; }
.game { min-height: 510px; border-radius: 23px; padding: clamp(18px, 4vw, 32px); background: var(--surface); box-shadow: var(--shadow); }
.loading { display: grid; min-height: 420px; place-items: center; color: var(--muted); font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-kicker { margin: 0; color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card-tip { margin: 0; color: var(--muted); font-size: 13px; }
.quiz-layout { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; align-items: center; gap: clamp(23px, 5vw, 52px); max-width: 790px; margin: 0 auto; }
.photo-frame { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 18px; background: linear-gradient(145deg, #dceaff, #f0f5fb); }
.member-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-frame::after { position: absolute; inset: 0; border: 1px solid rgba(10,37,64,.12); border-radius: inherit; content: ""; pointer-events: none; }
.answers { display: grid; gap: 10px; }
.answer-btn { display: flex; align-items: center; width: 100%; min-height: 55px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 13px; color: var(--ink); background: #fbfdff; font-size: 16px; font-weight: 700; text-align: left; transition: transform .14s ease, border .14s ease, background .14s ease; }
.answer-btn:hover:not(:disabled), .answer-btn:focus-visible:not(:disabled) { border-color: var(--blue); background: #f3f7ff; transform: translateY(-1px); outline: none; }
.answer-key { display: grid; place-items: center; flex: 0 0 29px; height: 29px; margin-right: 10px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 13px; }
.answer-btn.correct { border-color: var(--good); color: var(--good); background: var(--good-bg); }
.answer-btn.correct .answer-key { color: white; background: var(--good); }
.answer-btn.wrong { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.answer-btn.wrong .answer-key { color: white; background: var(--bad); }
.answer-btn:disabled { cursor: default; }
.feedback { min-height: 43px; margin-top: 16px; border-radius: 12px; padding: 11px 14px; font-size: 14px; line-height: 1.4; }
.feedback:empty { display: none; }
.feedback.good { color: var(--good); background: var(--good-bg); }
.feedback.bad { color: var(--bad); background: var(--bad-bg); }
.next-row { display: flex; justify-content: flex-end; margin-top: 13px; }
.primary-btn { border: 0; border-radius: 11px; padding: 12px 19px; color: white; background: var(--blue); font-weight: 800; box-shadow: 0 5px 13px rgba(65,134,246,.26); }
.primary-btn:hover, .primary-btn:focus-visible { background: #2e73e0; outline: none; transform: translateY(-1px); }
.practice-wrap, .type-wrap { max-width: 610px; margin: 0 auto; text-align: center; }
.practice-wrap .photo-frame { max-width: 390px; margin: 0 auto 18px; }
.reveal-panel { min-height: 78px; margin: 0 auto 16px; padding: 13px 18px; border-radius: 14px; background: #f2f6fb; }
.reveal-name { margin: 0 0 3px; font-size: 23px; }
.reveal-role { margin: 0; color: var(--muted); }
.reveal-hidden { color: var(--muted); font-size: 15px; }
.reveal-btn { border: 1px solid #b9d2f7; border-radius: 11px; padding: 11px 18px; color: var(--blue); background: white; font-weight: 800; }
.reveal-btn:hover, .reveal-btn:focus-visible { background: var(--blue-soft); outline: none; }
.type-instruction { margin: 0 0 17px; color: var(--muted); }
.type-wrap .photo-frame { max-width: 310px; margin: 0 auto 21px; }
.type-form { display: flex; gap: 9px; max-width: 510px; margin: 0 auto; }
.type-input { width: 100%; min-width: 0; border: 2px solid var(--line); border-radius: 11px; padding: 12px 14px; color: var(--ink); background: white; font-size: 16px; }
.type-input:focus { border-color: var(--blue); outline: 3px solid rgba(65,134,246,.16); }
.type-form .primary-btn { white-space: nowrap; }
.type-wrap .feedback { text-align: left; }
.shortcuts { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px 25px; padding-top: 19px; color: #a9c9f5; font-size: 12px; }
kbd { display: inline-block; min-width: 21px; border: 1px solid rgba(255,255,255,.32); border-radius: 5px; padding: 2px 5px; color: white; background: rgba(255,255,255,.1); font-family: inherit; font-size: 11px; text-align: center; }
.error-box { margin: 40px auto; max-width: 530px; border-radius: 14px; padding: 20px; color: var(--bad); background: var(--bad-bg); text-align: center; }

@media (max-width: 650px) {
  .app-shell { width: min(100% - 20px, 920px); padding-top: 18px; }
  .topbar { margin-bottom: 17px; }
  .brand-mark { width: 41px; height: 41px; border-radius: 12px; font-size: 21px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 24px; }
  .restart-link { padding: 8px 10px; }
  .restart-link span { display: none; }
  .mode-tab { padding: 11px 6px; font-size: 13px; }
  .mode-tab span { margin-right: 3px; }
  .stats { gap: 0; justify-content: space-around; margin: 18px 0 14px; }
  .stat strong { font-size: 21px; }
  .game { min-height: 520px; padding: 18px 15px; border-radius: 18px; }
  .card-head { margin-bottom: 14px; }
  .card-tip { display: none; }
  .quiz-layout { grid-template-columns: 1fr; gap: 18px; }
  .quiz-layout .photo-frame { max-width: 280px; margin: 0 auto; }
  .answer-btn { min-height: 51px; font-size: 15px; }
  .practice-wrap .photo-frame { max-width: 280px; }
  .type-wrap .photo-frame { max-width: 250px; }
  .type-form { flex-direction: column; }
  .type-form .primary-btn { width: 100%; }
  .shortcuts { display: none; }
}
