/* ==========================================================================
   score.css: the 5 Dice Score Sheet's own styles (/score/), shared with the
   5 Dice game (/dice/), which draws the same sheet and dice tray. Moved here
   from score/index.html's <style> on 2026-11-26, unchanged.
   ========================================================================== */
/* The header, dialogs, settings, leader board and toast come from
   /css/games.css, which every game shares; this is the sheet and the dice
   tray. Each player's colour (--who) marks their sheet's header, their dot
   on the leader board and their lines from the room. The Android app's
   games/score/ScorePage.kt draws the same: keep the two in step. */
.sc { --card-bg: var(--sw-box-bg, #ffffff); --card-line: var(--sw-box-border, rgba(47,74,114,.15)); }
.sc-card {
  background: var(--card-bg); border: 2px solid var(--card-line); border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(47,74,114,.08); color: var(--ink-deep);
}
/* The room line, on the wash. */
.sc-room { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; margin: 0 0 .75rem; color: var(--ink-deep); font-size: .92rem; }
.sc-room__btn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--sw-box-border, rgba(47,74,114,.2)); background: var(--sw-box-bg, rgba(255,255,255,.6));
  color: var(--ink-deep); font: inherit; font-weight: 700;
}
.sc-room__btn b { font-variant-numeric: tabular-nums; }
.sc-here { display: flex; align-items: center; min-width: 0; font-size: .85rem; }
.sc-here #here-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.sc-here::before { content: ""; margin-right: .35rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--game-good); flex: 0 0 auto; }
.sc-here.is-off::before { background: var(--game-warn); }

/* ---- the sheet ---- */
.sc-sheet { overflow: hidden; }
.sc-sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .6rem .9rem; background: var(--who, #2f4a72); color: #fff;
}
.sc-sheet__head h2 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.sc-sheet__back {
  flex: 0 0 auto; border: 1.5px solid rgba(255,255,255,.7); background: rgba(255,255,255,.15); color: #fff;
  border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.sc-body { padding: .75rem; display: grid; gap: .6rem; }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.sc-box {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  min-height: 3.3rem; padding: .35rem .7rem; border-radius: var(--radius-sm);
  border: 2px solid var(--game-line); background: var(--game-tint);
  color: var(--ink-deep); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
.sc-sheet:not(.is-locked) .sc-box { border-color: color-mix(in srgb, var(--who) 55%, transparent); }
.sc-sheet:not(.is-locked) .sc-box:active { background: color-mix(in srgb, var(--who) 18%, transparent); }
.sc-sheet.is-locked .sc-box { cursor: default; }
.sc-box__die { font-size: 2.3rem; line-height: 1; }
.sc-box__name { font-size: .92rem; font-weight: 600; line-height: 1.2; }
.sc-box__val { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.2ch; text-align: right; }
.sc-line { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; padding: 0 .15rem; }
.sc-line b { font-variant-numeric: tabular-nums; }
.sc-grand {
  display: flex; align-items: baseline; justify-content: center; gap: .6rem; padding: .45rem 0 .2rem;
  border-top: 1px solid var(--game-line); font-weight: 700;
}
.sc-grand strong { font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink-deep); }
.sc-lock { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; padding-top: .2rem; font-size: .9rem; }
.sc-lock .switch { position: relative; width: 2.9rem; height: 1.6rem; flex: 0 0 auto; }
.sc-lock__label { font-weight: 700; cursor: pointer; }
.sc-lock__turns { margin-left: auto; opacity: .85; }
.sc-lock__turns.is-over { opacity: 1; font-weight: 800; color: var(--game-good); }
.sc-lock .btn { padding: .3rem .9rem; font-size: .85rem; }
.sc-lock.is-nudged { animation: shake .4s; }
.sc-sheet.is-theirs .sc-lock { opacity: .55; }
@keyframes shake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }

/* ---- the leader board ---- */
.sc-board { margin-top: 1rem; padding: .8rem 1rem .9rem; }
.sc-board__head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 .35rem; }
.sc-board__head h2 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; }
.sc-board__head .iconbtn { width: 2.2rem; height: 2.2rem; color: var(--ink-soft); }
.sc-row { cursor: pointer; border-radius: var(--radius-sm); }
.sc-row.is-showing { background: var(--game-tint); }
.sc-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .45rem; vertical-align: 0; }
.sc-board__empty { margin: .25rem 0 0; font-size: .88rem; color: var(--ink-soft); }

