:root {
  --il-blue: #0038b8;
  --il-blue-light: #4d7df0;
  --il-white: #ffffff;
  --bg: #0c1014;
  --bg-card: #161b22;
  --bg-card-strong: #1f262f;
  --text: #f0f0f0;
  --text-dim: rgba(240, 240, 240, 0.65);
  --guess: #f56565;
  --truth: var(--il-blue-light);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--text);
}
body { background: var(--bg); }
.hidden { display: none !important; }

#map { position: absolute; inset: 0; }

/* ─── Splash / first-paint loader ─── */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse at center, #0e1828 0%, #060810 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
#splash.fading { opacity: 0; visibility: hidden; pointer-events: none; }
.magen-david {
  animation: md-spin 2.4s linear infinite, md-glow 1.6s ease-in-out infinite;
  transform-origin: 50% 50%;
}
.magen-david polygon { transform-origin: 50% 50%; transform-box: fill-box; }
.magen-david polygon:first-of-type {
  animation: md-counter 4.8s ease-in-out infinite;
}
.splash-label {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a3c0ff 0%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0.85;
}
@keyframes md-spin {
  to { transform: rotate(360deg); }
}
@keyframes md-counter {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes md-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(77, 125, 240, 0.45)); }
  50%      { filter: drop-shadow(0 0 22px rgba(77, 125, 240, 0.95)); }
}

/* ─── HUD (top banner during play) ─── */
#hud {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 18, 22, 0.88);
  border: 1px solid rgba(77, 125, 240, 0.25);
  padding: 12px 22px; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  z-index: 5; text-align: center; max-width: 92vw;
  backdrop-filter: blur(10px);
}
#round-info {
  font-size: 13px; color: var(--text-dim);
  display: flex; justify-content: center; align-items: center; gap: 14px;
  margin-bottom: 4px; letter-spacing: 0.3px;
}
#round-info span { unicode-bidi: isolate; }
#prompt {
  font-size: 20px; font-weight: 600;
  overflow-wrap: anywhere; word-break: break-word; line-height: 1.3;
}
#place-name-he { font-weight: 700; margin: 0 6px; color: var(--il-blue-light); }
#reveal-place { overflow-wrap: anywhere; word-break: break-word; }
#place-type {
  font-size: 12px; opacity: 0.55; font-weight: 400;
  text-transform: capitalize; margin-top: 3px; letter-spacing: 0.3px;
}

/* ─── Overlay + cards ─── */
#overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(8,10,14,0.7) 0%, rgba(8,10,14,0.5) 100%);
  z-index: 10; pointer-events: auto;
}
#overlay.pass-through { pointer-events: none; background: transparent; }
#overlay.pass-through .card { pointer-events: auto; }

.card {
  position: relative;
  background: linear-gradient(155deg, rgba(28, 36, 56, 0.78) 0%, rgba(14, 18, 28, 0.85) 100%);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  padding: 34px 38px; border-radius: 22px;
  text-align: center; min-width: 320px; max-width: 460px;
  box-shadow:
    0 24px 70px -10px rgba(0, 0, 0, 0.7),
    0 10px 32px -8px rgba(0, 56, 184, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
/* gradient border via mask */
.card::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(77, 125, 240, 0.65), rgba(255, 255, 255, 0.05) 40%, rgba(77, 125, 240, 0.35) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
/* soft top-light flag accent */
.card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--il-blue) 50%, transparent);
  opacity: 0.7;
}

.card h1 {
  margin: 0; font-size: 40px; letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--il-blue-light) 0%, var(--il-white) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title-row {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 0 0 14px;
}
.title-row .day-tag {
  font-size: 14px; font-weight: 700; padding: 2px 12px; border-radius: 999px;
  background: rgba(77, 125, 240, 0.18); color: var(--il-blue-light);
  border: 1px solid rgba(77, 125, 240, 0.4);
  -webkit-text-fill-color: var(--il-blue-light);
  letter-spacing: 0.3px;
}
.title-row .day-tag:empty { display: none; }
.tagline {
  font-size: 14px; line-height: 1.55; opacity: 0.78;
  margin: 4px 0 18px;
}
.card h2 { margin: 0 0 12px; font-size: 42px; color: var(--il-blue-light); font-weight: 700; }
.card p { opacity: 0.75; line-height: 1.5; }

button {
  background: var(--il-blue); color: var(--il-white); border: none;
  padding: 13px 32px; font-size: 16px; font-weight: 600;
  border-radius: 10px; cursor: pointer; margin-top: 18px;
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
}
button:hover { background: var(--il-blue-light); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(77, 125, 240, 0.4); }
button:active { transform: translateY(0); }

