/* The live table shares the pre-game felt, leather and brass visual language.
   Game layout and input mechanics remain in style.css. */
html:has(body.pregame-enabled.in-game) { scrollbar-width: none; }
html:has(body.pregame-enabled.in-game)::-webkit-scrollbar { display: none; }
body.pregame-enabled.in-game {
  color-scheme: dark;
  --paper: #0b281b;
  --panel: #163b2b;
  --ink: #f8edd1;
  --muted: #c8b88f;
  --accent: #c99b5b;
  --on-accent: #fff1d3;
  --edge: #7e6d47;
  --floor: #173c2b;
  --cup: #57351f;
  background: #092519 url('/maexchen/assets/table-calm.webp') center top / cover fixed;
}
body.pregame-enabled.in-game[data-theme=night] {
  --paper: #0a1d1b;
  --panel: #15312b;
  --floor: #172b27;
  --cup: #3a2a23;
  background-color: #071a19;
}
body.pregame-enabled.in-game[data-theme=pop] {
  --paper: #263c29;
  --panel: #35583a;
  --floor: #41693c;
  --cup: #8f4d2b;
  background-color: #234029;
}
body.pregame-enabled.in-game .app {
  padding: calc(13px + env(safe-area-inset-top)) 20px 0;
}
body.pregame-enabled.in-game .masthead { margin-bottom: 15px; }
body.pregame-enabled.in-game .wordmark {
  color: #f4e7bc;
  font: 700 16px/1.2 Georgia, serif;
  letter-spacing: .11em;
}
body.pregame-enabled.in-game .wordmark span {
  display: block;
  margin-top: 4px;
  color: #d1bc85;
  font: 600 10px/1.2 system-ui, sans-serif;
  letter-spacing: .15em;
}
body.pregame-enabled.in-game .menu-button {
  flex: none;
  border: 1px solid rgba(213,178,108,.72);
  border-radius: 50%;
  background: rgba(7,31,20,.82);
  box-shadow: 0 3px 12px #0005;
}
body.pregame-enabled.in-game .menu-button span { background: #e7cd91; }
body.pregame-enabled.in-game .players-panel {
  padding: 13px;
  border: 1px solid rgba(209,176,110,.46);
  border-radius: 17px;
  background: rgba(7,31,20,.76);
  box-shadow: 0 8px 24px #0003;
}
body.pregame-enabled.in-game .panel-title { margin-bottom: 10px; }
body.pregame-enabled.in-game .panel-title h2 {
  color: #e8d2a0;
  font: 700 11px/1.3 system-ui, sans-serif;
  letter-spacing: .13em;
}
body.pregame-enabled.in-game .player-number {
  height: 43px;
  border: 1px solid rgba(204,168,103,.35);
  border-radius: 10px;
  background: rgba(4,23,16,.82);
  color: #ead8ac;
}
body.pregame-enabled.in-game .player.current .player-number {
  border-color: #e6b77b;
  background: linear-gradient(#b85a34,#89351f);
  color: #fff1d5;
}
body.pregame-enabled.in-game .player.decision-claimant .player-number {
  border-color: #d7a66a;
  box-shadow: inset 0 0 0 1px #d7a66a66;
}
body.pregame-enabled.in-game .player.decision-claimant .player-number span { transform: none; }
body.pregame-enabled.in-game .player-name { color: #f7ebcb; font-size: 12px; }
body.pregame-enabled.in-game .play-layout { padding-top: 15px; }
body.pregame-enabled.in-game .cup { max-width: 370px; }
body.pregame-enabled.in-game .coaster {
  border-color: #b77e46;
  background: linear-gradient(145deg,#a1582f,#693117 64%,#4a2112);
  box-shadow: inset 0 0 0 5px #cb8c4a, inset 0 0 18px #2e120d, 0 8px 20px #0006;
}
body.pregame-enabled.in-game .coaster-ring {
  border-color: #d7a66a;
  background: linear-gradient(145deg,#874321,#512610);
  color: #f2ddb0;
  box-shadow: inset 0 2px 5px #0005;
}
body.pregame-enabled.in-game #table {
  padding-bottom: calc(var(--dock-height, 136px) + 26px + env(safe-area-inset-bottom));
}
body.pregame-enabled.in-game .dock-controls {
  width: min(100%, 500px);
  max-width: 500px;
  gap: 12px;
  padding: 11px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(214,177,106,.48);
  background: rgba(7,30,20,.97);
  box-shadow: 0 -8px 26px #0006;
}
body.pregame-enabled.in-game .dock-controls .dock-notifications {
  min-height: 106px;
  padding: 12px;
  border: 1px solid rgba(214,177,106,.42);
  border-radius: 15px;
  background: rgba(24,57,40,.8);
}
body.pregame-enabled.in-game .own-name { color: #f8e9c3; font: 700 15px/1.2 Georgia, serif; }
body.pregame-enabled.in-game .dock-controls .dock-notifications .game-message {
  color: #eee1c4;
  font-size: 13px;
  line-height: 1.4;
}
body.pregame-enabled.in-game .dock-controls .throw-button {
  --action-diameter: 104px;
  width: 104px;
  height: 104px;
  flex-basis: 104px;
  padding: 9px;
  border: 1px solid #dda36e;
  border-radius: 27px;
  background: linear-gradient(145deg,#bb5a33,#8d341f 72%);
  color: #fff1d3;
  box-shadow: inset 0 1px #f3b37b, inset 0 -4px #5e2317, 0 6px 14px #0006;
  font: 700 15px/1.15 Georgia, serif;
  text-wrap: balance;
  overflow-wrap: break-word;
}
body.pregame-enabled.in-game .dock-controls.is-decision {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
body.pregame-enabled.in-game .dock-controls.is-decision .dock-notifications {
  min-height: 0;
  width: 100%;
}
body.pregame-enabled.in-game .decision-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
body.pregame-enabled.in-game .decision-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 68px;
  padding: 9px 7px;
  border-radius: 18px;
  text-align: center;
  line-height: 1.1;
}
body.pregame-enabled.in-game .decision-actions strong { font: 700 17px/1.1 Georgia, serif; }
body.pregame-enabled.in-game .decision-actions small { font: 500 11px/1.2 system-ui, sans-serif; }
body.pregame-enabled.in-game #believeButton {
  border: 1px solid #d7ac70;
  background: #17442f;
  color: #fff1d3;
  box-shadow: inset 0 1px #e8cf9a55, 0 4px 12px #0005;
}
body.pregame-enabled.in-game #checkButton {
  border: 1px solid #dda36e;
  background: linear-gradient(#b45432,#87311e);
  color: #fff1d3;
  box-shadow: inset 0 1px #f3b37b, inset 0 -3px #5e2317, 0 4px 12px #0005;
}
body.pregame-enabled.in-game .test-shake {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid #d0a66f;
  border-radius: 999px;
  background: rgba(6,31,20,.9);
  color: #f7e8c6;
  font: 600 13px/1.2 system-ui, sans-serif;
}
body.pregame-enabled dialog {
  border: 1px solid rgba(216,180,108,.58);
  border-radius: 22px;
  background: #102c20;
  color: #f8e9c9;
  box-shadow: 0 18px 45px #0008;
}
body.pregame-enabled dialog::backdrop { background: #03130dc9; }
body.pregame-enabled dialog .fine { color: #d1c29f; font-size: 12px; }
body.pregame-enabled .dialog-head .quiet,
body.pregame-enabled .help-buttons .secondary,
body.pregame-enabled .claim-choices button {
  border: 1px solid rgba(214,177,106,.4);
  background: #214634;
  color: #f8e9c9;
}
body.pregame-enabled .claim-choices button:last-child {
  border-color: #dda36e;
  background: #a84729;
}
body.pregame-enabled #testingChoices { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
body.pregame-enabled #testingChoices button,
body.pregame-enabled #testingChoices button:last-child {
  min-height: 58px;
  padding: 5px;
  border: 1px solid rgba(214,177,106,.54);
  border-radius: 13px;
  background: #214634;
  color: #f8e9c9;
  font: 700 21px/1 Georgia, serif;
}
body.pregame-enabled #testingChoices button:hover,
body.pregame-enabled #testingChoices button:focus-visible { border-color: #edc487; background: #315a40; }
@media (max-width: 359px) {
  body.pregame-enabled.in-game .app { padding-right: 14px; padding-left: 14px; }
  body.pregame-enabled.in-game .dock-controls { padding-right: 14px; padding-left: 14px; }
  body.pregame-enabled.in-game .dock-controls .throw-button { width: 94px; height: 94px; flex-basis: 94px; font-size: 13px; }
}

/* Schocken table treatment, adapted to two private dice and bluff actions. */
.throw-timer { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 10px 0; color: #efd49c; }
.throw-timer-clock { position: relative; flex: 0 0 44px; width: 44px; height: 44px; }
.throw-timer-clock svg { display: block; width: 44px; height: 44px; transform: rotate(-90deg); fill: none; stroke-width: 2; }
.throw-timer-track { stroke: #a7884e55; }
.throw-timer-ring { stroke: #e2b866; stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linecap: round; }
.throw-timer-clock > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px; font-family: Arial,sans-serif; font-variant-numeric: tabular-nums; }
.throw-timer-clock b { font-size: 20px; font-weight: 600; }
.throw-timer-clock small { font-size: 11px; color: #d8c28c; }
.throw-timer-copy { min-width: 0; display: grid; gap: 4px; }
.throw-timer-copy strong { font: 700 14px/1.2 Arial,sans-serif; }
.throw-timer-copy > span { font: 12px/1.35 Arial,sans-serif; color: #ded1ad; }
.throw-timer[data-state="settling"] .throw-timer-clock { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .throw-timer-ring { visibility: hidden; } }

body.pregame-enabled.in-game .app { max-width: 500px; padding-inline: 16px; }
body.pregame-enabled.in-game .players-panel { padding: 8px 0; background: transparent; border-width: 1px 0; border-radius: 0; box-shadow: none; }
body.pregame-enabled.in-game .players { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 5px; scroll-snap-type: x proximity; }
body.pregame-enabled.in-game .player { flex: 0 0 78px; min-width: 0; scroll-snap-align: start; }
body.pregame-enabled.in-game .player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.pregame-enabled.in-game .cup-column { width: 100%; }
body.pregame-enabled.in-game .cup { width: min(calc(100% + 24px), 460px); max-width: none; background: url('/maexchen/assets/cup-top.png') center/contain no-repeat; overflow: hidden; }
body.pregame-enabled.in-game .coaster { inset: 18%; }
body.pregame-enabled.in-game .throw-timer[hidden] { display: none; }
body.pregame-enabled.in-game .play-layout { padding-top: 4px; }
body.pregame-enabled.in-game .dock-controls { position: relative; inset: auto; transform: none; width: 100%; max-width: none; display: flex; flex-direction: column; gap: 10px; padding: 8px 0 calc(16px + env(safe-area-inset-bottom)); background: transparent; box-shadow: none; }
body.pregame-enabled.in-game #table { padding-bottom: 0; }
body.pregame-enabled.in-game .dock-controls .dock-notifications { width: 100%; min-height: 0; padding: 12px 14px; }
body.pregame-enabled.in-game .dock-controls .throw-button,
body.pregame-enabled.in-game .test-shake { position: static; inset: auto; transform: none; width: 100%; min-height: 54px; height: auto; flex: none; border: 1px solid #d9ad70; border-radius: 28px; padding: 14px 20px; background: linear-gradient(#b54d2d,#87331f); color: #fff1d3; font: 700 18px/1.25 Georgia,serif; box-shadow: inset 0 1px #efb578,0 3px 6px #0005; }
body.pregame-enabled.in-game .test-shake { touch-action: none; user-select: none; -webkit-user-select: none; }
body.pregame-enabled.in-game .dock-controls :is(.throw-button,.test-shake)[hidden] { display: none; }
body.pregame-enabled.in-game .cup-hint { display: block; padding: 2px 10px; color: #d9c69b; }
body.pregame-enabled.in-game .own-identity { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.pregame-enabled.in-game .player-coins { display: flex; align-items: center; justify-content: center; gap: 3px; height: auto; }
body.pregame-enabled.in-game .player-meta { flex-direction: column; gap: 0; }
body.pregame-enabled.in-game .player-coins > span:not(.roman-pile) { white-space: nowrap; font: 700 12px/1.3 system-ui,sans-serif; color: #edd292; }
.roman-pile { position: relative; display: inline-block; flex: none; width: 76px; height: 45px; }
.roman-coin { position: absolute; width: 42%; height: auto; left: var(--coin-x); top: var(--coin-y); z-index: var(--coin-z); transform: translate(-50%,-50%) rotate(var(--coin-angle)); filter: drop-shadow(0 2px 1px #0008); pointer-events: none; user-select: none; }
@media(max-width:360px) { body.pregame-enabled.in-game .app { padding-inline: 12px; } body.pregame-enabled.in-game .player { flex-basis: 72px; } }

body.pregame-enabled.in-game .panel-title { display: none; }
body.pregame-enabled.in-game .player-meta .roman-pile { height: 32px; width: 65px; }
body.pregame-enabled.in-game .dock-notifications .own-identity { display: none; }
body.pregame-enabled.in-game .cup { width: min(calc(100% + 24px), 44svh, 420px); }
body.pregame-enabled.in-game .throw-timer { min-height: 56px; padding: 6px 0; }
body.pregame-enabled.in-game .dock-controls .dock-notifications { min-height: 52px; }
