/* ============================================================
   MapMaster | base.css
   Reset, body, typography, shared button styles, scrollbar,
   screen base layout, screen transitions, hidden utility.
   ============================================================ */

/* ============================================================
   HERO MAP BACKGROUND
   ============================================================ */
#heroMapBg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.06;
  pointer-events: none;
  overflow: hidden;
}

#heroMapBg svg {
  width: 120%;
  height: 120%;
  animation: mapDrift 40s linear infinite alternate;
}

/* countrySelectScreen needs flex-start + scroll since it has many items */
#countrySelectScreen {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 32px;
  padding-bottom: 28px;
}

#countrySelectScreen .hero-block {
  margin-bottom: 24px;
}

/* Ensure start screen content sits above the bg */
#startScreen { position: relative; }
#startScreen .hero-block,
#startScreen #scopeSection { position: relative; z-index: 1; }


/* ============================================================
   BREADCRUMB
   ============================================================ */
#breadcrumb,
#breadcrumbContinent,
#breadcrumbSetup {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.bc-item { color: var(--text-muted); }
.bc-sep  { color: var(--text-faint); margin: 0 2px; }
.bc-active {
  color: var(--coral);
  font-weight: 600;
}
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 20% 20%, rgba(232,96,74,0.08), transparent),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(232,96,74,0.05), transparent),
    radial-gradient(ellipse 50% 40% at 60% 10%, rgba(240,130,109,0.04), transparent);
  background-size: 200% 200%;
  animation: bgDrift 18s ease infinite;
  color: var(--text-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes bgDrift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -1.5px;
  line-height: 1.1;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.4px;
}

h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* ============================================================
   HIDDEN UTILITY
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   SCREEN BASE
   ============================================================ */
#startScreen,
#countrySelectScreen,
#continentSelectScreen,
#setupScreen,
#challengeSettings,
#winScreen,
#loseScreen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  animation: screenFade 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#gameScreen {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  animation: screenFade 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes screenFade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SCREEN TRANSITIONS
   ============================================================ */
.screen-exit  { animation: screenExit  0.25s ease forwards; }
.screen-enter { animation: screenEnter 0.3s  cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes screenExit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

@keyframes screenEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SHARED HERO BLOCK
   ============================================================ */
.hero-block {
  text-align: center;
  margin-bottom: 64px;
}

.hero-block h1       { margin-bottom: 14px; }
.hero-block h1 span  { color: var(--coral); }

.hero-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.hero-divider {
  width: 40px;
  height: 3px;
  background: var(--coral);
  border-radius: var(--r-full);
  margin: 20px auto 0;
}

/* ============================================================
   BUTTONS — GLOBAL BASE
   ============================================================ */
button {
  padding: 11px 22px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-body);
  background: var(--surface);
  border: 1.5px solid var(--border-med);
  border-radius: var(--r-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

button:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

button:active { transform: scale(0.96); }

button.selected {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
  box-shadow: var(--shadow-coral);
}

button:disabled,
button[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* ============================================================
   BACK BUTTON
   ============================================================ */
.back-btn {
  background: transparent;
  border: 1.5px solid var(--border-med);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.back-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 99px; }