/* ============================================
   WhoLiked — Pure Dark Theme (GarticPhone-style)
   ============================================ */

:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #161616;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-elevated: #1e1e1e;
  --glass-bg: rgba(30, 30, 30, 0.95);
  --glass-border: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f0f0;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.35);
  --accent: #fe2c55;
  --accent-hover: #ff4d6f;
  --accent-glow: rgba(254, 44, 85, 0.25);
  --accent-green: #00d47e;
  --accent-green-glow: rgba(0, 212, 126, 0.25);
  --accent-yellow: #ffc107;
  --accent-orange: #ff9100;
  --success: #00d47e;
  --danger: #ff4444;
  --warning: #ffc107;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-primary);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  min-height: 100vh;
  padding: 20px;
  animation: viewFadeIn 0.35s ease-out;
}

.view.active {
  display: flex;
  flex-direction: column;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

.accent {
  color: var(--accent);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #333;
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-subtle);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 17px;
}

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:active::after {
  opacity: 1;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(8px);
}

/* ============================================
   Forms
   ============================================ */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   Loading Screen
   ============================================ */
#loading-screen {
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
}

.loader-container {
  text-align: center;
}

.logo-pulse {
  animation: logoPulse 2s ease-in-out infinite;
}

.logo-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
}

.logo-text {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.loader-bar {
  width: 200px;
  height: 4px;
  background: var(--bg-card);
  border-radius: 4px;
  margin: 24px auto 0;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 4px;
  animation: loaderSlide 1.2s ease-in-out infinite;
}

@keyframes logoPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes loaderSlide {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(350%);
  }
}

/* ============================================
   Auth Views (Login / Register)
   ============================================ */
