.practice-page { background: var(--bg); }
.practice-page .page { padding-top: 20px; }
.practice-page .container { width: min(1040px, calc(100% - 48px)); }
.practice-page .topbar { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.practice-page .button { box-shadow: none; font-weight: 650; }
.practice-page .button.primary { background: var(--primary); }
.practice-intro { padding: 0 0 16px; }
.practice-intro h1 { font-size: var(--page-title-size); line-height: var(--page-title-line); font-weight: var(--page-title-weight); margin-bottom: 8px; overflow-wrap: anywhere; }
.practice-intro p { color: var(--muted); max-width: 760px; margin: 0; font-size: 15px; }
.practice-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); }
.practice-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 2px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 650; cursor: pointer; }
.practice-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.workspace { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 360px); justify-content: space-between; gap: 64px; padding: 16px 0 32px; align-items: start; }
.board-column { min-width: 0; max-width: 420px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.size-controls { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--control-border); border-radius: 6px; background: var(--surface-soft); }
.size-controls button { min-width: 46px; min-height: 44px; padding: 4px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.size-controls button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.control-field { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.control-field select, .control-field input { max-width: 155px; min-height: 46px; padding: 4px 9px; border: 1px solid var(--control-border); border-radius: 6px; background: var(--surface-strong); color: var(--text); font: inherit; }
.control-field input { width: 76px; }
.round-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.round-stats dt { color: var(--muted); font-size: 12px; line-height: 20px; }
.round-stats dd { margin: 0; font-size: var(--stat-number-size); font-weight: var(--stat-number-weight); line-height: var(--stat-number-line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.round-stats dl { margin: 0; padding: 6px 12px; background: var(--surface-soft); border-radius: 6px; }
.round-stats .next-stat { background: var(--next-bg); color: var(--next-ink); }
.round-stats .next-stat dt { color: inherit; }
.game-board { display: grid; grid-template-columns: repeat(var(--size, 5), minmax(0, 1fr)); gap: 8px; aspect-ratio: 1; width: 100%; }
.game-board button { aspect-ratio: 1; min-width: 0; min-height: 0; display: grid; place-items: center; padding: 0; border: 1px solid var(--control-border); border-radius: 6px; background: var(--surface-strong); color: var(--text); font: inherit; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; touch-action: manipulation; cursor: pointer; }
.game-board button:hover:not(:disabled) { border-color: var(--primary); }
.game-board button.done { background: var(--mint-soft); color: var(--mint); border-color: var(--mint); }
.game-board button.done::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; position: absolute; bottom: 7px; }
.game-board button.done { position: relative; }
.game-board button.incorrect { background: #fde0e0; color: #962f2f; border-color: #d65b5b; }
.game-board.paused button { color: transparent; }
.round-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.round-actions .button { min-height: 42px; cursor: pointer; }
.icon-button { width: 46px; height: 46px; flex: 0 0 46px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--control-border); border-radius: 6px; background: var(--surface-strong); color: var(--text); cursor: pointer; }
.icon-button:hover:not(:disabled), .button:hover { border-color: var(--primary); text-decoration: none; }
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }
button:disabled { cursor: default; opacity: .5; }
.game-board button:disabled { opacity: 1; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.round-message { min-height: 26px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.practice-side { padding-top: 12px; }
.practice-side section { padding: 0 0 24px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.practice-side h2 { font-size: 24px; line-height: 1.35; margin: 8px 0 12px; overflow-wrap: anywhere; }
.practice-side p { margin: 10px 0; color: var(--muted); font-size: 15px; }
.app-mark { border-radius: 8px; margin-bottom: 20px; }
.practice-side .platforms { font-size: 12px; font-weight: 650; margin-bottom: 8px; }
.app-benefits { list-style: none; padding: 0; margin: 24px 0; color: var(--text); font-size: 14px; }
.app-benefits li { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.app-benefits .icon { color: var(--mint); flex-shrink: 0; }
.practice-side .experience-note { font-size: 13px; line-height: 1.7; }
.experience-note h3 { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.practice-side .experience-note p { font-size: 13px; margin: 0; }
.app-link { display: inline-flex; align-items: center; gap: 9px; color: var(--primary); font-weight: 650; }
.app-link .store-icon { width: 24px; height: 24px; }
.result { margin-top: 18px; padding: 18px 0; border-top: 1px solid var(--border); }
.result h2 { font-size: 22px; }
.result p { color: var(--muted); }
[hidden] { display: none !important; }
.print-view { padding: 24px 0; }
.print-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 0 0 22px; }
.print-controls .button { cursor: pointer; }
.sheet-preview { padding: 30px; max-width: 480px; aspect-ratio: 210 / 297; background: white; color: #151515; border: 1px solid #d8d8d8; }
.sheet-preview h2 { font-size: 20px; }
.sheet-preview .paper-grid { margin-top: 24px; }
.paper-grid { display: grid; grid-template-columns: repeat(var(--size), 1fr); aspect-ratio: 1; border-top: 1px solid #222; border-left: 1px solid #222; }
.paper-grid span { display: grid; place-items: center; border-right: 1px solid #222; border-bottom: 1px solid #222; font-size: 24px; font-weight: 600; }
.paper-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; margin-top: 20px; }
.seo-content { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 40px; }
.seo-content h2 { font-size: 25px; line-height: 1.3; }
.seo-content h3 { font-size: 18px; margin: 22px 0 6px; }
.seo-content p { color: var(--muted); max-width: 850px; margin: 8px 0 18px; }
#faq { margin-top: 40px; }
#faq h2 { margin-bottom: 24px; }
#faq details { border-top: 1px solid var(--border); }
#faq details:last-child { border-bottom: 1px solid var(--border); }
#faq summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; min-height: 56px; list-style: none; cursor: pointer; font-size: 16px; font-weight: 600; }
#faq summary::-webkit-details-marker { display: none; }
#faq summary .icon { flex: 0 0 18px; color: var(--muted); }
#faq details[open] summary .icon { transform: rotate(45deg); }
#faq details p { padding-bottom: 12px; }
.seo-links { display: flex; gap: 20px; flex-wrap: wrap; margin: 24px 0; }
.seo-links a { color: var(--primary); text-decoration: underline; }
.local-note { color: var(--muted); font-size: 13px; margin-top: 18px; max-width: 640px; }
.practice-page:has(#view-practice:not([hidden])) > .page .local-note { display: none; }
.print-output { display: none; }
html[data-theme="paper"] { color-scheme: light; --bg: #fbf7eb; --surface-strong: #fffdf5; --text: #262720; --muted: #69685f; --border: #d4cfbd; --primary: #4c6b43; }
html[data-theme="mint"] { color-scheme: light; --bg: #f3fbf7; --surface-strong: #fff; --text: #123d30; --muted: #5a746b; --border: #c9ded5; --primary: #087b60; }
html[data-theme="sand"] { color-scheme: light; --bg: #fff7ed; --surface-strong: #fffdfa; --text: #493427; --muted: #796354; --border: #e1cbb5; --primary: #a14c1c; }
html[data-theme="night"] { color-scheme: dark; --bg: #13171c; --surface-strong: #20262e; --text: #eff3f6; --muted: #b1bcc6; --border: #424d5a; --primary: #78b4f1; }
html[data-theme="ink"] { color-scheme: light; --bg: #f3f3f1; --surface-strong: #fff; --text: #202522; --muted: #656b66; --border: #c6ccc7; --primary: #3a6447; }
@media (max-width: 920px) {
  .workspace { gap: 36px; grid-template-columns: minmax(0, 488px) minmax(0, 280px); }
  .controls .control-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 740px) {
  .practice-page .nav .secondary-nav { display: none; }
  .workspace { grid-template-columns: 1fr; gap: 36px; }
  .board-column { width: 100%; margin-inline: auto; }
  .practice-side { border-top: 1px solid var(--border); padding-top: 28px; }
  .practice-side .app-offer { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 18px; align-items: start; }
  .app-offer .app-mark { grid-column: 1; grid-row: 1 / 4; margin: 0; }
  .app-offer .platforms, .app-offer h2, .app-offer > p { grid-column: 2; }
  .app-offer .app-benefits, .app-offer > .button { grid-column: 1 / -1; justify-self: start; }
  .practice-intro h1 { font-size: 28px; line-height: 1.25; }
  .practice-tabs { gap: 20px; }
  .controls { align-items: center; }
  .game-board button { font-size: 23px; }
}
@media (max-width: 520px) {
  .practice-page .container { width: calc(100% - 32px); }
  .practice-page .page { padding-top: 16px; }
  .practice-page .topbar { position: relative; gap: 14px; margin-bottom: 24px; padding-bottom: 14px; }
  .practice-page .brand { padding-right: 115px; min-height: 44px; font-size: 15px; line-height: 1.35; }
  .practice-page .brand img { width: 32px; height: 32px; flex-shrink: 0; }
  .practice-page .nav { gap: 6px 14px; }
  .practice-page .nav a { font-size: 13px; }
  .practice-page .nav .download-link { padding-inline: 8px; }
  .practice-page .language-switch { position: absolute; top: 0; right: 0; max-width: 108px; font-size: 13px; min-height: 44px; }
  .practice-intro p { font-size: 14px; }
  .practice-intro h1 { font-size: 28px; margin-bottom: 8px; }
  .controls { gap: 8px; }
  .controls .control-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .controls .control-field select { max-width: 130px; font-size: 13px; }
  .size-controls button { min-width: 44px; min-height: 44px; font-size: 13px; }
  .round-stats dl { padding: 8px 10px; }
  .round-stats dd { font-size: 24px; line-height: 32px; }
  .workspace { padding-top: 20px; }
  .print-controls { gap: 14px; }
  .sheet-preview { padding: 20px; }
  .paper-meta { font-size: 11px; }
}
@media (max-width: 380px) {
  .practice-page .nav { gap: 4px 10px; }
  .practice-page .nav .download-link { padding-inline: 6px; }
  .practice-tabs { gap: 14px; font-size: 14px; }
  .controls .control-field select { max-width: 90px; }
  .game-board { gap: 4px; }
}
@media print {
  @page { size: A4 portrait; margin: 16mm; }
  html, body { color-scheme: light !important; background: #fff !important; color: #000 !important; }
  body > * { display: none !important; }
  body > .print-output { display: block !important; background: #fff !important; color: #000 !important; }
  .print-sheet { width: 178mm; break-after: page; page-break-after: always; background: #fff !important; color: #000 !important; }
  .print-sheet:last-child { break-after: auto; page-break-after: auto; }
  .print-sheet h2 { font-size: 18pt; color: #000; }
  .print-sheet p { font-size: 11pt; color: #000; }
  .print-sheet .paper-grid { width: 178mm; height: 178mm; margin: 12mm 0; }
  .print-sheet .paper-grid span { background: #fff !important; color: #000 !important; font-size: 26pt; }
  .print-sheet .paper-meta { font-size: 10pt; color: #000; }
}
