/* ============================================
   JUDAS E DISCÍPULOS - PWA Game
   Theme: Modern Dark + Gold (Material3-inspired)
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #09090b;
  --bg-card: #0f0f13;
  --bg-card-hover: #161620;

  --gold-primary: #d4a574;
  --gold-light: #f0d68a;
  --gold-dark: #a67c52;
  --gold-gradient: linear-gradient(135deg, #c9956a, #f0d68a, #c9956a);
  --gold-glow: rgba(212, 165, 116, 0.25);
  --gold-glow-strong: rgba(212, 165, 116, 0.45);

  --red-primary: #ef4444;
  --red-light: #f87171;
  --red-dark: #dc2626;
  --red-glow: rgba(239, 68, 68, 0.3);

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);

  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-full: 50%;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
}

/* --- DOTTED BACKGROUND PATTERN --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(#27272a 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 60%, transparent 100%);
  pointer-events: none;
}

#app {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  z-index: 1;
}

/* --- SPOTLIGHT GLOW --- */
#particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Spotlight blobs instead of particles */
#particles-container::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(212, 165, 116, 0.12) 0%, transparent 70%);
  filter: blur(60px);
}

#particles-container::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 30%;
  width: 400px;
  height: 250px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  filter: blur(80px);
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
  pointer-events: none;
}

/* --- Screens --- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 32px 24px;
  padding-top: max(32px, env(safe-area-inset-top, 32px));
  padding-bottom: max(32px, env(safe-area-inset-bottom, 32px));
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
  animation: screenIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screen.leaving {
  animation: screenOut 0.3s ease forwards;
}

/* =============================================
   SCREEN: HOME
   ============================================= */
.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 40px;
  width: 100%;
  text-align: center;
}

.logo {
  position: relative;
}

/* Glow behind logo */
.logo::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.logo-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 30px rgba(212, 165, 116, 0.6));
  animation: floatIcon 3s ease-in-out infinite;
  position: relative;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
  line-height: 1.3;
  position: relative;
}

.title-shimmer {
  background: linear-gradient(90deg,
    #a67c52 0%, #d4a574 20%, #fff5d4 50%, #d4a574 80%, #a67c52 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

.logo-subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 12px;
  position: relative;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
  position: relative;
}

.version-tag {
  position: absolute;
  bottom: 24px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: var(--font-mono);
  letter-spacing: 2px;
}

/* =============================================
   SCREEN: SETUP
   ============================================= */
.setup-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.screen-header {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 16px;
  margin-bottom: 8px;
}

.screen-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-primary);
  flex: 1;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.btn-back {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px 12px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-back:active {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  background: rgba(212, 165, 116, 0.08);
}

.setup-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-section label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* --- Theme Selector (Card-style with glow) --- */
.theme-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-option {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  overflow: hidden;
}

/* Glow behind selected */
.theme-option.selected {
  border-color: rgba(212, 165, 116, 0.5);
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow:
    0 0 0 1px rgba(212, 165, 116, 0.15),
    0 4px 20px rgba(212, 165, 116, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-option.selected::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.1), transparent 60%);
  pointer-events: none;
}

.theme-option .theme-icon {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 6px;
}

/* --- Category Selector --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.category-option {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.category-option .cat-icon {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 3px;
}

.category-option.selected {
  border-color: rgba(212, 165, 116, 0.4);
  color: var(--text-primary);
  background: rgba(212, 165, 116, 0.06);
  box-shadow: 0 0 15px rgba(212, 165, 116, 0.1);
}

/* --- Player Counter --- */
.player-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 8px 0;
}

.count-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.count-btn:active {
  transform: scale(0.9);
  border-color: var(--gold-primary);
  background: rgba(212, 165, 116, 0.1);
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.15);
}

.count-value {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  min-width: 70px;
  text-align: center;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(212, 165, 116, 0.3));
}

