/* ---------- Base ---------- */
* { box-sizing: border-box; }

/* Make the [hidden] attribute beat our display:flex/display:block rules. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000011;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#globe {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: grab;
}
#globe:active { cursor: grabbing; }

/* ---------- Top bar ---------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: #7fffd4;
  color: #001a14;
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 100;
  border-bottom: 1px solid #001a14;
  text-transform: uppercase;
}

.top-bar-button {
  background: transparent;
  border: none;
  color: #001a14;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  text-transform: uppercase;
}
.top-bar-button:hover { text-decoration: underline; }

.top-bar-title { flex: 1; text-align: center; }
.top-bar-date { font-weight: normal; }

/* ---------- Menu dropdown ---------- */
.menu-dropdown {
  position: fixed;
  top: 40px;
  left: 14px;
  background: #000011;
  border: 1px solid #7fffd4;
  padding: 8px;
  z-index: 150;
  font-family: "Courier New", Courier, monospace;
  min-width: 140px;
}
.menu-dropdown button {
  background: transparent;
  color: #7fffd4;
  border: none;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.menu-dropdown button:hover {
  background: #7fffd4;
  color: #001a14;
}

/* ---------- Score box ---------- */
.score-box {
  position: fixed;
  top: 52px;
  left: 14px;
  background: #000011;
  border: 2px solid #7fffd4;
  color: #7fffd4;
  padding: 6px 10px 8px;
  font-family: "Courier New", Courier, monospace;
  text-align: center;
  z-index: 80;
  min-width: 72px;
}
.score-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: bold;
}
.score-value {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Prompt box ---------- */
.prompt-box {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  background: #7a7a2e;
  color: #fff;
  padding: 12px 22px 14px;
  font-family: "Courier New", Courier, monospace;
  text-align: center;
  z-index: 80;
  max-width: min(640px, 90vw);
  border: 1px solid #4d4d1c;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.prompt-prefix {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.85;
}
.prompt-text {
  font-size: 22px;
  font-weight: bold;
  margin-top: 4px;
  line-height: 1.25;
}

/* ---------- Reveal overlay ---------- */
.reveal-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 17, 0.92);
  border: 2px solid #7fffd4;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  padding: 18px 26px 22px;
  text-align: center;
  z-index: 200;
  max-width: min(560px, 92vw);
  min-width: 320px;
  box-shadow: 0 0 24px rgba(127, 255, 212, 0.18);
}
.reveal-name {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: #fff;
}
.reveal-line {
  font-size: 16px;
  margin: 4px 0;
  letter-spacing: 0.5px;
}
.reveal-distance { color: #7fffd4; }
.reveal-score    { color: #7fffd4; }
.reveal-message {
  margin-top: 12px;
  font-style: italic;
  color: #ffa64d;
  font-size: 16px;
  line-height: 1.35;
}
.next-button {
  margin-top: 16px;
  background: #7fffd4;
  color: #001a14;
  border: none;
  padding: 8px 22px;
  font-family: inherit;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.next-button:hover { background: #aaffe6; }

/* ---------- Polaroid photo card ---------- */
.photo-card {
  position: fixed;
  top: 90px;
  right: 36px;
  background: #fafafa;
  padding: 14px 14px 44px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 110;
  --tilt: -4deg;
  transform: rotate(var(--tilt));
  animation: photo-pop 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.photo-img {
  display: block;
  width: 280px;
  height: 280px;
  object-fit: cover;
  background: #222;
}
.photo-caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: #333;
  font-family: "Marker Felt", "Comic Sans MS", "Courier New", cursive;
  font-size: 16px;
  letter-spacing: 0.5px;
}
@keyframes photo-pop {
  from { opacity: 0; transform: rotate(var(--tilt)) translateY(-14px) scale(0.85); }
  to   { opacity: 1; transform: rotate(var(--tilt)) translateY(0) scale(1); }
}

/* ---------- Floating tap label on the globe ---------- */
.globe-tooltip-outer {
  pointer-events: none;
  user-select: none;
}
.globe-tooltip-inner {
  position: absolute;
  left: 0;
  bottom: 12px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Courier New", Courier, monospace;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow:
    0 1px 0 #000,
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 16px rgba(0, 0, 0, 0.85);
  animation: tap-label-pop 220ms ease-out both;
}
.globe-tooltip-tap   { color: #7fffd4; }
.globe-tooltip-snark { color: #7fffd4; }

@keyframes tap-label-pop {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Final overlay ---------- */
.final-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 17, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", Courier, monospace;
  z-index: 300;
  padding: 20px;
  text-align: center;
}
.final-title {
  font-size: 26px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #7fffd4;
  margin-bottom: 24px;
}
.final-score-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}
.final-score-label {
  font-size: 12px;
  letter-spacing: 2px;
  color: #7fffd4;
  text-transform: uppercase;
}
.final-score-number {
  font-size: 64px;
  font-weight: bold;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.final-score-max {
  font-size: 24px;
  color: #7fffd4;
  font-weight: normal;
}
.final-message {
  font-style: italic;
  color: #ffa64d;
  font-size: 20px;
  max-width: 560px;
  line-height: 1.4;
  margin-bottom: 28px;
}
.final-reset-button {
  background: transparent;
  color: #7fffd4;
  border: 2px solid #7fffd4;
  padding: 10px 24px;
  font-family: inherit;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}
.final-reset-button:hover {
  background: #7fffd4;
  color: #001a14;
}

.final-scores-list {
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 22px;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.4;
}

.final-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.share-button {
  background: #7fffd4;
  color: #001a14;
  border: none;
  padding: 10px 24px;
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}
.share-button:hover { background: #aaffe6; }

.share-feedback {
  margin-top: 14px;
  font-family: "Courier New", Courier, monospace;
  color: #7fffd4;
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* ---------- Error overlay ---------- */
.error-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 17, 0.95);
  z-index: 400;
  padding: 20px;
}
.error-content {
  max-width: 520px;
  border: 2px solid #7fffd4;
  padding: 28px;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  text-align: center;
}
.error-content h2 {
  color: #7fffd4;
  margin-top: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 18px;
}
.error-content p { margin: 10px 0; line-height: 1.4; }
.error-content pre {
  background: #000;
  color: #7fffd4;
  padding: 10px 14px;
  border: 1px solid #7fffd4;
  overflow-x: auto;
  text-align: left;
  margin: 6px 0;
}
.error-content code {
  background: #000;
  color: #7fffd4;
  padding: 1px 5px;
}
.error-file-button {
  background: #7fffd4;
  color: #001a14;
  border: none;
  padding: 10px 22px;
  font-family: inherit;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
}
.error-file-button:hover { background: #aaffe6; }
.error-file-status {
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}
.error-divider {
  color: #7fffd4;
  margin: 22px 0 12px;
  font-size: 12px;
  letter-spacing: 1.5px;
  opacity: 0.75;
}
.error-hint { font-size: 13px; opacity: 0.8; }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .prompt-text { font-size: 18px; }
  .prompt-box { top: 48px; padding: 10px 16px; }
  .reveal-name { font-size: 18px; }
  .reveal-line { font-size: 14px; }
  .final-title { font-size: 20px; }
  .final-score-number { font-size: 48px; }
}
