/* ════════════════════════════════════════════════
   WINELOVELY · Global Reset & Variables
════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --wine:        #7b1c35;
  --wine-deep:   #4a0e1f;
  --wine-light:  #c0445e;
  --wine-glow:   #e8607c;
  --bg:          #0f0508;
  --bg-card:     #1e0c13;
  --gold:        #d4a843;
  --gold-light:  #f0c860;
  --text:        #f5e8ec;
  --text-dim:    #9a7a83;
  --radius:      16px;
  --radius-lg:   24px;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════
   SCREENS
════════════════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow-y: auto;
  gap: 24px;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ════════════════════════════════════════════════
   BACKGROUND TEXTURE
════════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(123,28,53,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(74,14,31,0.22) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.screen { z-index: 1; }

/* ════════════════════════════════════════════════
   SCREEN 1 · INTRO
════════════════════════════════════════════════ */
.intro-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(20px);
  /* animation driven by JS */
}

.logo-wine {
  font-size: 56px;
  filter: drop-shadow(0 0 20px rgba(200,70,90,0.6));
}

.logo-text {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--gold-light), var(--wine-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-typing {
  min-height: 100px;
  font-size: 20px;
  font-style: italic;
  color: var(--text);
  text-align: center;
  line-height: 1.8;
  white-space: pre-line;
  opacity: 0;
}

.powered-by {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.powered-by.visible { opacity: 1; }

/* ════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════ */
.btn-primary {
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--wine), var(--wine-light));
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(123,28,53,0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.4s ease;
  width: 100%;
  max-width: 320px;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 12px rgba(123,28,53,0.3);
}

.btn-primary.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ════════════════════════════════════════════════
   SCREEN TITLE
════════════════════════════════════════════════ */
.screen-title {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  background: linear-gradient(135deg, var(--gold-light), #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ════════════════════════════════════════════════
   SCREEN 2 · PLAYER COUNT / STEPPER
════════════════════════════════════════════════ */
.stepper {
  display: flex;
  align-items: center;
  gap: 28px;
}

.stepper-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--wine-light);
  background: var(--bg-card);
  color: var(--wine-glow);
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:active {
  background: var(--wine-deep);
  transform: scale(0.93);
}

.stepper-value {
  font-size: 72px;
  font-weight: 800;
  color: var(--wine-glow);
  min-width: 80px;
  text-align: center;
  line-height: 1;
}

.stepper-hint {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: -12px;
}

/* ════════════════════════════════════════════════
   SCREEN 3 · PLAYER NAMES
════════════════════════════════════════════════ */
.names-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px 2px;
}

.names-list::-webkit-scrollbar { width: 4px; }
.names-list::-webkit-scrollbar-track { background: transparent; }
.names-list::-webkit-scrollbar-thumb { background: var(--wine); border-radius: 4px; }

.name-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1.5px solid rgba(123,28,53,0.5);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.name-input::placeholder { color: var(--text-dim); }
.name-input:focus { border-color: var(--wine-glow); }

/* ════════════════════════════════════════════════
   SCREEN 4 · WHEEL
════════════════════════════════════════════════ */
.wheel-title { margin-bottom: -8px; }

.wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  color: var(--gold-light);
  z-index: 10;
  filter: drop-shadow(0 2px 8px rgba(212,168,67,0.6));
  line-height: 1;
}

#wheelCanvas {
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(123,28,53,0.5), 0 0 80px rgba(123,28,53,0.2);
}

.btn-spin {
  padding: 18px 52px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(212,168,67,0.4);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.3s;
}

.btn-spin:active { transform: scale(0.96); }
.btn-spin:disabled { opacity: 0.4; cursor: default; }

.winner-banner {
  text-align: center;
  animation: fadeInUp 0.5s ease forwards;
}

.winner-banner.hidden { display: none; }

.winner-label {
  font-size: 15px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.winner-name {
  font-size: 34px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-light), var(--wine-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 4px 0 16px;
}

.truth-dare-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.btn-truth,
.btn-dare {
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s;
}

.btn-truth {
  background: linear-gradient(135deg, #1a4fa0, #2e6fde);
  color: #fff;
  box-shadow: 0 4px 18px rgba(30,79,160,0.4);
}

.btn-dare {
  background: linear-gradient(135deg, var(--wine), var(--wine-light));
  color: #fff;
  box-shadow: 0 4px 18px rgba(123,28,53,0.4);
}

.btn-truth:active, .btn-dare:active { transform: scale(0.95); }

/* ════════════════════════════════════════════════
   SCREEN 5 · QUESTION
════════════════════════════════════════════════ */
.question-card {
  background: var(--bg-card);
  border: 1.5px solid rgba(123,28,53,0.4);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  text-align: center;
  animation: fadeInUp 0.45s ease forwards;
}

.question-type {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 6px 14px;
  border-radius: 100px;
  display: inline-block;
}

.question-type.truth {
  background: rgba(30,79,160,0.25);
  color: #6fa3ff;
  border: 1px solid rgba(30,79,160,0.4);
}

.question-type.dare {
  background: rgba(123,28,53,0.3);
  color: var(--wine-glow);
  border: 1px solid rgba(192,68,94,0.4);
}

.question-text {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}

/* ════════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

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

@keyframes logoRise {
  from { opacity: 1; transform: translateY(0);      }
  to   { opacity: 1; transform: translateY(-36vh);  }
}

@keyframes typingFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,168,67,0.5); }
  50%       { box-shadow: 0 0 0 12px rgba(212,168,67,0); }
}

.btn-spin.pulse { animation: pulse 1.6s ease infinite; }

/* ════════════════════════════════════════════════
   UTILITY
════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* Scrollbar for full page */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--wine-deep); border-radius: 4px; }