:root {
  --bg: #04060c;
  --ink: #e8eef7;
  --muted: #7d8ba3;
  --line: rgba(140, 170, 210, 0.16);
  --accent: #ffb648;
  --accent-dim: rgba(255, 182, 72, 0.14);
  --cool: #4fd8ff;
  --panel: rgba(8, 13, 24, 0.82);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

#globe-screen { position: fixed; inset: 0; }

#globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#globe-canvas.dragging { cursor: grabbing; }

/* Vignette keeps the eye on the globe and hides the horizon of the star field. */
#globe-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 42%, rgba(2, 4, 9, 0.75) 100%);
}

.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 26px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(255, 182, 72, 0.7);
  animation: pulse-mark 2.6s ease-in-out infinite;
}

@keyframes pulse-mark {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--ink);
}
.brand-text em { font-style: normal; color: var(--muted); }

.global-count { text-align: right; }
#total-players {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.global-count-label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-bottom {
  position: absolute;
  bottom: 24px; left: 0; right: 0;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}
.hint {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
}

/* Floating marker labels, positioned each frame from the 3D projection. */
#globe-labels { position: absolute; inset: 0; pointer-events: none; z-index: 4; }

.marker-label {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
  cursor: pointer;
  padding: 6px 8px;
  transition: opacity 0.25s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 7px;
}
.marker-label:hover { color: var(--accent); }
.marker-label .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.marker-label.locked { color: var(--muted); }
.marker-label.locked .dot { background: var(--muted); box-shadow: none; }
.marker-label .pop {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.arena-card {
  position: absolute;
  right: 42px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  padding: 30px 28px 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 4px;
  z-index: 6;
  animation: card-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(-50%) translateX(18px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.card-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.card-close:hover { color: var(--ink); }

.card-region {
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.card-name {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.card-country {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}

.fill-row {
  margin: 26px 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fill-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 2px;
  overflow: hidden;
}
.fill-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cool), var(--accent));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.fill-count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.fill-count strong { color: var(--ink); font-weight: 600; }

.enter-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #150d00;
  border: none;
  border-radius: 3px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.enter-btn:hover {
  background: #ffc76d;
  box-shadow: 0 0 28px rgba(255, 182, 72, 0.42);
}
.enter-btn:active { transform: scale(0.985); }
.enter-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.card-locked { text-align: center; padding-top: 4px; }
.lock-icon { font-size: 19px; opacity: 0.5; margin-bottom: 9px; }
.lock-text { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.lock-text strong { color: var(--ink); }

.loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg);
  z-index: 20;
  transition: opacity 0.6s ease;
}
.loading.done { opacity: 0; pointer-events: none; }

.loading-ring {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--muted);
}

.deploy-screen {
  --deploy-progress: 24%;
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 76% 48%, rgba(27, 112, 160, 0.2), transparent 34%),
    linear-gradient(135deg, #07111d, var(--bg) 62%);
  z-index: 30;
  color: #f4f7fb;
}

/* The image is requested by globe.js only once a deployment begins. A dark
   authored fallback remains behind it so a failed image never turns the load
   into a broken-image screen. */
.deploy-keyart {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  transform: scale(1.035);
  filter: saturate(0.94) contrast(1.035) brightness(0.9);
  transition: opacity 0.62s ease, transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.deploy-screen.art-ready .deploy-keyart {
  opacity: 1;
  transform: scale(1);
}

/* Two gradients do separate jobs: the left one protects the live type, while
   the lower one keeps controls readable against wet street reflections. */
.deploy-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(3, 6, 12, 0.94) 0%,
      rgba(3, 7, 14, 0.78) 25%,
      rgba(3, 8, 16, 0.2) 59%,
      rgba(2, 6, 12, 0.12) 100%),
    linear-gradient(0deg,
      rgba(2, 4, 9, 0.82) 0%,
      rgba(2, 5, 11, 0.08) 48%,
      rgba(2, 5, 11, 0.42) 100%);
}
.deploy-screen::after {
  content: "";
  position: absolute;
  inset: clamp(10px, 1.5vw, 22px);
  z-index: 4;
  border: 1px solid rgba(169, 218, 240, 0.13);
  box-shadow: inset 0 0 42px rgba(5, 15, 27, 0.18);
  pointer-events: none;
}