/* Traitor counter (smaller) */
.traitor-counter { gap: 24px; }
.count-btn-sm { width: 44px; height: 44px; font-size: 1.2rem; }
.count-value-sm {
  font-size: 2.2rem;
  min-width: 50px;
  background: linear-gradient(180deg, var(--red-light), var(--red-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.3));
}

/* Judas Info Badge */
.judas-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

/* --- Round Selector --- */
.round-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.round-option {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.round-option.selected {
  border-color: var(--gold-primary);
  background: var(--gold-gradient);
  color: var(--bg-primary);
  box-shadow: 0 4px 20px rgba(212, 165, 116, 0.3);
  transform: scale(1.08);
}

/* =============================================
   SCREEN: ROLES DISTRIBUTION
   ============================================= */
.roles-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  text-align: center;
  gap: 32px;
}

.pass-phone-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.player-name-display {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(212, 165, 116, 0.4));
}

/* --- Swipe to Reveal (Modern card with glow border) --- */
.swipe-reveal-container {
  width: 100%;
  height: 420px;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  touch-action: none;
}

/* Glow ring behind card */
.swipe-reveal-container::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.3), rgba(139, 92, 246, 0.2));
  filter: blur(1px);
  opacity: 0.5;
  z-index: 0;
}

.swipe-reveal-content {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 16px;
  z-index: 1;
}

.swipe-reveal-content.role-discipulo {
  background: linear-gradient(165deg, #111118 0%, #0d0d12 100%);
  border: 1px solid rgba(212, 165, 116, 0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 40px rgba(212, 165, 116, 0.1);
}

.swipe-reveal-content.role-judas {
  background: linear-gradient(165deg, #140d0d 0%, #120a0a 100%);
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 40px rgba(239, 68, 68, 0.1);
}

.swipe-reveal-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, #13131a 0%, #0c0c10 100%);
  border: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: grab;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06);
  will-change: transform;
}

.swipe-reveal-cover:active { cursor: grabbing; }
.swipe-reveal-cover.dragging { transition: none; }
.swipe-reveal-cover.released { transform: translateY(0) !important; }

.swipe-icon {
  font-size: 1rem;
  color: var(--gold-primary);
  opacity: 0.5;
}

.swipe-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 2px;
  line-height: 1.8;
  text-transform: uppercase;
}

/* Animated arrows */
.swipe-arrow-anim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
}

.arrow-up {
  display: block;
  width: 10px;
  height: 10px;
  border-left: 1.5px solid var(--gold-primary);
  border-top: 1.5px solid var(--gold-primary);
  transform: rotate(45deg);
  opacity: 0.15;
  animation: arrowBounce 1.5s ease-in-out infinite;
}
.arrow-up:nth-child(1) { animation-delay: 0s; }
.arrow-up:nth-child(2) { animation-delay: 0.15s; }
.arrow-up:nth-child(3) { animation-delay: 0.3s; }

/* Role card content */
.card-role-icon { font-size: 2.8rem; }

.card-role-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.role-discipulo .card-role-label { color: var(--gold-primary); }
.role-judas .card-role-label { color: var(--red-light); }

.card-word-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: var(--font-mono);
}

.card-word {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 3px;
}

.role-discipulo .card-word {
  color: var(--gold-light);
  filter: drop-shadow(0 0 20px rgba(240, 214, 138, 0.5));
}

.role-judas .card-word {
  color: var(--red-light);
  filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.5));
}

.card-judas-instruction {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: center;
  max-width: 240px;
  font-style: italic;
}

.card-judas-instruction strong {
  color: var(--red-light);
  font-style: normal;
}

.role-progress {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 2px;
}

/* =============================================
   SCREEN: ROUNDS
   ============================================= */
.rounds-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  text-align: center;
  gap: 28px;
}

.round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 4px;
}

