: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 {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.deploy-inner { text-align: center; }
.deploy-arena {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.deploy-status {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 34px;
}
.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); }

@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);
}
.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; }
