@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Russo+One&family=Chakra+Petch:wght@300;400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Reset & Root ─────────────────────────────────────────────────────── */
:root {
  --bg:          #060910;
  --surface:     #0e1118;
  --card:        #141820;
  --border:      rgba(255,255,255,0.07);
  --gold:        #f0b429;
  --gold2:       #c87d10;
  --glow:        rgba(240,180,41,0.28);
  --red:         #e63c3c;
  --green:       #22c55e;
  --white:       #eef0f4;
  --muted:       #5a607a;
  --text2:       #9097b0;
  --font-head:   'Russo One', 'Bebas Neue', sans-serif;
  --font-body:   'Chakra Petch', 'DM Sans', sans-serif;
  --neon-gold:   0 0 8px rgba(240,180,41,.8), 0 0 22px rgba(240,180,41,.4);
  --neon-gold-sm:0 0 6px rgba(240,180,41,.55);
  --transition:  .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

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

/* ── Login Screen ──────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(240,180,41,.13) 0%, transparent 60%),
    var(--bg);
}

.login-box {
  text-align: center;
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 90%;
}

.trophy {
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 0 28px rgba(240,180,41,.7));
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box h1 {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 8vw, 3.8rem);
  line-height: .92;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}

.login-box h1 em { color: var(--gold); font-style: normal; }

.login-box > p {
  color: var(--text2);
  font-size: .94rem;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  background: #fff;
  color: #1f2328;
  border: none;
  border-radius: 8px;
  padding: .85rem 1.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s;
  box-shadow: 0 2px 14px rgba(0,0,0,.4);
  position: relative; overflow: hidden;
}
.google-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -110%;
  width: 65%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg);
  transition: left .5s ease;
  pointer-events: none;
}
.google-btn:hover::before { left: 160%; }
.google-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(0,0,0,.5); }
.google-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.login-note {
  margin-top: 1.5rem;
  font-size: .76rem;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ── Nav ────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.5rem;
  background: rgba(6,9,16,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: var(--font-head);
  font-size: 1.4rem;
  letter-spacing: .1em;
  color: var(--gold);
  text-shadow: var(--neon-gold-sm);
}
.nav-brand span { color: var(--white); text-shadow: none; }

.nav-links { display: flex; gap: .25rem; }

.nav-tab {
  background: none; border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .85rem; font-weight: 500;
  cursor: pointer;
  padding: .4rem .9rem;
  border-radius: 6px;
  transition: all .18s;
  letter-spacing: .03em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.nav-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-tab:hover { color: var(--white); background: var(--card); }
.nav-tab.active { color: var(--gold); text-shadow: var(--neon-gold-sm); }
.nav-tab.danger { color: var(--red); }
.nav-tab.danger:hover { background: rgba(230,60,60,.1); }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.user-chip {
  display: flex; align-items: center; gap: .55rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: .28rem .85rem .28rem .3rem;
  font-size: .82rem; color: var(--text2);
}

.user-avatar-img {
  width: 28px; height: 28px;
  border-radius: 50%; object-fit: cover;
}
.user-avatar-img.sm { width: 34px; height: 34px; }

.user-avatar-fallback {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold2);
  display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 700; font-size: .75rem;
}
.user-avatar-fallback.sm { width: 34px; height: 34px; font-size: .85rem; }

/* ── Main wrap ──────────────────────────────────────────────────────────── */
.main-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 4rem;
}

.page-wrap {
  width: 100%;
  max-width: 980px;
  padding: 2rem 1.5rem;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1.2rem;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 1rem;
}
.alert-success { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.alert-error   { background: rgba(230,60,60,.12);  color: var(--red);   border: 1px solid rgba(230,60,60,.25); }

/* ── Spin page ───────────────────────────────────────────────────────────── */
.spin-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 680px) { .spin-layout { grid-template-columns: 1fr; } }

.wheel-col { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }

.wheel-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

canvas {
  border-radius: 50%;
  box-shadow:
    0 0 0 4px var(--surface),
    0 0 0 7px var(--gold2),
    0 0 0 10px rgba(240,180,41,.12),
    0 0 60px rgba(240,180,41,.38),
    0 0 110px rgba(240,180,41,.1);
  display: block;
  transition: box-shadow var(--transition);
}

.pointer {
  position: absolute;
  top: 50%; right: -28px;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-right: 30px solid var(--gold);
  filter: drop-shadow(0 0 10px rgba(240,180,41,.9)) drop-shadow(0 0 3px #000);
  z-index: 5;
}

.hub {
  position: absolute;
  width: 48px; height: 48px;
  background: radial-gradient(circle at 35% 35%, #ffe88a, var(--gold2));
  border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 18px var(--glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  cursor: pointer; z-index: 5;
  transition: transform .15s;
  font-family: sans-serif;
}
.hub:hover:not(:disabled) { transform: scale(1.1); }
.hub:disabled { opacity: .4; cursor: not-allowed; }

/* Budget badge */
.budget-badge {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1.4rem;
  width: 100%;
}
.budget-item { text-align: center; flex: 1; }
.budget-item .val {
  font-family: var(--font-head);
  font-size: 2rem; line-height: 1; color: var(--gold);
}
.budget-item .lbl { font-size: .68rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.budget-sep { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }

/* Spin button */
.spin-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #060910;
  border: none;
  font-family: var(--font-head);
  font-size: 1.55rem; letter-spacing: .1em;
  padding: .8rem;
  cursor: pointer; border-radius: 8px;
  transition: all .22s;
  box-shadow: 0 4px 18px rgba(240,180,41,.35);
  position: relative; overflow: hidden;
}
.spin-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -110%;
  width: 65%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.38), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
  pointer-events: none;
}
.spin-btn:hover:not(:disabled)::before { left: 160%; }
.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(240,180,41,.65), 0 0 0 2px rgba(240,180,41,.25);
}
.spin-btn:active:not(:disabled) { transform: translateY(0); }
.spin-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.spin-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.hint { font-size: .75rem; color: var(--muted); text-align: center; letter-spacing: .04em; }