.round-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Timer Ring */
.timer-container {
  position: relative;
  width: 180px;
  height: 180px;
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

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

.timer-progress {
  fill: none;
  stroke: var(--gold-primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke 0.5s ease;
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

.timer-progress.warning {
  stroke: var(--red-primary);
  filter: drop-shadow(0 0 6px var(--red-glow));
}

.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timer-text.warning {
  color: var(--red-light);
  animation: pulse 1s ease infinite;
}

.current-player-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(212, 165, 116, 0.4));
  animation: pulseGlow 2s ease infinite;
}

.round-instruction {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}

.round-instruction strong {
  color: var(--gold-primary);
}

.progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.progress-dot.done {
  background: var(--gold-primary);
  box-shadow: 0 0 8px rgba(212, 165, 116, 0.5);
}

.progress-dot.current {
  background: var(--gold-light);
  box-shadow: 0 0 12px rgba(240, 214, 138, 0.7);
  transform: scale(1.4);
}

.btn-end-game {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 12px 20px;
  margin-top: 8px;
  transition: color 0.2s ease;
}

.btn-end-game:active {
  color: var(--red-light);
}

.bottom-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 12px;
}

.bottom-divider {
  color: var(--text-muted);
  font-size: 0.6rem;
  opacity: 0.4;
  user-select: none;
}

/* =============================================
   SCREEN: VOTING
   ============================================= */
.voting-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.voting-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 2px;
}

.vote-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.vote-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.vote-item-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.vote-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vote-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.vote-btn:active {
  transform: scale(0.88);
  background: rgba(212, 165, 116, 0.12);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.vote-count {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.vote-count.pop { animation: votePop 0.3s ease; }

.voting-footer { padding-top: 16px; }

/* =============================================
   SCREEN: RESULT
   ============================================= */
.result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  text-align: center;
  gap: 32px;
}

.result-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.result-card {
  position: relative;
  width: 280px;
  padding: 48px 32px;
  border-radius: var(--radius-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: cardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: scale(0.8);
  overflow: hidden;
}

/* Gradient glow ring behind result card */
.result-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  z-index: -1;
  filter: blur(1px);
}

.result-card.discipulo {
  background: var(--bg-card);
  border: 1px solid rgba(212, 165, 116, 0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(212, 165, 116, 0.1);
}

.result-card.discipulo::before {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.4), rgba(139, 92, 246, 0.2));
}

.result-card.judas {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(239, 68, 68, 0.1);
}

.result-card.judas::before {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(234, 88, 12, 0.2));
}

.result-card-icon { font-size: 3rem; }

.result-card-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.result-card-role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.result-card.discipulo .result-card-role { color: var(--gold-primary); }
.result-card.judas .result-card-role { color: var(--red-light); }

/* =============================================
   SCREEN: END GAME
   ============================================= */
.end-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  text-align: center;
  gap: 28px;
}

.end-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 4px;
  text-transform: uppercase;
}

