:root {
  --bg: #07111f;
  --bg-2: #0b1628;
  --panel: #0d1a2d;
  --panel-2: #10213a;
  --text: #eef4ff;
  --muted: #8aa0bf;
  --line: rgba(123, 160, 214, 0.18);
  --accent: #ff9d1f;
  --accent-2: #2ed3ff;
  --accent-3: #7c5cff;
  --danger: #ff5d73;
  --success: #20d79a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --radius: 18px;
  --nav-h: 66px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(46,211,255,0.12), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(255,157,31,0.12), transparent 18%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
img, video { display: block; max-width: 100%; }

.container {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 0 14px;
}

.auth-body { display: grid; min-height: 100vh; }
.auth-page { display: grid; place-items: center; padding: 20px 14px; }

.card {
  background: linear-gradient(180deg, rgba(16, 33, 58, 0.96), rgba(12, 24, 42, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.auth-card { width: 100%; max-width: 460px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 17, 31, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav-shell {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.logo {
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
}

.top-header-nav {
  padding: 8px 0 10px;
}

.nav-shell-top {
  min-height: 58px;
}

.top-nav-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 8px;
}

.top-nav-links a {
  text-align: center;
  font-size: 0.74rem;
  padding: 10px 4px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
}

.top-nav-links a.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(46,211,255,0.18), rgba(255,157,31,0.18));
  border-color: var(--line);
}

.mobile-page {
  padding: 18px 0 28px;
}

.compact-top { margin-bottom: 14px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 9vw, 3.6rem); line-height: 0.96; margin-bottom: 10px; }
h2 { font-size: 1.35rem; }
.lead, .muted-line { color: var(--muted); }
.lead { font-size: 0.98rem; line-height: 1.5; }
.muted-line { font-size: 0.86rem; }

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  margin-bottom: 14px;
}

textarea { resize: vertical; min-height: 120px; }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
input[type="file"] { padding: 10px; }

.btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 13px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: .18s ease;
  min-height: 48px;
}

.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff6b00);
  border: none;
  font-weight: 800;
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #ff8a4c);
  border: none;
  font-weight: 800;
}

.inline-actions { display: grid; gap: 10px; }
.sticky-actions { position: sticky; bottom: 12px; background: linear-gradient(180deg, rgba(13,26,45,0), rgba(13,26,45,0.94) 22%, rgba(13,26,45,1)); padding-top: 10px; }
.top-actions { position: sticky; top: 136px; z-index: 5; background: linear-gradient(180deg, rgba(13,26,45,0.92), rgba(13,26,45,0.98)); padding-top: 10px; padding-bottom: 2px; }
.two-col-buttons { grid-template-columns: repeat(2, 1fr); }
.two-col-buttons .btn:last-child { grid-column: 1 / -1; }

.status-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--line);
}

.single-column { display: grid; gap: 14px; }
.reveal-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,157,31,0.16), rgba(46,211,255,0.08));
  border: 1px solid rgba(46,211,255,0.18);
}
.role-result { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.role-label { color: var(--accent-2); margin-bottom: 6px; }
.hidden { display: none; }

.player-list, .users-list { display: grid; gap: 10px; }
.player-option, .user-row-card, .leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.player-option span:last-child { font-weight: 700; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  display: grid;
  place-items: center;
  color: #07111f;
  font-weight: 900;
  flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.tiny-avatar { width: 34px; height: 34px; font-size: 0.88rem; }
.large-avatar { width: 72px; height: 72px; font-size: 1.6rem; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-meta span { display: block; color: var(--muted); font-size: 0.8rem; }

.wheel-stage { align-items: center; justify-content: center; display: flex; position: relative; }
.mobile-wheel-stage { padding: 6px 0 2px; }
.wheel-pointer {
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--accent);
  position: absolute; top: 0; z-index: 2;
}
#wheelCanvas {
  width: min(100%, 92vw);
  height: auto;
  max-width: 420px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
  border: 1px solid var(--line);
}

.row-with-avatar, .memory-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-rules { display: grid; gap: 10px; }
.score-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}

.leaderboard-list { display: grid; gap: 10px; margin-top: 12px; }
.leaderboard-rank {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,157,31,0.16); color: var(--accent); font-weight: 900;
}
.leaderboard-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.leaderboard-score { font-weight: 900; color: var(--accent-2); }

.memory-grid { display: grid; gap: 14px; }
.memory-card img, .memory-card video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
  background: #000;
}

.auth-submit { width: 100%; }

@media (min-width: 760px) {
  .container { width: min(100%, 920px); }
  .single-column, .memory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .single-column > :first-child:last-child { grid-column: auto; }
}

@media (max-width: 560px) {
  .top-nav-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-meta span { display: none; }
  .logo { font-size: 1rem; }
}

.profile-link {
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.profile-link:active { transform: scale(0.98); }
.profile-shortcut-card {
  padding: 2px 0 6px;
}
