:root {
  --bg: #11160f;
  --panel: #1b2a1f;
  --panel-2: #223528;
  --ink: #e8e6d6;
  --muted: #9aa893;
  --accent: #c9a14a;
  --accent-2: #6fae6a;
  --danger: #d2683f;
  --hp: #c8503f;
  --safe-pad: env(safe-area-inset-bottom, 0px);

  /* In-game HUD scaling unit. interface.css sizes everything in multiples of --u.
     --u-base is the responsive base value, overridden per-device in mobile.css
     (full 1vw on portrait phones; capped on desktop and phone-landscape). */
  --u-base: 1vw;
  --u: var(--u-base);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.screen { position: fixed; inset: 0; }
.hidden { display: none !important; }

/* ---------------- Splash ---------------- */
.splash {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 80% at 50% -10%, #2a3d2c 0%, #11160f 60%),
    var(--bg);
}
.splash-dots { display: flex; gap: 8px; margin-top: 22px; }
.splash-dots span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2);
  opacity: .35; animation: splash-pulse 1s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: .15s; }
.splash-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes splash-pulse { 0%, 100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }

/* ---------------- Auth ---------------- */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 80% at 50% -10%, #2a3d2c 0%, #11160f 60%),
    var(--bg);
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid #314733;
  border-radius: 16px;
  padding: 26px 22px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.brand {
  font-size: 34px;
  margin: 0;
  text-align: center;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 2px 0 #00000060;
}
.tagline { text-align: center; color: var(--muted); margin: 4px 0 18px; font-size: 14px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #314733;
  background: transparent; color: var(--muted); font-size: 15px; cursor: pointer;
}
.tab.active { background: var(--panel-2); color: var(--ink); border-color: var(--accent); }
#auth-form { display: flex; flex-direction: column; gap: 12px; }
#auth-form input[type=text],
#auth-form input[type=password] {
  padding: 13px 14px; border-radius: 10px; border: 1px solid #314733;
  background: #0e130d; color: var(--ink); font-size: 16px;
}
.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
/* Google sign-in */
.google-auth { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth-or { width: 100%; text-align: center; border-top: 1px solid #ffffff22; line-height: 0; }
.auth-or span { background: var(--panel, #1c2418); padding: 0 10px; color: var(--muted); font-size: 13px; position: relative; top: -1px; }
#google-btn { min-height: 40px; display: flex; justify-content: center; color-scheme: light; }
.primary {
  padding: 14px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(#d8b25a, #b8862f); color: #1a1306; font-weight: 700; font-size: 16px;
}
.primary:active { transform: translateY(1px); }
.error { color: var(--danger); font-size: 14px; min-height: 18px; text-align: center; margin: 2px 0 0; }
.muted { color: var(--muted); }

/* ---------------- Map canvas ---------------- */
#game-screen { background: #0a0d08; }
#game { position: absolute; inset: 0; }
#game canvas { display: block; }
