/* Lucky Lanes: a retro racing scorecard on a calm paper table. Fixed light palette. */
:root {
  color-scheme: light;
  --bg: #f2efe8;
  --bg-2: #e8e3d8;
  --card: #ffffff;
  --paper: #fbf7ee;
  --ink: #25221d;
  --muted: #7a7264;
  --line: #e3dccd;
  --accent: #e07a1f;
  --accent-dark: #a9570e;
  --accent-soft: #fff1e2;
  --red: #d6402d;    --red-dark: #8c2213;    --red-soft: #f8d8d1;
  --yellow: #e5ad1c; --yellow-dark: #7f5c05; --yellow-soft: #faeab8;
  --green: #2f8a57;  --green-dark: #155131;  --green-soft: #d2eadb;
  --blue: #2d6cb1;   --blue-dark: #163d6b;   --blue-soft: #d3e2f4;
  --bad: #c7321f;
  --ok: #2f8a57;
  --shadow: 0 1px 2px rgba(37, 34, 29, .08), 0 0 0 1px var(--line);
  /* tutorial kit (tutorial.css) */
  --tut-accent: #e07a1f;
  --tut-accent-ink: #ffffff;
  --tut-bubble: #fbf7ee;
  --tut-ink: #25221d;
  --tut-muted: #7a7264;
  --tut-dim: rgba(37, 34, 29, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0%, #f8f6f1 0%, var(--bg) 55%, var(--bg-2) 100%) fixed;
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: manipulation;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; touch-action: manipulation; }
[hidden] { display: none !important; }

#app {
  position: relative;
  max-width: 680px; margin: 0 auto;
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

/* ---------- top bar + menu ---------- */
.topbar { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; min-height: 52px; }
.back {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  color: var(--muted); text-decoration: none; font-size: 24px; border-radius: 22px;
}
.back:hover, .back:focus-visible { color: var(--ink); background: rgba(255, 255, 255, .7); }
.title { margin: 0; text-align: center; font-size: 19px; font-weight: 750; letter-spacing: .02em; }
.iconbtn {
  width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent;
  font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer; justify-self: end;
}
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: rgba(255, 255, 255, .8); }
.menu {
  position: absolute; z-index: 15; top: calc(env(safe-area-inset-top) + 50px); right: max(12px, env(safe-area-inset-right));
  min-width: 210px; padding: 6px; border-radius: 16px; background: var(--card);
  box-shadow: 0 12px 32px rgba(37, 34, 29, .18), 0 0 0 1px var(--line);
  display: flex; flex-direction: column; animation: rise .16s ease-out;
}
.menu button {
  min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent;
  text-align: left; font-weight: 600; cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--bg); outline: none; }