/* Info column */
.info-col { display: flex; flex-direction: column; gap: 1.2rem; }
.section-label { font-size: .68rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }

/* Result card */
.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  opacity: 1;
  position: relative; overflow: hidden;
}
.result-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
/* Gold pulse when new result lands */
@keyframes resultPulse {
  0%   { box-shadow: 0 0 0 0 rgba(240,180,41,0); border-color: rgba(240,180,41,.7); transform: scale(0.97); }
  30%  { box-shadow: 0 0 32px 8px rgba(240,180,41,.38); transform: scale(1.025); }
  65%  { box-shadow: 0 0 16px 2px rgba(240,180,41,.18); }
  100% { box-shadow: 0 0 0 0 rgba(240,180,41,0); border-color: rgba(255,255,255,.07); transform: scale(1); }
}
.result-card.show { animation: resultPulse 1s cubic-bezier(.22,.9,.32,1) forwards; }
.res-flag { display: flex; align-items: center; justify-content: center; margin-bottom: .3rem; min-height: 54px; }
.res-lbl  { font-size: .68rem; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.res-country { font-family: var(--font-head); font-size: 2.4rem; color: var(--gold); line-height: 1; text-shadow: var(--neon-gold-sm); }
.res-meta { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* History list (spin page) */
.history-list {
  display: flex; flex-direction: column; gap: .45rem;
  max-height: 310px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.history-item {
  display: flex; align-items: center; gap: .7rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: .6rem .85rem;
  font-size: .85rem;
  animation: fadeSlide .3s ease;
  transition: border-color .18s, background .18s;
}
.history-item:hover {
  border-color: rgba(240,180,41,.2);
  background: rgba(255,255,255,.04);
}
@keyframes fadeSlide { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:none; } }
.history-flag    { font-size: 1.25rem; }
.history-country { font-weight: 600; flex: 1; }
.history-time    { font-size: .72rem; color: var(--muted); }

/* ── History page table ──────────────────────────────────────────────────── */
.history-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead tr { border-bottom: 1px solid var(--border); }
th { text-align:left; font-size:.68rem; letter-spacing:.15em; text-transform:uppercase; color:var(--muted); padding:.7rem 1rem; }
td { padding:.72rem 1rem; border-bottom:1px solid rgba(255,255,255,.03); }
tbody tr:hover { background: rgba(255,255,255,.025); }
.muted { color: var(--text2); }
.sm    { font-size: .8rem; }
.fw-bold { font-weight: 600; }

.badge-spin {
  font-size: .7rem; padding: .15rem .5rem; border-radius: 4px;
  background: rgba(240,180,41,.12); color: var(--gold); font-weight: 600;
}
.badge-admin {
  font-size: .62rem; padding: .1rem .4rem; border-radius: 3px;
  background: rgba(240,180,41,.15); color: var(--gold); font-weight: 700;
  vertical-align: middle; margin-left: .35rem;
}

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-grid { display: grid; gap: 1.5rem; }
.admin-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem;
}
.admin-card h3 {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .75rem;
}

.user-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 0; border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-avatar-wrap { flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name  { font-weight: 600; font-size: .9rem; }
.user-email { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.spin-summary { text-align: center; min-width: 56px; }
.spin-remaining { font-family: var(--font-head); font-size: 1.5rem; color: var(--gold); }
.spin-total { font-size: .68rem; color: var(--muted); }
.spin-used-label { font-size: .68rem; color: var(--muted); }

.assign-form { display: flex; gap: .45rem; align-items: center; }
.assign-input {
  width: 60px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--white);
  font-family: 'DM Sans', sans-serif; font-size: .9rem;
  padding: .38rem .55rem; text-align: center;
}
.assign-input:focus { outline: none; border-color: var(--gold2); }
.assign-btn {
  background: var(--gold); color: #060910;
  border: none; border-radius: 6px;
  font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 600;
  padding: .42rem .85rem; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.assign-btn:hover { background: #ffc72c; }

.btn-refresh {
  background: none; border: 1px solid var(--border);
  color: var(--text2); border-radius: 5px;
  font-size: .72rem; padding: .2rem .55rem; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn-refresh:hover { border-color: var(--gold); color: var(--gold); }

/* Page header */
.page-header { margin-bottom: 2rem; }
.page-header h2 { font-family: var(--font-head); font-size: 2.2rem; letter-spacing: .04em; }
.page-header p  { color: var(--text2); font-size: .9rem; margin-top: .3rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: .9rem; }
.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast */
.toast {
  position: fixed; bottom: 1.75rem; right: 1.75rem;
  background: var(--card);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600; font-size: .85rem;
  padding: .75rem 1.3rem .75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(34,197,94,.3);
  border-left: 3px solid var(--green);
  box-shadow: 0 4px 24px rgba(0,0,0,.5), 0 0 16px rgba(34,197,94,.1);
  z-index: 9998;
  opacity: 0; transform: translateY(12px) scale(.96);
  transition: all .28s cubic-bezier(.2,.9,.3,1); pointer-events: none;
}
.toast.show   { opacity: 1; transform: translateY(0) scale(1); }
.toast.error  {
  border-left-color: var(--red);
  border-color: rgba(230,60,60,.3);
  box-shadow: 0 4px 24px rgba(0,0,0,.5), 0 0 16px rgba(230,60,60,.1);
}

/* ── Auth Forms (local login / register) ─────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

.form-group { display: flex; flex-direction: column; gap: .35rem; }

.form-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.form-hint {
  font-size: .68rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  padding: .72rem 1rem;
  transition: border-color .15s;
  outline: none;
}
.form-input::placeholder { color: var(--muted); }
.form-input:focus { border-color: var(--gold2); background: rgba(255,255,255,0.06); }

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #060910;
  border: none;
  border-radius: 8px;
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: .1em;
  padding: .75rem;
  cursor: pointer;
  transition: all .22s;
  box-shadow: 0 4px 18px rgba(240,180,41,.3);
  margin-top: .25rem;
  position: relative; overflow: hidden;
}
.submit-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -110%;
  width: 65%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent);
  transform: skewX(-18deg);
  transition: left .5s ease;
  pointer-events: none;
}
.submit-btn:hover::before { left: 160%; }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(240,180,41,.5), 0 0 0 2px rgba(240,180,41,.2); }
.submit-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .08em;
  margin: .5rem 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  margin-top: 1.2rem;
  font-size: .85rem;
  color: var(--muted);
}
.auth-switch a { color: var(--gold); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   ADMIN DASHBOARD
══════════════════════════════════════════════════════ */

.dash-wrap {
  width: 100%;
  max-width: 1100px;
  padding: 2rem 1.5rem 4rem;
}

/* Header */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.dash-title {
  font-family: var(--font-head);
  font-size: 2.4rem;
  letter-spacing: .04em;
  line-height: 1;
}
.dash-sub { color: var(--text2); font-size: .88rem; margin-top: .3rem; }

.dash-header-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .9rem;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 40px;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}
.live-label { font-size: .75rem; color: var(--green); font-weight: 600; letter-spacing: .08em; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: default;
}
.stat-card:hover {
  border-color: rgba(240,180,41,.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(240,180,41,.07);
}
.stat-card--gold { border-color: rgba(240,180,41,.3); background: rgba(240,180,41,.05); }

.stat-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.stat-val {
  font-family: var(--font-head);
  font-size: 2rem;
  line-height: 1;
  color: var(--white);
}
.stat-card--gold .stat-val { color: var(--gold); }
.stat-lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: .15rem; }
.stat-sub { font-size: .68rem; color: var(--muted); margin-top: .2rem; }

/* Dash grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
}
@media (max-width: 820px) { .dash-grid { grid-template-columns: 1fr; } }

/* Dash card */
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.dash-card-header h3 {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.dash-card-sub { font-size: .72rem; color: var(--muted); }

/* Live feed */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .65rem .85rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: feedIn .35s ease;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.feed-item:hover {
  border-color: rgba(240,180,41,.2);
  background: rgba(255,255,255,.05);
}
@keyframes feedIn {
  from { opacity:0; transform:translateX(-8px); }
  to   { opacity:1; transform:none; }
}

.feed-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #000;
  overflow: hidden;
}
.feed-avatar img { width: 100%; height: 100%; object-fit: cover; }

.feed-body { flex: 1; min-width: 0; }
.feed-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-country { font-size: .78rem; color: var(--text2); margin-top: .1rem; }

.feed-right { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex-shrink: 0; }
.feed-time { font-size: .68rem; color: var(--muted); }

/* Top countries */
.top-countries { display: flex; flex-direction: column; gap: .9rem; }

.country-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.country-rank {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--muted);
  min-width: 16px;
  text-align: center;
}
.country-flag { font-size: 1.4rem; flex-shrink: 0; }
.country-body { flex: 1; min-width: 0; }
.country-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .3rem;
}
.country-name  { font-size: .85rem; font-weight: 600; }
.country-count { font-size: .72rem; color: var(--muted); }

.country-bar-track {
  height: 5px;
  background: rgba(255,255,255,.06);
  border-radius: 99px;
  overflow: hidden;
}
.country-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  border-radius: 99px;
  transition: width .6s ease;
}

/* Users table */
.users-table-wrap { overflow-x: auto; }
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.users-table thead tr { border-bottom: 1px solid var(--border); }
.users-table th {
  text-align: left;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .6rem 1rem;
  white-space: nowrap;
}
.users-table td { padding: .8rem 1rem; border-bottom: 1px solid rgba(255,255,255,.03); vertical-align: middle; }
.users-table tbody tr:hover { background: rgba(255,255,255,.025); }
.users-table tbody tr:last-child td { border-bottom: none; }

.utbl-user { display: flex; align-items: center; gap: .75rem; }
.utbl-avatar {
  width: 36px; height: 36px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0;
}
.utbl-avatar--fallback {
  background: var(--gold2);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; color: #000;
}
.utbl-name { font-weight: 600; font-size: .88rem; }
.utbl-meta { font-size: .72rem; color: var(--muted); margin-top: .1rem; }

.utbl-num { font-family: var(--font-head); font-size: 1.3rem; color: var(--white); }
.utbl-num--gold { color: var(--gold); }

/* Progress bar (inline in table) */
.prog-track {
  height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: .25rem;
}
.prog-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease, background .3s;
}
.prog-pct { font-size: .68rem; color: var(--muted); }

