/* games/yatzy.html: Yatzy. The page around it is css/games/board-game.css, the 3D dice css/dice.css. */
.wrap.wide{max-width:1080px}

/* Lobby */
.lobby-seats{list-style:none;display:flex;flex-direction:column;gap:8px;margin:16px 0 10px}
.lobby-seats li{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg2)}
.lobby-seats .ok{color:var(--green)}
.yz-seat{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:var(--bg3,var(--card));
  border:1px solid var(--border);font-weight:800;font-size:13px;flex:none}

/* The dice beside the score sheet; one column on a narrow screen. */
.yz-play{display:grid;grid-template-columns:minmax(230px,400px) minmax(0,1fr);gap:18px;align-items:start}
.yz-dice{display:flex;flex-direction:column;gap:10px;min-width:0}
.yz-status{font-weight:800;font-size:16px;min-height:2.8em;margin:0}
.yz-actions{display:flex;justify-content:center;gap:8px}
.yz-actions .btn[hidden]{display:none}
.yz-hint{text-align:center;min-height:1.3em}
#takeover{white-space:normal;text-align:left}
#takeover[hidden]{display:none}
/* By the room the game has (the players panel and the text size take some), not the window. */
#v-game{container-type:inline-size;padding-right:0!important}   /* no move list beside the game (board-game.css keeps room for one) */
@container (max-width:900px){
  .yz-sheet tbody th small{display:none}
}
@container (max-width:600px){
  .yz-play{grid-template-columns:minmax(0,1fr)}
  .yz-dice{max-width:520px;width:100%;margin:0 auto}
  .yz-status{min-height:0}
}

/* The hand: the five dice of the turn; a kept die is lifted and marked. */
.yz-hand{display:flex;justify-content:center;gap:clamp(6px,1.6%,12px)}
.yz-die{display:flex;flex-direction:column;align-items:center;gap:3px;padding:0;border:0;background:none;cursor:pointer;color:var(--text);
  flex:0 1 64px;min-width:0;font:inherit}
.yz-die:disabled{cursor:default}
.yz-die small{font-size:11px;font-weight:700;color:var(--accent);min-height:1.3em}
.yz-face{position:relative;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);place-items:center;width:100%;aspect-ratio:1;box-sizing:border-box;
  padding:14%;border-radius:18%;background:radial-gradient(circle at 35% 30%,#fffdf7,#f4efe3 60%,#e6dfcf);color:#5a5040;font-weight:800;
  font-size:clamp(16px,3.6vw,24px);box-shadow:0 3px 5px rgba(0,0,0,.35),inset 0 0 6px rgba(120,100,70,.45);transition:transform .15s,box-shadow .15s}
.yz-face[data-v="0"]{display:flex;justify-content:center;opacity:.45}
.yz-face i{width:62%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 40% 35%,#4a4a4a,#111 70%)}
.yz-face[data-v="1"] i{width:78%;background:radial-gradient(circle at 40% 35%,#e0484c,#9e1015 70%)}
.yz-die:not(:disabled):hover .yz-face{transform:translateY(-2px)}
.yz-die.kept .yz-face{transform:translateY(-6px);box-shadow:0 0 0 3px var(--accent),0 8px 10px rgba(0,0,0,.35),inset 0 0 6px rgba(120,100,70,.45)}
.yz-die:focus-visible{outline:none}
.yz-die:focus-visible .yz-face{outline:3px solid var(--blue);outline-offset:3px}

/* The score sheet: a row per category, a column per player. */
.yz-sheet-wrap{overflow-x:auto;min-width:0;background:var(--card);border:1px solid var(--border);border-radius:12px}
.yz-sheet{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}
.yz-sheet th,.yz-sheet td{padding:3px 6px;border-bottom:1px solid var(--border);text-align:center}
.yz-sheet thead th{position:sticky;top:0;background:var(--card);font-size:13px;vertical-align:bottom}
.yz-sheet thead th span{display:block;max-width:8em;margin:0 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.yz-sheet tbody th{text-align:left;font-weight:700;white-space:nowrap;min-width:7.5em}
.yz-sheet tbody th small{margin-left:.5em;font-weight:400;font-size:11px;color:var(--muted)}
.yz-sheet.many tbody th small{display:none}
.yz-sheet .turn{background:color-mix(in srgb,var(--green) 10%,transparent)}
.yz-sheet thead .turn{box-shadow:inset 0 -3px 0 var(--green)}
.yz-sheet thead .won{box-shadow:inset 0 -3px 0 var(--accent)}
.yz-sheet .sum td,.yz-sheet .sum th{background:var(--bg2);font-size:13px}
.yz-sheet .sum td small{color:var(--muted)}
.yz-sheet .lower-first th,.yz-sheet .lower-first td{border-top:2px solid var(--border)}
.yz-sheet .total th,.yz-sheet .total td{font-size:16px;border-bottom:0;background:var(--bg2)}
.yz-sheet .struck{color:var(--muted)}
.yz-sheet td.flash{animation:yz-flash 1s ease-out}
@keyframes yz-flash{from{background:color-mix(in srgb,var(--accent) 55%,transparent)}}
.yz-pick{min-width:2.4em;padding:2px 6px;border-radius:8px;border:1px dashed var(--green);background:color-mix(in srgb,var(--green) 14%,transparent);
  color:var(--text);font:inherit;font-weight:800;cursor:pointer}
.yz-pick:hover,.yz-pick:focus-visible{background:var(--green);color:#fff;border-style:solid;outline:none}
.yz-pick.zero{border-color:var(--muted);background:none;color:var(--muted);font-weight:600}
@media (prefers-reduced-motion:reduce){.yz-sheet td.flash{animation:none;background:color-mix(in srgb,var(--accent) 30%,transparent)}}

/* The result */
.yz-podium{margin:6px 0 14px 1.4em;display:flex;flex-direction:column;gap:4px}
.yz-podium li span{display:inline-block;min-width:10em}