.deploy-masthead {
  position: absolute;
  z-index: 3;
  top: max(clamp(27px, 4vw, 54px), env(safe-area-inset-top, 0px));
  left: max(clamp(30px, 5vw, 76px), env(safe-area-inset-left, 0px));
  right: max(clamp(30px, 5vw, 76px), env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(225, 237, 246, 0.72);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.deploy-wordmark { display: flex; align-items: center; gap: 11px; }
.deploy-wordmark i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(255, 182, 72, 0.85);
}
.deploy-protocol { color: rgba(117, 211, 239, 0.72); }

.deploy-inner {
  position: absolute;
  z-index: 3;
  left: max(clamp(30px, 5vw, 76px), env(safe-area-inset-left, 0px));
  bottom: max(clamp(34px, 7vh, 82px), env(safe-area-inset-bottom, 0px));
  width: min(620px, 52vw);
  text-align: left;
}
.deploy-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}
.deploy-eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 10px rgba(255, 182, 72, 0.5);
}
.deploy-arena {
  max-width: 12ch;
  margin: 0;
  color: #f7f9fb;
  font-size: clamp(48px, 7.2vw, 108px);
  font-weight: 750;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.58);
}
.deploy-brief {
  margin: 18px 0 0;
  color: rgba(222, 231, 240, 0.68);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.deploy-readout {
  width: min(430px, 100%);
  margin: clamp(27px, 4.5vh, 48px) 0 24px;
}
.deploy-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}
.deploy-status {
  min-width: 0;
  overflow: hidden;
  color: rgba(224, 235, 244, 0.78);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deploy-status-pulse {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 0 0 rgba(79, 216, 255, 0.65);
  animation: deploy-signal 1.45s ease-out infinite;
}
@keyframes deploy-signal {
  0% { box-shadow: 0 0 0 0 rgba(79, 216, 255, 0.7); }
  65%, 100% { box-shadow: 0 0 0 7px rgba(79, 216, 255, 0); }
}

.deploy-progress {
  position: relative;
  height: 2px;
  overflow: hidden;
  background: rgba(183, 215, 230, 0.16);
}
.deploy-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--deploy-progress);
  background: linear-gradient(90deg, var(--accent), #ffe2a3 48%, var(--cool));
  box-shadow: 0 0 14px rgba(79, 216, 255, 0.52);
  transition: width 0.75s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.deploy-progress-fill::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -12px;
  width: 26px;
  height: 6px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.95), transparent 68%);
  animation: deploy-progress-breathe 1.15s ease-in-out infinite;
}
@keyframes deploy-progress-breathe {
  0%, 100% { opacity: 0.4; transform: scaleX(0.72); }
  50% { opacity: 1; transform: scaleX(1.2); }
}

