:root {
  color-scheme: dark;
  --canvas: #141c15;
  --panel: #222f23;
  --line: #46553a;
  --text: #f8ead2;
  --muted: #c6cbb4;
  --gold: #efc477;
  --ink: #281b10;
  --rust: #ffc49f;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
}

* { box-sizing: border-box }
body { margin: 0; background: radial-gradient(ellipse at 50% 3%, #283c2b 0, transparent 620px) }
button, input, select { font: inherit }
button, a, input, select { -webkit-tap-highlight-color: transparent }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .48 }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px }
a { color: inherit }
h1, h2, h3, p { margin: 0 }
h1, h2 { font-family: Georgia, serif }
h1 { font-size: clamp(2.4rem, 6vw, 4.7rem); line-height: .96; letter-spacing: -.047em; font-weight: 700 }
h2 { font-size: 1.6rem; line-height: 1.1; letter-spacing: -.04em }
h3 { font-size: 1.05rem }
.muted { color: var(--muted) }
.eyebrow { font-size: .73rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 800 }
.top { border-bottom: 1px solid var(--line); background: #1b281d }
.top-inner, main, footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto }
.top-inner { min-height: 59px; display: flex; align-items: center; gap: 22px }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; white-space: nowrap; font-size: 1.25rem; font-weight: 500; letter-spacing: -.04em }
.brand strong { color: var(--gold) }
.brand small { display: block; color: var(--muted); line-height: 1; letter-spacing: .13em; text-transform: uppercase; font-size: .59rem; font-weight: 750 }
.brand-icon { display: block; width: 38px; height: 38px; flex: none }
nav { display: flex; align-items: center; gap: 6px }
.nav-button, .quiet { border: 0; border-radius: 7px; color: var(--muted); background: transparent; padding: 8px 11px; font-size: .9rem; white-space: nowrap }
.nav-button:hover, .nav-button[aria-current="page"], .quiet:hover { background: #344834; color: var(--text) }
#account { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; font-size: .88rem }
#account strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
main { min-height: calc(100vh - 118px); padding: 18px 0 24px }
footer { border-top: 1px solid var(--line); padding: 12px 0 19px; color: var(--muted); font-size: .82rem }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 190px; display: flex; align-items: center; padding: clamp(16px, 3.2vw, 38px); border-radius: 16px; border: 1px solid #876644; color: var(--text); margin-bottom: 12px; background: linear-gradient(90deg, #19150f98, #19150f45 33%, transparent 64%), #312419 url('/romme.webp') center 72% / cover no-repeat }
.login-hero { min-height: clamp(310px, 40vw, 490px); background-position: center, center 56% }
#app:has(.login-hero) { min-height: 0; padding-bottom: 0 }
.hero-copy { position: relative; z-index: 1; max-width: 62%; display: grid; gap: 8px; justify-items: start; text-shadow: 0 2px 6px #160e08 }
.hero .eyebrow { color: var(--gold) }
.hero p:not(.eyebrow) { max-width: 380px }
.login-access { display: grid; gap: 8px; margin-top: 3px; font-size: .92rem }
.login-access .button { text-shadow: none }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 35px; padding: 6px 12px; border-radius: 9px; border: 1px solid transparent; background: var(--gold); color: var(--ink); font-weight: 750; text-decoration: none }
.button:hover:not(:disabled) { filter: brightness(1.09) }
.button.dark { background: var(--gold); color: var(--ink); text-shadow: none }
.button.secondary { border-color: var(--line); background: #314530; color: var(--text) }
.button.danger { background: transparent; border-color: #77543e; color: var(--rust) }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px }
.panel { background: linear-gradient(155deg, #2c3b2b, var(--panel) 70%); border: 1px solid var(--line); border-radius: 15px; padding: clamp(10px, 1.65vw, 17px); min-width: 0 }
.panel + .panel { margin-top: 9px }
.grid, .game-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .45fr); gap: 10px; align-items: start }
.game-grid { grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr) }
.grid > .panel + .panel, .game-grid > .panel + .panel { margin-top: 0 }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; flex-wrap: wrap; margin-bottom: 9px }
.page-head { margin: 0 0 12px }
.page-head h1, h2 { font-family: Georgia, serif }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 2px 0 4px; overflow-wrap: anywhere }
.page-head .eyebrow { color: var(--gold) }
.table-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin: 0 0 8px; font-size: .85rem }
.table-heading > :not(:first-child)::before { content: '·'; display: inline-block; margin-right: 10px; color: var(--muted) }
.table-heading h1 { font-size: 1.15rem; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere }
.table-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line) }
.table-row h3, .player-name { overflow-wrap: anywhere }
.table-row p { font-size: .87rem }
.empty { padding: 12px 0; color: var(--muted); border-top: 1px solid var(--line) }
.people { margin: 0; padding: 0; list-style: none }
.people li { display: flex; align-items: center; gap: 7px; padding: 5px 0; overflow-wrap: anywhere }
.people li + li { border-top: 1px solid var(--line) }
.dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold) }
.dot.off { background: #a38a73 }
.pill { color: var(--gold); font-size: .78rem; font-weight: 700 }
.connection { margin-bottom: 15px; color: var(--rust) }
.player-cards { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px }
.player-card { flex: 1 1 120px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; min-width: 0 }
.player-card.active { border-color: var(--gold); background: #334831 }
.player-card strong { display: block }
.player-card .muted { font-size: .8rem }
.turn-panel .section-head { margin-bottom: 5px }
.board-controls { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-bottom: 7px }
.roll-count { color: var(--muted); font-size: .9rem; font-weight: 700; padding-block: 6px }
.surface-picker { color: var(--muted); font-size: .75rem; gap: 3px }
.surface-picker select { padding: 5px 28px 5px 8px; font-size: .85rem }
form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px }
.chat-form input { padding: 5px 8px; min-width: 0 }
.clock { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold) }
.rank-period { margin-bottom: 8px }
.rank-period [aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: var(--ink) }
.scroll { overflow-x: auto }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums }
th, td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right }
th:first-child, td:first-child { text-align: left; padding-left: 0 }
th { font-size: .82rem; color: var(--muted) }
th[scope="row"] { color: var(--text); white-space: nowrap }
td.score-here { width: 1% }
.pick { background: #39462b; border: 1px solid #788154; color: var(--gold); border-radius: 6px; min-width: 38px; min-height: 26px; font-weight: 800 }
.pick:hover:not(:disabled) { background: var(--gold); color: var(--ink) }
tfoot td, tfoot th { color: var(--gold); font-weight: 800 }
dialog { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 16px; width: min(430px, calc(100% - 26px)); padding: 24px }
dialog::backdrop { background: #10110cd0 }
form { display: grid; gap: 16px }
label { display: grid; gap: 5px }
input, select { border: 1px solid var(--line); background: #1a281b; border-radius: 8px; color: var(--text); padding: 10px; width: 100% }
#notice { z-index: 3; position: fixed; bottom: 20px; right: 20px; max-width: min(440px, calc(100% - 40px)); padding: 11px 15px; border: 1px solid #77543e; border-radius: 10px; background: #3c2b20; color: var(--rust); box-shadow: 0 5px 30px #0005 }
.rules { display: grid; gap: 15px }
.rules ul, .rules ol { margin: 4px 0 0; padding-left: 22px }
.rules li + li { margin-top: 5px }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px }
.site-footer nav { width: auto; flex-wrap: wrap; gap: 6px 14px }
.site-footer a { text-underline-offset: .2em }
.legal-page { max-width: 760px; margin-inline: auto; padding: clamp(16px, 4vw, 36px); overflow-wrap: anywhere }
.legal-page h1 { font-size: clamp(2rem, 5vw, 3rem) }
.legal-page h2 { font-size: 1.25rem }
.legal-page section { display: grid; gap: 8px; margin-top: 20px }
.legal-page address { font-style: normal; white-space: pre-line }
.legal-page a { color: var(--gold); text-underline-offset: .2em }
body { min-height: 100svh }
main { min-height: 0 }
.hero { background-image: linear-gradient(90deg, #121b11da, #121b1130 59%, transparent), url('/romme.webp') }
.login-hero { min-height: clamp(340px, 43vw, 480px); background-position: center, center 78%; padding: clamp(24px, 5vw, 64px) }
.hero h1 { font-size: clamp(2.85rem, 6vw, 5.2rem); letter-spacing: -.05em; max-width: 11ch }
.hero em { color: var(--gold); font-style: normal; display: block }
.hero-copy { gap: 14px }
.hero-copy p { font-size: clamp(.94rem, 2vw, 1.15rem) }
.login-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 13px; padding: 14px 18px }
.login-panel .button { min-height: 42px; padding-inline: 16px; gap: 9px }
.discord-icon { width: 21px; height: 21px; fill: currentColor }
.grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, 1fr) }
.flow { display: grid; gap: 12px }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px }
.check { display: flex; gap: 9px; align-items: center }
.check input { width: auto; accent-color: var(--gold) }
.card-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-block: 4px }
.playing-card { display: inline-flex; min-width: 45px; min-height: 65px; padding: 6px; flex-direction: column; justify-content: center; align-items: center; gap: 4px; background: linear-gradient(140deg, #fff4d8, #e5cf9b); color: #242916; font-weight: 850; border: 1px solid #fff3d4; border-radius: 6px; box-shadow: 0 2px 3px #10190f90; line-height: 1 }
.playing-card.red { color: #9c2b21 }
.playing-card.wild { color: #635025 }
.playing-card small { font-size: .61rem }
.playing-card[aria-pressed=true] { outline: 2px solid #ffcf69; outline-offset: 2px; transform: translateY(-4px); background: #ffe2a0 }
.playing-card.drafted { outline: 1px dashed #e2c47d; outline-offset: 2px; opacity: .63 }
.felt { background: radial-gradient(ellipse at 50% 20%, #3b5937, #253b29 85%); border-color: #697457 }
.meld { border: 1px solid #70805a; padding: 8px; border-radius: 9px; background: #203327; display: grid; gap: 5px }
.melds { display: flex; flex-wrap: wrap; gap: 8px }
.turn-label { color: var(--gold); font-weight: 800 }
.chat-log { max-height: 10rem; overflow: auto; padding: 0; margin: 0; list-style: none; overflow-wrap: anywhere }
.chat-log li + li { margin-top: 4px }
.chat-form { display: flex; gap: 8px }
.chat-form input { min-width: 0 }
.share { display: flex; flex-wrap: wrap; gap: 8px }
.share input { flex: 1 1 180px; min-width: 0 }
.score { border-collapse: collapse; width: 100%; text-align: left; font-variant-numeric: tabular-nums }
.score th, .score td { padding: 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere }
.table-row { gap: 12px; flex-wrap: wrap }
.actions { align-items: center }
#network { margin-bottom: 7px; color: var(--rust) }
@media (max-width: 720px) {
  .top-inner, main, footer { width: calc(100% - 28px) }
  .top-inner { gap: 4px 10px; padding-block: 7px; flex-wrap: wrap }
  #nav:not(:empty) { order: 2; width: 100%; flex-wrap: wrap }
  .grid { grid-template-columns: minmax(0, 1fr) }
  .login-hero { min-height: 330px; background-position: center, 60% 83% }
  .hero { background-image: linear-gradient(90deg, #121b11f0, #121b1160 75%, #121b1135), url('/romme.webp') }
  .hero-copy { max-width: 84% }
}
