.play-content { max-width: 1400px; }
.game-ready { display: grid; gap: 28px; max-width: 920px; margin: 0 auto; }
.ready-visual { display: flex; align-items: center; justify-content: center; padding: 24px; border-radius: 20px; background: var(--background); }
.ready-visual .game-art { width: 170px; height: 170px; }
.ready-copy h1 { margin: 16px 0 8px; }
.play-context, .record-note { font-size: .875rem; color: var(--muted); }
.game-instruction { margin-top: 20px; font-size: .875rem; line-height: 1.7; }
.game-rules { margin: 18px 0; font-size: .8125rem; }
.game-rules summary { width: fit-content; padding: 8px 0; color: var(--muted); cursor: pointer; }
.game-rules summary:focus-visible { outline: 3px solid #7663be; outline-offset: 4px; border-radius: 4px; }
.record-note { margin: 22px 0 16px; }
.record-note strong { color: var(--ink); margin-left: 8px; }
.game-hud { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .8fr) auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); background: white; border-radius: 20px; }
.game-hud > div { flex: 1; min-width: 0; }
.game-hud span { display: block; font-size: .6875rem; color: var(--muted); }
.game-hud strong { display: block; margin-top: 5px; font-size: clamp(1rem, 4vw, 1.5rem); font-variant-numeric: tabular-nums; white-space: nowrap; }
#game-score { white-space: normal; overflow-wrap: anywhere; font-size: clamp(.875rem, 3vw, 1.5rem); }
.game-end { padding: 10px 12px; border-radius: 10px; background: var(--background); color: var(--muted); font-size: .75rem; }
.urgent #game-time { color: #b32739; }
.game-timebar { margin-top: 10px; }
.game-feedback { min-height: 42px; padding: 12px 2px 8px; font-size: .875rem; font-weight: 650; color: #2b7763; }
.game-feedback[data-kind="retry"] { color: #8c5a20; }
.game-arena { padding: clamp(16px, 3vw, 32px); background: white; border: 1px solid var(--line); border-radius: 24px; min-height: 330px; }
.game-scoring { margin-top: 18px; color: var(--muted); font-size: .75rem; line-height: 1.8; }
.game-tip { margin-top: 6px; font-size: .75rem; color: var(--muted); }
.round-label { font-size: .8125rem; color: var(--muted); text-align: center; margin-bottom: 22px; }
.question-prompt { font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 750; text-align: center; padding: 20px 8px 28px; overflow-wrap: anywhere; }
.answer-options { display: grid; gap: 12px; }
.answer-options button, .judge-actions button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 14px; border: 1px solid var(--line); background: var(--background); border-radius: 16px; font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.answer-options button:hover, .judge-actions button:hover { border-color: var(--coral); background: #ffedef; }
.answer-options kbd { color: var(--muted); font-size: .6875rem; font-family: inherit; font-weight: 400; }
.answer-options button:disabled { opacity: .6; }
.fall-zone { height: var(--drop-height, 330px); position: relative; border-radius: 20px; background: linear-gradient(#f5f1ff, #fff); overflow: hidden; margin-bottom: 18px; }
.falling-tile { position: absolute; left: calc(var(--lane) * 33.333% + 1%); width: 31.333%; min-height: 58px; display: grid; place-items: center; padding: 12px 5px; background: #e6f4ef; border: 2px solid #bbdccc; border-radius: 12px; font-size: clamp(.8125rem, 2vw, 1.125rem); font-weight: 750; overflow-wrap: anywhere; text-align: center; user-select: none; transition: top 80ms linear; }
[data-game-id="wordDrop"] .game-arena { min-height: 0; }
.drop-form { display: flex; gap: 10px; }
.drop-form input { flex: 1; min-width: 0; width: 100%; min-height: 54px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--background); color: var(--ink); font-size: 1rem; }
.drop-form input:focus { outline: 2px solid #7663be; outline-offset: 2px; }
.drop-form input[aria-invalid="true"] { border-color: var(--coral); outline-color: var(--coral); }
.drop-form button { flex: none; min-height: 54px; padding: 12px 18px; }
.fall-floor { position: absolute; bottom: 0; width: 100%; height: 4px; background: var(--coral); }
.memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.memory-tile { min-height: 80px; padding: 12px 8px; border: 2px solid transparent; border-radius: 16px; background: #e7e1fb; font-size: .875rem; font-weight: 700; overflow-wrap: anywhere; }
.memory-tile > span { font-size: 1.5rem; color: #8b7cb4; }
.memory-tile.face-up { background: #fff9ef; border-color: #f0d9ad; }
.memory-tile.matched { background: var(--mint); border-color: #b7ddcf; color: #347966; }
.build-answer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 92px; padding: 16px; border: 2px dashed var(--line); border-radius: 18px; margin: 0 0 24px; }
.build-answer > span { font-size: .8125rem; }
.build-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.build-answer button, .build-tiles button { min-width: 42px; min-height: 48px; padding: 8px 12px; border-radius: 10px; background: var(--yellow); border-bottom: 3px solid #e8c77c; font-size: 1.125rem; font-weight: 700; }
.build-answer button { background: #ffe3e6; border-color: #efabb4; }
.build-tiles button:disabled { opacity: .18; }
.build-answer.sentence button, .build-tiles.sentence button { font-size: .9375rem; }
.build-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.build-controls .button { min-height: 48px; padding: 10px 16px; font-size: .8125rem; }
.hunt-targets { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.hunt-targets span { padding: 7px 12px; border-radius: 10px; background: var(--lavender); font-size: .8125rem; }
.hunt-targets .done { background: var(--mint); text-decoration: line-through; }
.letter-grid { display: grid; grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr)); gap: 3px; max-width: 530px; margin: 0 auto; touch-action: none; }
.letter-grid button { padding: 0; aspect-ratio: 1; min-width: 0; border-radius: 6px; background: #f7f5fc; font-size: clamp(.625rem, 2.2vw, 1.125rem); font-weight: 700; }
.letter-grid button.found { background: var(--mint); color: #2a735f; }
.letter-grid button.selected { background: var(--coral); }
.hint-button { display: flex; margin: 22px auto 0; min-height: 44px; font-size: .75rem; }
.judge-pair { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 26px 8px 36px; font-size: 1.75rem; font-weight: 750; overflow-wrap: anywhere; text-align: center; }
.judge-link { color: #ac9da1; font-size: 1.25rem; }
.question-time { max-width: 400px; margin: 0 auto 28px; }
.judge-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.judge-actions button:last-child { background: var(--mint); }
.sequence-flash { display: grid; place-items: center; min-height: 200px; font-size: clamp(1.5rem, 4vw, 3rem); font-weight: 800; overflow-wrap: anywhere; text-align: center; }
.sequence-progress { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 12px 0 28px; color: var(--muted); }
.sequence-progress span { min-width: 36px; height: 36px; border-radius: 50%; background: var(--lavender); display: grid; place-items: center; }
.sequence-progress span.done { background: var(--mint); color: #347966; }
.mines-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 600px; margin: auto; }
.mines-grid button { min-height: 72px; padding: 10px 6px; border-radius: 14px; background: var(--lavender); font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; }
.mines-grid button.cleared { background: var(--mint); }
.mines-grid button.revealed { background: #fff6df; color: var(--ink); }
.mines-grid button.mine { background: #ffe4ba; }
.circuit-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; max-width: 530px; margin: 0 auto; background: #e9e3e7; padding: 4px; border-radius: 14px; touch-action: none; }
.circuit-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 3px; background: #fcfafb; border-radius: 5px; }
.endpoint-label { position: relative; z-index: 2; padding: 3px 1px; font-size: clamp(.625rem, 1.4vw, .875rem); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; background: #ffffffd9; border-radius: 4px; }
.endpoint { box-shadow: inset 0 0 0 2px #e4d9df; }
.grid-dot { width: 4px; height: 4px; border-radius: 50%; background: #e1d6dc; }
.wired .grid-dot { width: 12px; height: 12px; background: var(--wire); z-index: 1; }
.wire { position: absolute; background: var(--wire); }
.wire.left, .wire.right { height: 10px; width: 53%; top: calc(50% - 5px); }
.wire.left { left: -2px; } .wire.right { right: -2px; }
.wire.up, .wire.down { width: 10px; height: 53%; left: calc(50% - 5px); }
.wire.up { top: -2px; } .wire.down { bottom: -2px; }
.circuit-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.circuit-controls .button { min-height: 44px; padding: 10px 12px; font-size: .75rem; }
.game-result { max-width: 720px; margin: 0 auto; padding: clamp(24px, 4vw, 48px); text-align: center; }
.game-result h1 { margin: 20px 0 12px; }
.result-score { font-size: clamp(3rem, 8vw, 5rem); font-weight: 850; letter-spacing: -.06em; line-height: 1.2; margin: 26px 0 10px; overflow-wrap: anywhere; }
.result-score span { font-size: 1rem; font-weight: 600; letter-spacing: 0; margin-left: 8px; }
.new-best { color: #a05c15; font-size: .875rem; }
.result-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 32px 0; padding: 20px 8px; border-block: 1px solid var(--line); }
.result-stats span { display: block; font-size: .6875rem; color: var(--muted); }
.result-stats strong { display: block; margin-top: 8px; font-size: 1.375rem; }
.result-note { color: var(--muted); font-size: .75rem; margin: 20px 0; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.result-actions button { flex: 1; min-width: 110px; }
.result-words { text-align: left; }
.result-words h2 { font-size: 1rem; margin-bottom: 14px; }
.result-words p { display: flex; gap: 12px; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .8125rem; overflow-wrap: anywhere; }
.result-words p > * { min-width: 0; }
.result-words span { color: var(--muted); }
.practice-content { max-width: 1100px; }
.sentence-practice { padding: clamp(20px, 4vw, 40px); }
.practice-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.practice-heading h1 { margin-top: 12px; }
.practice-word { padding: 10px 14px; border-radius: 12px; background: var(--lavender); font-weight: 700; overflow-wrap: anywhere; }
.practice-feedback { min-height: 48px; margin-top: 22px; color: #2b7763; font-size: .875rem; line-height: 1.7; overflow-wrap: anywhere; }
.practice-feedback:empty { display: none; }
.practice-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.practice-footer > span { font-size: .75rem; color: var(--muted); }
.practice-footer button { min-height: 44px; background: transparent; padding: 8px 0; color: var(--muted); font-size: .8125rem; text-decoration: underline; text-underline-offset: 4px; }
.hero-ranking { min-height: 44px; margin-top: 8px; background: transparent; font-size: .8125rem; text-decoration: underline; text-underline-offset: 4px; }
.day-game { color: var(--muted); font-size: .8125rem; margin-top: 12px; }
.ranking-button { margin-top: 12px; font-size: .8125rem; }
.ranking-panel { max-width: 1000px; margin-inline: auto; padding: clamp(20px, 4vw, 40px); }
.ranking-heading h1 { margin: 20px 0 12px; }
.ranking-heading > p, .ranking-note { font-size: .8125rem; color: var(--muted); line-height: 1.8; }
.ranking-note { margin: 20px 0; }
.ranking-list { list-style: none; padding: 0; margin: 28px 0; }
.ranking-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 20px 12px; border-bottom: 1px solid var(--line); font-size: .875rem; }
.ranking-list strong { overflow-wrap: anywhere; }
.ranking-list li > span:last-child { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; max-width: 130px; }
.ranking-list small { font-size: .625rem; color: var(--muted); }
.ranking-list .my-ranking { border-radius: 12px; background: #ffe3e6; }
.ranking-place { color: var(--muted); }
.test-stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.test-card h2 { margin: 22px 0 10px; }
.test-card > p { color: var(--muted); font-size: .875rem; }
.test-card > button { margin-top: 26px; }
.test-card button:disabled { opacity: .55; }
.boss-content { max-width: 1050px; }
.boss-ready { max-width: 720px; margin: auto; padding: clamp(24px, 4vw, 40px); }
.boss-avatar { display: block; width: 120px; height: 120px; margin: 0 auto 20px; flex: none; }
.boss-ready > h1 { margin: 20px 0 12px; }
.boss-ready > p { color: var(--muted); font-size: .875rem; }
.boss-live { padding: clamp(20px, 4vw, 40px); }
.boss-top { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.boss-top .boss-avatar { margin: 0; }
.boss-top > div { flex: 1; min-width: min(100%, 220px); }
.boss-top h1 { margin: 12px 0 20px; font-size: 1.75rem; }
.boss-top p { color: var(--muted); font-size: .8125rem; margin-top: 10px; }
.boss-health { accent-color: #7663be; }
.boss-timer { margin-top: 28px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: .8125rem; color: var(--muted); }
.boss-timer strong { color: var(--ink); min-width: 45px; text-align: right; font-variant-numeric: tabular-nums; }
[data-boss-form] { display: flex; flex-wrap: wrap; gap: 12px; }
#boss-answer { flex: 1; width: 100%; min-width: 0; min-height: 54px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--background); color: var(--ink); }
[data-boss-form] .button { min-height: 54px; }
.boss-feedback { min-height: 60px; margin: 24px 0 12px; font-size: .9375rem; color: #2b7763; overflow-wrap: anywhere; }
.boss-next { display: flex; justify-content: flex-end; }
.boss-options.answer-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@keyframes boss-hit { 25%, 75% { transform: translateX(-7px); } 50% { transform: translateX(7px); } }
.boss-hit { animation: boss-hit .25s ease-in-out; }
.boss-guard { filter: saturate(.45); }
@media (prefers-reduced-motion: reduce) { .boss-hit { animation: none; } }
@media (max-width: 699px) {
  .play-content:has(.live-game) { padding-inline: 12px; }
  .live-game .game-arena { padding-inline: 10px; }
  .fall-zone { height: var(--drop-height, clamp(160px, 40svh, 280px)); }
  .game-hud { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px; padding-inline: 12px; }
  .game-hud > div { display: grid; align-self: stretch; align-content: space-between; }
  .game-hud span, .result-stats span { font-size: .875rem; word-break: keep-all; overflow-wrap: anywhere; }
  .game-hud strong, #game-score { font-size: clamp(1.125rem, 6vw, 1.375rem); }
  .game-end { min-height: 44px; }
  .game-end, .round-label, .hint-button, .circuit-controls .button { font-size: .875rem; }
  .game-feedback, .hunt-targets span, .falling-tile, .memory-tile, .mines-grid button { font-size: 1rem; }
  .answer-options button, .judge-actions button { font-size: 1.125rem; }
  .letter-grid button { font-size: clamp(.875rem, 3.5vw, 1.125rem); }
  .circuit-grid { container-type: inline-size; }
  .circuit-cell { aspect-ratio: auto; min-height: calc((100cqi - 8px) / 5); padding: 2px; }
  .endpoint-label { max-width: 100%; padding: 1px 0; font-size: clamp(.8125rem, 4.5vw, 1rem); line-height: 1.15; text-wrap: balance; }
}
@media (min-width: 700px) {
  .game-ready { grid-template-columns: 240px minmax(0, 1fr); padding: 32px; }
  .answer-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-game-id="sequence"] .answer-options { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .memory-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .memory-tile { min-height: 110px; }
  .game-arena { min-height: 390px; }
}
@media (max-width: 359px) {
  .game-hud { padding-block: 14px; }
  .game-end { padding: 8px; }
  .game-arena { padding: 12px; }
}
/* Reveal the result, score, and supporting cards in a short sequence. */
.game-result { animation: result-enter 180ms ease-out backwards; }
.game-result .result-score { animation: result-enter 220ms ease-out 40ms backwards; }
.game-result > p:not(.result-score), .game-result .result-stats > div { animation: result-enter 180ms ease-out 100ms backwards; }
.game-result .result-stats > div:nth-child(2) { animation-delay: 140ms; }
.game-result .result-stats > div:nth-child(3) { animation-delay: 180ms; }
.game-result .result-words { animation: result-enter 180ms ease-out 160ms backwards; }
.game-result .result-actions { animation: result-enter 180ms ease-out 200ms backwards; }
@keyframes result-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .game-result, .game-result .result-score, .game-result > p:not(.result-score), .game-result .result-stats > div, .game-result .result-words, .game-result .result-actions { animation: none; }
}