.deploy-screen[data-phase="assets"] { --deploy-progress: 58%; }
.deploy-screen[data-phase="connect"] { --deploy-progress: 86%; }
.deploy-screen[data-phase="complete"] { --deploy-progress: 100%; }
.deploy-screen[data-phase="complete"] .deploy-status-pulse {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 182, 72, 0.72);
  animation: none;
}
.deploy-screen[data-phase="complete"] #deploy-back { opacity: 0; pointer-events: none; }
.deploy-screen[data-phase="failed"] { --deploy-progress: 100%; }
.deploy-screen[data-phase="failed"] .deploy-status,
.deploy-screen[data-phase="failed"] .deploy-status-pulse { color: #ff9c87; }
.deploy-screen[data-phase="failed"] .deploy-status-pulse {
  background: #ff735c;
  box-shadow: 0 0 12px rgba(255, 94, 72, 0.6);
  animation: none;
}
.deploy-screen[data-phase="failed"] .deploy-progress-fill {
  background: #ff735c;
  box-shadow: 0 0 12px rgba(255, 94, 72, 0.4);
}

.deploy-screen .ghost-btn {
  min-height: 44px;
  padding: 12px 19px;
  background: rgba(3, 7, 13, 0.46);
  border-color: rgba(206, 225, 237, 0.26);
  color: rgba(225, 235, 243, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.deploy-screen .ghost-btn:hover {
  color: #fff;
  border-color: rgba(255, 182, 72, 0.7);
  background: rgba(14, 18, 24, 0.66);
}
.deploy-screen .ghost-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.deploy-coordinate {
  position: absolute;
  z-index: 3;
  right: max(clamp(30px, 5vw, 76px), env(safe-area-inset-right, 0px));
  bottom: max(clamp(30px, 5vw, 66px), env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 5px;
  justify-items: end;
  color: rgba(207, 225, 236, 0.42);
  font-size: 8px;
  letter-spacing: 0.27em;
  text-transform: uppercase;
}
.deploy-coordinate b {
  color: rgba(94, 213, 246, 0.74);
  font-size: 9px;
  font-weight: 650;
}
.ghost-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 11px 22px;
  border-radius: 3px;
  font-family: var(--font);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--muted); }

/* Portrait crops the wide illustration around the operator and central bot,
   then moves the information into a bottom-safe stack. */
@media (orientation: portrait) {
  .deploy-keyart { object-position: 35% 44%; }
  .deploy-screen::before {
    background:
      linear-gradient(0deg,
        rgba(2, 5, 10, 0.98) 0%,
        rgba(2, 6, 12, 0.78) 29%,
        rgba(2, 7, 14, 0.12) 62%,
        rgba(2, 6, 12, 0.52) 100%),
      linear-gradient(90deg, rgba(3, 6, 12, 0.35), transparent 70%);
  }
  .deploy-inner {
    left: max(24px, env(safe-area-inset-left, 0px));
    right: max(24px, env(safe-area-inset-right, 0px));
    bottom: max(34px, calc(22px + env(safe-area-inset-bottom, 0px)));
    width: auto;
  }
  .deploy-arena { font-size: clamp(48px, 14vw, 84px); }
  .deploy-readout { width: 100%; margin-top: 28px; }
  .deploy-coordinate { display: none; }
}

/* A phone in playable landscape can be under 390px tall once browser chrome is
   present. Keep every control inside that real visual viewport. */
@media (max-height: 520px) and (orientation: landscape) {
  .deploy-keyart { object-position: 52% 48%; }
  .deploy-masthead {
    top: max(20px, env(safe-area-inset-top, 0px));
    left: max(28px, calc(14px + env(safe-area-inset-left, 0px)));
    right: max(28px, calc(14px + env(safe-area-inset-right, 0px)));
  }
  .deploy-inner {
    left: max(28px, calc(14px + env(safe-area-inset-left, 0px)));
    bottom: max(22px, calc(10px + env(safe-area-inset-bottom, 0px)));
    width: min(520px, 50vw);
  }
  .deploy-eyebrow { margin-bottom: 8px; }
  .deploy-arena { font-size: clamp(39px, 6vw, 68px); }
  .deploy-brief { display: none; }
  .deploy-readout { margin: 20px 0 14px; }
  .deploy-coordinate { display: none; }
}

@media (max-width: 520px) and (orientation: portrait) {
  .deploy-masthead {
    top: max(25px, env(safe-area-inset-top, 0px));
    left: max(24px, env(safe-area-inset-left, 0px));
    right: max(24px, env(safe-area-inset-right, 0px));
    letter-spacing: 0.22em;
  }
  .deploy-protocol { display: none; }
  .deploy-brief { max-width: 30ch; font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .deploy-keyart { transform: none; transition: opacity 0.2s linear; }
  .deploy-screen.art-ready .deploy-keyart { transform: none; }
  .deploy-status-pulse,
  .deploy-progress-fill::after { animation: none; }
  .deploy-progress-fill { transition-duration: 0.01ms; }
}

@media (max-width: 720px) {
  .hud-top { padding: 18px 20px; }
  .arena-card {
    right: 16px; left: 16px;
    width: auto;
    top: auto; bottom: 74px;
    transform: none;
    animation: none;
  }
  .card-name { font-size: 25px; }
}


/* Callsign, bottom-left. Its own corner: the header carries the wordmark and
   the world count, and stacking a third thing there pushed the layout around.
   Left rather than right so it never sits under the arena card. */
.callsign-box {
  position: absolute;
  left: 34px; bottom: 26px;
  width: 190px;
  z-index: 6;
  pointer-events: auto;
}
.callsign-label {
  display: block;
  margin-bottom: 6px;
  font-size: 8.5px; letter-spacing: 0.26em;
  color: rgba(150, 165, 190, 0.55);
}
/* The field and its reroll sit on one line, so the button reads as belonging
   to the name rather than as a separate action. */
.callsign-row { display: flex; gap: 6px; align-items: stretch; }

/* Quiet by default. It is an offer, not a call to action — the primary thing
   on this card is entering the arena. */
.callsign-reroll {
  flex: 0 0 auto;
  width: 32px;
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid rgba(255, 176, 60, 0.3);
  border-radius: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.callsign-reroll:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.callsign-field {
  width: 100%;
  padding: 7px 11px;
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid rgba(255, 176, 60, 0.3);
  border-radius: 3px;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px; letter-spacing: 0.1em;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.callsign-field::placeholder { color: rgba(160, 172, 196, 0.4); }
.callsign-field:focus { border-color: var(--accent); background: rgba(255, 176, 60, 0.1); }
.callsign-field.bad { border-color: #ff7a5c; }
.callsign-note {
  margin-top: 5px;
  font-size: 9px; letter-spacing: 0.03em;
  color: rgba(150, 165, 190, 0.45);
}
.callsign-note.bad { color: #ff8a72; }


/* The turned-away screen for touch devices used to live here. It is gone
   because the thing it apologised for — no touch controls — is now built; see
   public/js/game/touch.js. The globe below is what a phone gets instead, and
   the rules that make it work under a thumb are at the end of this file. */

/* Admin key entry. A real field rather than window.prompt(), which a browser
   silently suppresses forever once the player has ticked "prevent this page
   from creating additional dialogs" — and which cannot be typed into while the
   game holds pointer lock. */
.admin-panel.admin-unlock {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 1.2rem;
  min-width: 19rem;
}
.admin-panel.admin-unlock input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f2f4f8;
  font: inherit;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.6rem;
  width: 100%;
}
.admin-panel.admin-unlock input:focus {
  outline: none;
  border-color: var(--amber, #f0b350);
}
.admin-panel.admin-unlock .admin-unlock-row { display: flex; gap: 0.5rem; }
.admin-panel.admin-unlock .admin-unlock-row button {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f2f4f8;
  font: inherit;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}
.admin-panel.admin-unlock .admin-unlock-row button[data-act="ok"] {
  background: var(--amber, #f0b350);
  border-color: var(--amber, #f0b350);
  color: #10151d;
}


/* =========================================================================
   THE LANDING SCREEN ON A PHONE
   =========================================================================

   The globe is the first thing anyone sees, and on a phone it arrives in
   portrait, because that is how a phone is held when someone opens a link
   somebody sent them. So this screen has to work in portrait — the rotate
   prompt is for the game, never for the door.

   The desktop layout puts the arena card against the right edge and the
   callsign box in the bottom-left corner, which works while there is a metre
   of screen between them. At 390px they overlap each other and the globe.
   In portrait the card becomes a sheet that rises from the bottom, which is
   the shape a phone user already knows what to do with. */

@media (max-width: 760px) {
  .hud-top { padding: 16px 18px; }
  .brand-text { font-size: 10.5px; letter-spacing: 0.2em; }
  .brand-mark { width: 8px; height: 8px; }
  #total-players { font-size: 19px; }
  .global-count-label { font-size: 8.5px; letter-spacing: 0.18em; }

  /* Safe areas matter here too: in portrait the home indicator sits directly
     over the bottom of the sheet, which is where ENTER ARENA is. */
  .arena-card {
    right: 0; left: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: auto;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    padding: 24px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    animation: sheet-up 0.22s ease-out;
  }
  @keyframes sheet-up {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .card-name { font-size: 25px; }
  /* 22px of glyph in a 30px box is a close button that gets missed and closes
     nothing, on the one control whose whole job is getting out. */
  .card-close {
    top: 6px; right: 8px;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
  }
  .enter-btn { padding: 16px; }

  /* Out of the corner and up under the header: the corner is where the sheet
     now lives, and a name field buried under a panel is a name nobody sets. */
  .callsign-box {
    left: 18px; right: 18px;
    bottom: auto;
    top: calc(60px + env(safe-area-inset-top, 0px));
    width: auto;
    max-width: 240px;
  }
  .callsign-field { font-size: 16px; }
  .callsign-reroll { width: 40px; height: 40px; }

  .hud-bottom { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  /* The desktop hint names a mouse: drag, scroll, click. None of those are
     things a phone has, so the phone gets told what it does have. Set here
     rather than swapped in script — it is a string that belongs to a layout. */
  body.touch-mode .hint { font-size: 0; letter-spacing: 0; }
  body.touch-mode .hint::after {
    content: 'Drag to spin · Pinch to zoom · Tap a beacon';
    font-size: 10px;
    letter-spacing: 0.14em;
  }
  /* An open sheet covers the hint; leaving it visible underneath reads as a
     stray line of text stuck to the bottom of a panel. */
  body:has(.arena-card:not(.hidden)) .hud-bottom { opacity: 0; }
}

/* The globe canvas must never scroll or zoom the page under a drag. */
body.touch-mode #globe-canvas { touch-action: none; }
body.touch-mode {
  overscroll-behavior: none;
  /* iPhone Safari has no fullscreen outside <video>, so the address bar stays
     and the visual viewport shrinks under it. Small-viewport units are the only
     thing that describes "the part that is definitely on screen". */
  height: 100svh;
}