/* ─── Multiplier legend ─── */
.mult-legend {
  display: flex; flex-direction: column; gap: 8px; margin: 18px auto 8px;
  font-size: 14px; max-width: 280px;
}
.mult-row {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center;
  gap: 14px;
  padding: 9px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.mult-row .mult-text { text-align: start; }
.mult-row:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(77, 125, 240, 0.35);
}
.mult-ico {
  width: 22px; height: 22px; flex-shrink: 0;
  color: var(--il-blue-light); opacity: 0.92;
  display: inline-flex; align-items: center; justify-content: center;
}
.mult-ico svg { width: 100%; height: 100%; stroke-width: 2; }
.mult-text { flex: 1; font-weight: 500; opacity: 0.9; }
.mult-bubble {
  font-weight: 800; font-size: 13px; letter-spacing: 0.3px;
  padding: 4px 12px; border-radius: 999px; min-width: 44px; text-align: center;
  box-shadow: 0 4px 12px -4px currentColor;
}
.mult-row.m1 .mult-bubble { background: rgba(160, 174, 192, 0.18); color: #cbd5e0; border: 1px solid rgba(160, 174, 192, 0.35); box-shadow: none; }
.mult-row.m2 .mult-bubble { background: rgba(237, 175, 65, 0.18); color: #fbcd6a; border: 1px solid rgba(237, 175, 65, 0.5); }
.mult-row.m3 .mult-bubble { background: rgba(229, 62, 62, 0.2);  color: #ff8585; border: 1px solid rgba(229, 62, 62, 0.55); }
.mult-row.m1 .mult-ico { color: #cbd5e0; }
.mult-row.m2 .mult-ico { color: #fbcd6a; }
.mult-row.m3 .mult-ico { color: #ff8585; }
/* small-variant for howto card keeps old inline classes */
.mult-legend.small .m1, .mult-legend.small .m2, .mult-legend.small .m3 {
  display: inline-block; min-width: 36px; padding: 3px 10px; border-radius: 6px;
  font-weight: 700; text-align: center; font-size: 13px;
}
.mult-legend.small .m1 { background: rgba(74, 85, 104, 0.7); color: var(--il-white); }
.mult-legend.small .m2 { background: rgba(214, 158, 46, 0.85); color: #1a1f26; }
.mult-legend.small .m3 { background: rgba(229, 62, 62, 0.85); color: var(--il-white); }
.mult { padding: 2px 9px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.game-total-hint { font-size: 12px; opacity: 0.55; margin-top: 12px; letter-spacing: 0.3px; }
.game-total-hint b { color: var(--il-blue-light); }

/* ─── Reveal card: bottom-corner stats overlay (maptap-style) ─── */
#overlay:has(#reveal-card:not(.hidden)) {
  align-items: flex-end; justify-content: flex-start;
  padding: 0 0 24px 24px;
}
#reveal-card {
  min-width: 260px; max-width: 320px;
  padding: 18px 22px; text-align: start;
  border-radius: 16px;
}
#reveal-card h2 {
  font-size: 36px; margin: 0 0 2px;
  text-align: start;
}
#reveal-breakdown { font-size: 13px; opacity: 0.55; margin: 0 0 8px; letter-spacing: 0.3px; }
#reveal-place { font-size: 17px; margin: 8px 0 4px; font-weight: 700; color: var(--il-blue-light); }
#reveal-desc {
  font-size: 12px; line-height: 1.45; opacity: 0.7;
  margin: 4px 0 6px; max-height: 4.5em; overflow: hidden;
  border-inline-start: 2px solid rgba(77, 125, 240, 0.35);
  padding-inline-start: 8px;
}
.reveal-source {
  display: inline-block; font-size: 11px; color: var(--il-blue-light);
  text-decoration: none; margin: 0 0 8px;
  padding: 2px 8px; border-radius: 6px;
  border: 1px solid rgba(77, 125, 240, 0.3);
  transition: background 0.15s, border-color 0.15s;
}
.reveal-source:hover { background: rgba(77, 125, 240, 0.12); border-color: rgba(77, 125, 240, 0.6); }
a.place-name { text-decoration: none; }
a.place-name:hover { text-decoration: underline; }
#reveal-dist { opacity: 0.7; font-size: 13px; display: flex; align-items: center; gap: 8px; }
#reveal-dist::before {
  content: ""; width: 16px; height: 2px;
  background: linear-gradient(90deg, var(--guess), var(--truth));
  border-radius: 2px;
}
#reveal-card #btn-next {
  width: 100%; margin-top: 14px; padding: 10px 20px; font-size: 14px;
}
@media (max-width: 520px) {
  #overlay:has(#reveal-card:not(.hidden)) {
    align-items: stretch; justify-content: stretch;
    padding: 0 12px 12px 12px;
  }
  #reveal-card { min-width: 0; max-width: none; width: 100%; }
}
#final-score {
  font-size: 80px; font-weight: 800; margin: 12px 0; letter-spacing: -3px;
  background: linear-gradient(135deg, var(--il-blue-light) 0%, var(--il-white) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#final-max { font-size: 13px; opacity: 0.45; margin-bottom: 6px; letter-spacing: 0.4px; }

/* End-card: list of today's 6 places with image + description */
#end-card { max-width: 560px; }
.places-title {
  font-size: 14px; font-weight: 700; opacity: 0.65;
  margin: 22px 0 10px; letter-spacing: 0.3px;
}
#places-list {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  max-height: 340px; overflow-y: auto;
  text-align: start;
}
@media (min-width: 560px) {
  #places-list { grid-template-columns: 1fr 1fr; }
}
.place-tile {
  display: flex; gap: 10px; align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px; padding: 8px; overflow: hidden;
}
.place-img {
  flex-shrink: 0; width: 56px; height: 56px;
  border-radius: 8px; overflow: hidden;
  background: rgba(77, 125, 240, 0.08);
  display: flex; align-items: center; justify-content: center;
}
.place-img img { width: 100%; height: 100%; object-fit: cover; }
.place-img .no-image { font-size: 22px; opacity: 0.55; }
.place-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.place-name {
  font-weight: 700; font-size: 13px; color: var(--il-blue-light);
  overflow-wrap: anywhere; word-break: break-word; line-height: 1.25;
}
.place-desc {
  font-size: 11px; line-height: 1.4; opacity: 0.75;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}

/* ─── Animated map markers ─── */
.marker-wrap {
  position: relative; width: 0; height: 0; pointer-events: none;
}
.marker-dot {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; margin-left: -11px; margin-top: -11px;
  border-radius: 50%;
  border: 3px solid var(--il-white);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 3px 12px rgba(0, 0, 0, 0.6);
  will-change: transform;
}
.marker-dot.guess { background: var(--guess); }
.marker-dot.truth { background: var(--truth); box-shadow: 0 0 0 2px rgba(0,0,0,0.55), 0 0 22px rgba(77,125,240,0.85); }

.marker-pulse {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; margin-left: -11px; margin-top: -11px;
  border-radius: 50%; border: 2px solid;
  opacity: 0; will-change: transform, opacity;
}
.marker-pulse.guess { border-color: var(--guess); }
.marker-pulse.truth { border-color: var(--truth); }

.ripple-ring {
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px; margin-left: -19px; margin-top: -19px;
  border-radius: 50%; border: 2px solid;
  will-change: transform, opacity;
}

/* ─── Toast ─── */
#toast {
  position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(229, 62, 62, 0.96); color: var(--il-white);
  padding: 11px 24px; border-radius: 10px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 20; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.flag-icon {
  display: block; width: 96px; height: auto; margin: 0 auto 12px;
  border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 56, 184, 0.35);
}