/* ══════════════════════════════════════════════════════
   SEPARATE LOGIN PORTALS
══════════════════════════════════════════════════════ */

/* User login — warm gold glow */
.login-screen--user {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(240,180,41,.13) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(240,140,20,.06) 0%, transparent 50%),
    var(--bg);
}

/* Admin login — cool blue/red secure feel */
.login-screen--admin {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(60,80,200,.14) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 100%, rgba(200,40,40,.07) 0%, transparent 50%),
    var(--bg);
}

/* Admin badge above the title */
.admin-login-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(60,80,200,.12);
  border: 1px solid rgba(100,120,240,.25);
  border-radius: 40px;
  padding: .35rem 1rem;
  margin-bottom: .25rem;
}
.admin-shield      { font-size: 1rem; }
.admin-badge-text  { font-size: .7rem; font-weight: 700; letter-spacing: .18em; color: #7b93f5; }

/* Admin-specific input tint */
.form-input--admin {
  border-color: rgba(100,120,240,.2);
}
.form-input--admin:focus {
  border-color: rgba(100,120,240,.6);
  background: rgba(60,80,200,.06);
}

/* Admin submit button — blue instead of gold */
.submit-btn--admin {
  background: linear-gradient(135deg, #5b73f0 0%, #3a50c8 100%);
  box-shadow: 0 4px 18px rgba(60,80,200,.35);
}
.submit-btn--admin:hover {
  box-shadow: 0 8px 28px rgba(60,80,200,.5);
}

/* Small link to switch portals (top-right corner) */
.admin-portal-link {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  font-size: .75rem;
  color: var(--gold);
  letter-spacing: .05em;
  text-decoration: none;
  opacity: .7;
  transition: opacity .15s;
}
.admin-portal-link:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════
   SLIDE-IN USER DETAIL PANEL
══════════════════════════════════════════════════════ */

/* Overlay backdrop */
.panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.panel-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Panel itself */
.user-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #0e1118;
  border-left: 1px solid rgba(255,255,255,.08);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,.5);
}
.user-panel.open {
  transform: translateX(0);
}

