/* ============================================================
   GamePlatform — platform.css
   Shared styles for all platform pages (auth, lobby, settings).
   Game pages use base.css from the POC for light/dark card UI.
   ============================================================ */

/* === TOKENS === */
:root {
  --primary-1: #60a5fa;
  --primary-2: #2563eb;
  --primary-3: #0ea5e9;
  --bg: #070c14;
  --surface: #0e1522;
  --surface-alt: #121b2a;
  --text: #eaf2ff;
  --muted: rgba(234,242,255,.82);
  --muted-dim: rgba(234,242,255,.55);
  --border: #223148;
  --border-dim: rgba(34,49,72,.6);
  --accent: var(--primary-2);
  --gold-1: #f7d77a;
  --gold-2: #d4af37;
  --gold-3: #b88a00;
  --gold-border: #9a7720;
  --btn-radius: 16px;
  --card-radius: 16px;
  --danger: #ef4444;
  --success: #10b981;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--primary-1); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === STARFIELD BACKGROUND (warm glow, locked) === */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 12% 18%, rgba(255,196,99,.16), transparent 60%),
    radial-gradient(1100px 700px at 88% 12%, rgba(240,99,132,.12), transparent 60%),
    radial-gradient(1200px 800px at 50% 120%, rgba(255,140,66,.14), transparent 60%),
    linear-gradient(180deg, #0b0a0f, #120e14);
}

/* Viewport gold frame */
body::after {
  content: "";
  position: fixed;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(212,175,55,.3);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.03),
    inset 0 0 40px rgba(212,175,55,.06);
  pointer-events: none;
  z-index: 9999;
}

/* === LAYOUT === */
.platform-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}
.platform-wrap.narrow {
  max-width: 480px;
}
.platform-wrap.mid {
  max-width: 720px;
}

/* === HEADER / NAV === */
.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid color-mix(in oklab, var(--primary-2), black 55%);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 24px rgba(0,0,0,.35);
  margin-bottom: 16px;
}
.platform-logo {
  color: var(--gold-2);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
}
.platform-logo:hover { text-decoration: none; filter: brightness(1.1); }
.platform-nav { display: flex; gap: 8px; align-items: center; }

/* Gold nav pills */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1a1200;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .08s ease, filter .15s ease;
  text-decoration: none;
}
.nav-pill:hover { transform: translateY(-1px); filter: brightness(1.06); text-decoration: none; }
.nav-pill-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-2);
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  transition: border-color .15s ease, color .15s ease;
  text-decoration: none;
}
.nav-pill-ghost:hover { border-color: var(--gold-2); color: var(--gold-1); text-decoration: none; }

/* Breadcrumb */
.breadcrumb {
  font-size: 12px;
  color: var(--muted-dim);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { margin: 0 5px; opacity: .5; }

/* === CARDS / SURFACES === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 30px rgba(0,0,0,.4);
}
.card-label {
  color: var(--muted-dim);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* === AUTH CARD === */
.auth-card {
  background: rgba(14,21,34,.92);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 28px 28px 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 20px 50px rgba(0,0,0,.5);
}
.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.auth-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* === FORM ELEMENTS === */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7,12,20,.85);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
  appearance: none;
}
.field input:focus,
.field select:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.field input::placeholder { color: var(--muted-dim); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint {
  font-size: 11px;
  color: var(--muted-dim);
  margin-top: 4px;
}
.field-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}
.field-error.show { display: block; }

/* Password strength bar */
.strength-bar {
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  margin-top: 6px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width .3s ease, background .3s ease;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
  width: 100%;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  color: #f8fbff;
  border-color: color-mix(in oklab, var(--primary-2), black 20%);
  background:
    radial-gradient(120% 180% at 50% -80%, rgba(255,255,255,.4), transparent 55%),
    linear-gradient(180deg, var(--primary-1), var(--primary-2) 55%, var(--primary-3));
  box-shadow:
    0 8px 24px rgba(16,118,255,.3),
    inset 0 1px 0 color-mix(in oklab, var(--primary-2), white 25%);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 32px rgba(16,118,255,.4), inset 0 1px 0 color-mix(in oklab, var(--primary-2), white 30%);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  color: var(--text);
  background: linear-gradient(180deg, #1c2437, #121a2a);
  border-color: #2a3a63;
}
.btn-secondary:hover { filter: brightness(1.08); text-decoration: none; }

.btn-ghost {
  color: var(--primary-1);
  background: transparent;
  border-color: color-mix(in oklab, var(--primary-2), black 50%);
}
.btn-ghost:hover { border-color: var(--primary-2); text-decoration: none; }

.btn-oauth {
  background: rgba(255,255,255,.04);
  border-color: var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.btn-oauth:hover { background: rgba(255,255,255,.07); text-decoration: none; }

.btn-sm { padding: 7px 14px; font-size: 13px; width: auto; }

.btn:disabled, .btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* OAuth row */
.oauth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.divider-line { flex: 1; height: 1px; background: var(--border-dim); }
.divider-text { font-size: 12px; color: var(--muted-dim); }

/* Link row */
.link-row {
  text-align: center;
  font-size: 13px;
  color: var(--muted-dim);
  margin-top: 16px;
}
.link-row a { color: var(--primary-1); }

/* === ALERTS === */
.alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-success {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.3);
  color: #6ee7b7;
}
.alert-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
}
.alert-info {
  background: rgba(37,99,235,.1);
  border: 1px solid rgba(37,99,235,.3);
  color: #93c5fd;
}

/* === ANNOUNCE BANNER === */
.announce {
  background: rgba(255,255,255,.025);
  border: 1px solid color-mix(in oklab, var(--primary-2), black 55%);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* === GRIDS === */
.g2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.g4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 10px; }

/* === FOOTER === */
.platform-footer {
  text-align: center;
  padding: 16px;
  color: var(--muted-dim);
  font-size: 12px;
  margin-top: auto;
}
.platform-footer a { color: var(--gold-2); font-weight: 600; }

/* === SPINNER === */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === UTILITY === */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-dim { color: var(--muted-dim); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .auth-card { padding: 20px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .oauth-row { grid-template-columns: 1fr; }
  body::after { display: none; }
}