/* Comet head — travels with the line tip. Lives inside .marker-wrap so
   MapLibre positions the wrap (zero size) at the LngLat, and this dot is
   centered inside it via absolute + translate. */
.comet-head {
  position: absolute; left: 0; top: 0;
  width: 14px; height: 14px; margin-left: -7px; margin-top: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #c2d4ff 55%, #4d7df0 100%);
  box-shadow: 0 0 16px 6px rgba(255, 255, 255, 0.85),
              0 0 32px 12px rgba(77, 125, 240, 0.7),
              0 0 64px 20px rgba(77, 125, 240, 0.35);
  will-change: transform, opacity;
}

/* ─── Floating topbar (always visible, sits ABOVE overlay) ─────────── */
#topbar {
  position: fixed; top: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; pointer-events: none; z-index: 20;
}
#topbar > * { pointer-events: auto; }
#btn-signout {
  font-size: 12px; font-weight: 600;
  padding: 6px 12px !important; min-width: auto;
}

#user-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(15, 18, 22, 0.85);
  border: 1px solid rgba(77, 125, 240, 0.25);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; color: var(--text);
  backdrop-filter: blur(10px);
}
#user-chip button {
  background: transparent; padding: 4px 6px; margin: 0; font-size: 14px;
  border-radius: 6px; min-width: auto;
}
#user-chip button:hover { background: rgba(77, 125, 240, 0.25); transform: none; box-shadow: none; }

