/* globe + clue media + reveal overlay + clue lightbox */
.globe-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Only a first-paint fallback: Globe.resize() measures the stage and sets the
   real pixel size, because viewport units cannot see the HUD and panel. */
#globe {
  width: min(94vw, 62vh);
  height: min(94vw, 62vh);
  touch-action: none;
  cursor: grab;
}
#globe:active { cursor: grabbing; }
#globe.pickable { cursor: crosshair; }

.globe-label {
  position: absolute;
  transform: translate(-50%, -140%);
  background: var(--sheen-primary);
  color: var(--on-accent);
  font-family: "Archivo Black", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 0 var(--line);
  font-size: 0.82rem;
  white-space: nowrap;
  pointer-events: none;
  animation: pop 0.28s cubic-bezier(0.3, 1.7, 0.5, 1);
}
/* the label carries the same right/wrong signal as the banner: green when you
   got it, rose when you did not */
.globe-label.ok { background: linear-gradient(180deg, #a8c47c, var(--ok)); }
.globe-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--line);
}

.locate-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sheen-primary);
  color: var(--on-accent);
  font-family: "Inter", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  border: var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 0 var(--line);
  font-size: 0.8rem;
  animation: bob 2.2s ease-in-out infinite;
}

/* zoom controls, bottom-right of the globe area */
.globe-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
}
.globe-zoom-btn {
  width: 42px;
  height: 42px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--sheen-card);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.11s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.11s ease;
}
.globe-zoom-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
.globe-zoom-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.globe-zoom-btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: 0 4px 0 var(--line); }
.zoom-reset { font-size: 0.82rem; background: var(--sheen-primary); color: var(--on-accent); }

/* flag / shape clue card floats over the top of the globe area */
.clue-media {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sheen-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard), var(--shadow-soft);
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dropin 0.36s cubic-bezier(0.25, 1.6, 0.45, 1);
  font: inherit;
  cursor: zoom-in;
  z-index: 6;
  transition: top 0.28s ease, left 0.28s ease, transform 0.28s ease, padding 0.28s ease;
}
@keyframes dropin { from { transform: translate(-50%, -18px); opacity: 0; } }
.clue-flag {
  width: min(62vw, 260px);
  height: auto;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: block;
  transition: width 0.28s ease;
}
.clue-shape {
  width: min(52vw, 220px);
  height: min(52vw, 220px);
  display: block;
  transition: width 0.28s ease, height 0.28s ease;
}
.clue-shape path { fill: var(--accent) !important; }

/* Once the player starts turning the globe the clue steps aside: it shrinks and
   moves to the corner so it stops covering the part of the globe being read.
   Tapping it opens the full-size view. */
.clue-media.compact {
  top: 8px;
  left: 8px;
  transform: none;
  padding: 6px;
  border-radius: var(--radius);
  animation: none;
}
.clue-media.compact .clue-flag { width: 62px; }
.clue-media.compact .clue-shape { width: 46px; height: 46px; }

/* result banner: sits at the top of the stage so the globe stays visible */
.reveal {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(94%, 470px);
}
.reveal-inner {
  background: var(--sheen-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard), var(--shadow-soft);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  animation: dropin-plain 0.36s cubic-bezier(0.25, 1.6, 0.45, 1);
}
@keyframes dropin-plain { from { transform: translateY(-18px); opacity: 0; } }
/* Getting it right goes green, top to bottom: the banner edge, the tick, the
   answer, the points earned. Wrong stays neutral ink. */
.reveal.ok .reveal-inner { border-color: var(--ok); box-shadow: 0 5px 0 var(--ok-text), var(--shadow-soft); }
.reveal-mark {
  font-family: "Archivo Black", sans-serif; font-size: 1.4rem; line-height: 1; flex-shrink: 0;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--line); border-radius: var(--radius-pill);
}
.reveal.ok .reveal-mark {
  color: var(--on-accent);
  background: linear-gradient(180deg, #a8c47c, var(--ok));
  animation: stamp 0.42s cubic-bezier(0.3, 1.8, 0.5, 1);
}
/* the tick lands like a stamp: the one moment worth a flourish */
@keyframes stamp { 0% { transform: scale(0.2) rotate(-24deg); opacity: 0; } 60% { transform: scale(1.18) rotate(6deg); } }
.reveal.bad .reveal-mark { color: var(--card); background: var(--ink); }
.reveal-body { flex: 1; text-align: left; min-width: 0; }
.reveal-text { font-family: "Archivo Black", sans-serif; font-size: 1rem; color: var(--ink); }
.reveal-text b { color: var(--accent-text); }
.reveal.ok .reveal-text b { color: var(--ok-text); }
.reveal-points { font-family: "Inter", sans-serif; font-weight: 700; color: var(--ink-soft); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.reveal-points.plus { color: var(--ok-text); }
.reveal-continue {
  flex-shrink: 0;
  border: var(--border);
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--on-blue);
  background: var(--sheen-blue);
  border-radius: var(--radius);
  padding: 10px 17px;
  font-size: 0.85rem;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.11s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.11s ease;
}
.reveal-continue:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); filter: brightness(1.12); }
.reveal-continue:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }

/* ================= clue lightbox ================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg-1) 86%, transparent);
}
.lightbox-panel {
  width: min(560px, 100%);
  max-height: 100%;
  background: var(--sheen-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard), var(--shadow-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: dropin-plain 0.26s cubic-bezier(0.25, 1.6, 0.45, 1);
}
.lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lightbox-title {
  font-family: "Archivo Black", sans-serif; text-transform: uppercase;
  font-size: 0.95rem; letter-spacing: 0.04em; margin: 0; color: var(--ink);
}
.lightbox-close {
  border: var(--border); background: var(--sheen-quiet); color: var(--ink);
  width: 42px; height: 42px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 800; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.11s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.11s ease;
}
.lightbox-close:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
.lightbox-close:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.lightbox-body { display: flex; align-items: center; justify-content: center; min-height: 0; overflow: auto; }
.lightbox-body img { width: 100%; height: auto; border: var(--border); border-radius: var(--radius); display: block; }
.lightbox-body svg { width: min(100%, 420px); height: auto; aspect-ratio: 1; display: block; }
.lightbox-body svg path { fill: var(--accent) !important; }
