/* LarpApp web styling.
   The custom properties mirror LarpColors in the Flutter app so both clients
   read as one product. Change a token here and in theme.dart together. */
:root {
  --bg: #08080c;
  --surface: #14141d;
  --surface-high: #1e1e2b;
  --border: #2a2a3a;
  --violet: #8b5cf6;
  --violet-deep: #6d28d9;
  --gold: #ffc542;
  --win: #3ddc97;
  --loss: #ff4d6d;
  --text: #ffffff;
  --muted: #8a8a9e;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

/* ---------------------------------------------------------------- header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 8px;
}
.logo { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; }
.logo em { font-style: normal; color: var(--violet); }

.nav { display: flex; gap: 6px; }
.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a.active {
  color: var(--violet);
  background: rgba(139, 92, 246, 0.16);
  border-color: var(--violet);
}

/* ------------------------------------------------------------------ type */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
}
.hero {
  font-size: clamp(40px, 9vw, 64px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  margin: 10px 0 0;
}
.hero-gold {
  font-size: clamp(34px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffe082, var(--gold), #e0a020);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2.section { font-size: 24px; font-weight: 800; margin: 4px 0 14px; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 14px; }

.stats { display: flex; justify-content: space-between; gap: 12px; }
.stat .value { font-size: 22px; font-weight: 800; }
.stat .label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: block;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--violet), var(--violet-deep));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.gold {
  background: linear-gradient(135deg, #ffe082, var(--gold), #e0a020);
  color: #211a04;
}
.btn.ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
}
.btn + .btn { margin-top: 10px; }

/* ---------------------------------------------------------------- inputs */
.field {
  width: 100%;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.field:focus { outline: none; border-color: var(--violet); }

/* ------------------------------------------------------------------ tier */
.tier {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  border: 1px solid;
}

/* ----------------------------------------------------------- leaderboard */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tab {
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.tab.active {
  color: var(--violet);
  border-color: var(--violet);
  background: rgba(139, 92, 246, 0.16);
}
.tab.active.gold {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(255, 197, 66, 0.14);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.row.me { border-color: var(--violet); background: rgba(139, 92, 246, 0.12); }
.row .pos { width: 30px; font-weight: 900; color: var(--muted); }
.row .pos.top { color: var(--gold); }
.row .flag { font-size: 18px; }
.row .who { flex: 1; min-width: 0; }
.row .who .name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .metric { text-align: right; }
.row .metric .n { font-weight: 900; }

/* ----------------------------------------------------------------- duels */
.duel { display: flex; gap: 12px; align-items: flex-start; }
.duel .vs { align-self: center; font-weight: 900; color: var(--muted); }
.side { flex: 1; min-width: 0; text-align: center; }
.photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-high);
  display: block;
}
.photo.mine { border: 2.5px solid var(--violet); }
.side.clickable { cursor: pointer; }
.side.clickable:hover .photo { border-color: var(--violet); }
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-high);
  overflow: hidden;
  margin: 10px 0 6px;
}
.bar > i { display: block; height: 100%; background: var(--muted); }
.bar > i.mine { background: var(--violet); }

.verdict { font-size: 96px; font-weight: 900; line-height: 1; }
.verdict.win { color: var(--win); }
.verdict.loss { color: var(--loss); }

.error {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--loss);
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.4);
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 40px auto;
  border: 3px solid var(--surface-high);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ladder {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* ------------------------------------------------------------------ ammo */
.ammo {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}
.ammo:hover { border-color: var(--violet); }
.ammo-thumb {
  width: 72px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-high);
  flex-shrink: 0;
}
.ammo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--muted);
}
.ammo-text { min-width: 0; }

.photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
}

/* ------------------------------------------------------------- live stage */
.stage-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-high);
}
.stage-still,
.stage-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stage-flag { font-size: 46px; }

/* ------------------------------------------------------------------ masks */
.masks {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  justify-content: center;
}
.mask-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  min-width: 60px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.mask-chip:hover { border-color: var(--violet); }
.mask-chip.active {
  border-color: var(--violet);
  background: rgba(139, 92, 246, 0.16);
  color: var(--text);
}
.mask-emoji { font-size: 24px; line-height: 1; }
.mask-label { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
