:root {
  --bg-main: #0b0c10;
  --bg-card: rgba(18, 20, 29, 0.85);
  --bg-card-border: rgba(245, 158, 11, 0.2);
  --bg-card-hover: rgba(28, 31, 44, 0.95);
  --gold-primary: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.4);
  --gold-dark: #b45309;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(217, 119, 6, 0.05) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px 12px 32px 12px;
}

.app-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* Header */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px 16px 4px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 28px;
  background: rgba(245, 158, 11, 0.15);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* User pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 10px;
  border-radius: 30px;
}

.user-avatar {
  font-size: 18px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.75rem;
  font-weight: 700;
}

.user-status {
  font-size: 0.65rem;
  color: var(--gold-primary);
  font-weight: 600;
}

/* Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: rgba(245, 158, 11, 0.15);
  color: #fff;
  border: 1px solid var(--bg-card-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.hero-banner {
  text-align: center;
  margin-bottom: 20px;
}

.trophy-halo {
  font-size: 52px;
  margin-bottom: 8px;
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.hero-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Status box */
.status-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--gold-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--gold-primary);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.status-reward {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--gold-primary);
  color: #000;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-glow {
  box-shadow: 0 6px 20px var(--gold-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-whatsapp {
  background: #25d366;
  color: #000;
}

.btn-telegram {
  background: #0088cc;
  color: #fff;
}

/* Arena Elements */
.arena-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-wrap {
  flex: 1;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.badge-type {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-primary);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.3s ease;
}

.timer-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 0.9rem;
  color: #fbbf24;
}

/* Question Area */
.question-box {
  text-align: center;
  margin-bottom: 20px;
}

.poster-container {
  width: 170px;
  height: 250px;
  margin: 0 auto 14px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  position: relative;
  border: 2px solid var(--bg-card-border);
}

.blurred-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.5s ease;
}

.poster-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 6px;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 6px;
}

.question-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.option-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.option-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
}

.option-btn.selected {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--gold-primary);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: var(--success) !important;
  color: #34d399 !important;
}

.option-btn.incorrect {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: var(--danger) !important;
  color: #f87171 !important;
}

/* Results */
.results-header {
  text-align: center;
  margin-bottom: 20px;
}

.results-medal {
  font-size: 56px;
  margin-bottom: 6px;
}

.score-display {
  margin: 12px 0;
}

.score-big {
  font-size: 3.4rem;
  font-weight: 900;
  color: var(--gold-primary);
  font-family: monospace;
}

.score-denom {
  font-size: 1.4rem;
  color: var(--text-muted);
}

.reward-pill-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
  border: 1.5px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 20px;
}

/* Duel Arena Scoreboard */
.duel-scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.player-pill {
  display: flex;
  flex-direction: column;
}

.player-pill .p-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.player-pill .p-score {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: monospace;
}

.player-me .p-score {
  color: var(--gold-primary);
}

.player-rival .p-score {
  color: #60a5fa;
}

.duel-vs-badge {
  font-weight: 900;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 8px;
}

/* Forms & inputs */
.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
}

.form-input:focus {
  border-color: var(--gold-primary);
}

.join-room-group {
  display: flex;
  gap: 8px;
}

.or-separator {
  text-align: center;
  position: relative;
  margin: 18px 0;
}

.or-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.or-separator span {
  position: relative;
  background: var(--bg-card);
  padding: 0 10px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.room-code-tag {
  display: inline-block;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gold-primary);
  font-family: monospace;
  background: rgba(245, 158, 11, 0.1);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--gold-primary);
  margin-top: 10px;
}

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

.round-status-toast {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  text-align: center;
  font-weight: 600;
  margin-top: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 32, 0.95);
  border: 1px solid var(--bg-card-border);
  padding: 10px 18px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.d-none { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
