@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─── CSS Variables ──────────────────────────────────── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-input: #16162a;

  --neon-pink: #ff6ec7;
  --neon-purple: #b06ab3;
  --neon-gradient: linear-gradient(135deg, #ff6ec7, #b06ab3, #8a5cf5);
  --neon-glow-pink: 0 0 1.5rem rgba(255, 110, 199, 0.4);
  --neon-glow-purple: 0 0 1.5rem rgba(176, 106, 179, 0.4);
  --neon-glow-strong: 0 0 2rem rgba(255, 110, 199, 0.6), 0 0 4rem rgba(176, 106, 179, 0.3);

  --text-primary: #f0e6ff;
  --text-secondary: #9d8ec7;
  --text-muted: #6b5b8a;

  --mode-light: #4ade80;
  --mode-adult: #fbbf24;
  --mode-dirty: #f43f5e;

  --radius: 1rem;
  --radius-sm: 0.625rem;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  font-size: clamp(14px, 2vw, 18px);
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ─── Layout ─────────────────────────────────────────── */
.app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.screen {
  display: none;
  width: 100%;
  max-width: 32rem;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--neon-glow-pink); }
  50% { box-shadow: var(--neon-glow-strong); }
}

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

/* ─── Typography ─────────────────────────────────────── */
.logo {
  font-size: 2.5rem;
  font-weight: 900;
  background: var(--neon-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  filter: drop-shadow(0 0 1.5rem rgba(255, 110, 199, 0.4));
  letter-spacing: -0.03em;
}

.subtitle {
  color: var(--text-secondary);
  text-align: center;
  font-size: 1rem;
  font-weight: 400;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--neon-gradient);
  color: #fff;
  box-shadow: var(--neon-glow-pink);
}

.btn-primary:hover {
  transform: translateY(-0.125rem);
  box-shadow: var(--neon-glow-strong);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid rgba(255, 110, 199, 0.2);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  color: var(--neon-pink);
}

.btn-full {
  width: 100%;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 110, 199, 0.1);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(255, 110, 199, 0.3);
}

.card-game {
  cursor: pointer;
  text-align: center;
  padding: 2rem 1.5rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

.card-game:hover {
  background: var(--bg-card-hover);
  transform: translateY(-0.25rem);
}

.card-game .card-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.card-game .card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-game .card-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ─── Mode Cards ─────────────────────────────────────── */
.mode-card {
  cursor: pointer;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mode-card:hover {
  transform: translateY(-0.125rem);
}

.mode-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.mode-dot.light { background: var(--mode-light); box-shadow: 0 0 0.5rem rgba(74, 222, 128, 0.5); }
.mode-dot.adult { background: var(--mode-adult); box-shadow: 0 0 0.5rem rgba(251, 191, 36, 0.5); }
.mode-dot.dirty { background: var(--mode-dirty); box-shadow: 0 0 0.5rem rgba(244, 63, 94, 0.5); }

.mode-info {
  flex: 1;
}

.mode-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.mode-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ─── Inputs ─────────────────────────────────────────── */
.input-group {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid rgba(255, 110, 199, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.input:focus {
  border-color: var(--neon-pink);
  box-shadow: 0 0 0.5rem rgba(255, 110, 199, 0.2);
}

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

/* ─── Gender Toggle ──────────────────────────────────── */
.gender-toggle {
  display: flex;
  gap: 0.25rem;
}

.gender-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 110, 199, 0.15);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.gender-btn.selected {
  border-color: var(--neon-pink);
  background: rgba(255, 110, 199, 0.15);
  color: var(--text-primary);
  box-shadow: 0 0 0.5rem rgba(255, 110, 199, 0.2);
}

.add-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neon-gradient);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.add-btn:hover {
  box-shadow: var(--neon-glow-pink);
  transform: scale(1.05);
}

/* ─── Player List ────────────────────────────────────── */
.player-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 40vh;
  overflow-y: auto;
}

.player-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 110, 199, 0.08);
  border-radius: var(--radius-sm);
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.player-emoji {
  font-size: 1.25rem;
}

.player-name {
  flex: 1;
  font-weight: 500;
}

.player-gender {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.player-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition);
  line-height: 1;
}

.player-remove:hover {
  color: var(--mode-dirty);
}

/* ─── Game Screen ────────────────────────────────────── */
.game-player {
  text-align: center;
}

.game-player-name {
  font-size: 2rem;
  font-weight: 800;
  background: var(--neon-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-player-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.choice-buttons {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.choice-btn {
  flex: 1;
  padding: 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: 2px solid;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-card);
}

.choice-btn.truth {
  border-color: rgba(138, 92, 245, 0.5);
  color: #a78bfa;
}

.choice-btn.truth:hover {
  background: rgba(138, 92, 245, 0.15);
  border-color: #a78bfa;
  box-shadow: 0 0 1.5rem rgba(138, 92, 245, 0.3);
  transform: translateY(-0.125rem);
}

.choice-btn.dare {
  border-color: rgba(255, 110, 199, 0.5);
  color: var(--neon-pink);
}

.choice-btn.dare:hover {
  background: rgba(255, 110, 199, 0.15);
  border-color: var(--neon-pink);
  box-shadow: 0 0 1.5rem rgba(255, 110, 199, 0.3);
  transform: translateY(-0.125rem);
}

/* ─── Content Card ───────────────────────────────────── */
.content-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 110, 199, 0.2);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.content-type-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.content-text {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ─── Loading ────────────────────────────────────────── */
.loading {
  display: none;
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.loading.active {
  display: block;
}

.spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 110, 199, 0.15);
  border-top-color: var(--neon-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ─── Header / Nav ───────────────────────────────────── */
.header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 0.375rem;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 110, 199, 0.3);
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 110, 199, 0.5);
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
  .app {
    padding: 1.5rem 0.75rem;
  }

  .logo {
    font-size: 2rem;
  }

  .choice-buttons {
    gap: 0.75rem;
  }

  .choice-btn {
    padding: 1rem;
    font-size: 1rem;
  }

  .content-text {
    font-size: 1.1rem;
  }
}

@media (min-width: 768px) {
  .app {
    padding: 3rem 2rem;
  }
}
