@font-face {
  font-family:Vera;
  src:url('../assets/Vera.ttf');
  font-weight:400;
  font-display:swap
}
@font-face {
  font-family:Vera;
  src:url('../assets/VeraBd.ttf');
  font-weight:700;
  font-display:swap
}
:root {
  --cream:#fff3de;
  --ink:#28183d;
  --mint:#9ce6d4;
  --yellow:#ffd447;
  --coral:#ff766b;
  --border:2px solid var(--ink)
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:var(--cream);
  color:var(--ink);
  font-family:Vera,Arial,sans-serif;
  font-size:14px
}
button,a {
  -webkit-tap-highlight-color:transparent
}
button {
  font:inherit;
  cursor:pointer;
  color:inherit
}
a {
  color:inherit
}
button:disabled {
  cursor:default
}
button:focus-visible,a:focus-visible {
  outline:3px solid #70448c;
  outline-offset:5px
}
[hidden] {
  display:none!important
}
.sr-only,.skip {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%)
}
.skip:focus {
  clip-path:none;
  width:auto;
  height:auto;
  background:var(--yellow);
  padding:15px;
  z-index:30
}
.game-header {
  display:flex;
  align-items:center;
  gap:28px;
  padding:18px 4%;
  border-bottom:var(--border)
}
.brand {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:28px;
  font-weight:700;
  letter-spacing:-1.8px;
  text-decoration:none
}
.brand img {
  border:var(--border);
  border-radius:11px;
  transform:rotate(-9deg)
}
.edition {
  font-size:10px;
  letter-spacing:1.3px;
  line-height:1.9
}
.edition b {
  display:block;
  font-size:9px;
  color:#70448c
}
.header-actions {
  display:flex;
  gap:10px;
  margin-left:auto
}
.header-actions button,#pause {
  background:transparent;
  border:var(--border);
  padding:13px 16px;
  border-radius:5px;
  font-size:12px;
  min-height:48px
}
.header-actions button:last-child {
  background:var(--yellow)
}
main {
  max-width:1600px;
  margin:auto;
  padding:0 4%
}
.page-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:32px 0 28px;
  gap:24px
}
.eyebrow {
  font-size:10px;
  letter-spacing:1.4px;
  line-height:1.8;
  font-weight:700;
  margin:0 0 12px
}
h1 {
  font-size:clamp(30px,3.7vw,56px);
  letter-spacing:-2.5px;
  margin:0;
  line-height:1.1
}
h1 em {
  font-style:normal;
  color:var(--coral);
  -webkit-text-stroke:1px var(--ink);
  text-shadow:2px 2px 0 var(--ink)
}
.page-title>p {
  line-height:1.7;
  font-size:12px
}
.game-layout {
  display:grid;
  grid-template-columns:240px minmax(0,1fr);
  gap:28px;
  align-items:start
}
.sidebar {
  padding-top:7px
}
.character-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px
}
.character-choice {
  background:#fff8ec;
  border:var(--border);
  border-radius:8px;
  padding:0 5px 10px;
  overflow:hidden;
  transition:transform .15s;
  min-height:132px
}
.character-choice img {
  object-fit:contain;
  width:100%;
  height:106px;
  display:block
}
.character-choice span {
  font-weight:700;
  font-size:10px;
  display:block;
  line-height:1.4
}
.character-choice.selected {
  background:var(--mint);
  box-shadow:3px 3px 0 var(--ink);
  transform:rotate(-2deg)
}
.character-choice:disabled {
  opacity:.6
}
.character-choice.selected:disabled {
  opacity:1
}
.personal-best {
  border-top:var(--border);
  margin-top:28px;
  padding-top:22px
}
.best-value {
  font-size:46px;
  font-weight:700;
  letter-spacing:-2px;
  margin:8px 0
}
.best-value small {
  font-size:18px
}
.personal-best>p:not(.eyebrow):not(.best-value) {
  font-size:12px;
  line-height:1.8
}
.plain-button {
  background:none;
  border:0;
  padding:12px 0;
  text-decoration:underline;
  text-underline-offset:4px;
  font-size:12px;
  min-height:48px
}
.local-note {
  line-height:1.8;
  font-size:11px;
  color:#655770;
  margin:24px 0
}
.arena {
  border:var(--border);
  border-radius:12px;
  overflow:hidden;
  box-shadow:6px 6px 0 var(--ink);
  background:#fff8ec
}
.stage {
  position:relative;
  background:#c5eee3
}
canvas {
  display:block;
  width:100%;
  aspect-ratio:1.9;
  height:auto
}
.stage-top {
  position:absolute;
  top:18px;
  left:20px;
  right:20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  pointer-events:none
}
.stage-top button {
  pointer-events:auto;
  background:var(--cream)!important
}
.practice-badge {
  font-size:9px;
  font-weight:700;
  letter-spacing:1px;
  background:var(--cream);
  border:1px solid var(--ink);
  padding:9px 12px;
  border-radius:20px
}
.scene-caption {
  position:absolute;
  bottom:15px;
  left:20px;
  right:20px;
  display:flex;
  justify-content:space-between;
  font-size:9px;
  font-weight:700;
  letter-spacing:1px
}
.scene-caption b {
  font-size:17px;
  letter-spacing:-.5px
}
.control-panel {
  border-top:var(--border);
  padding:22px 26px 18px;
  min-height:230px
}
.phase-track {
  display:flex;
  gap:15px;
  align-items:center;
  font-size:9px;
  font-weight:700;
  letter-spacing:1px
}
.phase-track span {
  opacity:.45
}
.phase-track .current {
  opacity:1;
  background:var(--yellow);
  border-radius:3px;
  padding:7px 10px
}
.phase-track i {
  font-style:normal;
  opacity:.5
}
.instructions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:16px 0
}
.instructions h2 {
  font-size:23px;
  letter-spacing:-.9px;
  margin:0 0 8px;
  line-height:1.2
}
.instructions p {
  font-size:12px;
  margin:0;
  line-height:1.7
}
#countdown {
  font-weight:700;
  font-size:37px;
  letter-spacing:-2px;
  font-variant-numeric:tabular-nums
}
.primary {
  background:var(--yellow);
  color:var(--ink);
  border:var(--border);
  border-radius:5px;
  box-shadow:3px 3px 0 var(--ink);
  min-height:54px;
  padding:15px 22px;
  font-size:14px;
  font-weight:700;
  transition:transform .15s
}
.primary:hover {
  transform:translateY(-2px)
}
.primary:disabled {
  opacity:.65;
  transform:none
}
#ready-controls {
  display:flex;
  gap:18px;
  align-items:center
}
.keyboard-tip {
  font-size:11px;
  line-height:1.7
}
.momentum {
  margin:0 0 14px
}
.momentum-track {
  height:13px;
  border:var(--border);
  border-radius:10px;
  overflow:hidden;
  background:var(--cream)
}
#momentum-fill {
  height:100%;
  width:0;
  background:var(--coral);
  transition:width .06s
}
#tap-count {
  display:block;
  font-size:12px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  line-height:1.4;
  margin-top:6px;
}
#rhythm-feedback {
  font-size:10px;
  display:block;
  margin-top:6px;
  min-height:16px
}
.pads {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px
}
.pad {
  position:relative;
  min-height:90px;
  border:var(--border);
  border-radius:7px;
  background:var(--cream);
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  text-align:left;
  padding:15px 22px
}
.pad.expected {
  background:var(--yellow);
  box-shadow:3px 3px 0 var(--ink)
}
.pad span {
  font-weight:700;
  font-size:13px
}
.pad kbd {
  display:block;
  font:inherit;
  font-size:10px;
  margin-bottom:7px
}
.pad b {
  position:absolute;
  right:20px;
  top:20px;
  font-size:36px
}
.pads.settling {
  opacity:.45
}
.aim-button {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  background:var(--coral);
  border:var(--border);
  border-radius:7px;
  min-height:90px;
  width:100%;
  padding:18px 24px;
  box-shadow:3px 3px 0 var(--ink);
  font-size:14px;
  font-weight:700;
  touch-action:none;
  user-select:none
}
.aim-icon {
  font-size:37px;
  display:block;
  transform:rotate(var(--aim-rotation,0deg))
}
.aim-button.holding {
  background:var(--mint)
}
.result-distance {
  font-size:70px;
  font-weight:700;
  letter-spacing:-4px;
  margin:0
}
.result-distance small {
  font-size:25px;
  letter-spacing:0
}
.result>p:not(.result-distance):not(.eyebrow) {
  font-size:14px;
  line-height:1.7;
  margin:8px 0 15px
}
.result-stats {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
  padding:17px 0;
  margin:0 0 14px;
  border-top:1px solid #28183d33;
  border-bottom:1px solid #28183d33
}
.result-stats dt {
  font-size:11px;
  margin-bottom:6px
}
.result-stats dd {
  font-size:16px;
  font-weight:700;
  margin:0
}
.result .plain-button {
  margin-left:14px
}
.pause-overlay {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  background:#fff3def2;
  text-align:center;
  padding:20px;
  z-index:5
}
.pause-overlay>span {
  font-size:47px
}
.pause-overlay h2 {
  font-size:28px;
  letter-spacing:-1px;
  margin:12px 0 0
}
.pause-overlay p {
  line-height:1.7;
  font-size:12px
}
.storage-note {
  font-size:11px;
  line-height:1.6;
  margin:10px 0 0
}
.storage-note:empty {
  display:none
}
footer {
  display:flex;
  align-items:center;
  gap:24px;
  padding:28px 0;
  font-size:11px;
  line-height:1.6
}
footer>a {
  margin-left:auto
}
footer button {
  background:none;
  border:0;
  text-decoration:underline;
  min-height:48px;
  font-size:11px
}
dialog {
  background:var(--cream);
  color:var(--ink);
  border:var(--border);
  border-radius:12px;
  padding:34px;
  max-width:550px;
  width:calc(100% - 32px);
  max-height:calc(100dvh - 40px);
  box-shadow:7px 7px 0 var(--ink)
}
dialog::backdrop {
  background:#28183d99
}
dialog h2 {
  font-size:37px;
  letter-spacing:-1.8px;
  margin:12px 0 20px
}
dialog p,dialog li {
  font-size:13px;
  line-height:1.8
}
.close-dialog {
  position:absolute;
  right:14px;
  top:10px;
  background:none;
  border:0;
  font-size:30px;
  width:48px;
  height:48px
}
.help-steps {
  padding-left:22px
}
.help-steps li {
  padding-left:8px;
  margin-bottom:20px
}
.help-steps p {
  margin:6px 0
}
.history-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-top:1px solid #28183d33;
  padding:15px 0;
  gap:15px
}
.history-row span {
  font-size:11px;
  line-height:1.8
}
.history-row strong {
  font-size:20px
}
.noscript {
  position:fixed;
  inset:auto 10px 10px;
  background:var(--yellow);
  border:var(--border);
  padding:20px;
  z-index:50
}
@media(min-width:1400px) {
  .game-layout {
    grid-template-columns:270px minmax(0,1fr);
    gap:36px
  }
  .character-choice img {
    height:120px
  }
}
@media(max-width:1000px) {
  .game-layout {
    grid-template-columns:180px minmax(0,1fr);
    gap:20px
  }
  .character-choice img {
    height:85px
  }
  .character-choice {
    min-height:118px
  }
  .control-panel {
    padding:18px
  }
  .instructions h2 {
    font-size:20px
  }
  .edition {
    display:none
  }
  .result-stats {
    gap:10px
  }
  .result-stats dd {
    font-size:14px
  }
  .pad {
    padding:14px
  }
  .pad b {
    right:14px
  }
  .keyboard-tip {
    display:none
  }
  .page-title>p {
    max-width:220px
  }
  .local-note {
    font-size:10px
  }
}
@media(max-width:700px) {
  .game-header {
    padding:14px 5%;
    gap:12px
  }
  .brand {
    font-size:24px;
    gap:10px
  }
  .brand img {
    width:42px;
    height:42px
  }
  .header-actions {
    gap:8px
  }
  .header-actions button {
    font-size:10px;
    padding:10px
  }
  .header-actions #help {
    font-size:0
  }
  .header-actions #help span {
    font-size:20px
  }
  .header-actions #help:before {
    content:'?';
    font-size:16px;
    font-weight:700
  }
  .header-actions #help span {
    display:none
  }
  main {
    padding:0 5%
  }
  .page-title {
    margin:24px 0
  }
  .page-title>p {
    display:none
  }
  h1 {
    font-size:34px;
    letter-spacing:-1.9px
  }
  .eyebrow {
    font-size:9px;
    letter-spacing:1px
  }
  .game-layout {
    display:flex;
    flex-direction:column;
    gap:18px
  }
  .sidebar {
    display:contents
  }
  .sidebar>section:first-child {
    width:100%
  }
  .character-grid {
    grid-template-columns:repeat(4,1fr);
    gap:8px
  }
  .character-choice img {
    height:76px
  }
  .character-choice {
    min-height:104px;
    padding:0 3px 8px
  }
  .character-choice span {
    font-size:8px
  }
  .personal-best {
    order:3;
    width:100%;
    margin-top:12px;
    padding-top:18px;
    display:grid;
    grid-template-columns:1fr auto;
    gap:0 20px
  }
  .personal-best .eyebrow {
    grid-column:1/-1
  }
  .personal-best .best-value {
    font-size:37px;
    margin:0
  }
  .personal-best #history-summary {
    font-size:11px;
    margin:0;
    grid-column:1
  }
  .personal-best .plain-button {
    grid-column:2;
    grid-row:2/4
  }
  .local-note {
    order:4;
    margin:0;
    font-size:11px
  }
  .arena {
    width:100%;
    box-shadow:4px 4px 0 var(--ink)
  }
  canvas {
    aspect-ratio:1.3
  }
  .stage-top {
    top:12px;
    left:12px;
    right:12px
  }
  .practice-badge {
    font-size:8px;
    padding:8px
  }
  .stage-top #pause {
    padding:8px;
    font-size:10px;
    min-height:40px
  }
  .scene-caption {
    left:12px;
    right:12px;
    font-size:8px
  }
  .control-panel {
    padding:18px 15px
  }
  .instructions {
    gap:10px
  }
  .instructions h2 {
    font-size:20px
  }
  .instructions p {
    font-size:11px
  }
  .phase-track {
    font-size:8px;
    gap:10px
  }
  .phase-track .current {
    padding:6px 8px
  }
  .pad {
    min-height:94px;
    padding:14px 12px
  }
  .pad span {
    font-size:11px
  }
  .pad b {
    font-size:29px;
    right:10px;
    top:28px
  }
  .pads {
    gap:10px
  }
  .result-distance {
    font-size:57px
  }
  .result-stats {
    grid-template-columns:1fr 1fr;
    gap:18px
  }
  .result .primary {
    width:100%;
    font-size:12px
  }
  .result .plain-button {
    margin:8px 0 0
  }
  .aim-button {
    font-size:12px;
    padding:16px;
    min-height:94px
  }
  footer {
    flex-wrap:wrap;
    gap:10px 20px;
    font-size:10px
  }
  footer p {
    width:100%;
    margin:0
  }
  footer>a {
    margin-left:0
  }
  dialog {
    padding:28px 22px
  }
  dialog h2 {
    font-size:33px
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation:none!important;
    transition:none!important
  }
}
/* On phones, keep the scene and active controls together in the viewport. */
@media(max-width:700px) {
  .playing .page-title,.playing .sidebar>section:first-child,.playing .personal-best,.playing .local-note,.playing footer {
    display:none
  }
  .playing .game-layout {
    margin-top:18px
  }
}