/* Panel header */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.panel-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: .08em;
  color: var(--white);
}
.panel-close {
  background: rgba(255,255,255,.06);
  border: none;
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.panel-close:hover { background: rgba(230,60,60,.2); color: var(--red); }

/* Loading */
.panel-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
  font-size: .88rem;
}
.panel-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,.07);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollable content area */
.panel-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

/* Section */
.panel-section {
  padding: 1.3rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.panel-section:last-child { border-bottom: none; }
.panel-section-title {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* Profile */
.panel-profile {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.panel-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--gold2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #000;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(240,180,41,.3);
}
.panel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.panel-profile-info { min-width: 0; }
.panel-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.panel-username { font-size: .8rem; color: var(--text2); margin-top: .15rem; }
.panel-email    { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.panel-joined   { font-size: .72rem; color: var(--muted); margin-top: .25rem; letter-spacing: .04em; }

/* Budget */
.panel-budget {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: .9rem 1.2rem;
  margin-bottom: .9rem;
}
.panel-budget-item { text-align: center; flex: 1; }
.panel-budget-item--gold .panel-budget-val { color: var(--gold); }
.panel-budget-val {
  font-family: var(--font-head);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--white);
}
.panel-budget-lbl { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: .1rem; }
.panel-budget-sep { width: 1px; height: 30px; background: rgba(255,255,255,.07); flex-shrink: 0; }

/* Progress */
.panel-prog-track {
  height: 7px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: .4rem;
}
.panel-prog-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width .6s ease, background .3s;
}
.panel-prog-label { font-size: .72rem; color: var(--muted); }

/* Assign form */
.panel-assign-form { display: flex; gap: .5rem; margin-bottom: .5rem; }
.panel-assign-note { font-size: .72rem; color: var(--muted); line-height: 1.5; }

/* History */
.panel-history-count {
  font-size: .7rem;
  font-weight: 400;
  background: rgba(240,180,41,.12);
  color: var(--gold);
  border-radius: 4px;
  padding: .1rem .45rem;
}
.panel-history {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.07) transparent;
}
.panel-history-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 8px;
  padding: .55rem .85rem;
  font-size: .83rem;
  animation: fadeSlide .25s ease;
}
.panel-history-flag    { font-size: 1.2rem; flex-shrink: 0; }
.panel-history-country { font-weight: 600; flex: 1; }
.panel-history-time    { font-size: .7rem; color: var(--muted); text-align: right; }
.panel-history-num     {
  font-size: .68rem;
  background: rgba(240,180,41,.1);
  color: var(--gold);
  border-radius: 4px;
  padding: .1rem .4rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   USER PROFILE PAGE
══════════════════════════════════════════════════════ */

.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}

.profile-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

/* Avatar section */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-bottom: 1rem;
}

.profile-avatar-wrap {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
}

.profile-avatar-img,
.profile-avatar-fallback {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(240,180,41,.35);
  display: block;
}

