:root {
  --panel: rgba(14, 20, 42, 0.93);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f3f5fb;
  --muted: #9ba8c8;
  --accent: #ff6b4a;
  --accent-ink: #2a0e06;
  --good: #34d399;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(120% 90% at 50% 30%, #131c3d 0%, #080c1c 60%, #05070f 100%) #05070f;
  color: var(--text);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

[hidden] { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; }

body::before {
  /* a sparse star field behind the globe */
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.7;
  background-image:
    radial-gradient(1px 1px at 37px 61px, #dbe6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 173px 219px, #dbe6ff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 291px 97px, #ffffff 50%, transparent 51%),
    radial-gradient(1px 1px at 121px 331px, #c9d6ff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 409px 283px, #dbe6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 233px 419px, #ffffff 50%, transparent 51%);
  background-size: 457px 463px, 389px 521px, 613px 347px, 331px 577px, 541px 433px, 499px 607px;
  pointer-events: none;
}

#globe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: transparent;
}
#globe .maplibregl-canvas { cursor: crosshair; outline: none; }
#globe .maplibregl-canvas-container.maplibregl-interactive:active .maplibregl-canvas { cursor: grabbing; }

/* the ring that fills while you press and hold */
#globe { -webkit-touch-callout: none; }
.hold-ring {
  position: absolute;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
}
.hold-ring svg { display: block; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke-width: 5; }
.hold-ring .track { stroke: rgba(10, 16, 36, 0.55); }
.hold-ring .fill { stroke: #ffffff; stroke-linecap: round; stroke-dasharray: 226.2; stroke-dashoffset: 226.2; }
.hold-ring.on { opacity: 1; transition: opacity 0.1s linear 0.1s; }
.hold-ring.on .fill { animation: hold-fill var(--hold-ms, 500ms) linear forwards; }
@keyframes hold-fill { to { stroke-dashoffset: 0; } }

/* the player's pin and the real spot */
.maplibregl-marker { pointer-events: none; }
.pin { width: 30px; height: 40px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55)); }
.pin svg { display: block; transform-origin: 50% 100%; }
.pin svg.drop { animation: pin-drop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pin-drop {
  from { transform: translateY(-22px) scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.answer { position: relative; width: 0; height: 0; }
.answer-dot {
  position: absolute;
  left: -9px; top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--good);
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.3), 0 2px 6px rgba(0, 0, 0, 0.6);
}
.answer-label {
  position: absolute;
  left: 0; bottom: 18px;
  transform: translateX(-50%);
  padding: 5px 10px;
  background: rgba(10, 16, 36, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.75);
  border-radius: 999px;
  font: 600 13px/1.2 var(--sans);
  color: #ffffff;
  white-space: nowrap;
}
.answer-label:empty { display: none; }
.answer.no-dot .answer-dot { display: none; }
.answer.no-dot .answer-label { bottom: auto; top: 0; transform: translate(-50%, -50%); }

/* names of nearby countries and cities, shown only once a find is revealed */
.ctx { position: relative; width: 0; height: 0; }
.ctx span {
  position: absolute;
  white-space: nowrap;
  color: #ffffff;
  text-shadow: 0 0 3px rgba(4, 8, 22, 0.95), 0 0 6px rgba(4, 8, 22, 0.9), 0 1px 2px rgba(4, 8, 22, 0.95);
}
.ctx.country span {
  transform: translate(-50%, -50%);
  font: 700 11.5px/1.2 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ctx.city span {
  left: 0;
  top: 0;
  transform: translateY(-50%);
  padding-left: 9px;
  font: 600 12px/1.2 var(--sans);
  color: #e8edfa;
}
.ctx.city span::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1.5px rgba(4, 8, 22, 0.85);
}
.ctx.state span {
  transform: translate(-50%, -50%);
  font: 600 10.5px/1.2 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}
.ctx.crowded { visibility: hidden; }
/* name tags for your finds on the results globe: only once zoomed in */
.ctx.find { display: none; }
#globe.zoomed-in .ctx.find { display: block; }
.ctx.find span {
  left: 0;
  bottom: 11px;
  transform: translateX(-50%);
  padding: 2px 8px;
  background: rgba(10, 16, 36, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  font: 700 12px/1.3 var(--sans);
  text-shadow: none;
}

.credit {
  position: fixed;
  left: 10px;
  right: 10px; /* a long credit line wraps instead of running off a phone */
  bottom: calc(6px + var(--safe-b));
  margin: 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 3;
}
@media (max-width: 899px) {
  /* the card and results sheet sit along the bottom on phones; rest the credit on top of them */
  .credit { bottom: calc(var(--ui-bottom, 250px) + 6px); }
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + var(--safe-t)) 12px 8px;
  pointer-events: none;
  z-index: 5;
}
.topbar > * { pointer-events: auto; position: relative; }
/* keeps the logo and progress strip readable when pale land slides underneath */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(112px + var(--safe-t));
  background: linear-gradient(to bottom, rgba(5, 8, 20, 0.82) 0%, rgba(5, 8, 20, 0.55) 55%, rgba(5, 8, 20, 0) 100%);
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand svg { flex: none; }
@media (max-width: 440px) { .daytag .date { display: none; } }
@media (max-width: 380px) { .daytag { display: none; } } /* room for four-digit scores on small phones */
.wordmark {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.daytag {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.topright { display: flex; align-items: center; gap: 6px; }
.scorechip {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.scorechip b { font-size: 15px; }
@media (max-width: 400px) { .scorechip span { display: none; } }
.scorechip span { font-size: 11px; color: var(--muted); }

.iconbtn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
}
.iconbtn:hover { background: rgba(32, 42, 78, 0.95); }

/* ---------- progress: 4 legs of 5 ---------- */

.progress {
  position: fixed;
  top: calc(60px + var(--safe-t));
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  z-index: 6;
}
.progress .leg { display: flex; gap: 3px; }
.progress i {
  width: 12px; height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(5, 8, 20, 0.35);
  transition: background 0.25s, transform 0.25s;
}
.progress i.now { background: #ffffff; transform: scaleY(1.5); }
body[data-phase="done"] .progress { display: none; }

/* ---------- zoom ---------- */

.zoom {
  position: fixed;
  right: 12px;
  top: calc(86px + var(--safe-t));
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
.zoom button {
  width: 36px; height: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
}
body[data-phase="done"] .zoom { display: none; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  top: calc(84px + var(--safe-t));
  left: 50%;
  transform: translate(-50%, -8px);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #10162c;
  font-size: 13px;
  font-weight: 650;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  z-index: 6;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- the find card ---------- */

.card {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 20px));
  padding: 15px 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.eyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .sep { margin: 0 6px; opacity: 0.6; }
.card .eyebrow { display: flex; align-items: center; gap: 10px; }
/* how hard this find is, and its multiplier */
.diff {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.diff[data-level="easy"] { color: #6ee7b7; }
.diff[data-level="medium"] { color: #fcd34d; }
.diff[data-level="hard"] { color: #fda4af; }
.sum-list .place b .x { display: inline; margin-left: 6px; font-size: 11px; font-weight: 700; color: #c6cfe6; }

.card h1 {
  margin: 5px 0 1px;
  font-family: var(--serif);
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.1;
  font-weight: 700;
  text-wrap: balance;
}
.card .sub { margin: 0; font-size: 15px; color: #c6cfe6; }

.slot { height: 54px; display: flex; align-items: center; margin: 6px 0 8px; }
body[data-phase="guess"] .slot, body[data-phase="scoring"] .slot { margin-bottom: 0; }
.hint { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14.5px; color: #c6cfe6; }
.hint::before {
  /* a little "press here" target */
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 0 4px rgba(14, 20, 42, 1), inset 0 0 0 11px var(--accent);
}

.result { display: flex; align-items: center; gap: 14px; width: 100%; }
.result-pts {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--tier, var(--line));
  font-variant-numeric: tabular-nums;
}
.result-pts b { font-size: 26px; line-height: 1; color: var(--tier, #fff); }
.result-pts span { font-size: 11px; color: var(--muted); }
.result-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.result-meta strong { font-size: 15px; }
.result-meta span { font-size: 13.5px; color: #c6cfe6; }

.primary, .ghost {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.08s, opacity 0.2s, background 0.2s;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { background: #ff7d60; }
.primary:active, .ghost:active { transform: scale(0.98); }
.primary:disabled { opacity: 0.38; cursor: default; }
.primary.next { background: #f3f5fb; color: #10162c; }
.ghost { background: rgba(255, 255, 255, 0.06); border-color: var(--line); color: var(--text); }
.ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- end-of-day summary ---------- */

.summary {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 56dvh;
  padding: 18px 18px calc(18px + var(--safe-b));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.sum-score { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.sum-score b { font-family: var(--serif); font-size: 46px; line-height: 1.05; }
.sum-score span { font-size: 16px; color: var(--muted); }
.rank { margin: 2px 0 14px; font-size: 15px; font-weight: 650; color: var(--good); }

.sum-grid { display: grid; gap: 7px; margin-bottom: 14px; }
.sum-leg { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; }
.sum-leg .name { font-size: 13px; color: #c6cfe6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-leg .squares { display: flex; gap: 4px; }
.sum-leg .squares i { width: 17px; height: 17px; border-radius: 5px; }
.sum-leg .pts { width: 38px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.sum-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.back-today { margin-top: 8px; min-height: 42px; font-size: 14.5px; }
.nextup { margin: 10px 0 12px; font-size: 13px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

.sum-tip { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.sum-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sum-list li { border-bottom: 1px solid var(--line); }
.sum-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr auto 40px;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  background: none;
  border: 0;
  text-align: left;
}
.sum-list button:hover { background: rgba(255, 255, 255, 0.05); }
.sum-list li.active button { background: rgba(255, 255, 255, 0.09); }

/* ---------- the place card: photos, a description and a fact ---------- */

.placecard {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 72dvh;
  padding: 18px 18px calc(18px + var(--safe-b));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #10162c;
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
  z-index: 7;
  -webkit-user-select: text;
  user-select: text;
}
.placecard h2 { margin: 4px 44px 1px 0; font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.placecard .eyebrow { margin-right: 44px; }
.placecard .sub { margin: 0 0 12px; font-size: 15px; color: #c6cfe6; }
.pc-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}
.pc-photos {
  display: flex;
  gap: 8px;
  height: 172px;
  margin: 0 -18px 12px;
  padding: 0 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.pc-photos a, .pc-ghost {
  flex: none;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  scroll-snap-align: start;
}
.pc-photos img { display: block; height: 100%; width: auto; min-width: 120px; max-width: 300px; object-fit: cover; }
.pc-ghost { width: 220px; animation: pc-pulse 1.2s ease-in-out infinite; }
@keyframes pc-pulse { 50% { opacity: 0.45; } }
.pc-text { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: #e3e8f6; }
.pc-text.muted { color: var(--muted); }
.pc-fact {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 14px;
}
.pc-fact b { display: block; margin-bottom: 3px; font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--good); }
.pc-fact p { margin: 0; font-size: 14.5px; line-height: 1.45; color: #e3e8f6; }
.pc-credit { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.pc-credit a { color: #c6cfe6; }
.sum-list .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-list .place { min-width: 0; }
.sum-list .place b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-list .place span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-list .dist { font-size: 12.5px; color: #c6cfe6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-list .chip {
  justify-self: end;
  min-width: 36px;
  padding: 3px 0;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #0b1020;
  font-variant-numeric: tabular-nums;
}

/* ---------- dialogs ---------- */

dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 22px;
  background: #10162c;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(3, 5, 12, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 26px; }
dialog .lede { margin: 0 0 12px; font-size: 15px; line-height: 1.45; color: #c6cfe6; }
dialog .steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 7px; font-size: 14.5px; line-height: 1.4; color: #dfe5f5; }
dialog .fine { margin: 12px 0 16px; font-size: 12.5px; color: var(--muted); }
dialog form.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
dialog h3, .sum-friends h3 {
  margin: 16px 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
dialog .fine.tight { margin: 0 0 4px; }
#dlgSettings #btnHelp { margin-top: 6px; }
#dlgSettings form { margin-top: 10px; }

/* ---------- friends ---------- */

.inline { display: flex; gap: 8px; }
.inline input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  -webkit-user-select: text;
  user-select: text;
}
.inline input::placeholder { color: var(--muted); }
.inline input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inline .primary { width: auto; flex: none; }
#frAddCode { letter-spacing: 0.12em; text-transform: uppercase; }
#frAddCode::placeholder { letter-spacing: 0; text-transform: none; }

.formnote { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: var(--good); }
.formnote.bad { color: #fca5a5; }

.codebox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 6px 0 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.codebox span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.codebox b {
  font: 700 26px/1.25 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: 0.14em;
  -webkit-user-select: text;
  user-select: text;
}
.small { width: auto; flex: none; min-height: 40px; padding: 0 14px; font-size: 14px; }

.board { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--line); }
.board li {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.board .rank { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li.you .who { font-weight: 700; }
.board .score { font-weight: 700; font-variant-numeric: tabular-nums; }
.board .score.muted { font-weight: 500; color: var(--muted); }
.board .score small { font-size: 12px; font-weight: 500; color: var(--muted); }
.board .remove {
  min-width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}
.board .remove.sure { padding: 0 9px; border-color: #fca5a5; color: #fca5a5; font-size: 12.5px; font-weight: 700; }

.linkbtn { padding: 12px 0 4px; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
#dlgFriends form[method="dialog"] { margin-top: 10px; }
.sum-friends { margin: 0 0 16px; }
.sum-friends h3 { margin-top: 4px; }
.sum-friends .fine { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: #c6cfe6; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }

/* ---------- ranks ---------- */

.rankcard { margin: 10px 0 12px; padding: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 16px; }
.rankhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rankhead span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.rankhead b { font-family: var(--serif); font-size: 26px; }
.rankbar { height: 8px; margin: 8px 0; border-radius: 4px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.rankbar i { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.rankcard p { margin: 0; font-size: 13.5px; color: #c6cfe6; }
.rankcard details { margin-top: 10px; font-size: 13px; }
.rankcard summary { cursor: pointer; color: var(--muted); }
.rankcard details .fine { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.ranklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.ranklist li { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; color: #c6cfe6; }
.ranklist li.mine { color: #ffffff; font-weight: 700; }

.rankbadge {
  margin-left: 7px;
  padding: 1px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: 1px;
  color: #94a3b8;
}
.rankbadge[data-rank="sparrow"] { color: #cbd5e1; }
.rankbadge[data-rank="swallow"] { color: #7dd3fc; }
.rankbadge[data-rank="hawk"] { color: #fcd34d; }
.rankbadge[data-rank="falcon"] { color: #fdba74; }
.rankbadge[data-rank="eagle"] { color: #6ee7b7; }
.standing { margin: -8px 0 14px; font-size: 13.5px; color: #c6cfe6; }
.standing .rankbadge { margin-left: 0; margin-right: 6px; font-size: 11.5px; }

.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.statgrid div { padding: 12px 8px; text-align: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 14px; }
.statgrid b { display: block; font-family: var(--serif); font-size: 24px; font-variant-numeric: tabular-nums; }
.statgrid span { font-size: 11.5px; color: var(--muted); }

/* ---------- practice menu ---------- */

.practice-list { display: grid; gap: 6px; }
.practice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
}
.practice-row:hover { background: rgba(255, 255, 255, 0.11); }
.practice-row .what { min-width: 0; }
.practice-row .what b { display: block; font-size: 15.5px; }
.practice-row .what span { display: block; font-size: 12.5px; color: var(--muted); }
.practice-row .how { flex: none; font-size: 12.5px; color: #c6cfe6; text-align: right; font-variant-numeric: tabular-nums; }
.practice-row .how .weak { display: block; color: #fda4af; font-weight: 700; }

/* ---------- stats by continent, type and difficulty ---------- */

.areas { display: grid; gap: 7px; margin: 10px 0 4px; }
.area { display: grid; grid-template-columns: 112px 1fr 30px 64px; align-items: center; gap: 8px; font-size: 13.5px; }
.area .bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.area .bar i { display: block; height: 100%; border-radius: 4px; }
.area b { text-align: right; font-variant-numeric: tabular-nums; }
.area small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.area.gap { margin-top: 8px; }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; font-size: 15px; }
.segmented { display: flex; padding: 3px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 12px; }
.segmented button { padding: 7px 12px; background: none; border: 0; border-radius: 9px; font-size: 13.5px; font-weight: 650; color: var(--muted); }
.segmented button.on { background: #f3f5fb; color: #10162c; }
.setting.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.setting.stack .fine { margin: 0; }
.setting.stack > .segmented:not(.wide) { align-self: flex-start; }
.sharebox { margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14.5px; }
.segmented.wide button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; }
.segmented.wide b { font-size: 14px; }
.segmented.wide small { font-size: 11.5px; font-weight: 500; opacity: 0.8; }
.segmented.cut { margin: 8px 0 2px; }
.segmented.cut button { flex: 1; }

/* "want more today?" on the results screen */
.sum-more { margin: 0 0 16px; }
.sum-more h3 {
  margin: 4px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.sum-more-buttons { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.sum-more-buttons .ghost { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 8px 10px; }
.sum-more-buttons b { font-size: 14.5px; }
.sum-more-buttons span { font-size: 12.5px; font-weight: 500; color: #c6cfe6; }
.sum-more .fine { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
dialog#dlgSettings form { margin-top: 20px; }

/* ---------- wider screens ---------- */

@media (min-width: 560px) {
  .progress i { width: 18px; height: 6px; }
  .progress { gap: 14px; }
  .topbar { padding: 14px 18px 8px; }
  .progress { top: 66px; }
  .zoom { top: 92px; right: 18px; }
}

@media (min-width: 1000px) {
  .progress { top: 28px; }
  .zoom { top: 74px; }
}

@media (min-width: 900px) {
  .placecard {
    left: 16px;
    right: auto;
    bottom: 16px;
    width: 400px;
    height: auto;
    max-height: calc(100dvh - 104px);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  }
  .summary {
    left: auto;
    right: 16px;
    top: 72px;
    bottom: 16px;
    width: 392px;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .progress i, .primary, .ghost { transition: none; }
}

/* ---------- account ---------- */
.account { margin: 4px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.04); font-size: 14.5px; }
.account b { display: block; margin-bottom: 4px; }
.account .fine { margin: 0 0 10px; }
.account .formnote { margin: 8px 0 0; }
.account .formnote:empty { display: none; }
.account #acWho { color: var(--text); overflow-wrap: anywhere; }
.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: #fff; color: #1f1f1f; font: inherit; font-weight: 600; cursor: pointer; }
.google:hover { background: #f1f3f8; }
.google:disabled { opacity: 0.5; cursor: default; }
.linkbtn.sure { color: var(--accent); }
.sum-account { display: block; width: 100%; margin: 0 0 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 13px; text-align: center; cursor: pointer; }
.sum-account b { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.sum-account:hover { border-color: rgba(255, 255, 255, 0.3); }

/* ---------- the sign-up popup after a finished game ---------- */
.join { text-align: center; }
.join-kicker { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.join-score { margin: 2px 0 14px; }
.join-score b { font-family: Georgia, 'Times New Roman', serif; font-size: 44px; line-height: 1.1; }
.join-score span { font-size: 15px; color: var(--muted); }
.join h2 { margin-bottom: 10px; }
.join-list { list-style: none; margin: 0 0 16px; padding: 0; text-align: left; font-size: 15px; }
.join-list li { position: relative; padding: 7px 0 7px 28px; border-bottom: 1px solid var(--line); }
.join-list li:last-child { border-bottom: 0; }
.join-list li::before { content: ''; position: absolute; left: 6px; top: 13px; width: 10px; height: 5px; border-left: 2px solid #3ddc97; border-bottom: 2px solid #3ddc97; transform: rotate(-45deg); }
.join .formnote:empty { display: none; }
.join .fine { margin: 10px 0 12px; }
.join form .ghost { width: 100%; }

/* ---------- sign-in inside Friends ---------- */
.fr-signin { margin: 0 0 12px; }
.fr-signin .fine { margin: 8px 0 0; text-align: center; }
.fr-signin .formnote:empty { display: none; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fr-keep { margin: 18px 0 0; }
.fr-keep .fine { margin-bottom: 12px; }

/* ---------- email and password ---------- */
.use-email { width: 100%; margin-top: 8px; min-height: 46px; }
.stacked { display: flex; flex-direction: column; margin-top: 14px; }
.stacked label { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.stacked input { margin: 0 0 12px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: var(--text); font: inherit; font-size: 16px; }
.stacked input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.stacked .fine { margin: -4px 0 12px; }
#dlgEmail .formnote:empty { display: none; }
#dlgEmail .linkbtn { display: block; margin: 10px auto 0; }
#dlgEmail form[method='dialog'] { margin-top: 12px; }

/* ---------- a pop-up's closing button stays in view ----------
   Long pop-ups scroll; their last row of buttons (Close, Done, Not now)
   stays pinned to the bottom so it never has to be scrolled to. */
dialog { padding-bottom: 0; } /* the button row supplies the bottom padding, so every browser pins it the same way */
dialog > form[method='dialog'] {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -22px;
  padding: 12px 22px 22px;
  background: linear-gradient(to bottom, rgba(16, 22, 44, 0), #10162c 12px);
}
#dlgEmail form[method='dialog'] { margin-top: 0; }

/* ---------- Birdseye Plus ---------- */
body:not(.paywall) .paid { display: none !important; }
body.paywall .early { display: none !important; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.plan { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 84px; padding: 12px 8px; border: 1.5px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.05); color: var(--text); font: inherit; cursor: pointer; }
.plan b { font-size: 15px; }
.plan span { font-size: 14px; }
.plan small { font-size: 12px; color: var(--muted); }
.plan.on { border-color: var(--accent); background: rgba(255, 107, 74, 0.12); }
.plus .primary { width: 100%; }
.codeentry { margin: 14px 0 4px; text-align: left; }
.codeentry summary { padding: 8px 0; font-size: 14px; color: #c6cfe6; cursor: pointer; }
.codeentry .inline { margin-top: 6px; }
.codeentry .inline .primary { width: auto; }
#plCode { letter-spacing: 0.1em; text-transform: uppercase; }
#plCode::placeholder { letter-spacing: 0; text-transform: none; }
#plSignIn { margin-top: 10px; }
#plMember .lede { margin-bottom: 16px; }
.account .primary { width: 100%; }
.sum-more-buttons .plus-offer { border-color: var(--accent); background: rgba(255, 107, 74, 0.12); }

/* ---------- inside the iOS and Android apps ---------- */
.google.apple { margin-bottom: 8px; }
.google[hidden] { display: none; }

#plSignIn { margin-top: 10px; text-align: center; }
#plSignIn .formnote { margin: 0 0 10px; }
#plRestore { display: block; margin: 6px auto 0; }
#plTerms, #plLegal { margin: 8px 0 0; text-align: center; }
#plLegal a { color: var(--muted); }
#plRestore[hidden], #plTerms[hidden] { display: none; }

/* ---------- deleting the account ---------- */
.danger { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid #f87171; border-radius: 14px; background: rgba(248, 113, 113, 0.14); color: #fecaca; font: inherit; font-weight: 700; cursor: pointer; }
.danger:disabled { opacity: 0.5; cursor: default; }
#acDelete { display: block; padding-top: 4px; }
#dlgDelete .formnote { margin: 8px 0; }
#dlgDelete .formnote:empty { display: none; }
#dlgDelete .stacked { margin-top: 4px; }
