@font-face { font-family: 'DM Sans'; src: url('./assets/dm-sans.ttf') format('truetype'); font-style: normal; font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('./assets/playfair-display.ttf') format('truetype'); font-style: normal; font-weight: 400 900; font-display: swap; }
html { background: #101c1b; }
body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); overscroll-behavior-y: none; }
button { touch-action: manipulation; }
body.loading > header, body.loading > main { visibility: hidden; }
#loading-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; color: var(--gold); }
#loading-screen span { font: 64px Georgia, serif; }
.settings-button { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid #46503c; border-radius: 50%; background: transparent; color: var(--gold); }
.settings-button svg { width: 23px; fill: var(--bg); stroke: currentColor; stroke-width: 1.5; }
.save-notice { padding: 12px 16px; color: #f4d9a9; border: 1px solid #806847; border-radius: 8px; font-size: 13px; margin: 0 0 18px; }
dialog { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px); overscroll-behavior: contain; }
.close-button { min-width: 44px; min-height: 44px; flex-shrink: 0; }
#settings-dialog, #privacy-dialog, #license-dialog { width: min(560px, calc(100% - 28px)); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.setting-row label { font-size: 15px; cursor: pointer; flex: 1; }
.setting-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.setting-row input { appearance: none; -webkit-appearance: none; width: 50px; height: 32px; border: 1px solid #69736a; border-radius: 20px; background: #26332c; position: relative; margin: 6px 0; flex-shrink: 0; cursor: pointer; }
.setting-row input::after { content: ''; position: absolute; width: 24px; height: 24px; top: 3px; left: 3px; border-radius: 50%; background: #c5ccc4; transition: transform .18s; }
.setting-row input:checked { background: var(--gold); border-color: var(--gold); }
.setting-row input:checked::after { background: #15211f; transform: translateX(18px); }
.setting-row input:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.local-note { display: flex; gap: 14px; margin-top: 24px; padding: 18px; border-radius: 10px; background: #192b24; }
.local-note > span { font-size: 23px; color: var(--gold); }
.local-note strong { font-size: 14px; font-weight: 500; }
.local-note p { margin: 6px 0 0; font-size: 12px; line-height: 1.65; }
.settings-links { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; font-size: 12px; color: var(--muted); }
.settings-links button { min-height: 44px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 10px; }
.stats-grid strong { display: block; color: var(--gold); font: 500 28px var(--serif); overflow-wrap: anywhere; }
.stats-grid span { color: var(--muted); font-size: 12px; }
.history-caption { font-size: 12px; }
#privacy-dialog h3 { font: 500 20px var(--serif); margin: 24px 0 8px; }
#privacy-dialog p { font-size: 14px; line-height: 1.7; }
.license-links { display: flex; flex-wrap: wrap; gap: 20px; margin: 20px 0; }
.license-links button { font-size: 12px; min-height: 44px; }
#license-copy { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 var(--font); color: var(--muted); }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
@media (max-width: 760px) {
  .site-header { height: 66px; padding-inline: 18px; }
  main { padding-top: 16px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading h1 { font-size: 25px; }
  .mobile-rules-button, .history-button { min-width: 44px; min-height: 44px; }
  .heading-actions { gap: 4px; }
  .felt { height: 380px; }
  .table-lettering { top: 140px; }
  .round-message { top: 199px; }
  .round-message > span { font-size: 19px; }
  .round-message > small { max-width: 290px; margin-inline: auto; }
  .control-deck { padding: 14px 10px; }
  .chips { gap: 3px; }
  .chip, .chip-500 { width: 44px; height: 44px; flex: 0 0 44px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .sidebar { margin-top: 22px; }
  footer { padding-bottom: 20px; }
}
@media (max-width: 350px) {
  .game-shell { margin-inline: -4px; }
  .control-deck { padding-inline: 5px; }
  .chips { gap: 1px; }
  .heading-actions { gap: 0; }
  .page-heading h1 { font-size: 23px; }
}

@media (max-width: 760px) { .table-lettering small { display: none; } }

.setting-row label { font-size: 16px; }
.chip, .chip-500 { font-size: 14px; }