#toolbar {
  display: inline-flex; gap: 6px;
  background: rgba(15, 18, 22, 0.85);
  border: 1px solid rgba(77, 125, 240, 0.25);
  padding: 6px; border-radius: 14px;
  backdrop-filter: blur(10px);
  margin-right: auto;  /* in RTL flex this pushes toolbar to visual left */
}
.tb-btn {
  background: transparent; color: var(--text);
  border: none; padding: 6px 10px; margin: 0;
  border-radius: 8px; font-size: 15px; line-height: 1; min-width: 34px;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.tb-btn:hover { background: rgba(77, 125, 240, 0.25); transform: translateY(-1px); box-shadow: none; }
.tb-btn:active { transform: translateY(0); }

/* Google sign-in button */
.btn-google {
  background: #fff !important; color: #1a1f26 !important;
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px;
}
.btn-google:hover { background: #f5f7fa !important; transform: translateY(-1px); }
.signin-hint { font-size: 11px; opacity: 0.5; margin: 8px 0 0; }

#signin-area { margin: 18px 0 4px; }
#signin-area .btn-google { width: 100%; justify-content: center; }

/* Visual divider between primary (Google) and secondary (guest) auth */
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 12px; opacity: 0.55;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px;
  background: rgba(255, 255, 255, 0.15);
}
.auth-divider span {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim);
}

/* Secondary (outline) button — used for 'continue as guest' */
.btn-secondary {
  background: transparent !important;
  color: var(--il-blue-light) !important;
  border: 1px solid rgba(77, 125, 240, 0.45) !important;
  width: 100%;
}
.btn-secondary:hover {
  background: rgba(77, 125, 240, 0.12) !important;
  border-color: rgba(77, 125, 240, 0.7) !important;
  color: var(--il-white) !important;
  box-shadow: 0 6px 16px rgba(77, 125, 240, 0.25) !important;
}

/* Countdown */
.countdown { font-size: 12px; opacity: 0.55; margin-top: 10px; letter-spacing: 0.5px; }
.countdown span { font-variant-numeric: tabular-nums; color: var(--il-blue-light); font-weight: 600; }

/* Emoji strip + end-card actions */
#emoji-strip {
  font-size: 28px; letter-spacing: 4px; margin: 4px 0 12px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
#end-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#end-actions button { margin: 6px 0; padding: 10px 18px; font-size: 14px; }

/* Name input */
#name-input {
  width: 100%; padding: 10px 14px; margin-top: 12px;
  background: var(--bg-card-strong); color: var(--text);
  border: 1px solid rgba(77, 125, 240, 0.3); border-radius: 8px;
  font-size: 16px; font-family: inherit;
}
#name-input:focus { outline: none; border-color: var(--il-blue-light); }

/* History + leaderboard rows */
.hist-row, .lb-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 14px;
}
.hist-row:last-child, .lb-row:last-child { border-bottom: none; }
.hist-row b, .lb-row b { color: var(--il-blue-light); }
.lb-row span:first-child { opacity: 0.5; min-width: 28px; }
#history-list, #lb-list { max-height: 360px; overflow-y: auto; margin: 14px 0; text-align: right; }

#toast[data-kind="ok"] { background: rgba(72, 187, 120, 0.96); }

#day-num { color: var(--il-blue-light); font-weight: 700; }

/* Howto skip link + nicer card padding */
.link-btn {
  background: transparent; color: var(--text-dim); padding: 6px 10px;
  margin: 12px 0 0; font-size: 13px; text-decoration: underline; min-width: 0;
  border: none;
}
.link-btn:hover { color: var(--il-blue-light); transform: none; background: transparent; box-shadow: none; }

/* Slightly more breathing room around the start card content */
#start-card { padding-top: 28px; }
.mult-legend > div { padding: 4px 0; }
.flag-icon { width: 80px; margin-bottom: 6px; }

/* ─── Spinner ────────────────────────────────────────────────────────── */
#spinner {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 14, 0.5); z-index: 30; backdrop-filter: blur(2px);
}
.spinner-ring {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(77, 125, 240, 0.2);
  border-top-color: var(--il-blue-light);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Stats modal ────────────────────────────────────────────────────── */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 14px 0;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat b {
  font-size: 28px; font-weight: 800; color: var(--il-blue-light);
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 11px; opacity: 0.6; }
.hist-title { font-size: 14px; opacity: 0.7; margin: 12px 0 6px; }
#histogram {
  display: flex; flex-direction: column; gap: 4px;
  text-align: right; margin-bottom: 12px;
}
.hist-row-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.hist-label { width: 64px; opacity: 0.55; font-variant-numeric: tabular-nums; }
.hist-bar {
  background: var(--il-blue); color: #fff; padding: 3px 8px;
  border-radius: 4px; min-width: 22px;
  text-align: center; font-weight: 700;
  transition: width 0.5s ease-out;
}

