:root {
  color-scheme: dark;
  --ink: #edf5f0;
  --muted: #97aaaa;
  --paper: #0b1115;
  --card: #162229;
  --line: #2b3b43;
  --mint: #8ad5bd;
  --mint-dark: #63b797;
  --gold: #f4c46b;
  --gold-dark: #cda85d;
  --bust-red: #bd6470;
  --shadow: 0 6px 0 #070c10, 0 18px 36px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 15% 8%, rgba(77, 126, 109, .16), transparent 48%),
    radial-gradient(ellipse at 85% 75%, rgba(37, 83, 99, .14), transparent 50%), var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
}
body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(32deg, transparent 0 3px, rgba(159, 187, 178, .06) 3px 4px),
    repeating-linear-gradient(122deg, transparent 0 5px, rgba(159, 187, 178, .05) 5px 6px);
}
body.has-open-modal { overflow: hidden; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid var(--mint); outline-offset: 6px; }
h1, h2, p { margin-top: 0; }
.app-shell { position: relative; width: min(100% - 40px, 940px); margin: 0 auto; padding: 26px 0 22px; }
.site-header, .hero-copy, .site-footer { display: flex; align-items: center; justify-content: space-between; }
.site-header { gap: 24px; padding: 0 4px 24px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 9px); gap: 5px; align-items: end; height: 29px; transform: rotate(-14deg); }
.brand-mark span { width: 9px; height: 9px; background: var(--ink); border-radius: 50%; box-shadow: 0 3px 0 #050b0d; }
.brand-mark span:nth-child(2) { height: 15px; border-radius: 6px; background: var(--mint); }
.brand-mark span:nth-child(3) { height: 24px; border-radius: 6px; background: var(--gold); }
.eyebrow, .round-label, .site-footer { font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .12em; }
.eyebrow { margin: 0 0 4px; color: var(--muted); }
h1 { margin: 0; font-size: 25px; line-height: 1; letter-spacing: -.06em; }
.brand-dot { color: var(--mint); }
.header-actions { display: flex; gap: 10px; }
.account-icon svg { display: block; width: 19px; height: 19px; margin: auto; }
.account-icon.is-signed-in { color: var(--mint); border-color: #528974; }
.main-nav { display: flex; flex: 1; justify-content: center; gap: 8px; }
.nav-link { padding: 12px 18px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .1em; text-decoration: none; }
.nav-link:hover { border-color: #35484e; color: var(--ink); background: #152229; }
.nav-link[aria-current="page"] { border-color: #477568; background: linear-gradient(145deg, #233b34, #152822); color: var(--mint); box-shadow: 0 4px 0 #07110d, inset 0 1px 0 rgba(255, 255, 255, .04); }
.nav-link:focus-visible, .profile-play-link:focus-visible { outline: 3px solid var(--mint); outline-offset: 4px; border-radius: 8px; }
.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid #34474d;
  border-radius: 11px;
  background: linear-gradient(150deg, #26363d, #172229);
  box-shadow: 0 4px 0 #060c10, inset 0 1px 0 rgba(255, 255, 255, .07);
  cursor: pointer;
  font-size: 16px;
  transition: transform .15s ease, border-color .15s ease;
}
.icon-button:hover { border-color: var(--mint-dark); transform: translateY(-1px); }
.icon-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #060c10; }
.hero-copy {
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid #2e4248;
  border-radius: 22px;
  background: radial-gradient(ellipse at 0 0, rgba(138, 213, 189, .08), transparent 70%),
    linear-gradient(140deg, #18262c, #101a20);
  box-shadow: var(--shadow);
}
.round-label { margin: 0 0 12px; color: var(--mint); font-weight: 500; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px rgba(138, 213, 189, .4); vertical-align: 1px; }
h2 { margin-bottom: 12px; font-size: clamp(36px, 6vw, 56px); line-height: 1; letter-spacing: -.065em; }
.lede { max-width: 420px; margin-bottom: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.game-hero { display: block; text-align: center; }
.game-hero .round-label { margin-bottom: 18px; text-align: left; }
.game-hero .lede { max-width: 580px; margin-inline: auto; }

/* Each game piece has its own edge and shadow above the woven backdrop. */
.game-card { max-width: 560px; margin: 0 auto; padding: 30px 12px 20px; text-align: center; }
.score-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 auto 18px; }
.score-plaque, .rolls-plaque {
  border: 1px solid #35484e;
  border-radius: 16px;
  background: linear-gradient(145deg, #203039, #121d23);
  box-shadow: var(--shadow);
}
.score-plaque { min-width: 172px; padding: 16px 24px 14px; }
.rolls-plaque { min-width: 90px; padding: 16px 18px; }
.score-row .eyebrow { margin-bottom: 8px; font-size: 9px; }
.score { color: var(--mint); font-size: 68px; line-height: 1; letter-spacing: -.06em; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 #0b1c18, 0 0 24px rgba(138, 213, 189, .12); transition: color .2s ease; }
.roll-count { color: #d8e4df; font-family: "DM Mono", monospace; font-size: 34px; line-height: 1.2; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #050b0e; }
.bust-warning { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #61303c; border-radius: 20px; background: #160e13; color: var(--bust-red); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .1em; box-shadow: 0 2px 0 #080d0f; }
.warning-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bust-red); }
.dice-stage { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 140px; margin-top: 14px; perspective: 700px; }
.die {
  position: relative;
  width: 106px;
  height: 106px;
  border: 1px solid #e0eade;
  border-radius: 21px;
  background: linear-gradient(140deg, #f8fbf2, #d8e6dc);
  box-shadow: inset 0 2px 1px #fff, inset -3px -3px 8px rgba(37, 65, 51, .12),
    6px 8px 0 #8fa99a, 7px 10px 0 #30453c, 12px 22px 26px rgba(0, 0, 0, .4);
}
.die.rolling { animation: roll-die .65s cubic-bezier(.2, .8, .3, 1); }
@keyframes roll-die {
  0% { transform: rotate(0) scale(1); }
  32% { transform: rotateX(18deg) rotate(20deg) translateY(-16px) scale(1.05); }
  68% { transform: rotateX(-12deg) rotate(-16deg) translateY(4px) scale(.94); }
  100% { transform: rotate(0) scale(1); }
}
.pip { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #223c34; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .6); transform: translate(-50%, -50%); opacity: 0; }
.pip-1 { top: 25%; left: 25%; }
.pip-2 { top: 25%; left: 75%; }
.pip-3 { top: 50%; left: 50%; }
.pip-4 { top: 75%; left: 25%; }
.pip-5 { top: 75%; left: 75%; }
.pip-6 { top: 50%; left: 25%; }
.die[data-value="1"] .pip-3, .die[data-value="2"] .pip-1, .die[data-value="2"] .pip-5, .die[data-value="3"] .pip-1, .die[data-value="3"] .pip-3, .die[data-value="3"] .pip-5, .die[data-value="4"] .pip-1, .die[data-value="4"] .pip-2, .die[data-value="4"] .pip-4, .die[data-value="4"] .pip-5, .die[data-value="5"] .pip-1, .die[data-value="5"] .pip-2, .die[data-value="5"] .pip-3, .die[data-value="5"] .pip-4, .die[data-value="5"] .pip-5, .die[data-value="6"] .pip-1, .die[data-value="6"] .pip-2, .die[data-value="6"] .pip-4, .die[data-value="6"] .pip-5, .die[data-value="6"] .pip-6 { opacity: 1; }
.die[data-value="6"] .pip-3 { left: 75%; opacity: 1; }
.plus { color: #66817a; font-family: "DM Mono", monospace; font-size: 24px; text-shadow: 0 2px 0 #050b0e; }
.roll-result { width: fit-content; min-width: 155px; margin: 12px auto 24px; padding: 7px 12px; border: 1px solid #2c4148; border-radius: 8px; background: linear-gradient(140deg, #1c2b32, #111d23); color: #bdcec6; box-shadow: 0 3px 0 #070c10; font-family: "DM Mono", monospace; font-size: 11px; }

/* The face travels toward its base when a button is pressed. */
.roll-button {
  --button-glow: 0 0 20px rgba(138, 213, 189, .38), 0 0 46px rgba(138, 213, 189, .23);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 260px);
  height: 84px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid #66ab8f;
  border-radius: 14px;
  background: linear-gradient(145deg, #363638, #242426);
  color: #c0f1da;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, .08), inset 0 -6px 12px rgba(0, 0, 0, .3),
    0 10px 0 #1b1b1d, 0 16px 0 #101012, 0 27px 38px rgba(0, 0, 0, .5), var(--button-glow);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.roll-button span { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: .05em; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.roll-button small { margin-top: 5px; color: #9dbbb0; font-family: "DM Mono", monospace; font-size: 9px; line-height: 1.2; letter-spacing: .06em; }
.roll-button:enabled:hover, .roll-button:focus-visible {
  --button-glow: 0 0 26px rgba(138, 213, 189, .65), 0 0 60px rgba(138, 213, 189, .4);
}
.roll-button:focus-visible { outline-offset: -4px; }
.roll-button:enabled:hover { transform: translateY(-2px); }
.roll-button:enabled:active { transform: translateY(7px); box-shadow: inset 0 2px 2px rgba(255, 255, 255, .06), inset 0 -3px 10px rgba(0, 0, 0, .3), 0 3px 0 #1b1b1d, 0 9px 0 #101012, 0 16px 25px rgba(0, 0, 0, .5), var(--button-glow); }
.roll-button.is-awaiting-roll::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 26px rgba(138, 213, 189, .65), 0 0 60px rgba(138, 213, 189, .4);
  opacity: 0;
  animation: green-glow-pulse 2.4s ease-in-out infinite;
}
@keyframes green-glow-pulse {
  0%, 100% { opacity: 0; }
  50% { opacity: .85; }
}
.roll-button.is-busted {
  --button-glow: 0 0 20px rgba(189, 100, 112, .38), 0 0 46px rgba(189, 100, 112, .23);
  border-color: var(--bust-red);
}
.roll-button.is-busted span { color: var(--bust-red); font-size: 32px; letter-spacing: .015em; }
.roll-button.is-busted:enabled:hover, .roll-button.is-busted:focus-visible {
  --button-glow: 0 0 26px rgba(189, 100, 112, .65), 0 0 60px rgba(189, 100, 112, .4);
}
.roll-button.is-busted:focus-visible { outline-color: var(--bust-red); }
.roll-button:disabled { cursor: wait; filter: brightness(.75); }
.game-status { max-width: 390px; min-height: 21px; margin: 26px auto 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.rolling-dots { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 20px; font-family: "DM Mono", monospace; font-size: 26px; line-height: 20px; }
.rolling-dots span { display: inline-block; animation: suspense-bounce .65s ease-in-out infinite; }
.rolling-dots span:nth-child(2) { animation-delay: .1s; }
.rolling-dots span:nth-child(3) { animation-delay: .2s; }
@keyframes suspense-bounce {
  0%, 65%, 100% { transform: translateY(0); opacity: .4; }
  32% { transform: translateY(-6px); opacity: 1; }
}
.daily-status { max-width: 420px; margin: 24px auto 0; padding-top: 18px; border-top: 1px solid var(--line); }
.daily-status p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.daily-status .reset-label { margin-top: 14px; font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .04em; }
.reset-label time { display: inline-block; margin-left: 5px; padding: 4px 8px; border: 1px solid #30464c; border-radius: 6px; background: linear-gradient(145deg, #203138, #121f25); color: var(--mint); box-shadow: 0 3px 0 #060d11, inset 0 1px 0 rgba(255, 255, 255, .04); font-size: 14px; font-variant-numeric: tabular-nums; }
.reset-label span { display: block; margin-top: 8px; font-size: 9px; color: #718b8b; }
.site-footer { gap: 16px; padding: 10px 4px 0; color: #718b8b; font-size: 8px; }

/* Dialogs use the same raised surfaces as the game. */
.modal { width: min(calc(100% - 40px), 410px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 34px; border: 1px solid #354b52; border-radius: 20px; background: linear-gradient(145deg, #19272e, #111a20); color: var(--ink); box-shadow: 0 10px 0 #060c10, 0 30px 100px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05); }
.modal::backdrop { background: rgba(4, 9, 12, .75); backdrop-filter: blur(5px); }
.modal h2 { margin: 8px 0 18px; font-size: 34px; }
.modal p:not(.eyebrow) { color: #b0c0ba; line-height: 1.75; font-size: 13px; }
.modal-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid #3a4d55; border-radius: 8px; background: linear-gradient(145deg, #293a42, #1b272e); box-shadow: 0 3px 0 #070c10; font-size: 20px; cursor: pointer; }
.modal-close:active { transform: translateY(2px); box-shadow: 0 1px 0 #070c10; }
.legend { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: #b0c0ba; font-size: 12px; }
.legend-tile { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; color: #15251e; font-family: "DM Mono", monospace; font-weight: 500; box-shadow: 0 3px 0 #060d10; }
.legend-tile.exact { background: var(--mint); }
.legend-tile.close { background: linear-gradient(145deg, #363638, #242426); color: var(--bust-red); border-color: var(--bust-red); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats-grid > div { padding: 15px 5px; border: 1px solid #35484e; border-radius: 12px; background: linear-gradient(145deg, #23343c, #142129); box-shadow: 0 4px 0 #070e12; text-align: center; }
.stats-grid strong, .stats-grid span { display: block; }
.stats-grid strong { color: var(--mint); font-size: 26px; font-variant-numeric: tabular-nums; }
.stats-grid span { margin-top: 5px; color: var(--muted); font-size: 10px; }
#stat-status { font-size: 17px; line-height: 2; }

/* Profile records share the game's raised surfaces. */
.profile-local-badge { flex-shrink: 0; padding: 9px 11px; border: 1px solid #36504e; border-radius: 8px; background: #14242a; color: #a3beb4; font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .07em; }
.profile-error { padding: 14px 18px; border: 1px solid #725b38; border-radius: 10px; background: #2a241b; color: var(--gold); font-size: 12px; line-height: 1.7; }
.profile-records { margin-top: 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.profile-metric { min-width: 0; padding: 20px; border: 1px solid #35484e; border-radius: 16px; background: linear-gradient(145deg, #203039, #121d23); box-shadow: var(--shadow); }
.profile-metric .eyebrow { margin-bottom: 14px; font-size: 9px; line-height: 1.5; letter-spacing: .08em; }
.profile-metric > strong { display: block; min-height: 53px; color: var(--mint); font-size: 42px; line-height: 1.2; letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.profile-metric > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.profile-lifetime { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; padding: 24px 0 4px; color: var(--muted); font-size: 11px; }
.profile-lifetime strong { margin-right: 5px; color: var(--ink); font-family: "DM Mono", monospace; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.profile-panel { margin-top: 24px; padding: 24px; border: 1px solid #2e4248; border-radius: 18px; background: linear-gradient(145deg, #18262d, #101b21); box-shadow: var(--shadow); }
.profile-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.profile-panel-header .eyebrow { margin-bottom: 7px; font-size: 9px; }
.profile-panel h3 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.04em; font-weight: 500; }
.profile-play-link { flex-shrink: 0; padding: 5px 0; color: var(--mint); font-size: 12px; text-decoration: none; }
.profile-play-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.profile-today-stats { gap: 14px; }
.profile-today-stats strong { font-size: 32px; line-height: 1.3; }
.profile-today-stats #stat-status { font-size: 18px; line-height: 42px; }
.profile-roll-label { margin: 24px 0 12px; font-size: 9px; }
.profile-rolls { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.profile-roll { padding: 7px 10px; border: 1px solid #35534b; border-radius: 7px; background: #182b26; box-shadow: 0 2px 0 #080f0c; color: #b6d8c8; font-family: "DM Mono", monospace; font-size: 11px; }
.profile-roll.is-bust { border-color: #683a44; background: #291a22; color: var(--bust-red); }
.profile-today-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.history-count { padding: 7px 9px; border: 1px solid #30464c; border-radius: 7px; background: #1a2b31; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; white-space: nowrap; }
.history-empty { padding: 26px 10px 30px; text-align: center; }
.history-empty > span { display: block; margin-bottom: 12px; color: var(--mint); font-size: 32px; }
.history-empty h4 { margin: 0 0 8px; font-size: 21px; font-weight: 500; letter-spacing: -.03em; }
.history-empty p { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; }
.history-table th { padding: 0 12px 13px; border-bottom: 1px solid #35484e; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; font-weight: 400; letter-spacing: .09em; text-transform: uppercase; }
.history-table td { padding: 15px 12px; border-bottom: 1px solid #25383f; color: #c4d2ca; font-size: 12px; }
.history-table th:first-child, .history-table td:first-child { padding-left: 0; }
.history-table th:last-child, .history-table td:last-child { padding-right: 0; text-align: right; }
.history-table th:nth-child(2), .history-table th:nth-child(3), .history-table .history-number { text-align: right; }
.history-table .history-number { font-family: "DM Mono", monospace; font-size: 13px; font-variant-numeric: tabular-nums; }
.history-table td:nth-child(2) { color: var(--mint); }
.history-outcome { display: inline-block; padding: 5px 8px; border: 1px solid #3b4e51; border-radius: 6px; background: #1d2d32; color: #b1c3bc; font-family: "DM Mono", monospace; font-size: 9px; white-space: nowrap; }
.history-outcome.busted { border-color: #613440; background: #281a21; color: var(--bust-red); }
.history-outcome.in-progress { border-color: #3b6552; background: #182d23; color: var(--mint); }
.history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.history-pagination p { margin: 0; color: var(--muted); font-size: 11px; }
.history-pagination > div { display: flex; gap: 8px; }
.history-page-button { width: 36px; height: 32px; padding: 0; border: 1px solid #3a5159; border-radius: 8px; background: linear-gradient(145deg, #23353d, #17252c); box-shadow: 0 3px 0 #070d12; color: var(--mint); cursor: pointer; }
.history-page-button:enabled:hover { border-color: var(--mint); }
.history-page-button:enabled:active { transform: translateY(2px); box-shadow: 0 1px 0 #070d12; }
.history-page-button:disabled { opacity: .35; cursor: default; }
.profile-history-note { margin: 18px 0 0; color: #819995; font-size: 11px; line-height: 1.7; }
.profile-storage-note { margin: 24px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: center; }
.profile-account { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 18px 20px; border: 1px solid #31494a; border-radius: 14px; background: #142127; }
.profile-account > div { min-width: 0; }
.profile-account p { margin: 0; color: #b0c0ba; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.profile-account #profile-account-status { margin-top: 5px; color: var(--muted); font-size: 11px; }
.account-action { padding: 11px 14px; border: 1px solid #3e6158; border-radius: 9px; background: linear-gradient(145deg, #263a35, #192b25); box-shadow: 0 3px 0 #080f0c; color: var(--mint); font-size: 12px; cursor: pointer; }
.account-action:hover:enabled { border-color: var(--mint); }
.account-action:active:enabled { transform: translateY(2px); box-shadow: 0 1px 0 #080f0c; }
.account-action:disabled { opacity: .5; cursor: default; }
.profile-account .account-action { flex-shrink: 0; }
.account-modal { width: min(calc(100% - 28px), 460px); }
.account-modal h2 { max-width: 300px; }
.account-modal label { display: block; margin: 22px 0 8px; color: var(--ink); font-size: 12px; }
.account-modal input { width: 100%; padding: 13px 12px; border: 1px solid #415950; border-radius: 8px; background: #0e191e; color: var(--ink); font: inherit; font-size: 15px; }
.account-modal input:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.account-primary { width: 100%; margin-top: 14px; }
.account-actions { display: flex; flex-direction: column; gap: 12px; }
.account-modal .account-note { margin-top: 18px; font-size: 11px; color: var(--muted); }
.account-email { overflow-wrap: anywhere; font-family: "DM Mono", monospace; }
.account-modal .account-status { margin: 22px 0 0; padding: 12px; border: 1px solid #344b47; border-radius: 8px; background: #11201d; color: #bcd6c8; font-size: 12px; }
.account-dismiss { display: block; margin: 16px auto 0; padding: 8px; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
@media (max-width: 560px) {
  .profile-account { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .profile-account .account-action { align-self: flex-start; }
}
#profile-title:focus, #game-title:focus { outline: none; }

/* Centered play stack, with personal bests beside the current run counters. */
body.is-play-page { --play-die-size: clamp(88px, 10.4dvh, 112px); }
.is-play-page .app-shell { display: flex; flex-direction: column; min-height: 100dvh; padding-block: 16px; }
.is-play-page .site-header { padding-bottom: 20px; }
.is-play-page #play-page { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.is-play-page .game-hero { padding: 20px 28px; }
.is-play-page .game-hero .round-label { margin-bottom: 10px; font-size: 10px; }
.is-play-page .game-hero h2 { margin-bottom: 10px; font-size: clamp(36px, 4.4dvh, 48px); }
.is-play-page .game-hero .lede { font-size: 13px; line-height: 1.5; }
.is-play-page .game-card { display: flex; flex-direction: column; align-items: center; width: min(100%, 560px); margin-block: auto; padding: 26px 12px 24px; }
.is-play-page .score-row { align-items: stretch; justify-content: center; flex-direction: row; gap: 16px; margin: 0 0 18px; }
.is-play-page .score-plaque { min-width: 176px; padding: 14px 20px; }
.is-play-page .rolls-plaque { min-width: 144px; padding: 14px 18px; }
.is-play-page .score-row .eyebrow { margin-bottom: 8px; font-size: 9px; }
.is-play-page .score { font-size: clamp(46px, 5.6dvh, 64px); }
.is-play-page .roll-count { font-size: clamp(38px, 5dvh, 54px); line-height: 1.12; }
.is-play-page .play-best { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: nowrap; }
.is-play-page .play-best strong { margin-left: 3px; color: #d0e2d7; font-family: "DM Mono", monospace; font-weight: 500; font-variant-numeric: tabular-nums; }
.is-play-page .bust-warning { padding: 5px 10px; }
.is-play-page .dice-stage { gap: 22px; min-height: calc(var(--play-die-size) + 24px); margin-top: 18px; }
.is-play-page .die { width: var(--play-die-size); height: var(--play-die-size); border-radius: 21px; }
.is-play-page .pip { width: calc(var(--play-die-size) * .15); height: calc(var(--play-die-size) * .15); }
.is-play-page .plus { font-size: 24px; }
.is-play-page .roll-result { min-width: 150px; margin: 12px auto 26px; padding: 6px 12px; font-size: 11px; line-height: 1.4; }
.is-play-page .roll-button { width: min(100%, 260px); height: 84px; padding: 12px; }
.is-play-page .roll-button span { font-size: 28px; }
.is-play-page .roll-button.is-busted span { font-size: 32px; }
.is-play-page .roll-button small { margin-top: 5px; }
.is-play-page .game-status { min-height: 20px; margin: 24px 0 0; font-size: 12px; line-height: 1.6; }
.is-play-page .daily-status { width: 100%; max-width: 560px; margin: 22px 0 0; padding-top: 14px; }
.is-play-page .daily-status p { font-size: 11px; line-height: 1.6; }
.is-play-page .daily-status .reset-label { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin-top: 10px; font-size: 9px; }
.is-play-page .reset-label time { margin: 0; padding: 4px 9px; font-size: 15px; line-height: 1.4; }
.is-play-page .reset-label span { margin: 0; font-size: 9px; }
.is-play-page .site-footer { padding-top: 6px; }

.welcome-modal { width: min(calc(100% - 28px), 525px); padding: 34px 32px 28px; text-align: center; }
.welcome-modal[open] { animation: welcome-in .2s ease-out; }
#welcome-modal .eyebrow { color: #a8b8b6; font-size: 12px; letter-spacing: .18em; }
#welcome-title { margin: 12px 0 22px; background: linear-gradient(110deg, var(--mint), var(--gold)); background-clip: text; color: transparent; font-size: 44px; letter-spacing: -.06em; }
#welcome-title span { color: var(--mint); }
#welcome-modal .welcome-odds { margin-bottom: 24px; color: var(--mint); font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; }
#welcome-modal .welcome-copy p { color: #b0bdbb; font-size: 13px; line-height: 1.8; text-align: left; }
#welcome-modal strong { color: #f4f2ec; font-weight: 700; }
#welcome-modal .welcome-note { margin: 22px 0 24px; padding: 14px; border: 1px solid #2c3c3d; border-radius: 10px; background: #111d22; color: #a8b8b6; font-size: 12px; line-height: 1.7; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .15); }
.welcome-play { display: block; width: min(100%, 280px); margin: 0 auto; padding: 14px 18px; border: 1px solid #afebd1; border-radius: 10px; background: linear-gradient(145deg, #a6e1c8, #79bea6); color: #102c23; box-shadow: 0 5px 0 #35644e, 0 9px 0 #0a1511, inset 0 1px 0 rgba(255, 255, 255, .4); font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .12s ease; }
.welcome-play:hover { transform: translateY(-1px); }
.welcome-play:active { transform: translateY(3px); box-shadow: 0 2px 0 #35644e, 0 6px 0 #0a1511; }
.welcome-rules { margin-top: 22px; padding: 4px 8px; border: 0; background: transparent; color: #a8b8b6; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-family: "DM Mono", monospace; font-size: 11px; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .die.rolling, .welcome-modal[open], .rolling-dots span, .roll-button.is-awaiting-roll::after { animation: none; }
  button, .score { transition: none; }
}
@media (max-width: 560px) {
  .app-shell { width: min(100% - 24px, 940px); padding-top: 20px; }
  .site-header { padding: 0 2px 22px; }
  .brand-lockup { gap: 10px; }
  .brand-lockup .eyebrow { font-size: 8px; }
  .hero-copy { padding: 22px; border-radius: 18px; }
  .game-card { padding: 26px 4px 18px; }
  .dice-stage { gap: 20px; min-height: 126px; }
  .die { width: 94px; height: 94px; border-radius: 18px; }
  .pip { width: 14px; height: 14px; }
  .welcome-modal { padding: 28px 22px 24px; }
  .site-footer { font-size: 7px; letter-spacing: .08em; }
  .site-header { flex-wrap: wrap; gap: 16px; }
  .brand-lockup { flex: 1; }
  .main-nav { order: 3; flex-basis: 100%; gap: 10px; }
  .nav-link { flex: 1; padding: 12px; text-align: center; }
  .profile-local-badge { display: none; }
  .profile-records { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .profile-metric { padding: 16px; }
  .profile-metric > strong { min-height: 44px; font-size: 36px; }
  .profile-lifetime { gap: 12px; font-size: 10px; }
  .profile-lifetime strong { font-size: 12px; }
  .profile-panel { margin-top: 20px; padding: 18px; }
  .profile-panel h3 { font-size: 21px; }
  .profile-panel-header { gap: 12px; }
  .profile-play-link { font-size: 10px; }
  .profile-today-stats { gap: 8px; }
  .history-table th { font-size: 8px; }
  .history-table td { font-size: 10px; }
  .history-table th, .history-table td { padding-left: 5px; padding-right: 5px; }
  .history-table .history-number { font-size: 11px; }
  .history-outcome { padding: 5px; font-size: 8px; }
}

@media (max-height: 950px) {
  body.is-play-page { --play-die-size: clamp(78px, 10dvh, 96px); }
  .is-play-page .app-shell { padding-block: 12px; }
  .is-play-page .site-header { padding-bottom: 14px; }
  .is-play-page .game-hero { padding: 16px 24px; }
  .is-play-page .game-hero .round-label { margin-bottom: 8px; font-size: 9px; }
  .is-play-page .game-hero h2 { margin-bottom: 8px; font-size: clamp(32px, 4.4dvh, 42px); }
  .is-play-page .game-hero .lede { font-size: 12px; line-height: 1.4; }
  .is-play-page .game-card { padding: 18px 12px 14px; }
  .is-play-page .score-row { margin-bottom: 14px; }
  .is-play-page .score-plaque, .is-play-page .rolls-plaque { padding: 10px 18px; }
  .is-play-page .score-row .eyebrow { margin-bottom: 6px; }
  .is-play-page .score { font-size: clamp(42px, 5.2dvh, 52px); }
  .is-play-page .roll-count { font-size: clamp(36px, 4.65dvh, 46px); }
  .is-play-page .play-best { margin-top: 8px; font-size: 10px; }
  .is-play-page .dice-stage { min-height: calc(var(--play-die-size) + 22px); margin-top: 14px; }
  .is-play-page .roll-result { margin: 10px auto 20px; padding: 4px 10px; font-size: 10px; }
  .is-play-page .roll-button { height: 76px; padding: 10px; }
  .is-play-page .roll-button span { font-size: 26px; }
  .is-play-page .roll-button.is-busted span { font-size: 30px; }
  .is-play-page .roll-button small { margin-top: 4px; }
  .is-play-page .game-status { min-height: 18px; margin-top: 20px; font-size: 11px; }
  .is-play-page .daily-status { margin-top: 16px; padding-top: 10px; }
  .is-play-page .daily-status .reset-label { margin-top: 8px; gap: 4px 8px; font-size: 8px; }
  .is-play-page .reset-label time { padding: 3px 7px; font-size: 13px; }
  .is-play-page .reset-label span { font-size: 8px; }
}

@media (max-width: 560px) {
  .is-play-page .app-shell { padding-block: 10px; }
  .is-play-page .site-header { flex-wrap: nowrap; gap: 8px; padding-bottom: 12px; }
  .is-play-page .brand-lockup { flex: 0 1 auto; gap: 8px; }
  .is-play-page .brand-lockup .eyebrow { font-size: 7px; letter-spacing: .06em; }
  .is-play-page h1 { font-size: 22px; }
  .is-play-page .brand-mark { grid-template-columns: repeat(3, 7px); gap: 4px; height: 24px; }
  .is-play-page .brand-mark span { width: 7px; }
  .is-play-page .main-nav { order: 0; flex-basis: auto; gap: 4px; }
  .is-play-page .nav-link { flex: 0 1 auto; padding: 9px 8px; font-size: 10px; letter-spacing: .04em; }
  .is-play-page .icon-button { width: 34px; height: 34px; }
  .is-play-page .header-actions { gap: 6px; }
  .is-play-page .game-hero { padding: 12px 18px; }
  .is-play-page .game-card { padding: 14px 4px 10px; }
  .is-play-page .score-row { gap: 12px; margin-bottom: 12px; }
  .is-play-page .score-plaque, .is-play-page .rolls-plaque { width: clamp(120px, 36vw, 154px); min-width: 0; padding-inline: 12px; }
  .is-play-page .dice-stage { gap: 18px; margin-top: 12px; }
  .is-play-page .roll-result { margin-top: 8px; margin-bottom: 18px; }
  .is-play-page .game-status { margin-top: 18px; }
  .is-play-page .daily-status { margin-top: 12px; }
}

@media (max-height: 780px) {
  body.is-play-page { --play-die-size: clamp(68px, 10.5dvh, 84px); }
  .is-play-page .app-shell { padding-block: 8px; }
  .is-play-page .site-header { padding-bottom: 10px; }
  .is-play-page .game-hero { padding: 10px 20px; }
  .is-play-page .game-hero .round-label { margin-bottom: 6px; }
  .is-play-page .game-hero h2 { margin-bottom: 6px; font-size: 32px; }
  .is-play-page .game-hero .lede { font-size: 11.5px; line-height: 1.4; }
  .is-play-page .game-card { padding-block: 10px 8px; }
  .is-play-page .score-row { margin-bottom: 8px; }
  .is-play-page .score-plaque, .is-play-page .rolls-plaque { padding-block: 8px; }
  .is-play-page .score-row .eyebrow { margin-bottom: 4px; font-size: 8px; }
  .is-play-page .score { font-size: 38px; }
  .is-play-page .roll-count { font-size: 34px; }
  .is-play-page .play-best { margin-top: 6px; font-size: 9.5px; }
  .is-play-page .bust-warning { padding: 3px 8px; font-size: 8.5px; }
  .is-play-page .dice-stage { min-height: calc(var(--play-die-size) + 18px); margin-top: 10px; }
  .is-play-page .roll-result { margin: 6px auto 12px; }
  .is-play-page .roll-button { height: 64px; padding: 8px; }
  .is-play-page .roll-button span { font-size: 24px; }
  .is-play-page .roll-button.is-busted span { font-size: 28px; }
  .is-play-page .roll-button small { margin-top: 3px; }
  .is-play-page .game-status { min-height: 17px; margin-top: 16px; line-height: 1.5; }
  .is-play-page .daily-status { margin-top: 10px; padding-top: 8px; }
  .is-play-page .daily-status p { font-size: 10px; line-height: 1.5; }
  .is-play-page .daily-status .reset-label { margin-top: 6px; font-size: 8px; }
  .is-play-page .site-footer { padding-top: 4px; }
}

@media (max-height: 700px) {
  body.is-play-page { --play-die-size: clamp(60px, 10dvh, 72px); }
  .is-play-page .app-shell { padding-block: 6px; }
  .is-play-page .site-header { padding-bottom: 8px; }
  .is-play-page .game-hero { padding-block: 8px; }
  .is-play-page .game-hero .round-label { margin-bottom: 4px; }
  .is-play-page .game-hero h2 { margin-bottom: 4px; font-size: 28px; }
  .is-play-page .game-hero .lede { font-size: 11px; }
  .is-play-page .game-card { padding-block: 8px 6px; }
  .is-play-page .score-row { margin-bottom: 6px; }
  .is-play-page .score-plaque, .is-play-page .rolls-plaque { padding-block: 6px; }
  .is-play-page .score-row .eyebrow { margin-bottom: 3px; }
  .is-play-page .score { font-size: 34px; }
  .is-play-page .roll-count { font-size: 30px; }
  .is-play-page .play-best { margin-top: 4px; font-size: 9px; }
  .is-play-page .dice-stage { margin-top: 8px; }
  .is-play-page .roll-result { margin: 4px auto 8px; }
  .is-play-page .game-status { margin-top: 12px; }
  .is-play-page .daily-status { margin-top: 6px; padding-top: 4px; }
  .is-play-page .daily-status .reset-label { margin-top: 5px; }
}

@media (max-width: 360px) {
  .is-play-page h1 { font-size: 20px; }
  .is-play-page .icon-button { width: 32px; height: 32px; }
  .is-play-page .brand-mark { display: none; }
  .is-play-page .brand-lockup .eyebrow { font-size: 6px; }
}
