: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.
     1vw so the chrome scales with screen width on a portrait phone, capped at 5px
     so it stops growing once the screen is wider than a phone (500px+) — tablets,
     foldables and desktop all share the 5px ceiling. The cap MUST be unconditional:
     when it was applied per-device in mobile.css there was a cliff at the
     breakpoint, and the Fold 5's ~900px inner screen straddled it. mobile.css
     overrides this for phone-landscape. */
  --u-base: min(1vw, 5px);
  --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;
  /* The HUD is sized off the viewport (--u), so the device's font-size / text-scaling
     accessibility setting must not multiply it on top of that — Android's text autosizing
     otherwise inflates every label and overflows the chrome (pills wrap, toasts collide).
     100% pins text to the authored size; pinch-zoom is unaffected (and already disabled
     by the viewport meta). */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.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; }
.language-picker { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); font-size:13px; }
.language-picker select { min-width:170px; padding:9px 10px; border:1px solid #314733; border-radius:9px; background:#0e130d; color:var(--ink); font:inherit; }
.auth-language { margin:-5px 0 14px; }
.settings-language { padding:8px 0 10px; border-bottom:1px solid #ffffff12; margin-bottom:8px; }
html[dir="rtl"] .language-picker, html[dir="rtl"] .remember { direction:rtl; }
.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; }
/* Community link — sits under the sign-in options, quiet until hovered. */
.auth-discord {
  margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 10px; border: 1px solid #314733;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.auth-discord svg { width: 18px; height: 18px; }
.auth-discord:hover { color: #fff; border-color: #5865f2; background: #5865f21a; }
/* Native (Capacitor) sign-in button — the GIS web button can't render in a WebView. */
.google-native { display: inline-flex; align-items: center; gap: 10px; width: 260px; max-width: 100%;
  justify-content: center; padding: 11px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: #1a73e8; color: #fff; font-size: 15px; font-weight: 600; }
.google-native:disabled { opacity: .6; cursor: default; }
.google-native .g-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px;
  height: 22px; border-radius: 50%; background: #fff; color: #1a73e8; font-weight: 700; font-size: 14px; }
.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); }
.secondary {
  padding: 12px; border: 1px solid #314733; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); color: var(--ink); font-weight: 600; font-size: 15px;
}
.secondary:active { transform: translateY(1px); }
/* Subtle cancel/back action (e.g. the submenu "Back" buttons): outlined, muted, no fill. */
.ghost {
  padding: 12px; border: 1px solid #314733; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 15px;
}
.ghost:hover { color: var(--ink); border-color: #46603f; }
.ghost:active { transform: translateY(1px); }
.boost-card { display: flex; flex-direction: column; gap: 12px; text-align: center; max-width: 360px; }
.boost-card h2 { color: var(--accent); }
.boost-card p { margin: 0; line-height: 1.5; }
/* Supporter benefits list (sub-modal): left-aligned inside the centred card; the leading
   emoji on each line acts as the marker, so no bullet. */
.sub-benefits { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column;
  gap: 8px; text-align: left; max-width: 300px; color: var(--muted); line-height: 1.45; }
.sub-benefits li { padding-left: 2px; }
/* Blue star marker — matches the in-game supporter nameplate colour (player.js SUPPORTER_NAME_COLOR). */
.sub-benefits .star-blue { color: #4ea8ff; }
.sub-benefits-note { font-size: 12px; opacity: .85; }
#boost-status { color: var(--accent-2); font-weight: 600; min-height: 1.2em; }
.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; }