.end-winner {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: winnerReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.end-winner.discipulos {
  background: linear-gradient(180deg, var(--gold-light), var(--gold-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(212, 165, 116, 0.5));
}

.end-winner.judas-win {
  background: linear-gradient(180deg, var(--red-light), var(--red-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.5));
}

.end-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.end-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.end-summary-card h4 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.end-word-reveal {
  display: flex;
  justify-content: center;
  gap: 40px;
}

.end-word-item { text-align: center; }

.end-word-item .label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.end-word-item .word {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.end-word-item.discipulo-word .word { color: var(--gold-primary); }
.end-word-item.judas-word .word { color: var(--red-light); }

.end-players-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.end-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.end-player-row:last-child { border-bottom: none; }

.end-player-role {
  font-size: 0.6rem;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.end-player-role.discipulo {
  background: rgba(212, 165, 116, 0.1);
  color: var(--gold-primary);
  border: 1px solid rgba(212, 165, 116, 0.2);
}

.end-player-role.judas {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.end-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

/* =============================================
   SCREEN: INSTALL & SHARE
   ============================================= */
.install-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.install-app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.install-app-icon {
  width: 56px;
  height: 56px;
  background: var(--gold-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #09090b;
  flex-shrink: 0;
}

.install-app-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.install-app-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.install-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-section-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.install-section-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.install-manual {
  margin-top: 4px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  animation: slideIn 0.3s ease forwards;
}

.install-manual.highlight {
  border-color: var(--gold-dark);
  background: rgba(212, 165, 116, 0.05);
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.08);
}

.install-manual-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.install-steps {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.install-steps strong {
  color: var(--text-primary);
}

/* iOS Visual Guide */
.ios-guide-toggle {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s ease;
}

.ios-guide-toggle:active { opacity: 0.6; }

.ios-guide-toggle .toggle-arrow {
  transition: transform 0.3s ease;
  font-size: 0.5rem;
}

.ios-guide-toggle.open .toggle-arrow {
  transform: rotate(90deg);
}

.ios-visual-guide {
  display: none;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
  animation: fadeSlideIn 0.3s ease forwards;
}

.ios-visual-guide.visible {
  display: flex;
}

.ios-guide-step {
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ios-guide-step svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}

.ios-guide-caption {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.ios-guide-caption strong {
  color: var(--gold-primary);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.install-steps .step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--gold-gradient);
  color: #09090b;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 6px;
  vertical-align: middle;
}

.share-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-link-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  border-radius: 100px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  outline: none;
}

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

.share-copy-btn {
  background: var(--gold-gradient);
  color: #09090b;
  border: none;
  border-radius: 100px;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.share-copy-btn:active {
  transform: scale(0.95);
}

.share-copied-msg {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #4ade80;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  animation: slideIn 0.3s ease forwards;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  position: relative;
  background: #fafafa;
  color: #09090b;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px 32px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.08);
  width: 100%;
  overflow: hidden;
}

/* Shine sweep on press */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  border-radius: inherit;
}

.btn-primary:active {
  transform: scale(0.96);
  background: #e4e4e7;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.btn-primary:active::after { transform: translateX(100%); }

.btn-primary:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary:disabled:active { transform: none; }
.btn-primary:disabled::after { display: none; }

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  padding: 14px 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text-primary);
  transform: scale(0.96);
}

.btn-danger {
  background: transparent;
  color: var(--red-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 100px;
  padding: 16px 32px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-danger:active {
  background: rgba(239, 68, 68, 0.08);
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.btn-icon-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 12px 20px;
  margin-top: 8px;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-icon-link:active {
  color: var(--gold-primary);
}

.btn-icon-link-icon {
  font-size: 0.85rem;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  background: #111116;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 360px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
}

.modal-overlay.visible .modal-content {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-primary);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 3px;
}

.modal-body {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.8;
}

.modal-body h4 {
  color: var(--gold-primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  margin-top: 16px;
  margin-bottom: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.modal-body p { margin-bottom: 8px; }

.modal-close { margin-top: 24px; width: 100%; }

/* =============================================
   EFFECTS
   ============================================= */

/* Confetti */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

/* Flash Overlay */
.flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0;
}

.flash-overlay.flash-red {
  background: radial-gradient(circle, rgba(239,68,68,0.2), transparent 70%);
  animation: flashPulse 0.6s ease;
}

.flash-overlay.flash-gold {
  background: radial-gradient(circle, rgba(212,165,116,0.2), transparent 70%);
  animation: flashPulse 0.6s ease;
}

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */

@keyframes screenIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes screenOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-15px); }
}

@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@keyframes particleFloat {
  0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.1; }
  100% { transform: translateY(-10vh) translateX(30px); opacity: 0; }
}

@keyframes arrowBounce {
  0%, 100% { opacity: 0.1; transform: rotate(45deg) translateY(0); }
  50%      { opacity: 0.5; transform: rotate(45deg) translateY(-4px); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(212, 165, 116, 0.3)); }
  50%      { filter: drop-shadow(0 0 25px rgba(212, 165, 116, 0.6)); }
}

@keyframes votePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

@keyframes cardReveal {
  0%   { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes winnerReveal {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

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

@keyframes flashPulse {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* =============================================
   ACCESSIBILITY
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