/* Phone-first interaction: actual browser height, safe edges and reachable two-thumb controls. */
html { -webkit-text-size-adjust: 100%; }
button, a { touch-action: manipulation; }
.pad, .aim-button { touch-action: none; -webkit-touch-callout: none; }
.selection-hint { font-size: 14px; line-height: 1.5; margin: -4px 0 12px; }
@media (min-width: 901px) { .selection-hint { display: none; } }
@media (max-width: 900px) {
  .game-header {
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  }
  .game-header .brand { font-size: 22px; gap: 8px; letter-spacing: -1.4px; }
  .game-header .brand img { width: 38px; height: 38px; }
  .edition { display: none; }
  .header-actions { gap: 6px; }
  .header-actions button { min-width: 48px; min-height: 48px; padding: 10px 8px; font-size: 12px; }
  .header-actions #help { width: 48px; font-size: 0; }
  .header-actions #help:before { content: '?'; font-size: 20px; font-weight: 700; }
  .header-actions #help span { display: none; }
  main { padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); }
  .page-title { margin: 24px 0; }
  .page-title > p { display: none; }
  h1 { font-size: clamp(32px, 7.5vw, 52px); }
  .eyebrow { font-size: 11px; }
  .game-layout { display: flex; flex-direction: column; gap: 18px; }
  .sidebar { display: contents; }
  .sidebar > section:first-child { width: 100%; min-width: 0; }
  .character-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(100px, 1fr);
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 5px 5px 10px;
  }
  .character-choice { min-height: 136px; padding: 4px 6px 10px; scroll-snap-align: center; }
  .character-choice img { height: 96px; }
  .character-choice span { font-size: 13px; }
  .personal-best { order: 3; width: 100%; }
  .local-note { order: 4; font-size: 14px; }
  .arena { width: 100%; min-width: 0; box-shadow: 3px 3px 0 var(--ink); }
  .arena canvas { width: 100%; aspect-ratio: 1.4; }
  .control-panel { padding: 16px; min-height: 0; }
  .instructions h2 { font-size: 21px; line-height: 1.25; }
  .instructions p { font-size: 14px; line-height: 1.5; }
  .phase-track { font-size: 10px; gap: 9px; }
  .phase-track .current { padding: 6px; }
  .plain-button, .personal-best #history-summary, footer, footer button { font-size: 14px; }
  .pad { min-height: 104px; padding: 16px; }
  .pad span { font-size: 15px; }
  .pad kbd { display: none; }
  .pad b { font-size: 32px; top: 50%; right: 14px; transform: translateY(-50%); }
  .aim-button { min-height: 104px; font-size: 15px; padding: 16px; }
  .practice-badge { font-size: 10px; padding: 9px 10px; }
  .stage-top { left: 12px; right: 12px; top: 12px; }
  .stage-top #pause { min-width: 60px; min-height: 48px; font-size: 12px; padding: 10px; }
  #rhythm-feedback { font-size: 13px; line-height: 1.4; min-height: 19px; }
  #ready-controls .primary { width: 100%; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-stats dt, .storage-note, dialog p, dialog li, .history-row span { font-size: 14px; }
  .result .primary { font-size: 15px; }
  .history-row strong { white-space: nowrap; }
  dialog { padding: 26px 22px; max-height: calc(var(--viewport-height, 100dvh) - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .pause-overlay { overflow-y: auto; }
  .pause-overlay h2 { font-size: 23px; }
  .pause-overlay p { font-size: 14px; }
  .pause-overlay > span { font-size: 30px; }
  footer { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  body.playing:not([data-game-phase="result"]) {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--viewport-height, 100dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .playing .page-title, .playing .sidebar > section:first-child, .playing .personal-best, .playing .local-note, .playing footer { display: none; }
  .playing:not([data-game-phase="result"]) .game-header { flex: 0 0 auto; }
  .playing:not([data-game-phase="result"]) main { flex: 1; min-height: 0; display: flex; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .playing:not([data-game-phase="result"]) .game-layout { flex: 1; min-height: 0; min-width: 0; margin-top: 8px; display: flex; }
  .playing:not([data-game-phase="result"]) .arena { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .playing:not([data-game-phase="result"]) .stage { flex: 1 1 0; min-height: 120px; }
  .playing:not([data-game-phase="result"]) canvas { height: 100%; aspect-ratio: auto; }
  .playing:not([data-game-phase="result"]) .control-panel { flex: 0 0 auto; }
  .playing .instructions { margin: 10px 0; }
  .playing .instructions h2 { font-size: 19px; margin-bottom: 5px; }
  .playing .momentum { margin-bottom: 12px; }
  .playing[data-game-phase="result"] .game-layout { margin-top: 12px; }
  .playing[data-game-phase="result"] .stage { max-height: 30svh; overflow: hidden; }
  .playing[data-game-phase="result"] canvas { height: 30svh; aspect-ratio: auto; }
  .playing[data-game-phase="result"] .control-panel { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 900px) and (max-height: 640px) {
  .playing .phase-track, .playing .instructions p, .playing .scene-caption { display: none; }
  .playing .control-panel { padding: 10px 12px; }
  .playing .instructions h2 { font-size: 17px; margin-bottom: 0; }
  .playing .instructions { margin: 6px 0 10px; }
  .playing .pad, .playing .aim-button { min-height: 88px; }
  .playing .pause-overlay { padding: 12px; }
  .playing .pause-overlay > span, .playing .pause-overlay p { display: none; }
  .playing .pause-overlay h2 { font-size: 19px; margin: 0 0 12px; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .playing:not([data-game-phase="result"]) .arena { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 42%); }
  .playing:not([data-game-phase="result"]) .control-panel { border-top: 0; border-left: var(--border); display: flex; flex-direction: column; justify-content: center; }
  .playing .momentum { margin-bottom: 8px; }
  .playing .pads { gap: 8px; }
  .playing .pad { padding: 12px; }
  .playing .pad span { font-size: 12px; }
  .playing .pad b { display: none; }
  .playing .aim-button { font-size: 14px; }
  .playing[data-game-phase="result"] .stage { display: none; }
}
@media (max-width: 360px) {
  .pad b { display: none; }
  .pad { text-align: center; }
}
@media (max-width: 900px) {
  footer a { display: inline-flex; align-items: center; min-height: 48px; }
}

/* An open typographic tally, with the same punch as the campaign headline. */
.server-counters { margin:8px 0 28px; text-align:center; }
.launch-tally { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px 14px; margin:0; }
.launch-tally strong { font-size:clamp(52px,15vw,76px); font-weight:700; line-height:1.1; letter-spacing:-5px; color:var(--coral); -webkit-text-stroke:1px var(--ink); text-shadow:3px 3px 0 var(--ink); transform:rotate(-6deg); overflow-wrap:anywhere; max-width:100%; }
.launch-tally > span { font-size:clamp(14px,4vw,20px); font-weight:700; letter-spacing:-.8px; padding:5px 0; background:linear-gradient(transparent 65%,var(--yellow) 65%); }
.server-counters #counter-status:not([hidden]) { margin:12px 0 0; }
.character-count { display:block; margin-top:5px; font-size:10px; line-height:1.4; font-weight:400; }
.server-data-details { margin-top:16px; font-size:12px; line-height:1.5; }
.server-data-details summary { cursor:pointer; min-height:44px; display:flex; align-items:center; text-decoration:underline; }
@media (max-width:900px) {
  .server-data-details { order:4; width:100%; margin-top:0; }
  .character-count { font-size:10px; white-space:nowrap; letter-spacing:-.15px; }
}
#counter-status { font-size:12px; line-height:1.4; }

.playing .server-counters { display:none; }

.server-data-note { font-size:12px; line-height:1.5; }

.playing .server-data-details { display:none; }

/* The leaderboard is a scrollable dialog; it never displaces active game controls. */
.ranking-link {
  display: block; width: 100%; min-height: 48px; margin: 12px 0;
  border: var(--border); border-radius: 6px; padding: 12px 14px;
  background: var(--mint); font-weight: 700; font-size: 14px; text-align: center;
}
#ranking-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(var(--viewport-height, 100dvh) - 24px); overflow-y: auto; }
#ranking-dialog h2 { padding-right: 30px; }
.ranking-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; }
.ranking-tools > label { grid-column: 1 / -1; font-size: 13px; font-weight: 700; }
.ranking-tools select, #ranking-alias { min-height: 48px; min-width: 0; max-width: 100%; width: 100%; border: var(--border); border-radius: 5px; padding: 10px; background: #fff8ec; color: var(--ink); font: inherit; font-size: 16px; }
#ranking-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 14px; }
#ranking-table th { text-align: left; font-size: 11px; padding: 10px 4px; border-bottom: var(--border); }
#ranking-table th:first-child { width: 54px; }
#ranking-table th:last-child { width: 92px; }
#ranking-table td { border-bottom: 1px solid #28183d33; padding: 12px 4px; font-size: 14px; vertical-align: middle; overflow-wrap: anywhere; }
#ranking-table td:last-child, #ranking-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
#ranking-table td:last-child { font-weight: 700; }
.ranking-character { display: block; margin-top: 5px; font-size: 12px; line-height: 1.5; }
#ranking-table .is-me { background: var(--mint); }
.ranking-profile { margin-top: 24px; padding-top: 20px; border-top: var(--border); }
.ranking-profile h3 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.5px; }
#ranking-form label { display: block; font-weight: 700; margin-bottom: 8px; }
#ranking-name-help, #ranking-dialog .ranking-fine-print { font-size: 12px; line-height: 1.6; }
#ranking-own { font-weight: 700; }
.ranking-profile-actions { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
#ranking-dialog :focus-visible { outline: 3px solid #70448c; outline-offset: 3px; }
@media (max-width: 500px) {
  #ranking-dialog { padding: 24px 14px; }
  #ranking-dialog h2 { font-size: 27px; }
  #ranking-table th:first-child { width: 52px; }
  #ranking-table th:last-child { width: 76px; }
  #ranking-table td { font-size: 13px; }
  .ranking-character { font-size: 12px; }
  .ranking-profile-actions > button { width: 100%; }
}
#ranking-dialog[open] { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.ranking-heading { position: relative; flex: none; padding: 22px 24px 12px; border-bottom: 1px solid #28183d33; }
.ranking-heading .close-dialog { top: 10px; right: 10px; }
#ranking-dialog .ranking-heading h2 { padding-right: 38px; margin-bottom: 0; }
.ranking-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 24px 24px; }
@media (max-width: 500px) { .ranking-heading { padding: 20px 14px 12px; } .ranking-body { padding: 0 14px 18px; } }
#ranking-dialog .ranking-profile { margin: 14px 0 20px; padding: 0 0 18px; border-top: 0; border-bottom: var(--border); }
#ranking-profile-editor > summary { cursor: pointer; min-height: 48px; padding: 12px 0; font-weight: 700; line-height: 1.5; }
#ranking-profile-editor[open] > summary { margin-bottom: 12px; }


/* Reserve room for edition copy so rotating phrases do not move the character picker. */
.page-title .game-taglines { max-width: 34em; min-width: 0; margin: 0; min-height: 3.4em; }
.game-taglines span { display: block; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .page-title { flex-direction: column; align-items: stretch; gap: 14px; text-align: center; }
  .page-title .game-taglines { display: block; width: 100%; margin: 0 auto; font-size: 12px; }
}

.character-search { display: grid; gap: 8px; margin: 14px 0 10px; font-size: 14px; font-weight: 700; }
.character-search input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--ink); border: var(--border); border-radius: 8px; background: #fff8ec; }
.character-search input:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
#character-search-empty { font-size: 14px; }

/* The invitation is dismissible and uses native sharing only after a user gesture. */
#share-dialog { width:min(560px,calc(100% - 24px)); padding:0; max-height:calc(var(--viewport-height,100dvh) - 24px); overflow:hidden; }
#share-dialog[open] { display:flex; flex-direction:column; }
.share-content { min-height:0; overflow-y:auto; padding:28px 20px 16px; }
.share-footer { flex-shrink:0; padding:12px 20px max(16px,env(safe-area-inset-bottom)); border-top:2px solid var(--ink); background:var(--cream); }
#share-close { z-index:1; background:var(--cream); }
#share-dialog h2 { font-size:clamp(26px,7vw,38px); line-height:1.05; padding-right:18px; margin-bottom:14px; }
#share-dialog .eyebrow { font-size:10px; letter-spacing:.09em; padding-right:24px; }
#share-character { margin:0; font-weight:700; overflow-wrap:anywhere; }
#share-dialog .share-distance { font-size:clamp(40px,11vw,62px); font-weight:700; color:#be3f4f; line-height:1.1; margin:8px 0 20px; font-variant-numeric:tabular-nums; }
.share-platforms,.share-utilities { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.share-platforms a,.share-platforms button,.share-utilities button { display:flex; align-items:center; justify-content:center; min-height:50px; border:2px solid var(--ink); border-radius:10px; padding:10px 8px; background:#fff9ee; color:var(--ink); font-weight:700; text-decoration:none; font-size:14px; text-align:center; }
.share-platforms .share-whatsapp { background:#9ce6d4; }
.share-platforms button:disabled,.share-utilities button:disabled { opacity:.5; }
#share-dialog .share-help,#share-status { font-size:12px; line-height:1.5; margin:14px 0; }
#share-dialog details { margin:16px 0; }
#share-dialog summary { min-height:44px; cursor:pointer; }
#share-message { display:block; width:100%; min-height:120px; resize:vertical; font:inherit; font-size:13px; border:2px solid var(--ink); border-radius:8px; padding:10px; }
#share-card-preview { display:block; width:100%; max-width:250px; height:auto; margin:18px auto; border-radius:12px; }
#share-card-preview[hidden] { display:none; }
#share-continue { display:block; min-height:54px; width:100%; margin:0; font-size:17px; }
#result-share { margin:14px 0; width:100%; }
.incoming-challenge { padding:16px; border:var(--border); border-radius:12px; background:var(--yellow); font-weight:700; text-align:center; }
body.playing .incoming-challenge { display:none; }

#share-native { grid-column:1 / -1; background:var(--yellow); }

.share-email-text { color:var(--ink); display:inline-flex; align-items:center; min-height:48px; margin-bottom:12px; }
.share-email-text[hidden] { display:none; }

.ranking-featured { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:56px; margin:0 0 20px; padding:12px 16px; border:var(--border); border-radius:12px; background:var(--mint); color:var(--ink); box-shadow:3px 3px 0 var(--ink); font:inherit; font-weight:700; cursor:pointer; }
body.playing:not([data-game-phase="result"]) .ranking-featured { display:none; }