.profile-avatar-fallback {
  background: var(--gold2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #000;
}

/* Hover overlay */
.avatar-overlay {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .25rem;
  font-size: .7rem; font-weight: 600;
  color: #fff; letter-spacing: .05em;
  opacity: 0;
  transition: opacity .2s;
  cursor: pointer;
}
.avatar-overlay span:first-child { font-size: 1.3rem; }
.profile-avatar-wrap:hover .avatar-overlay { opacity: 1; }

.profile-display-name { font-size: 1.1rem; font-weight: 700; }
.profile-username      { font-size: .82rem; color: var(--text2); margin-top: .2rem; }
.profile-meta          { font-size: .74rem; color: var(--muted); margin-top: .25rem; }

.avatar-hint {
  font-size: .74rem;
  color: var(--muted);
  margin-top: .1rem;
}

/* Confirm bar */
.avatar-confirm {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .9rem;
  padding: .75rem 1rem;
  background: rgba(240,180,41,.07);
  border: 1px solid rgba(240,180,41,.2);
  border-radius: 8px;
  flex-wrap: wrap;
}
.avatar-confirm-text { font-size: .85rem; color: var(--text2); flex: 1; }

/* Account info grid */
.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
@media (max-width: 480px) { .profile-info-grid { grid-template-columns: 1fr; } }

.profile-info-item {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 8px;
  padding: .75rem 1rem;
}
.profile-info-label { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.profile-info-val   { font-size: .95rem; font-weight: 600; color: var(--white); }

/* ── Wheel tooltip ─────────────────────────────────────────────────────────── */
.wheel-tooltip {
  position: fixed;
  background: rgba(10,10,18,.95);
  border: 1px solid rgba(240,180,41,.5);
  color: var(--white);
  font-size: .85rem;
  font-weight: 600;
  padding: .4rem .85rem;
  border-radius: 8px;
  pointer-events: none;
  z-index: 9997;
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  letter-spacing: .03em;
}

/* ── Profile inline name edit ──────────────────────────────────────────────── */
.edit-pencil {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  padding: .1rem .3rem;
  border-radius: 4px;
  transition: background .15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.edit-pencil:hover { background: rgba(240,180,41,.12); }

.name-display-wrap { position: relative; }

.name-display {
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  padding: .72rem 1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ══════════════════════════════════════════════════════
   GLOBAL ENHANCEMENTS — Accessibility, Polish, Motion
══════════════════════════════════════════════════════ */

/* Universal focus ring — gold, consistent everywhere */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Table row pointer */
.users-table tbody tr { cursor: pointer; }

/* Panel history items */
.panel-history-item {
  transition: border-color .18s, background .18s;
  cursor: default;
}
.panel-history-item:hover {
  border-color: rgba(240,180,41,.18);
  background: rgba(255,255,255,.04);
}

/* Budget badge top accent */
.budget-badge {
  position: relative;
}
.budget-badge::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold2), transparent);
}

/* Result card top bar animation on new result */
.result-card.show::before {
  animation: topBarFlash .8s ease forwards;
}
@keyframes topBarFlash {
  0%   { opacity: 0; }
  30%  { opacity: 1; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
  100% { opacity: 1; }
}

/* Hub button SVG support */
.hub { font-family: sans-serif; }

/* Assign button shimmer */
.assign-btn {
  position: relative; overflow: hidden;
}
.assign-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -110%;
  width: 65%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  transform: skewX(-18deg);
  transition: left .45s ease;
  pointer-events: none;
}
.assign-btn:hover::before { left: 160%; }

/* Wheel spinning state — brighter glow ring */
canvas.spinning {
  box-shadow:
    0 0 0 4px var(--surface),
    0 0 0 7px var(--gold),
    0 0 0 10px rgba(240,180,41,.2),
    0 0 80px rgba(240,180,41,.55),
    0 0 140px rgba(240,180,41,.18);
}

/* Stat icon — replace emoji sizing */
.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }

/* Section labels spacing refinement */
.section-label { margin-bottom: .6rem; }