.auth-view {
  justify-content: center;
  align-items: center;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 26px;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-error {
  display: none;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.2);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-view {
  align-items: center;
  padding-top: 40px;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 40px;
}

.dashboard-header .logo-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.dashboard-header h1 {
  font-size: 32px;
}

.dashboard-header p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 14px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.tiktok-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.tiktok-status.linked {
  color: var(--success);
}

.dashboard-actions {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.dashboard-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dashboard-card-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.dashboard-card-text h3 {
  font-size: 16px;
  margin-bottom: 2px;
}

.dashboard-card-text p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   TikTok Link View
   ============================================ */
.tiktok-link-view {
  align-items: center;
  justify-content: center;
}

.tiktok-link-container {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.qr-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 24px 0;
}

.qr-container img {
  max-width: 200px;
  border-radius: var(--radius-md);
}

.link-url {
  word-break: break-all;
  background: var(--bg-secondary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--accent);
  margin: 16px 0;
  border: 1px solid var(--border-subtle);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 16px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Lobby View (GarticPhone-style)
   ============================================ */
.lobby-view {
  align-items: center;
  padding-top: 30px;
}

.lobby-container {
  width: 100%;
  max-width: 480px;
}

.lobby-header {
  text-align: center;
  margin-bottom: 24px;
}

.lobby-header h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.lobby-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Pin display — big and bold */
.pin-display {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
}

.pin-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.pin-code {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pin-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

/* Game mode selector */
.mode-selector {
  margin-bottom: 24px;
}

.mode-selector-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-family: var(--font);
}

.mode-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.mode-btn.active {
  border-color: var(--accent);
  background: rgba(254, 44, 85, 0.08);
  color: var(--text-primary);
}

.mode-btn-icon {
  font-size: 24px;
}

.mode-btn-text {
  font-size: 13px;
  font-weight: 700;
}

/* Player list */
.lobby-players-section {
  margin-bottom: 24px;
}

.lobby-players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.lobby-players-header h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.lobby-players-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 4px 0;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
  animation: slideInUp 0.35s ease-out both;
}

.player-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  flex-shrink: 0;
  color: #fff;
}

.player-name {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}

.host-badge {
  background: var(--accent-yellow);
  color: #000;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.video-count-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.video-count-badge.insufficient {
  color: var(--danger);
}

/* Waiting msg */
.waiting-msg {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ============================================
   Game View (GarticPhone-style big layout)
   ============================================ */
.game-view {
  padding: 0;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Top bar */
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.game-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.round-badge {
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.type-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.type-badge.like {
  background: rgba(254, 44, 85, 0.15);
  color: var(--accent);
}

.type-badge.repost {
  background: rgba(0, 212, 126, 0.15);
  color: var(--accent-green);
}

/* Circular Timer — centered in topbar */
.round-timer {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.timer-svg {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 3;
}

.timer-progress {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear, stroke 0.4s ease;
}

.timer-text {
  position: absolute;
  font-size: 16px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.timer-critical {
  animation: timerPulse 0.5s ease-in-out infinite;
}

.timer-critical .timer-text {
  color: var(--accent);
}

.timer-expired .timer-text {
  color: var(--danger);
}

@keyframes timerPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* Scores mini (topbar right) */
.game-scores-mini {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.score-chip {
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.score-val {
  color: var(--accent);
  font-weight: 800;
}

/* Main game content */
.game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Video container */
.video-container {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.video-overlay {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.video-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.video-player {
  position: relative;
}

.video-embed-container {
  width: 100%;
  display: flex;
  justify-content: center;
  background: #000;
}

.tiktok-video-player {
  width: 100%;
  max-height: 580px;
  border: none;
  background: #000;
  object-fit: contain;
}

.video-cover {
  max-width: 100%;
  max-height: 400px;
  border-radius: 0;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.no-video-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.video-desc {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
}

/* Voting area */
.voting-area {
  width: 100%;
}

.voting-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.vote-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.vote-btn {
  padding: 16px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.vote-btn:not(:disabled):hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.vote-btn:not(:disabled):active {
  transform: scale(0.97);
}

.vote-btn.is-you {
  opacity: 0.3;
  cursor: not-allowed;
}

.vote-btn.selected {
  background: rgba(254, 44, 85, 0.12) !important;
  border-color: var(--accent) !important;
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  animation: selectedPulse 1.5s ease-in-out infinite;
}

.vote-btn.voted-out {
  opacity: 0.25;
  transform: scale(0.95);
}

@keyframes selectedPulse {

  0%,
  100% {
    box-shadow: 0 0 15px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 30px var(--accent-glow);
  }
}

.vote-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* ============================================
   Result Area (post-vote reveal)
   ============================================ */
#result-area {
  width: 100%;
  display: none;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.result-reveal {
  margin-bottom: 20px;
}

.result-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  margin-bottom: 12px;
}

#result-text {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

#result-type {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}

/* Vote results list */
.result-votes-section {
  text-align: left;
  margin: 20px 0;
}

.result-votes-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.vote-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin: 3px 0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border-left: 3px solid transparent;
}

.vote-correct {
  background: rgba(0, 212, 126, 0.06);
  border-left-color: var(--success);
}

.vote-wrong {
  background: rgba(255, 68, 68, 0.06);
  border-left-color: var(--danger);
}

.vote-result-icon {
  font-size: 16px;
}

.stealth-bonus {
  background: rgba(255, 193, 7, 0.08);
  border-left-color: var(--warning) !important;
  margin-top: 6px;
}

/* Scores in result */
.result-scores-section {
  text-align: left;
}

.result-scores-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 3px 0;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

.score-rank {
  font-size: 16px;
  width: 28px;
  text-align: center;
}

.score-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.score-pts {
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

/* Result actions */
.result-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ============================================
   Final Results View
   ============================================ */
.results-view {
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.results-container {
  width: 100%;
  max-width: 420px;
  z-index: 10;
}

.winner-section {
  margin-bottom: 32px;
}

.winner-crown {
  font-size: 48px;
  animation: crownBounce 1s ease infinite;
}

@keyframes crownBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.winner-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--accent-yellow);
  object-fit: cover;
  margin: 12px 0;
}

#winner-name {
  font-size: 28px;
  font-weight: 900;
}

#winner-score {
  font-size: 16px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 4px;
}

/* Final scoreboard */
.final-scoreboard {
  text-align: left;
  margin: 24px 0;
}

.scoreboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin: 4px 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.scoreboard-item:first-child {
  background: rgba(255, 193, 7, 0.06);
  border-color: rgba(255, 193, 7, 0.15);
}

.scoreboard-rank {
  font-size: 18px;
  width: 32px;
  text-align: center;
}

.scoreboard-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.scoreboard-score {
  font-weight: 800;
  color: var(--accent);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* Confetti */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(-100vh) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

.confetti-piece {
  position: fixed;
  top: -10px;
  z-index: 1000;
  animation: confettiFall linear forwards;
  pointer-events: none;
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }

  70% {
    transform: scale(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes revealGlow {
  0% {
    opacity: 0;
    transform: scale(0.8);
    filter: blur(8px);
  }

  60% {
    filter: blur(0);
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes shakeX {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-5px);
  }

  40% {
    transform: translateX(5px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(3px);
  }
}

.anim-slide-in {
  animation: slideInUp 0.35s ease-out both;
}

.anim-pop {
  animation: popIn 0.3s ease-out both;
}

.anim-reveal {
  animation: revealGlow 0.5s ease-out both;
}

.anim-shake {
  animation: shakeX 0.4s ease both;
}

/* ============================================
   Minimum videos warning
   ============================================ */
.min-videos-warning {
  background: rgba(255, 68, 68, 0.08);
  border: 1px solid rgba(255, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
}

.min-videos-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  .view {
    padding: 16px;
  }

  .auth-container {
    padding: 28px 20px;
  }

  .logo-text {
    font-size: 32px;
  }

  .pin-code {
    font-size: 32px;
    letter-spacing: 6px;
  }

  .vote-buttons {
    grid-template-columns: 1fr;
  }

  .game-scores-mini {
    display: none;
  }

  .game-topbar {
    padding: 8px 14px;
  }

  .round-timer {
    width: 42px;
    height: 42px;
  }

  .timer-svg {
    width: 42px;
    height: 42px;
  }

  .timer-text {
    font-size: 13px;
  }

  .tiktok-video-player {
    max-height: 480px;
  }

  .game-content {
    padding: 12px;
  }

  .voting-title {
    font-size: 17px;
  }

  .vote-btn {
    padding: 14px 10px;
    font-size: 14px;
  }

  .mode-buttons {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }
}

/* ============================================
   Language Toggle
   ============================================ */
.lang-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.lang-toggle:hover {
  background: var(--bg-card-hover);
  transform: scale(1.1);
}

.lang-toggle:active {
  transform: scale(0.95);
}

/* ============================================
   Auto Next Countdown
   ============================================ */
.auto-next-countdown {
  margin-top: 20px;
  text-align: center;
}

.auto-next-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.auto-next-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-green) 100%);
  border-radius: var(--radius-full);
  animation: autoNextShrink 6s linear forwards;
  width: 100%;
}

@keyframes autoNextShrink {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.auto-next-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.auto-next-text #auto-next-num {
  color: var(--text-primary);
  font-weight: 800;
  font-size: 16px;
}

/* ============================================
   Sync Progress
   ============================================ */
.link-url {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: none;
}