:root {
  color-scheme: dark;
  --space: #1c1426;
  --paper: #fcfaff;
  --muted: #c8bcce;
  --accent: #e9a9f1;
  --line: #f5e6ff2d;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  min-height: 100svh;
  margin: 0;
  padding: 18px 0 48px;
  color: var(--paper);
  font: 16px/1.45 var(--sans);
  background-color: var(--space);
  isolation:isolate;
}
.night-sky {
  position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:clip;
}
.night-sky-plane {
  position:absolute; inset:0; transform-origin:38% 65%;
}
.night-sky-plane::before {
  content:""; position:absolute; inset:-100vmax;
  background-image:
    url("/top10/night-stars.svg"),
    radial-gradient(ellipse 85vw 80vh at calc(100vmax + 40vw) calc(100vmax + 5vh),#302239,var(--space) 100%);
  background-size:1049px 719px,100% 100%;
  background-position:100vmax 100vmax,0 0;
  background-repeat:repeat,no-repeat;
}
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
[hidden] { display: none !important; }
.tab-shell, .account-dialog, .error-toast {
  border: 1px solid #f0f2f530;
  background: linear-gradient(165deg,#eff2f41a,#e7ebf007 72%,#e7ebf010) var(--glass-tint, transparent);
  backdrop-filter: blur(18px) saturate(.5) brightness(1.26);
  box-shadow: 0 4px 16px #0e0d1552, inset 0 1px #fff2;
}
.error-toast {
  --glass-tint: #21182bc2;
  position: fixed;
  inset: max(72px, env(safe-area-inset-top)) 0 auto;
  z-index: 10;
  width: max-content;
  max-width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 9px 14px;
  border-radius: 14px;
  color: var(--paper);
  font: 14px/1.4 var(--sans);
  text-align: center;
  pointer-events: none;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1,h2,p { margin: 0; }
p { color: var(--muted); }
h1,h2 { font-family: var(--mono); font-weight: 400; }
h1 { font-size: clamp(28px, 4.4vw, 54px); line-height: 1.12; }
h2 { font-size: clamp(20px, 2.4vw, 29px); line-height: 1.2; }
.game-title {
  color: var(--paper);
  font: 400 clamp(26px, 3.1vw, 40px)/1.15 var(--mono);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.game-prompt { color: var(--paper); font: 500 16px/1.4 var(--sans); }
.game-description { color: var(--muted); font: 400 16px/1.45 var(--sans); }
.game-meta { color: var(--muted); font: 400 13px/1.5 var(--mono); }
.game-feedback { color: var(--accent); font: 500 14px/1.45 var(--sans); }
.game-title + .game-description { margin-top: 6px; }

.flight-nav {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 24px);
  min-height: 44px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.tab-shell {
  padding: 3px 5px;
  border-radius: 24px;
}
.tab-track {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(var(--tab-count,3),minmax(0,var(--tab-width,88px)));
  gap: 2px;
}
.tab-track > :is(a,label) {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 7px;
  border-radius: 18px;
  color: #d6d7dc;
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
}
.tab-track > :is(a,label):hover { color: #fff; }
.tab-track > :is(a[aria-current],label:has(:checked)) { position: relative; color: #fff; }
.tab-track > .mode-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc((100% + 2px)/var(--tab-count,3) - 2px);
  transform: translateX(calc(var(--tab) * (100% + 2px)));
  border: 1px solid #f1f3f527;
  border-radius: 18px;
  background: linear-gradient(165deg,#f2f4f629,#f2f4f60c);
  box-shadow: inset 0 1px #fff2;
  z-index: -1;
  pointer-events: none;
}
.flight-nav nav a:focus-visible { outline-offset: -2px; }

.flight main { width: min(1040px,calc(100% - 40px)); margin-inline: auto; }
.flight .legal-copy {
  width: min(68ch, calc(100% - 40px));
  padding-top: clamp(32px, 6vw, 76px);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.legal-copy h1 { margin-bottom: 20px; font-size: clamp(28px, 4.2vw, 48px); }
.legal-copy h2 { margin: 28px 0 8px; font-size: 18px; }
.legal-copy p + p { margin-top: 14px; }
.legal-copy a { color: var(--accent); }
.home-content,[data-mode=daily] article {
  min-height: clamp(480px, calc(100svh - 124px), 720px);
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: center;
  gap: clamp(28px, 6vw, 78px);
}
.flight .home-content { max-width: 880px; }
.home-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 18px 0;
}
.home-art::before {
  position: absolute;
  inset: 0;
  content: "";
  z-index: -1;
  background: repeating-linear-gradient(135deg,transparent 0 8px,#cd8fe042 8px 9px);
  mask-image: linear-gradient(to bottom,transparent,#000 22% 78%,transparent);
}
.globe-play { display: block; width: min(100%,340px); padding: 0; border: 0; border-radius: 50%; background: none; }
.globe-play:active img { opacity: .85; }
.globe-play :is(img,svg) { display: block; width: 100%; height: auto; transform-origin: center; }
.home-actions { display: grid; gap: 20px; }
.home-actions h1 { font: 400 clamp(28px, 4.3vw, 45px)/1.2 Monoton,var(--mono); }
.home-actions p { margin-top: 6px; }

.key,#tools button {
  display: inline-grid;
  place-items: center;
  min-height: 43px;
  padding: 9px 16px;
  border: 1px solid #f7f7f8;
  border-radius: 8px;
  background: linear-gradient(#fff,#f1f2f4);
  box-shadow: 0 3px #a9adb6,0 5px 10px #09091170;
  color: #25262a;
  font-weight: 600;
  text-decoration: none;
}
.key:hover,#tools button:not(:disabled):hover { background: #fff; }
.key:not(:disabled):active,#tools button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px #a9adb6, inset 0 1px 3px #25262a29; }
.home-actions .key { min-height: 51px; }

[data-mode=daily] article { gap: clamp(25px, 5vw, 66px); }
.daily-stage { position: relative; }
.daily-stage .map { width: min(100%, 510px); aspect-ratio: 1; margin-inline: auto; }
.map :is(img,canvas) { display: block; width: 100%; height: 100%; }
#earth { cursor: grab; touch-action: none; }
#earth:active { cursor: grabbing; }
#tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
#tools button { min-width: 42px; min-height: 36px; padding: 6px 12px; }
.daily-copy { display: grid; min-width: 0; gap: 22px; overflow-wrap: anywhere; }
.daily-copy:has(form:not([hidden])) { row-gap: 12px; }
#signal:not([hidden]) + .game-meta { margin-top: 10px; }
[data-mode=daily] .intro:has(h1[hidden]):has(time:empty) { display:none; }
#status { margin-top: 12px; }
#status:empty { display: none; }
#retry { margin-top: 12px; }
label { display: block; margin-bottom: 6px; font-size: 14px; }
.guess-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; }
.entry { display: flex; gap: 10px; align-items: start; }
input,select {
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #f5e6ff40;
  border-radius: 8px;
  background: #f9ecff08;
}
input { flex: 1; width: 100%; }
input::placeholder { color: #c8bcce; }
select option { background: #30243c; }
@media (width > 700px) {
  .daily-copy form, .flag-copy form { position: relative; }
  .country-suggestions { position: absolute; inset: 100% 0 auto; z-index: 1; }
}
.country-suggestions,#choices { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.country-suggestions button,#choices button {
  border: 0; padding: 7px 0; background: transparent;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}

.rank-content { padding-top: clamp(32px,6vw,76px); }
.controls { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 24px 0 28px; }
.controls select { display: block; width: 100%; margin-top: 5px; }
.board { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(24px,5vw,60px); }
#rule { margin: 9px 0 22px; }
#feedback { min-height: 1.5em; margin: 14px 0 6px; color: var(--accent); }
#again { margin: 8px 0; }
details { margin-top: 12px; font-size: 14px; color: var(--muted); }
details p { margin-top: 8px; }
.score { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; color: var(--muted); font: 14px var(--mono); }
.score b { color: var(--paper); }
@media (max-width: 700px) {
  .home-content,[data-mode=daily] article,.board { grid-template-columns: 1fr; gap: 24px; }
  .home-content,[data-mode=daily] article { min-height: 0; padding-top: 28px; }
  .home-art { padding-block: 0; }
  .globe-play,.daily-stage .map { max-width: min(100%,330px); }
  .home-actions { width: min(100%,430px); margin-inline: auto; }
  .daily-copy { gap: 12px; }
  .controls { gap: 8px; }
  .controls select { padding-inline: 6px; }
}
@media (max-width: 360px) {
  .flight-nav nav a { padding-inline: 5px; }
}

@media (prefers-reduced-motion: no-preference) {
  .globe-play { transition: transform 360ms cubic-bezier(.22,.8,.22,1); }
  .home-content[inert] .globe-play { transform: translateY(-16px) rotate(-14deg); }

}
@keyframes rank-hit {
  from { background: #e9a9f14a; transform: translateX(-5px); }
  to { background: transparent; transform: none; }
}

.flight-stage { display: grid; overflow: clip; align-items: start; }
.flight-stage > main { grid-area: 1 / 1; }
.flight-stage > main[inert] { pointer-events: none; }
.flight-stage > main { opacity: 1; transform: translateX(0); }
.flight-stage > main[inert] { opacity: 0; transform: translateX(var(--shift, 0px)); }
@media (prefers-reduced-motion: no-preference) {
  .tab-track > .mode-selection { transition: transform 360ms cubic-bezier(.22,.8,.22,1); }
  .flight-stage > main { transition: opacity 300ms ease-in-out, transform 360ms cubic-bezier(.22,.8,.22,1); }
}

[data-mode=rank-home] .home-art::before { content:none; }
.rank-dial { display: block; width: min(100%,340px); height: auto; }
.flight-stage > main { transform: translateX(0) scale(1); }
.flight-stage > main[inert] { transform: translateX(var(--shift,0px)) scale(var(--zoom,1)); }
.home-actions .key { justify-self: start; min-width: 124px; }
@media (prefers-reduced-motion: no-preference) {
  .home-content.launching[inert] .globe-play { transform: translateY(-22px) rotate(32deg) scale(1.12); }
  .rank-dial { transition: transform 360ms cubic-bezier(.22,.8,.22,1); }
  .home-content.launching[inert] .rank-dial { transform: rotate(9deg) scale(1.12); }
}

.globe-play [data-country].pointed { fill: #701c7f; }

.globe-play .rotatable { cursor: grab; touch-action: none; user-select: none; }
.globe-play .dragging { cursor: grabbing; }

/* Both states use the same column centers and visible globe diameter. */
.flight main[data-mode=daily] { max-width: 880px; }
[data-mode=daily] article { gap: clamp(28px, 6vw, 78px); }
[data-mode=home] .home-art, .daily-stage { container-type: inline-size; }
.globe-play { width: min(340px,79.75cqw); }
.daily-stage .map { width: min(328.6px,77.1cqw); }
.daily-stage:has(#earth:not([hidden])) .map { width: min(426.3px,100cqw); }
.daily-stage #tools { position: absolute; top: 100%; inset-inline: 0; }
@media (prefers-reduced-motion: no-preference) {
  .flight-nav, [data-mode=home] .home-actions, [data-mode=home] .home-art::before, .daily-copy {
    transition: opacity 220ms ease;
  }
  .daily-launch :is(.flight-nav,.daily-copy,[data-mode=home] .home-actions),
  .daily-launch [data-mode=home] .home-art::before { opacity: 0; }
  .daily-launch .home-art { pointer-events: none; }
  .daily-launch .home-content[inert] .globe-play { transform: none; }
}

/* The ten fixed positions keep a round's sky familiar as answers arrive. */
.flight .rank-content {
  --rank-sky-height: clamp(330px, calc(100svh - 280px), 560px);
  max-width: 920px;
  padding-top: 0;
}
.star-chart {
  position: relative; margin: 0 auto; padding: 0; list-style: none;
  height: var(--rank-sky-height);
}
.star-chart li {
  position:absolute; top:calc(var(--y) - 3px); left:calc(var(--inset) - 3px);
  width:min(32%,calc(100% - var(--inset))); display:flex; align-items:flex-start;
}
.star-chart li:nth-child(even) {
  left:auto; right:calc(var(--inset) - 3px); flex-direction:row-reverse; text-align:right;
}
.star-chart li:nth-child(1) { --inset:10%; --y:22%; }
.star-chart li:nth-child(2) { --inset:31%; --y:9%; }
.star-chart li:nth-child(3) { --inset:37%; --y:36%; }
.star-chart li:nth-child(4) { --inset:9%; --y:46%; }
.star-chart li:nth-child(5) { --inset:18%; --y:58%; }
.star-chart li:nth-child(6) { --inset:38%; --y:69%; }
.star-chart li:nth-child(7) { --inset:6%; --y:75%; }
.star-chart li:nth-child(8) { --inset:21%; --y:83%; }
.star-chart li:nth-child(9) { --inset:34%; --y:88%; }
.star-chart li:nth-child(10) { --inset:14%; --y:24%; }
.star-chart li:nth-child(even) .leader {
  margin-inline:0 5px; border-left:0; border-right:1px solid var(--accent); transform:skewX(-42deg);
}
.star-chart li:nth-child(even) .star-label { padding-inline:0 9px; }
.starlight { flex:none; height:6px; width:6px; border-radius:50%; background:#a89ab5; box-shadow:0 0 5px #d9b4eb55; }
.found .starlight { background:#fff6ff; box-shadow:0 0 5px 2px #edbbff,0 0 18px 5px #ce80ed77; }
.found .starlight::before { content:""; display:block; width:16px; height:16px; margin:-5px; background:#fff3ff; clip-path:polygon(50% 0,57% 42%,100% 50%,57% 56%,50% 100%,43% 57%,0 50%,43% 42%); }
.leader { width:clamp(18px,3vw,44px); flex:none; height:13px; border-bottom:1px solid var(--accent); border-left:1px solid var(--accent); transform:skewX(42deg); margin-left:5px; margin-top:12px; opacity:0; }
.star-label { padding:0 0 0 9px; margin-top:24px; font:500 14px/1.25 var(--mono); overflow-wrap:anywhere; color:#ece0f3; }
.revealed .leader { opacity:.8; }
.revealed:not(.found) .star-label { color:var(--muted); }
.rank-console { width:min(100%,620px); margin:0 auto; }
.rank-caption { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:baseline; gap:4px 12px; margin-bottom:9px; }
#rank-difficulty { justify-self:end; }
.pick-board { display:block; margin-top:8px; padding:0; border:0; background:transparent; cursor:pointer; color:var(--muted); font:12px var(--mono); }
.rank-progress b { font-weight:400; }
.rank-console .entry { position:relative; }
.rank-console .entry input { min-height:48px; padding-right:60px; }
.rank-console .entry button { position:absolute; right:6px; top:5px; min-height:34px; width:40px; padding:4px; }
.rank-console #feedback { min-height:0; margin:6px 0; }
.rank-options .controls { margin:12px 0; }
@media (prefers-reduced-motion:no-preference) {
  [data-mode=rank-home] .home-actions,[data-mode=rank-home] .home-art,.rank-console { transition:opacity 280ms ease,transform 400ms ease; }
  .rank-launch :is(.flight-nav,[data-mode=rank-home] .home-actions,[data-mode=rank-home] .home-art,.rank-console) { opacity:0; }
  .rank-launch [data-mode=rank-home] .home-art { transform:scale(.86); }
  .rank-launch .rank-console { transform:translateY(15px); }

  .landed .starlight { animation:star-ignite 540ms ease-out; }
  .landed .leader { animation:trace-leader 360ms 140ms both ease-out; }
  .landed .star-label { animation:name-star 220ms 440ms both; }
}
@keyframes star-ignite { 35% { transform:scale(1.8); } }
@keyframes trace-leader { from { clip-path:inset(0 100% 0 0); } to { clip-path:inset(0); } }
@keyframes name-star { from { opacity:0; } to { opacity:1; } }

#hit-announcement { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media (prefers-reduced-motion:no-preference) {
  .star-chart li.landed:nth-child(even) .leader { animation-name:trace-left; }
}
@keyframes trace-left { from { clip-path:inset(0 0 0 100%); } to { clip-path:inset(0); } }
.star-chart .leader { margin-top:3px; }
.star-label { margin-top:7px; }

.flight .rank-content { width:100%; max-width:1320px; display:grid; }
.sky-window { overflow:clip; position:relative; }
.star-chart { width:min(920px,calc(100% - 40px)); }
.rank-console { width:min(620px,calc(100% - 40px)); }
.star-chart { isolation:isolate; }
.rank-action { display:grid; min-height:48px; align-items:center; }
.rank-action > * { grid-area:1 / 1; }
.rank-summary { width:min(620px,calc(100% - 40px)); margin:0 auto; padding:12px 0 28px; }
.rank-changing .rank-console { opacity:0; }
.rank-summary h2:focus { outline:none; }
#rank-result-score { margin-top:10px; }
.rank-result-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px 18px; margin-top:20px; }
.rank-result-actions #again { margin:0; }
.rank-progress > * { display:inline-block; }
@media (min-width: 900px) {
  .rank-content {
    /* Leave room for the navbar and the page's vertical padding. */
    --rank-workspace-height: max(0px, calc(100svh - 110px));
    grid-template-columns:minmax(0,100fr) minmax(0,0fr);
  }
  .rank-content:not([data-round-result]) {
    min-height:var(--rank-workspace-height);
    align-content:center;
  }
  .rank-content[data-round-result] {
    --rank-result-drop: max(0px, calc((var(--rank-workspace-height) - var(--rank-sky-height)) / 2));
    grid-template-columns:minmax(0,65fr) minmax(0,35fr);
    padding-top:var(--rank-result-drop);
  }
  .sky-window { grid-area:1 / 1; }
  .rank-console { grid-area:2 / 1 / 3 / -1; }
  .rank-summary { grid-area:1 / 2; align-self:center; width:100%; padding:20px clamp(24px,4vw,56px) 20px 0; }
  .rank-content[data-round-result] .leader { width:clamp(16px,2.5vw,32px); }
  .rank-content[data-round-result] .star-label { font-size:clamp(11px,1.1vw,14px); }
}
@media (prefers-reduced-motion:no-preference) {
  .rank-launch .flight-stage > .rank-content:not([inert]) { transition:none; transform:none; }
  .rank-launch .sky-window { overflow:visible; }
  .rank-console .rank-action { transition:translate 460ms cubic-bezier(.22,.8,.25,1); }
  .rank-launch .rank-action { translate:0 10px; }
  .rank-finishing .rank-console { transition:opacity 160ms ease,translate 160ms ease,display 160ms allow-discrete; }
  .rank-finishing .rank-console[hidden] { opacity:0; translate:0 5px; }
  .rank-finishing .rank-summary { animation:rank-result-arrive 260ms 180ms cubic-bezier(.22,.8,.25,1) both; }
  .rank-console #feedback:not(:empty) { animation:console-message 240ms ease-out; }
  .rank-options[open] .controls { animation:console-message 220ms ease-out; }
}
@media (min-width: 900px) and (prefers-reduced-motion:no-preference) {
  .rank-finishing { animation:rank-sky-shift 460ms 160ms cubic-bezier(.22,.8,.25,1) both; }
  .rank-finishing .rank-summary { animation-delay:470ms; }
}
@keyframes rank-sky-shift {
  from { grid-template-columns:minmax(0,100fr) minmax(0,0fr); padding-top:var(--rank-play-drop, 0px); }
  to { grid-template-columns:minmax(0,65fr) minmax(0,35fr); padding-top:var(--rank-result-drop); }
}
@keyframes rank-result-arrive {
  from { opacity:0; translate:10px 0; }
  to { opacity:1; translate:0 0; }
}
@keyframes console-message {
  from { opacity:0; transform:translateY(4px); }
  to { opacity:1; transform:translateY(0); }
}

.shooting-star {
  position:absolute; width:clamp(46px,7vw,90px); height:2px;
  pointer-events:none; opacity:0; transform-origin:right center;
  background:linear-gradient(90deg,transparent,#c999e377 52%,#fff2ff);
}
.shooting-star::after {
  content:""; position:absolute; right:-1px; top:-1px; width:4px; height:4px;
  border-radius:50%; background:#fff3ff; box-shadow:0 0 7px #f2bbff;
}

.flag-cover::before { content:none; }
.flag-placeholder { width:100%; aspect-ratio:3 / 2; background:#9b64b5; }
.flag-game .flag-placeholder { display:none; position:absolute; inset:0 auto auto 0; }
.flight-stage > main.flag-handoff { transition:none; transform:none; }
.flag-mast { position:absolute; width:4px; border-radius:4px; background:linear-gradient(90deg,#706a80,#fff9ff 55%,#a69cb3); transform-origin:bottom; }
.flag-game { max-width:880px; }
.flag-scene { width:100%; aspect-ratio:1; position:relative; isolation:isolate; overflow:hidden; }
.flag-flight { position:absolute; inset:0; width:100%; height:100%; }
.flag-mast { bottom:36%; left:calc(34% - 2px); height:44%; opacity:0; transform:translateY(5px); }
.flag-fabric { position:absolute; top:1%; left:100%; width:clamp(75px,10vw,132px); transform-origin:0 0; }
.flag-cloth { display:block; width:100%; filter:saturate(.73) contrast(.93) brightness(1.11); }
.flag-fabric::after { mask:var(--flag-shape) center / 100% 100% no-repeat; content:""; position:absolute; inset:0; background:repeating-linear-gradient(0deg,#efe8ff2e 0 1px,transparent 1px 3px),linear-gradient(105deg,#fff4,transparent 40%,#e9dfff25); pointer-events:none; }
.flag-copy form,.flag-result { width:100%; }
.flag-result .key { margin-top:20px; }
.flag-status:empty { display:none; }
.flag-status { margin-top:8px; }
@media (prefers-reduced-motion:no-preference) {
  .flag-fabric { animation:flag-breeze 2.6s ease-in-out infinite alternate; }
  .flag-copy form:not([hidden]),.flag-result:not([hidden]) { animation:console-message 300ms ease-out; }
  .flag-unfurl[data-phase=guess] .flag-placeholder { display:block; animation:flag-fade 320ms ease-out both; }
  .flag-unfurl[data-phase=guess] .flag-cloth,
  .flag-unfurl[data-phase=guess] .flag-fabric::after { animation:flag-fade 320ms ease-in reverse both; }
}
@keyframes flag-breeze { from { transform:scaleX(.98); } to { transform:scaleX(1); } }
@keyframes flag-fade { from { opacity:1; } to { opacity:0; } }



.account-dialog {
  --glass-tint: #281b325c;
  width: min(360px, calc(100% - 32px));
  padding: clamp(18px, 5vw, 26px);
  border-radius: 16px;
  color: var(--paper);
}
.account-dialog::backdrop { background: #120e1ab8; }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-heading h2 { font: 500 24px/1.2 var(--sans); letter-spacing: -.025em; outline: none; }
:is(#account-close,.dialog-close) { position: relative; flex: none; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
:is(#account-close,.dialog-close)::before, :is(#account-close,.dialog-close)::after { content: ""; position: absolute; inset: 0; width: 13px; height: 1.5px; margin: auto; border-radius: 1px; background: currentColor; }
:is(#account-close,.dialog-close)::before { transform: rotate(45deg); }
:is(#account-close,.dialog-close)::after { transform: rotate(-45deg); }
:is(#account-close,.dialog-close):hover { background: #ffffff12; color: white; }
#account-hint, #account-status, #account-profile p { font-size: 14px; margin-top: 8px; overflow-wrap: anywhere; }
.account-dialog form, #account-profile { display: grid; gap: 14px; margin-top: 18px; }
.account-dialog form label { display: block; margin-bottom: 6px; font: 500 13px/1.4 var(--sans); }
.account-dialog input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #ffffff40; border-radius: 8px; background: #1d1525; color: inherit; }
.account-dialog input:focus-visible { outline: 2px solid #cbaad4; outline-offset: -1px; }
#account-code { letter-spacing: .2em; font-family: var(--mono); }
.account-dialog .key { min-height: 44px; padding: 7px 14px; font-size: 15px; }
#account-methods { margin-top: 17px; }
#account-google { display: flex; align-items: center; justify-content: center; height: 40px; overflow: clip; border-radius: 4px; }
#account-google:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-divider { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.account-divider::before, .account-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#account-methods:not([hidden]) + #account-hint + form { margin-top: 12px; }
.site-links { display: flex; justify-content: center; gap: 16px; padding: 14px; font-size: 13px; color: var(--muted); }
#account-status:empty { display: none; }
.account-link { background: transparent; border: 0; color: var(--muted); font: inherit; cursor: pointer; justify-self: start; padding: 4px 0; }
.account-link:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }
#account-resend { justify-self: center; font-size: 13px; }
@media (prefers-reduced-motion: no-preference) {
  .account-dialog[open] { animation: account-arrive 180ms ease-out; }
  .account-dialog[data-closing]::backdrop { animation: account-backdrop-exit 150ms ease-in forwards; }
}
@keyframes account-backdrop-exit { to { opacity:0; } }
@keyframes account-arrive { from { opacity: 0; transform: translateY(5px); } }

.player-actions {
  position: absolute;
  inset: 18px clamp(20px, 3vw, 52px) auto auto;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
}
.player-actions .account-link { font-size: 14px; }
.player-actions .key { min-height: 40px; padding: 8px 20px; text-decoration: none; }
@media (max-width: 800px) {
  .player-actions { position: static; justify-content: flex-end; margin: 8px 16px 0; }
}

.endless-controls { display: grid; gap: 10px; margin-top: 12px; }
.endless-controls [hidden] { display: none; }
.endless-gate article .daily-stage { display: none; }
.endless-gate article { grid-template-columns: minmax(0, 440px); justify-content: center; }
.endless-gate .intro { display: none; }
.endless-gate .daily-copy { justify-items: center; text-align: center; }
.purchase-note { display: block; margin: 9px 0 0; color: var(--muted); font-size: 12px; }

.board-picker { margin:12px 0; }
.board-picker select { display:block; width:100%; margin-top:5px; }

.account-dialog:has(#account-profile:not([hidden])) {
  width:min(408px,calc(100% - 32px)); padding:24px;
  background:linear-gradient(145deg,#393440ee,#232029f7 65%); border-color:#ffffff28;
}
#account-profile { gap:20px; margin-top:4px; }
.account-byline { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; }
#account-identity { color:var(--muted); font-size:14px; overflow-wrap:anywhere; }
#account-access { color:#e9b9ef; font:11px var(--mono); }
#account-access::before { content:'✦'; margin-right:4px; }
.streak-panel h3,#account-difficulty legend { margin:0; font:500 14px var(--sans); color:var(--paper); }
.streak-total { display:flex; align-items:baseline; gap:8px; margin:3px 0 14px; }
.streak-total strong { font:500 44px/1.1 var(--mono); letter-spacing:-.07em; }
.streak-total span { color:var(--muted); font-size:14px; }
#account-week { margin:0; padding:0; display:grid; grid-template-columns:repeat(7,1fr); list-style:none; }
#account-week li { position:relative; padding-top:18px; text-align:center; font:10px var(--mono); color:var(--muted); }
#account-week li::before { content:''; position:absolute; left:50%; right:-50%; height:1px; top:6px; background:#65576b; }
#account-week li:last-child::before { display:none; }
#account-week li::after { content:''; box-sizing:border-box; position:absolute; left:50%; top:3px; width:7px; height:7px;
  transform:translateX(-50%); background:#302937; border:1px solid #8e8095; border-radius:50%; }
#account-week li.played::after { width:12px; height:12px; top:0; border:0; border-radius:0; background:#f5c3ff;
  clip-path:polygon(50% 0%,63% 37%,100% 50%,63% 63%,50% 100%,37% 63%,0% 50%,37% 37%); }
#account-week li[aria-current] { color:white; font-weight:600; }
#account-difficulty { margin:0; padding:0; border:0; min-width:0; }
#account-difficulty legend { margin-bottom:9px; padding:0; }
.difficulty-switch { --tab-count:4; --tab-width:1fr; }
.difficulty-switch > label { position:relative; margin:0; cursor:pointer; font-weight:500; }
.account-dialog .difficulty-switch input { position:absolute; inset:0; height:100%; min-height:0; margin:0; opacity:0; cursor:pointer; }
.difficulty-switch label:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:-2px; }
.account-dialog #account-difficulty-help { margin:7px 0 0; font-size:12px; color:var(--muted); }
#account-signout { justify-self:end; padding:4px; font-size:13px; }

.rank-options select { display:block; width:100%; margin-top:5px; }
.rank-options { width:min(440px,calc(100% - 32px)); }
