/* ==============================================
   YO NUNCA — Bold, chunky, festival poster vibes
   Big blocky type, solid color backgrounds, tilt
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Archivo+Black&display=swap');

:root {
  --black: #0a0a0a;
  --white: #fafafa;
  --gray: #777;
  --gray-light: #ddd;
  --accent: #ff2d55;
  --radius: 16px;
  --font-display: 'Archivo Black', 'Impact', sans-serif;
  --font-body: 'Space Grotesk', -apple-system, sans-serif;

  /* Rotating question backgrounds */
  --bg-1: #ffe156;
  --bg-2: #ff6b6b;
  --bg-3: #c084fc;
  --bg-4: #4ade80;
  --bg-5: #38bdf8;
  --bg-6: #fb923c;
  --bg-7: #f472b6;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

/* ---- Screens ---- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 1;
  background: var(--white);
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

.screen-content {
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  padding: 60px 24px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.screen-content-center {
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* ========================================
   WELCOME SCREEN
   ======================================== */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 4px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 11rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: 0.05em;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  width: 100%;
  padding: 18px 32px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
}

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

.btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  color: var(--black);
  border: 3px solid var(--black);
}

.btn-back {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--black);
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 20;
}

.btn-back:hover {
  background: rgba(0,0,0,0.06);
}

.btn-exit {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: opacity 0.2s;
}

.btn-exit:hover {
  opacity: 1;
}

/* ========================================
   SETUP SCREEN
   ======================================== */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--gray);
  margin-top: -16px;
  font-weight: 500;
}

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

.setup-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray);
}

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

.toggle-btn {
  flex: 1;
  padding: 14px 8px;
  border: 3px solid var(--gray-light);
  border-radius: 14px;
  background: transparent;
  font-family: var(--font-display);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--black);
  text-transform: uppercase;
}

.toggle-btn:hover {
  border-color: var(--black);
}

.toggle-btn.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ========================================
   PLAYERS SCREEN
   ======================================== */
.players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 4px;
}

.player-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  animation: slideIn 0.2s ease;
}

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

.player-input {
  flex: 1;
  padding: 14px 16px;
  border: 3px solid var(--gray-light);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
  background: transparent;
  color: var(--black);
}

.player-input:focus {
  border-color: var(--black);
}

.player-input::placeholder {
  color: #bbb;
  font-weight: 400;
}

.btn-remove-player {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  flex-shrink: 0;
}

.btn-remove-player:hover {
  color: var(--accent);
}

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 3px dashed var(--gray-light);
  border-radius: 14px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add:hover {
  border-color: var(--black);
  color: var(--black);
}

.btn-add:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ========================================
   GAME SCREEN — SOLID COLOR BACKGROUNDS
   ======================================== */
#screen-game {
  transition: background-color 0.4s ease, opacity 0.35s ease, visibility 0.35s ease;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 24px;
  z-index: 5;
}

.game-progress {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--black);
  opacity: 0.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  perspective: 600px;
}

.card-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Smooth floaty tilt via JS requestAnimationFrame */
  will-change: transform;
}

.card-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--black);
  opacity: 0.35;
  margin-bottom: 12px;
}

.card-question {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8.5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  word-break: break-word;
  text-transform: uppercase;
  color: var(--black);
}

/* Card animation */
.card-enter {
  animation: cardEnter 0.3s ease forwards;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========================================
   DRINK SCREEN
   ======================================== */
#screen-drink {
  background: var(--black);
  color: var(--white);
}

#screen-drink .btn-primary {
  background: var(--white);
  color: var(--black);
}

.drink-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.drink-icon {
  font-size: 5rem;
  animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0) rotate(-3deg); }
  to { transform: translateY(-16px) rotate(3deg); }
}

.drink-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 12vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.drink-message {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  max-width: 300px;
  white-space: pre-line;
}

/* ========================================
   END SCREEN
   ======================================== */
.end-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.end-icon {
  font-size: 5rem;
}

.end-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 14vw, 7rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.end-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray);
  max-width: 280px;
}

.end-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

/* ========================================
   CONFETTI CANVAS
   ======================================== */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* ========================================
   SCROLLBAR
   ======================================== */
.players-list::-webkit-scrollbar { width: 3px; }
.players-list::-webkit-scrollbar-track { background: transparent; }
.players-list::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 3px; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 380px) {
  .screen-content {
    padding: 48px 18px 28px;
    gap: 22px;
  }
  .toggle-btn {
    padding: 12px 4px;
    font-size: 0.8rem;
  }
  .card-question {
    font-size: clamp(1.7rem, 7.5vw, 3.5rem);
  }
}

@media (min-height: 800px) {
  .hero-title {
    font-size: clamp(6rem, 20vw, 12rem);
  }
  .card-question {
    font-size: clamp(2.5rem, 9vw, 5rem);
  }
}

@media (min-width: 768px) {
  .card-question {
    font-size: clamp(3rem, 5vw, 4.5rem);
  }
}