/* Smooth scrollbar accent */
* { scrollbar-width: thin; scrollbar-color: rgba(240,180,41,.2) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(240,180,41,.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(240,180,41,.4); }

/* ── Flag images (flagcdn.com) ───────────────────────────── */
.flag-img {
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  object-fit: cover;
  flex-shrink: 0;
}
.flag-img.res-flag-img {
  width: 48px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.feed-flag  { border-radius: 2px; vertical-align: middle; }
.res-flag-placeholder { font-size: 2rem; color: var(--muted); }

/* ── Admin dashboard redesign ───────────────────────────── */

/* Colored stat cards */
.stat-card--blue   { border-top: 2px solid #3b82f6; }
.stat-card--green  { border-top: 2px solid var(--green); }
.stat-card--gold   { border-top: 2px solid var(--gold); background: rgba(240,180,41,.04); }
.stat-card--purple { border-top: 2px solid #a855f7; }

.stat-icon--blue   { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.2); }
.stat-icon--blue svg   { stroke: #60a5fa; }
.stat-icon--green  { background: rgba(34,197,94,.12);  border-color: rgba(34,197,94,.2); }
.stat-icon--green svg  { stroke: #4ade80; }
.stat-icon--gold   { background: rgba(240,180,41,.12); border-color: rgba(240,180,41,.2); }
.stat-icon--gold svg   { stroke: var(--gold); }
.stat-icon--purple { background: rgba(168,85,247,.12); border-color: rgba(168,85,247,.2); }
.stat-icon--purple svg { stroke: #c084fc; }

/* Admin header eyebrow */
.dash-eyebrow {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .2rem;
}

/* Dash card header SVG icons */
.dash-card-header h3 svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
}

/* Country rank gold for #1 */
.country-rank--gold {
  color: var(--gold) !important;
  text-shadow: 0 0 8px rgba(240,180,41,.5);
}

/* Country flag in admin (real img, not emoji) */
.country-flag .flag-img {
  width: 24px;
  height: auto;
  border-radius: 3px;
}

/* Assign btn — stop propagation fix (visual only) */
.assign-form { position: relative; }

/* Better dash title */
.theme-dark .dash-title {
  background: linear-gradient(135deg, #fff 40%, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Better stat val in dark */
.theme-dark .stat-card--gold .stat-val { color: var(--gold); }

/* Reduced motion — disable all animations/transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   SPINTHEWHEELS.IO LIGHT THEME
   Clean, white, app-like — applied via .theme-light on <body>
══════════════════════════════════════════════════════════════ */

.theme-light {
  --bg:      #f0f3fa;
  --surface: #ffffff;
  --card:    #ffffff;
  --border:  #e2e8f0;
  --gold:    #f0b429;
  --gold2:   #d97706;
  --glow:    rgba(240,180,41,.2);
  --red:     #ef4444;
  --green:   #10b981;
  --white:   #1e293b;
  --muted:   #94a3b8;
  --text2:   #64748b;
}

/* ── Base overrides ────────────────────────────────────────── */
.theme-light body,
.theme-light { background: var(--bg); color: var(--white); }

.theme-light body::after { display: none; } /* remove grain */

/* ── Navbar ──────────────────────────────────────────────── */
.theme-light .navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.theme-light .nav-brand {
  color: var(--gold2);
  text-shadow: none;
}
.theme-light .nav-brand span { color: var(--white); }
.theme-light .nav-tab { color: var(--text2); }
.theme-light .nav-tab:hover { color: var(--white); background: #f1f5f9; }
.theme-light .nav-tab.active { color: var(--gold2); text-shadow: none; }
.theme-light .nav-tab.danger { color: var(--red); }
.theme-light .nav-tab.danger:hover { background: #fef2f2; }
.theme-light .user-chip { background: #f1f5f9; border-color: var(--border); color: var(--text2); }
.theme-light .user-avatar-fallback { background: var(--gold2); color: #fff; }

/* ── main-wrap — no padding for spin layout ──────────────── */
.theme-light .main-wrap {
  padding: 0;
  align-items: stretch;
  display: flex;
  flex-direction: column;
}

/* ── Flash alerts sit above layout ───────────────────────── */
.theme-light .alert-success { background:#f0fdf4; color:#166534; border-color:#bbf7d0; }
.theme-light .alert-error   { background:#fef2f2; color:#991b1b; border-color:#fecaca; }

/* ── Toast in light theme ───────────────────────────────── */
.theme-light .toast {
  background: #1e293b;
  color: #f8fafc;
  border-left-color: var(--green);
  border-color: rgba(16,185,129,.3);
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.theme-light .toast.error { border-left-color: var(--red); border-color: rgba(239,68,68,.3); }

/* ── Login screen light ──────────────────────────────────── */
.theme-light .login-screen {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(240,180,41,.08) 0%, transparent 60%),
    #f0f3fa;
}
.theme-light .login-screen--admin {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.08) 0%, transparent 60%),
    #f0f3fa;
}
.theme-light .login-box h1 { color: var(--white); }
.theme-light .login-box h1 em { color: var(--gold2); }
.theme-light .login-box > p { color: var(--text2); }
.theme-light .form-input {
  background: #fff;
  border-color: var(--border);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.theme-light .form-input:focus { border-color: var(--gold2); background: #fff; }
.theme-light .form-label { color: var(--text2); }
.theme-light .auth-switch { color: var(--muted); }
.theme-light .auth-switch a { color: var(--gold2); }
.theme-light .admin-login-badge { background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.2); }
.theme-light .login-note { color: var(--muted); }
.theme-light .admin-portal-link { color: var(--gold2); }

/* ══════════════════════════════════════════════════════════
   STP 3-COLUMN LAYOUT
══════════════════════════════════════════════════════════ */

.stp-layout {
  display: grid;
  grid-template-columns: 240px 1fr 270px;
  height: calc(100vh - 57px);
  overflow: hidden;
}
@media (max-width: 1000px) { .stp-layout { grid-template-columns: 1fr 240px; } }
@media (max-width: 700px)  { .stp-layout { grid-template-columns: 1fr; height: auto; overflow: visible; } }

/* ── Panels ────────────────────────────────────────────── */
.stp-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stp-panel--results {
  border-right: none;
  border-left: 1px solid var(--border);
}
@media (max-width: 1000px) { .stp-panel--teams { display: none; } }
@media (max-width: 700px)  { .stp-panel--results { border-left: none; border-top: 1px solid var(--border); } }

/* ── Panel header ─────────────────────────────────────── */
.stp-panel-hd {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.1rem .6rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.stp-panel-hd svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); }

.stp-badge {
  margin-left: auto;
  background: rgba(255,255,255,.08);
  color: var(--text2);
  font-size: .65rem;
  font-weight: 700;
  border-radius: 99px;
  padding: .15rem .6rem;
}

/* ── Teams scroll list ────────────────────────────────── */
.stp-teams-scroll {
  flex: 1;
  overflow-y: auto;
  padding: .3rem 0;
}
.stp-team-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .42rem 1.1rem;
  transition: background .12s;
  cursor: default;
  user-select: none;
}
.stp-team-row:hover { background: rgba(255,255,255,.05); }
.stp-team-row.stp-winner {
  background: rgba(240,180,41,.12);
  border-left: 3px solid var(--gold2);
}
.stp-team-row.stp-taken {
  opacity: .4;
  pointer-events: none;
}
.stp-team-row.stp-taken .stp-team-name {
  text-decoration: line-through;
  color: var(--muted);
}
.stp-taken-badge {
  margin-left: auto;
  font-size: .6rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: .04em;
}
.stp-team-flag { font-size: 1.1rem; flex-shrink: 0; }
.stp-team-name { font-size: .82rem; font-weight: 500; color: var(--white); }

/* ── Center main area ─────────────────────────────────── */
.stp-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
  padding: .6rem 1rem 1rem;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
}
.stp-wheel-container {
  position: relative;
  flex-shrink: 0;
  /* Shrink the container so the canvas never overflows */
  max-width: min(520px, calc(100vh - 340px));
  width: 100%;
  aspect-ratio: 1;
}
/* Make canvas fill its container responsively */
.stp-wheel-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Canvas in light theme */
.theme-light canvas {
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px rgba(0,0,0,.09),
    0 10px 48px rgba(0,0,0,.13);
}
.theme-light canvas.spinning {
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px var(--gold2),
    0 10px 60px rgba(240,180,41,.35);
}

/* Hub in light theme */
.theme-light .hub {
  background: radial-gradient(circle at 35% 35%, #fffde7, var(--gold));
  border-color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

/* Pointer in light theme */
.theme-light .pointer {
  border-right-color: var(--gold2);
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.25));
}

/* ── STP Spin button (large pill) ─────────────────────── */
.stp-spin-btn {
  background: linear-gradient(135deg, #f0b429 0%, #d97706 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: var(--font-head);
  font-size: 1.6rem;
  letter-spacing: .12em;
  padding: .85rem 3.5rem;
  min-width: 220px;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(240,180,41,.45);
  transition: all .22s;
  position: relative;
  overflow: hidden;
}
.stp-spin-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -110%;
  width: 65%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-18deg);
  transition: left .5s ease;
  pointer-events: none;
}
.stp-spin-btn:hover:not(:disabled)::before { left: 160%; }
.stp-spin-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px rgba(240,180,41,.6);
}
.stp-spin-btn:active:not(:disabled) { transform: translateY(0) scale(.99); }
.stp-spin-btn:disabled {
  background: linear-gradient(135deg, #3a3a4a, #2a2a38);
  color: rgba(255,255,255,.35);
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transform: none;
  border: 1px solid rgba(255,255,255,.08);
}
.stp-spin-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── STP Budget ───────────────────────────────────────── */
.stp-budget {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .55rem 1.4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.stp-budget-item { text-align: center; }
.stp-budget-val {
  font-family: var(--font-head);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--gold);
}
.stp-budget-lbl {
  font-size: .62rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: .1rem;
}
.stp-budget-sep { width: 1px; height: 28px; background: var(--border); }

/* Hint text in light */
.theme-light .hint { color: var(--muted); }

/* ── Results panel ────────────────────────────────────── */
.stp-result {
  background: var(--card) !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 1.2rem !important;
}
.stp-result::before { display: none !important; }
.stp-result .res-country { color: var(--gold) !important; text-shadow: var(--neon-gold-sm) !important; }
.stp-result .res-lbl { color: var(--muted) !important; }
.stp-result .res-meta { color: var(--text2) !important; }
.stp-result .res-flag { min-height: 56px !important; margin-bottom: .35rem !important; }

.stp-history {
  flex: 1;
  overflow-y: auto;
  padding: .35rem .5rem !important;
  max-height: none !important;
}
.stp-history .history-item {
  background: var(--card);
  border-color: var(--border);
}
.stp-history .history-item:hover { background: rgba(255,255,255,.04); border-color: rgba(240,180,41,.3); }
.stp-history .history-country { color: var(--white); }
.stp-history .history-time { color: var(--muted); }

/* ══════════════════════════════════════════════════════════
   RESULT POPUP — spinthewheels.io style
══════════════════════════════════════════════════════════ */

.stp-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(5px);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.stp-popup-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.stp-popup {
  background: var(--card);
  border-radius: 28px;
  padding: 2.5rem 2.8rem 2rem;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06);
  transform: scale(.88) translateY(24px);
  transition: transform .38s cubic-bezier(.2,.9,.3,1);
  position: relative;
  overflow: hidden;
  min-width: 300px;
  max-width: 400px;
  width: 90vw;
}
.stp-popup-overlay.show .stp-popup {
  transform: scale(1) translateY(0);
}

.stp-popup-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 28px;
}

.stp-popup-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .6rem;
  animation: popFlagIn .5s .1s cubic-bezier(.2,.9,.3,1) both;
}
.stp-popup-flag img {
  width: 96px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
@keyframes popFlagIn {
  from { transform: scale(.3) rotate(-10deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

.stp-popup-label {
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .2rem;
}

.stp-popup-country {
  font-family: var(--font-head);
  font-size: 2.6rem;
  line-height: 1.05;
  color: var(--gold);
  text-shadow: var(--neon-gold-sm);
  margin-bottom: .35rem;
  animation: popCountryIn .4s .25s ease both;
}
@keyframes popCountryIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.stp-popup-meta {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.stp-popup-actions {
  display: flex;
  gap: .65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.stp-popup-again {
  background: linear-gradient(135deg, #f0b429, #d97706);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: .07em;
  padding: .65rem 1.6rem;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(240,180,41,.4);
  position: relative; overflow: hidden;
}
.stp-popup-again:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(240,180,41,.5); }

.stp-popup-close-btn {
  background: rgba(255,255,255,.08);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 500;
  padding: .65rem 1.6rem;
  cursor: pointer;
  transition: all .2s;
}
.stp-popup-close-btn:hover { background: rgba(255,255,255,.13); color: var(--white); }

/* Confetti pieces */
.cfp {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  animation: cfpFall var(--dur, 1.4s) var(--delay, 0s) ease-in both;
  top: -12px;
}
@keyframes cfpFall {
  0%   { transform: translateY(0) rotate(0deg) translateX(0); opacity: 1; }
  100% { transform: translateY(420px) rotate(var(--spin, 600deg)) translateX(var(--dx, 0px)); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   ROUND BADGE (center panel, above spin button)
══════════════════════════════════════════════════════════ */

.stp-round-badge {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: rgba(240,180,41,.08);
  border: 1px solid rgba(240,180,41,.2);
  border-radius: 40px;
  padding: .3rem .9rem;
}
.stp-round-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}
.stp-round-num {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--gold);
  text-shadow: var(--neon-gold-sm);
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════
   NEW ROUND OVERLAY
══════════════════════════════════════════════════════════ */

.new-round-overlay {
  position: fixed; inset: 0;
  background: rgba(6,9,16,.85);
  backdrop-filter: blur(8px);
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.new-round-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.new-round-box {
  position: relative;
  text-align: center;
  padding: 3rem 3.5rem 2.5rem;
  background: var(--card);
  border: 1px solid rgba(240,180,41,.25);
  border-radius: 28px;
  box-shadow: 0 0 80px rgba(240,180,41,.15), 0 24px 60px rgba(0,0,0,.6);
  max-width: 420px;
  width: 90vw;
  overflow: hidden;
  transform: scale(.88);
  transition: transform .4s cubic-bezier(.2,.9,.3,1);
}
.new-round-overlay.show .new-round-box { transform: scale(1); }

.new-round-confetti {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 28px;
}

.new-round-trophy {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: .6rem;
  animation: trophyBounce .6s .2s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes trophyBounce {
  from { transform: scale(.2) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

.new-round-complete {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .25em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: .35rem;
}

.new-round-number {
  font-family: var(--font-head);
  font-size: 3.2rem;
  line-height: 1;
  color: var(--gold);
  text-shadow: var(--neon-gold);
  margin-bottom: .75rem;
  animation: roundNumIn .5s .35s ease both;
}
@keyframes roundNumIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.new-round-sub {
  font-size: .85rem;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 1.8rem;
}

.new-round-btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #060910;
  border: none;
  border-radius: 50px;
  font-family: var(--font-head);
  font-size: 1.2rem;
  letter-spacing: .1em;
  padding: .75rem 2.5rem;
  cursor: pointer;
  transition: all .22s;
  box-shadow: 0 4px 20px rgba(240,180,41,.4);
  position: relative; overflow: hidden;
}
.new-round-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(240,180,41,.6);
}

/* ══════════════════════════════════════════════════════════
   LIGHT THEME — Profile, History, other user pages
══════════════════════════════════════════════════════════ */

.theme-light .page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.theme-light .profile-card,
.theme-light .admin-card {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.theme-light .history-table-wrap table { background: #fff; border-radius: 12px; overflow: hidden; }
.theme-light thead tr { background: #f8fafd; }
.theme-light th { color: var(--muted); }
.theme-light td { border-bottom-color: #f0f4f8; color: var(--white); }
.theme-light tbody tr:hover { background: #f8faff; }

.theme-light .page-header h2 { color: #1e293b; }
.theme-light .page-header p  { color: var(--text2); }

.theme-light .profile-section-title,
.theme-light .section-label { color: var(--muted); }
.theme-light .profile-display-name { color: var(--white); }
.theme-light .profile-info-item {
  background: #f8fafd;
  border-color: var(--border);
}
.theme-light .profile-info-label { color: var(--muted); }
.theme-light .profile-info-val   { color: var(--white); }
.theme-light .name-display {
  background: #f8fafd;
  border-color: var(--border);
  color: var(--white);
}
.theme-light .form-input { background: #fff; border-color: var(--border); color: var(--white); }
.theme-light .assign-input { background: #f8fafd; border-color: var(--border); color: var(--white); }

/* Badge in light theme */
.theme-light .badge-spin { background: rgba(240,180,41,.12); color: var(--gold2); }
.theme-light .badge-admin { background: rgba(240,180,41,.12); color: var(--gold2); }

/* Focus visible in light theme */
.theme-light :focus-visible { outline-color: var(--gold2); }

/* ── Pool control card ────────────────────────────────────────────────────── */
.pool-control-card { padding: 1.4rem; }

.pool-control-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: .25rem;
}
@media (max-width: 760px) { .pool-control-grid { grid-template-columns: 1fr; } }

.pool-control-item { display: flex; flex-direction: column; }
.pool-control-label { font-size: .78rem; font-weight: 700; color: var(--white); margin-bottom: .2rem; }
.pool-control-sub   { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.pool-control-form  { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; }

/* ── Admin profile page ─────────────────────────────────────────────────────── */
.admin-profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}

.admin-profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
@media (max-width: 520px) { .admin-profile-info-grid { grid-template-columns: 1fr; } }

/* ── SMTP provider chips ─────────────────────────────────────────────────────── */
.smtp-providers { margin-bottom: 1.2rem; }
.smtp-provider-label { font-size: .72rem; color: var(--muted); margin-bottom: .5rem; letter-spacing: .05em; }
.smtp-provider-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.smtp-chip {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 20px;
  padding: .25rem .8rem;
  font-size: .75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.smtp-chip:hover { background: rgba(240,180,41,.1); border-color: rgba(240,180,41,.3); color: var(--gold); }

select.form-input { cursor: pointer; }
select.form-input option { background: var(--card); }

/* ══════════════════════════════════════════════════════
   LANGUAGE SWITCHER
══════════════════════════════════════════════════════ */
.lang-switcher {
  position: relative;
}
.lang-btn {
  display: flex; align-items: center; gap: .4rem;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text2); border-radius: 8px;
  padding: .35rem .75rem; cursor: pointer;
  font-family: inherit; font-size: .82rem;
  transition: all .15s; white-space: nowrap;
}
.lang-btn:hover { border-color: rgba(240,180,41,.4); color: var(--white); }
.lang-btn span  { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }

.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: .3rem;
  min-width: 160px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  display: none; flex-direction: column; gap: .15rem;
}
.lang-switcher.open .lang-dropdown { display: flex; }

.lang-option {
  display: flex; align-items: center; gap: .6rem;
  background: none; border: none;
  color: var(--text2); border-radius: 7px;
  padding: .5rem .75rem; cursor: pointer;
  font-family: inherit; font-size: .85rem;
  text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.lang-option:hover  { background: rgba(255,255,255,.06); color: var(--white); }
.lang-option.active { background: rgba(240,180,41,.1); color: var(--gold); font-weight: 600; }

/* Login page flag strip */
.login-lang-switcher {
  position: absolute; top: 1rem; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: .3rem;
}
.login-lang-btn {
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  border-radius: 6px; padding: .25rem .5rem;
  font-size: 1.1rem; cursor: pointer;
  transition: all .15s; line-height: 1;
}
.login-lang-btn:hover  { background: rgba(255,255,255,.12); }
.login-lang-btn.active { border-color: var(--gold); background: rgba(240,180,41,.1); }

/* Close dropdown when clicking outside */
.lang-switcher:not(.open) .lang-dropdown { display: none; }