/* ---------- layout ---------- */
.layout {
  display: flex; flex-direction: column; gap: 10px;
  min-height: calc(100vh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: calc(100dvh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* ---------- player chips ---------- */
.players { display: flex; gap: 6px; }
.pchip {
  flex: 1 1 0; min-width: 0; min-height: 50px; padding: 5px 8px 5px 11px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(37, 34, 29, .06); cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; text-align: left;
  transition: background .2s, box-shadow .2s;
}
.pc-name { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.pc-score { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pc-move { display: flex; gap: 3px; justify-content: flex-end; min-width: 0; overflow: hidden; }
.pchip.active { background: #fff; box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(37, 34, 29, .1); }
.pchip.active .pc-name { color: var(--accent-dark); }
.pchip.winner { background: #fff7dc; box-shadow: 0 0 0 2px var(--yellow); }
.pchip.flash { animation: chipflash .9s ease-out; }
@keyframes chipflash { 0% { background: var(--accent-soft); transform: scale(1.04); } 100% { transform: scale(1); } }
.mv {
  font-style: normal; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums;
}
.mv-red { background: var(--red); } .mv-yellow { background: var(--yellow); color: #2b1f00; }
.mv-green { background: var(--green); } .mv-blue { background: var(--blue); }
.mv-pass { background: var(--bg-2); color: var(--muted); }

/* ---------- status ---------- */
.status {
  min-height: 24px; text-align: center; font-weight: 700; font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status.warn { color: #8a6405; }
.status.bad { color: var(--bad); }

/* ---------- dice tray: white step | colour step ---------- */
.tray { background: var(--card); border-radius: 18px; padding: 8px; box-shadow: var(--shadow); }
.dice-row { display: flex; justify-content: center; gap: 8px; }
.dgroup {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 8px 6px; border-radius: 14px; transition: background .2s, opacity .2s, box-shadow .2s;
}
.dgroup.on { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.dgroup.off { opacity: .4; }
.dcap { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.dgroup.on .dcap { color: var(--accent-dark); }
.dd { display: flex; gap: 6px; align-items: flex-start; }
.dcol { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.die {
  width: 40px; height: 40px; border-radius: 9px; padding: 5px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  place-items: center; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16), 0 1px 3px rgba(0, 0, 0, .25);
  transition: opacity .2s, transform .2s;
}
.die i { width: 7px; height: 7px; border-radius: 50%; }
.die i.on { background: currentColor; }
.die-white { background: #fdfcf8; color: #1c1c1c; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .1), 0 0 0 1px #d9d3c6, 0 1px 3px rgba(0, 0, 0, .15); }
.die-red { background: var(--red); color: #fff; }
.die-yellow { background: var(--yellow); color: #2b1f00; }
.die-green { background: var(--green); color: #fff; }
.die-blue { background: var(--blue); color: #fff; }
.die.stale { opacity: .5; }
.die.rolling { animation: tumble .15s linear infinite; }
.die-gone { opacity: .5; background: transparent !important; border: 2px dashed #c9c1b2; box-shadow: none; display: grid; place-items: center; }
.gone-flag { width: 20px; height: 14px; border-radius: 2px; background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 7px 7px; }
.wsum { align-self: center; min-width: 34px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; height: 40px; display: flex; align-items: center; }
.whites .dd { min-height: 40px; padding-bottom: 21px; }
.wsum.old { opacity: .45; }
.csums { display: flex; gap: 2px; min-height: 18px; }
.colours .csums { min-height: 18px; }
.csum {
  min-width: 18px; height: 18px; padding: 0 3px; border-radius: 5px; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.csum.ok { background: var(--accent); color: #fff; }
.csum.no { color: #b3aa9a; text-decoration: line-through; }

/* ---------- your scorecard ---------- */
.card-wrap { background: var(--paper); border-radius: 18px; padding: 8px 6px; box-shadow: var(--shadow); }
.card-foot { display: flex; justify-content: flex-end; padding: 0 6px; }
.card-foot:empty, .card-spins:empty { display: none; }
.card-spins { padding-top: 6px; }
.scorecard { display: flex; flex-direction: column; gap: 6px; }
.lane { display: flex; align-items: stretch; gap: 2px; padding: 3px; border-radius: 10px; position: relative; }
.lane-red { background: var(--red); --lc: var(--red); --ld: var(--red-dark); --ls: var(--red-soft); }
.lane-yellow { background: var(--yellow); --lc: var(--yellow); --ld: var(--yellow-dark); --ls: var(--yellow-soft); }
.lane-green { background: var(--green); --lc: var(--green); --ld: var(--green-dark); --ls: var(--green-soft); }
.lane-blue { background: var(--blue); --lc: var(--blue); --ld: var(--blue-dark); --ls: var(--blue-soft); }
.lane-tab { flex: 0 0 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 10px; }
.lane-yellow .lane-tab { color: #2b1f00; }
.cell {
  flex: 1 1 0; min-width: 0; height: 50px; padding: 0; margin: 0;
  border: 0; border-radius: 7px; background: var(--ls); color: var(--ld);
  font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: flex-basis .15s, background .15s, transform .12s, box-shadow .15s;
  cursor: default;
}
.cell:disabled { opacity: 1; }
.cell.lastnum { box-shadow: inset 0 0 0 2px var(--ld); }
.cell.needs5::after { content: "5+"; position: absolute; top: 1px; right: 2px; font-size: 8px; font-weight: 800; color: var(--ld); opacity: .75; }
.cell.gone { background: rgba(255, 255, 255, .3); color: rgba(0, 0, 0, .3); }
.cell.crossed { background: #fffdf6; color: rgba(0, 0, 0, .28); }
.cell.crossed::before, .cell.crossed::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 76%; height: 3.5px; margin-left: -38%;
  margin-top: -1.75px; background: var(--ink); border-radius: 2px;
}
.cell.crossed::before { transform: rotate(45deg); }
.cell.crossed::after { transform: rotate(-45deg); }
.cell.new { animation: pop .8s ease-out 2; }
.cell.legal {
  flex: 0 0 44px; background: #fff; color: var(--ink); cursor: pointer; z-index: 1;
  box-shadow: 0 0 0 3px var(--accent), 0 3px 8px rgba(0, 0, 0, .25);
  font-size: 19px; animation: glow 1.4s ease-in-out infinite;
}
.cell.legal.needs5::after { content: none; }
.cell.legal:active { transform: scale(.95); }
.cell.preview { background: #fff; outline: 2px dashed var(--ld); outline-offset: -5px; }
.cell.flag {
  flex: 0 0 24px; border-radius: 50%; align-self: center; height: 24px;
  background: repeating-conic-gradient(#fff 0 25%, #1b1b1b 0 50%) 0 0 / 8px 8px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); opacity: .75;
}
.cell.flag.crossed { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.cell.flag.crossed::before, .cell.flag.crossed::after { background: var(--bad); height: 4px; }
.lane.shut::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(135deg, rgba(20, 20, 20, .22) 0 6px, transparent 6px 14px);
}
.lane.shut::after {
  content: "CLOSED"; position: absolute; right: 34px; top: 50%; transform: translateY(-50%);
  z-index: 3; pointer-events: none; font-weight: 800; font-size: 11px; letter-spacing: .12em;
  background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 4px;
}
.scorecard.ro { gap: 4px; }
.scorecard.ro .cell { height: 32px; font-size: 12px; border-radius: 5px; }
.scorecard.ro .cell.flag { flex-basis: 18px; height: 18px; }
.scorecard.ro .lane { padding: 2px; border-radius: 7px; }
.scorecard.ro .lane.shut::after { font-size: 9px; right: 26px; }

.spins { display: inline-flex; gap: 3px; align-items: center; vertical-align: -1px; }
.spin { width: 12px; height: 12px; border: 1.5px solid #b8af9f; border-radius: 3px; background: #fff; position: relative; }
.spin.sm { width: 9px; height: 9px; }
.spin.on { background: var(--bad); border-color: var(--bad); }
.spin.on::after { content: ""; position: absolute; inset: 35% 10%; background: #fff; border-radius: 1px; }

/* ---------- action row ---------- */
.step-row { display: flex; justify-content: center; min-height: 56px; margin-top: auto; padding-top: 4px; }
.roll-btn, .pass-btn {
  flex: 1 1 auto; max-width: 340px; min-height: 56px; border-radius: 28px; border: 0; cursor: pointer;
  font-size: 18px; font-weight: 750; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  transition: transform .12s, opacity .15s;
}
.roll-btn { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-dark); }
.roll-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-dark); }
.roll-btn:disabled { opacity: .45; }
.pass-btn { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.pass-btn small { font-size: 12px; font-weight: 600; }
.pass-btn.risky small { color: var(--bad); }
.pass-btn:disabled { opacity: .4; cursor: default; }
.pass-btn:active:not(:disabled) { transform: scale(.98); }
.roll-btn:focus-visible, .pass-btn:focus-visible, .pchip:focus-visible, .cell:focus-visible, .iconbtn:focus-visible, .back:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  padding: 12px; background: rgba(37, 34, 29, .38); animation: fade .18s ease-out;
}
@media (min-width: 600px) { .overlay { align-items: center; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
.panel {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto;
  overscroll-behavior: contain; background: var(--card); color: var(--ink); border-radius: 24px; padding: 18px 20px 20px;
  box-shadow: 0 20px 50px rgba(37, 34, 29, .25); animation: rise .22s ease-out;
}
.panel-wide { max-width: 600px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -8px 6px 0; }
.panel-head h2 { margin: 0; }
.panel h2 { margin: 0 0 8px; font-size: 21px; font-weight: 750; }
.panel h3 { margin: 18px 0 6px; font-size: 15px; }
.panel p, .panel li { font-size: 15px; }
.panel ul, .panel ol { padding-left: 20px; margin: 6px 0; }
.lede { color: var(--muted); margin: 0 0 12px; }
.field-label { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.field-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); min-height: 18px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--bg); }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg button {
  min-height: 44px; border-radius: 12px; border: 0; background: transparent; cursor: pointer;
  font-weight: 650; color: var(--muted);
}
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(37, 34, 29, .18); }
.panel-buttons { display: flex; gap: 10px; margin-top: 18px; }
.panel-buttons.col { flex-direction: column; gap: 4px; }
.primary, .secondary {
  min-height: 50px; padding: 0 18px; border-radius: 25px; cursor: pointer; font-weight: 700; font-size: 16px; flex: 1 1 0; border: 0;
}
.primary { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-dark); }
.primary:active { transform: translateY(1px); }
.secondary { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.link { min-height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.sheet-line { margin: 10px 0 0; font-size: 15px; }
.sheet-line.muted { color: var(--muted); font-size: 14px; }
.closed { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: -2px; }
.rc { width: 16px; height: 16px; border-radius: 4px; opacity: .35; }
.rc-red { background: var(--red); } .rc-yellow { background: var(--yellow); } .rc-green { background: var(--green); } .rc-blue { background: var(--blue); }
.rc.shut { opacity: 1; box-shadow: 0 0 0 2px var(--ink); }

.tally { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; }
.tb {
  display: inline-flex; align-items: center; min-width: 34px; height: 30px; padding: 0 6px;
  justify-content: center; border-radius: 7px; border: 2px solid; background: #fff; font-variant-numeric: tabular-nums;
}
.tb b { font-size: 15px; }
.tb-red { border-color: var(--red); color: var(--red-dark); }
.tb-yellow { border-color: var(--yellow); color: var(--yellow-dark); }
.tb-green { border-color: var(--green); color: var(--green-dark); }
.tb-blue { border-color: var(--blue); color: var(--blue-dark); }
.tb-spin { border-color: #b8af9f; color: var(--bad); }
.tb-total { border-color: var(--ink); background: var(--ink); color: #fff; min-width: 44px; }
.op { color: var(--muted); font-weight: 800; }
.key-table { overflow-x: auto; }
.key-table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.key-table th, .key-table td { border: 1px solid var(--line); padding: 4px 2px; text-align: center; font-size: 12px; }
.key-table th { text-align: left; padding: 4px 6px; font-weight: 600; color: var(--muted); }
.log { font-size: 14px; color: var(--ink); }
.log .line { padding: 6px 0; border-bottom: 1px solid var(--line); }
.log .bad { color: var(--bad); }
.lt { font-weight: 700; padding: 0 5px; border-radius: 4px; color: #fff; }
.lt-red { background: var(--red); } .lt-yellow { background: var(--yellow); color: #2b1f00; }
.lt-green { background: var(--green); } .lt-blue { background: var(--blue); }
.stats-note { color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 4px -4px 0; }
.score-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.score-table th, .score-table td { padding: 7px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.score-table th:first-child, .score-table td:first-child { text-align: left; font-weight: 700; }
.score-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.score-table td small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; }
.fl { display: inline-block; width: 9px; height: 9px; margin-left: 2px; vertical-align: -1px; border-radius: 1px; background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 4.5px 4.5px; box-shadow: 0 0 0 1px var(--ink); }
.score-table td.tot { font-weight: 800; font-size: 17px; }
.score-table tr.win td { background: #fff7dc; }
.score-table tr.you td:first-child { color: var(--accent-dark); }
.th-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.th-red { background: var(--red); } .th-yellow { background: var(--yellow); }
.th-green { background: var(--green); } .th-blue { background: var(--blue); }
.th-txt { display: none; }

/* ---------- animation ---------- */
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 3px var(--accent), 0 3px 8px rgba(0, 0, 0, .25); } 50% { box-shadow: 0 0 0 5px rgba(224, 122, 31, .5), 0 3px 8px rgba(0, 0, 0, .25); } }
@keyframes pop { 0% { transform: scale(1); } 30% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes tumble { 0% { transform: rotate(-9deg) translateY(-2px); } 50% { transform: rotate(8deg) translateY(1px); } 100% { transform: rotate(-9deg) translateY(-2px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- phones ---------- */
@media (max-width: 420px) {
  .players.n4 .pchip, .players.n5 .pchip { padding: 4px 5px 4px 8px; }
  .players.n5 .pc-score { font-size: 16px; }
  .players.n5 .mv { min-width: 18px; height: 18px; font-size: 11px; padding: 0 2px; }
  .players.n4 .pc-move, .players.n5 .pc-move { gap: 2px; }
}
@media (max-width: 380px) {
  #app { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .die { width: 35px; height: 35px; padding: 4px; }
  .die i { width: 6px; height: 6px; }
  .dd { gap: 4px; }
  .dgroup { padding: 4px 5px 6px; }
  .wsum { height: 35px; font-size: 18px; }
  .whites .dd { min-height: 35px; }
  .cell { font-size: 13px; }
  .cell.legal { flex-basis: 40px; font-size: 17px; }
  .cell.flag { flex-basis: 20px; height: 20px; }
  .lane-tab { flex-basis: 10px; }
}
/* tall phones: a roomier scorecard */
@media (max-width: 559px) and (min-height: 780px) {
  .layout { gap: 14px; }
  .cell { height: 60px; }
  .scorecard { gap: 7px; }
  .die { width: 42px; height: 42px; }
  .dgroup { padding: 4px 6px 6px; }
  .dd { gap: 5px; }
  .wsum { height: 42px; }
  .whites .dd { min-height: 42px; }
  .tray { padding: 10px 6px; }
}

/* ---------- wider screens ---------- */
@media (min-aspect-ratio: 1/1) {
  .layout { min-height: 0; }
  .step-row { margin-top: 4px; }
}
@media (min-width: 560px) {
  .cell { font-size: 17px; height: 54px; }
  .cell.legal { flex-basis: 50px; }
  .die { width: 48px; height: 48px; padding: 6px; }
  .die i { width: 8px; height: 8px; }
  .wsum { height: 48px; font-size: 22px; }
  .whites .dd { min-height: 48px; }
  .dice-row { gap: 14px; }
  .th-txt { display: inline; margin-left: 4px; }
  .th-dot { width: 10px; height: 10px; }
  .scorecard.ro .cell { height: 36px; font-size: 13px; }
}

/* Tutorial kit: lift the first-visit chip above the Roll / Pass button at the bottom of the screen. */
@media (max-aspect-ratio: 1/1) {   /* portrait: the button spans the bottom; tutorial.css loads later, hence body */
  body .tut-chip { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* Online play (online.js): a presence line under the status line, in the same row. */
.status-row { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.status-row .status { align-self: stretch; }
.net { color: var(--muted); }
#over-leave { margin-top: 8px; }
/* After an online race, the kit's Rematch / Leave bar sits at the bottom: "See results" moves up above it. */
body:has(> .bp-online-endbar:not([hidden])) .step-row { margin-bottom: 84px; }
