/* Globusjagd – round, flat, comic look: deep space, glowing planet, soft shadows, chunky rounded UI.
   Own style (inspired by animated explainer videos), all shapes drawn here. */

:root {
  --space-1: #0b1628;
  --space-2: #17304f;
  --heat-0: #eaf3ff;
  --heat-1: #a7d8ff;
  --heat-2: #ffe36e;
  --heat-3: #ffae42;
  --heat-4: #ff6b4a;
  --heat-5: #e0283e;
  --found: #ffd23f;
}

/* this game always uses the dark space look (also in light mode), like a planetarium */
body.space {
  --bg: var(--space-1);
  --card: #13243d;
  --text: #f0f4ef;
  --muted: #b4cded;
  --line: #27405f;
  --accent: #ffd23f;
  --on-accent: #0b1628;
  --highlight: #344966;
  --track: #1b3150;
  --shadow: 0 10px 30px rgb(0 0 0 / 35%);
  color-scheme: dark;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, #cfe3ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 40%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 22%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 64%, #cfe3ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 8% 86%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 92%, #fff 50%, transparent 51%),
    radial-gradient(1200px 800px at 50% 25%, var(--space-2), var(--space-1) 70%) fixed;
  background-size: 420px 420px, 380px 380px, 460px 460px, 300px 300px, 520px 520px, 350px 350px, 400px 400px, 330px 330px, auto;
}
body.space h1 span { color: var(--accent); background: none; text-shadow: 0 0 22px rgb(255 210 63 / 45%); }

/* ---------- the planet ---------- */
.globe-wrap { position: relative; width: 100%; max-width: 480px; margin: 4px auto 0; container-type: inline-size; }
#globe {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  touch-action: none;
  cursor: grab;
  animation: float 6s ease-in-out infinite;
}
/* soft shadow on the "ground": shrinks when the planet floats up */
.globe-wrap::before {
  content: "";
  position: absolute; left: 20cqw; top: 88cqw; width: 60cqw; height: 6cqw;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 45%), transparent);
  animation: ground 6s ease-in-out infinite;

}
.globe-wrap.zoomed::before { visibility: hidden; }   /* the animation owns opacity */
@keyframes float { 50% { transform: translateY(-2.2cqw); } }
@keyframes ground { 50% { transform: scaleX(0.82); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { #globe, .globe-wrap::before { animation: none; } }
#globe:active { cursor: grabbing; }

.zoom { position: absolute; right: 4px; bottom: 44px; display: grid; gap: 8px; }
.zoom button {
  width: 44px; height: 44px;
  font: 800 1.5rem/1 "Outfit", sans-serif;
  color: var(--space-1);
  background: #f0f4ef;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 0 #9fb3cc, 0 8px 16px rgb(0 0 0 / 35%);
  cursor: pointer;
}
.zoom button:active { transform: translateY(3px); box-shadow: 0 1px 0 #9fb3cc; }

.scale { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 6px; font-size: 0.8rem; color: var(--muted); }
.scale i {
  width: 160px; height: 10px; border-radius: 99px;
  background: linear-gradient(90deg, var(--heat-0), var(--heat-1), var(--heat-2), var(--heat-3), var(--heat-4), var(--heat-5));
}

/* ---------- guessing ---------- */
/* keep the game (and its suggestion list) above the footer, also with the Halloween layers */
html body.space .app { position: relative; z-index: 2; }
.guess { display: flex; gap: 8px; margin-top: 6px; }
.combo { position: relative; flex: 1; }
#guessInput {
  width: 100%;
  padding: 14px 18px;
  font: 600 1.1rem "DM Sans", sans-serif;
  color: var(--text);
  background: #0f1f36;
  border: 3px solid #27405f;
  border-radius: 999px;
  outline: none;
}
#guessInput:focus { border-color: var(--accent); }
.guess .btn { border-radius: 999px; padding: 0 22px; font-size: 1.05rem; box-shadow: 0 4px 0 #c79c12; }
.guess .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c79c12; }

/* opens upwards over the globe: never covers the footer, and on phones the keyboard sits below the input */
.suggest {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); z-index: 20;
  max-height: min(340px, 55vh); overflow-y: auto; overscroll-behavior: contain;
  list-style: none; margin: 0; padding: 6px;
  background: #13243d; border: 2px solid #27405f; border-radius: 18px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 45%);
}
.suggest li { padding: 10px 14px; border-radius: 12px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: #1f3a5e; }
.suggest li small { color: var(--muted); margin-left: 6px; }

/* ---------- list of guesses ---------- */
.guesses { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.guesses li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #13243d;
  border-radius: 999px;
  box-shadow: 0 3px 0 #0a1526;
}
.guesses li .dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 -3px 0 rgb(0 0 0 / 18%); }
.guesses li b { font-weight: 700; }
.guesses li small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.guesses li .km { font: 800 1rem "Outfit", sans-serif; }
.guesses li.last { outline: 2px solid var(--accent); }

.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.9rem; }
.heat-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.heat-legend .h0 { background: var(--heat-0); }
.heat-legend .h2 { background: var(--heat-2); }
.heat-legend .h4 { background: var(--heat-4); }
.heat-legend .h5 { background: var(--heat-5); }

.result {
  margin-top: 14px;
  padding: 22px 18px;
  text-align: center;
  background: #13243d;
  border-radius: 28px;
  box-shadow: 0 6px 0 #0a1526, 0 16px 40px rgb(0 0 0 / 35%);
}
.result h2 { font: 800 1.6rem "Outfit", sans-serif; margin: 0 0 4px; }
.result .country { font: 900 2.2rem "Outfit", sans-serif; color: var(--found); text-shadow: 0 0 24px rgb(255 210 63 / 40%); }
.result .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.result .btn { border-radius: 999px; }