/* ---- the dice tray, along the bottom while the dice are out ---- */
.sc-tray {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 80;
  width: min(500px, 100%); padding: .7rem .9rem calc(.6rem + env(safe-area-inset-bottom, 0px));
  background: var(--sw-modal-bg, #fdfcf8); color: var(--ink-deep);
  border-radius: var(--radius-card) var(--radius-card) 0 0; box-shadow: 0 -6px 24px rgba(20,35,60,.22);
}
.sc-tray[hidden] { display: none; }
.sc-tray__row { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.sc-die {
  width: min(14vw, 3.6rem); aspect-ratio: 1; border-radius: .55rem; padding: 0;
  border: 2px dashed var(--game-line); background: transparent; color: var(--ink-soft);
  font-size: min(9vw, 2.3rem); line-height: 1; cursor: pointer;
}
.sc-die.held { border-style: solid; border-color: #007BFF; }
.sc-roll {
  width: min(15vw, 3.9rem); aspect-ratio: 1; border-radius: 50%; margin-left: .25rem;
  display: grid; place-content: center; border: 0; cursor: pointer;
  background: var(--c-good); color: #fff; font: inherit; line-height: 1;
}
.sc-roll b { font-size: 1.4rem; }
.sc-roll small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.sc-roll:disabled { opacity: .35; cursor: default; }
.sc-tray__hint { margin: .45rem 0 0; text-align: center; font-size: .82rem; color: var(--ink-soft); }
body.sc-tray-on .shell { padding-bottom: 9rem; }

/* ---- the room's lines, in each player's colour ---- */
.sc-toasts {
  position: fixed; top: calc(4.2rem + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 95; width: min(26rem, calc(100% - 2rem)); display: grid; gap: .4rem; pointer-events: none;
}
.sc-toast {
  padding: .55rem .9rem; border-radius: 999px; color: #fff; font-weight: 700; font-size: .9rem; text-align: center;
  box-shadow: 0 6px 18px rgba(20,35,60,.25); animation: sc-toast-in 260ms var(--ease);
  transition: opacity 400ms var(--ease);
}
.sc-toast.is-going { opacity: 0; }
@keyframes sc-toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---- dialogs ---- */
.sc-pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr)); gap: .4rem; margin: .5rem 0 0; }
.sc-pick {
  padding: .6rem 0; border-radius: var(--radius-sm); border: 2px solid var(--game-line); background: var(--game-tint);
  color: inherit; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
}
.sc-pick:hover { border-color: var(--ink); }
.sc-commit { text-align: center; }
.sc-commit p { font-size: 1.15rem; margin: .4rem 0 .2rem; }
.sc-field { display: block; margin: .6rem 0 .25rem; font-weight: 700; }
.sc-roomrow { display: flex; gap: .5rem; align-items: center; }
.sc-roomrow .game-input { margin: 0; flex: 1; }
.sc-roomrow .btn { flex: 0 0 auto; padding: .55rem .8rem; font-size: .85rem; }
.sc-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.1rem, 1fr)); gap: .4rem; margin: .25rem 0 .5rem; }
.sc-swatch { aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.12) inset; }
.sc-swatch[aria-pressed="true"] { border-color: var(--ink-deep); box-shadow: 0 0 0 2px var(--sw-modal-bg, #fdfcf8) inset; }
.sc-preview { height: .5rem; border-radius: 999px; margin: .3rem 0 0; }
.sc-error { color: var(--game-bad); font-weight: 600; margin: .4rem 0 0; }
.fw-modal.is-first .close-modal:not(.btn) { display: none; }
.sc-setbtns { display: flex; gap: .5rem; flex-wrap: wrap; }
.sc-setbtns .btn { padding: .4rem .9rem; font-size: .85rem; }

/* ---- the way to the game (/dice/), under the leader board ---- */
.sc-play { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; padding: .8rem 1rem; text-decoration: none; }
.sc-play__die { font-size: 2.4rem; line-height: 1; }
.sc-play__words { flex: 1; min-width: 0; font-size: 1rem; line-height: 1.35; }
.sc-play__words b { display: block; font-size: 1.05rem; }
.sc-play__go { flex: 0 0 auto; min-height: 2.75rem; }