/* ─── How-to-play ────────────────────────────────────────────────────── */
.howto-slide p { line-height: 1.6; }
.mult-legend.small { margin-top: 12px; font-size: 13px; }
#howto-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 18px;
}
#howto-nav button { margin: 0; }
#howto-nav .ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
#howto-nav .ghost:hover { background: rgba(255, 255, 255, 0.05); }
#howto-dots { display: inline-flex; gap: 6px; }
#howto-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
#howto-dots .dot.on { background: var(--il-blue-light); }

/* ─── Mobile (≤ 480 px) ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Cards: tighter padding, slightly larger min-tap area on inputs */
  .card { padding: 18px 16px; min-width: 0; max-width: 94vw; border-radius: 16px; }
  .card h1 { font-size: 28px; }
  .card h2 { font-size: 26px; }
  .card p { font-size: 13px; }
  .tagline { font-size: 13px; margin: 4px 0 14px; }
  .flag-icon { width: 60px; margin-bottom: 4px; }

  #final-score { font-size: 58px; margin: 8px 0; }
  #final-max { font-size: 12px; }

  /* HUD — full-width banner at top so long Hebrew prompts wrap nicely */
  #hud {
    padding: 9px 12px; top: 60px;          /* under the topbar */
    left: 8px; right: 8px; transform: none;
    max-width: none; width: auto;
  }
  #prompt { font-size: 16px; line-height: 1.3; }
  #round-info { gap: 8px; font-size: 11px; flex-wrap: wrap; }

  .stat-row { grid-template-columns: repeat(2, 1fr); }

  /* Topbar — keep on its own row, give chips room */
  #topbar { top: 8px; left: 8px; right: 8px; gap: 6px; }
  .tb-btn {
    padding: 8px 10px; min-width: 40px; min-height: 40px;
    font-size: 16px; touch-action: manipulation;
  }
  #toolbar { padding: 4px; gap: 4px; }
  #user-chip { padding: 4px 10px; font-size: 12px; gap: 6px; max-width: 60vw; }
  #user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #user-chip button { padding: 6px 8px; min-width: 36px; font-size: 12px; }

  #emoji-strip { font-size: 22px; letter-spacing: 2px; word-spacing: 4px; }
  #end-actions { flex-direction: column; gap: 8px; }
  #end-actions button { width: 100%; }
  button { touch-action: manipulation; }

  /* Marker dot bigger so the tap target is unambiguous on a finger */
  .marker-dot { width: 26px; height: 26px; margin-left: -13px; margin-top: -13px; }
  .marker-pulse { width: 26px; height: 26px; margin-left: -13px; margin-top: -13px; }
  .comet-head { width: 16px; height: 16px; margin-left: -8px; margin-top: -8px; }

  /* Reveal stats card collapses to a full-width strip */
  #reveal-card h2 { font-size: 26px; }
  #reveal-card #btn-next { padding: 12px; font-size: 15px; }
  #reveal-card { padding: 14px 16px; }
  #reveal-desc { font-size: 11px; max-height: 3.5em; }

  /* Multiplier rows: shrink padding, ensure full text visible */
  .mult-legend { gap: 6px; margin: 14px auto 6px; max-width: 100%; }
  .mult-row { padding: 8px 12px; gap: 10px; font-size: 13px; }
  .mult-bubble { font-size: 12px; padding: 3px 9px; min-width: 38px; }
  .mult-ico { width: 18px; height: 18px; }

  /* End-card places gallery: single column with bigger thumb on phones */
  #end-card { max-width: 94vw; }
  #places-list {
    grid-template-columns: 1fr;
    max-height: 38vh;
  }
  .place-img { width: 64px; height: 64px; }
  .place-name { font-size: 14px; }
  .place-desc { font-size: 11px; -webkit-line-clamp: 2; }
}

/* Allow vertical scrolling inside the end card on small heights */
@media (max-height: 720px) {
  #end-card { max-height: 92vh; overflow-y: auto; }
  #places-list { max-height: 32vh; }
}

/* MapLibre canvas should accept fast pinch/pan but not browser zoom delay */
.maplibregl-map, .maplibregl-canvas { touch-action: pan-x pan-y pinch-zoom; }
.maplibregl-ctrl-attrib { font-size: 10px; opacity: 0.55; }
