: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('/dorfabend.webp') center 66% / 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 }
.dice-tray {
  aspect-ratio: 16 / 9;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #6f6b49;
  border-radius: 11px;
  padding: clamp(14px, 3vw, 32px);
  background: #243624 url('/spieltische.webp') var(--table-position, left top) / 201.6% 202.6% no-repeat;
  margin-bottom: 9px;
  box-shadow: 0 3px 0 #111c13;
}
.dice-tray[data-surface="biergarten"] { --table-position: right top }
.dice-tray[data-surface="burgkeller"] { --table-position: left bottom }
.dice-tray[data-surface="waldlichtung"] { --table-position: right bottom }
.dice-area { display: grid; width: min(390px, 92%); grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(5px, 1.1vw, 12px); perspective: 700px }
.die { color: #442b1c; background: transparent; border: 0; aspect-ratio: 1; position: relative; padding: 0; min-width: 0; border-radius: 19%; container-type: inline-size; transform-style: preserve-3d; }
.die:disabled { opacity: 1 }
.die-face { position: absolute; inset: 0; border: 1px solid #fff2ce; border-radius: 19%; background: linear-gradient(150deg, #fff5d8, #ecd198 73%, #cfa86d); box-shadow: 0 5px 0 #a37750, 0 8px 11px #170d08aa; }
.die[aria-pressed="true"] .die-face, .die.kept .die-face { background: linear-gradient(150deg, #ffe2a0, #efb85b); border-color: #ffe4a7; box-shadow: 0 0 0 3px #ffd486, 0 7px 12px #160e09cc; }
.die.blank .die-face { border: 1px dashed #f5d39980; background: #2a1c16a8; box-shadow: none; }
.die:enabled:hover .die-face { filter: brightness(1.13) }
.roll-in {
  --depth: 48cqw;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: tumble .82s cubic-bezier(.27,.58,.35,1) both;
}
.die-side { backface-visibility: hidden }
.die-side:nth-child(1) { transform: translateZ(var(--depth)) }
.die-side:nth-child(2) { transform: rotateY(180deg) translateZ(var(--depth)) }
.die-side:nth-child(3) { transform: rotateY(90deg) translateZ(var(--depth)) }
.die-side:nth-child(4) { transform: rotateY(-90deg) translateZ(var(--depth)) }
.die-side:nth-child(5) { transform: rotateX(90deg) translateZ(var(--depth)) }
.die-side:nth-child(6) { transform: rotateX(-90deg) translateZ(var(--depth)) }
.die:nth-child(2n) .roll-in { --direction: -1; animation-delay: .025s }
.die:nth-child(3n) .roll-in { animation-delay: .055s }
.die:nth-child(5n) .roll-in { animation-delay: .075s }
@keyframes tumble {
  0% { transform: translate3d(calc(-35% * var(--direction, 1)), -83%, 20px) rotateZ(-29deg) rotateY(calc(-300deg * var(--direction, 1))) rotateX(450deg); }
  31% { transform: translate3d(calc(14% * var(--direction, 1)), 40%, calc(-1 * var(--depth))) rotateZ(20deg) rotateY(calc(-160deg * var(--direction, 1))) rotateX(200deg); }
  53% { transform: translate3d(calc(8% * var(--direction, 1)), -24%, 6px) rotateZ(-12deg) rotateY(calc(-83deg * var(--direction, 1))) rotateX(103deg); }
  73% { transform: translate3d(0, 12%, calc(-1 * var(--depth))) rotateZ(6deg) rotateY(calc(-21deg * var(--direction, 1))) rotateX(39deg); }
  87% { transform: translate3d(0, -4%, calc(-1 * var(--depth))) rotateZ(-3deg) rotateX(-10deg); }
  100% { transform: translateZ(calc(-1 * var(--depth))); }
}
@media (prefers-reduced-motion: reduce) {
  .dice-tray .die .roll-in { animation-duration: .001s; animation-delay: 0s }
}
.roll-button { min-width: min(200px, 100%); }
.pips { position: absolute; inset: 18%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center }
.pip { width: 61%; aspect-ratio: 1; border-radius: 50%; background: currentColor }
.turn-detail { margin-top: 7px }
.table-chat { margin-top: 8px }
.table-chat h2 { font-size: 1.2rem }
#table-chat-log { margin: 0 0 7px; padding: 0; max-height: 9rem; overflow-y: auto; list-style: none }
#table-chat-log li { padding: 4px 2px; font-size: .86rem; overflow-wrap: anywhere }
#table-chat-log li + li { border-top: 1px solid var(--line) }
#table-chat-log li .pill { margin-left: 6px }
#table-chat-log p { white-space: pre-wrap }
.chat-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 }
@media (max-width: 710px) {
  .top-inner, main, footer { width: calc(100% - 28px) }
  .top-inner { gap: 6px; padding-block: 10px; flex-wrap: wrap }
  nav { order: 2; width: 100% }
  main { padding-top: 10px }
  .grid, .game-grid { grid-template-columns: minmax(0, 1fr) }
  .hero { border-radius: 15px; min-height: 160px; background-position: center, 59% center }
  .login-hero { min-height: 300px; background-position: center, 59% center }
  .hero-copy { max-width: 72% }
}
@media (max-width: 355px) {
  .hero-copy { max-width: 100% }
}

.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 }
