/* ========================================
   VERDADE OU DESAFIO — PARTY GAME
   Complete Stylesheet
   ======================================== */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0015;
  --bg-secondary: #150a28;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #b8b0cc;
  --text-muted: #6b6080;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-green: #22c55e;
  --accent-cyan: #06b6d4;
  --accent-yellow: #eab308;
  --neon-glow: 0 0 20px rgba(168, 85, 247, 0.5), 0 0 40px rgba(168, 85, 247, 0.2);
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Fredoka One', cursive;
  --font-body: 'Nunito', sans-serif;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- CANVAS LAYERS ---------- */
#particlesCanvas,
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#confettiCanvas {
  z-index: 1000;
}

/* ---------- CUSTOM SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 3px;
}

/* ---------- SELECTION ---------- */
::selection {
  background: rgba(168, 85, 247, 0.4);
  color: #fff;
}

/* ---------- SCREENS ---------- */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* ===========================================
   BUTTONS
   =========================================== */

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1.3;
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  padding: 14px 28px;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 30px rgba(168, 85, 247, 0.5);
  transform: translateY(-2px);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 14px 28px;
  font-size: 1rem;
  border: 2px solid rgba(168, 85, 247, 0.3);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.1);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 14px 28px;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.btn-ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
}

/* Success */
.btn-success {
  background: linear-gradient(135deg, #059669, var(--accent-green));
  color: #fff;
  padding: 14px 28px;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}
.btn-success:hover:not(:disabled) {
  box-shadow: 0 6px 25px rgba(34, 197, 94, 0.5);
  transform: translateY(-2px);
}

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, #b91c1c, var(--accent-red));
  color: #fff;
  padding: 14px 28px;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover:not(:disabled) {
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
}

/* Warning */
.btn-warning {
  background: linear-gradient(135deg, #d97706, var(--accent-orange));
  color: #fff;
  padding: 14px 28px;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

/* Sizes */
.btn-lg {
  padding: 18px 36px;
  font-size: 1.15rem;
}
.btn-md {
  padding: 14px 28px;
  font-size: 1rem;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Icon Button */
.icon-btn {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  background: var(--bg-card-hover);
  transform: scale(1.05);
}
.icon-btn:active {
  transform: scale(0.95);
}

/* Back Button */
.btn-back {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-back:hover {
  background: var(--bg-card-hover);
}

/* ===========================================
   ANIMATIONS
   =========================================== */

/* Pulse */
.pulse-btn {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
  }
  50% {
    box-shadow: 0 4px 40px rgba(168, 85, 247, 0.6),
                0 0 60px rgba(236, 72, 153, 0.3);
  }
}

/* Glow */
.glow-btn {
  animation: glow 2s infinite;
}
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.7),
                0 0 80px rgba(236, 72, 153, 0.3);
  }
}

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade Out */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Slide Up */
@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide Down */
@keyframes slideDown {
  from {
    transform: translateY(-40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Bounce In */
@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.08);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Card Slide In */
@keyframes cardSlideIn {
  from {
    transform: translateX(-30px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Shake */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

.shake {
  animation: shake 0.4s ease;
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===========================================
   MODAL OVERLAYS
   =========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-box {
  background: linear-gradient(145deg, #1e1035, #150a28);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--border-radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--transition);
  line-height: 1;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.modal-buttons .btn {
  flex: 1;
}

/* ---------- AGE MODAL ---------- */
.age-box {
  text-align: center;
}
.age-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}
.age-box h2 {
  font-family: var(--font-display);
  margin-bottom: 12px;
  font-size: 1.5rem;
}
.age-box p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ---------- CONFIRM MODAL ---------- */
.confirm-box {
  text-align: center;
  max-width: 380px;
}
.confirm-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}
.confirm-box h2 {
  font-family: var(--font-display);
  margin-bottom: 10px;
  font-size: 1.3rem;
}
.confirm-box p {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.9rem;
}

/* ---------- HOW TO PLAY MODAL ---------- */
.how-to-play-box h2 {
  font-family: var(--font-display);
  margin-bottom: 24px;
  text-align: center;
  font-size: 1.4rem;
}
.how-to-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 14px 18px;
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  position: relative;
  transition: var(--transition);
}
.step:hover {
  background: var(--bg-card-hover);
}
.step-number {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--accent-purple);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}
.step-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}
.how-to-play-box .btn-primary {
  width: 100%;
}

/* ---------- SETTINGS MODAL ---------- */
.settings-box h2 {
  font-family: var(--font-display);
  margin-bottom: 24px;
  font-size: 1.3rem;
}
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.setting-item label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}
.setting-item select {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.setting-item select:focus {
  border-color: var(--accent-purple);
}

.setting-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.settings-list .btn {
  width: 100%;
}

/* Toggle Switch */
.toggle-wrap {
  flex-shrink: 0;
}
.toggle-input {
  display: none;
}
.toggle-label {
  display: block;
  width: 52px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-label::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.toggle-input:checked + .toggle-label {
  background: var(--accent-purple);
}
.toggle-input:checked + .toggle-label::after {
  left: 27px;
}

/* ---------- MANAGE PLAYERS MODAL ---------- */
.manage-box h2 {
  font-family: var(--font-display);
  margin-bottom: 20px;
  font-size: 1.3rem;
}
.manage-players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 50vh;
  overflow-y: auto;
}
.manage-player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}
.manage-player-item:hover {
  background: var(--bg-card-hover);
}
.manage-player-item .manage-avatar {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.manage-player-item .manage-name {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
}
.manage-player-item .manage-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 8px;
}
.manage-player-item button {
  background: rgba(239, 68, 68, 0.15);
  border: none;
  color: var(--accent-red);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-body);
  transition: var(--transition);
}
.manage-player-item button:hover {
  background: rgba(239, 68, 68, 0.3);
}
.manage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===========================================
   HOME SCREEN
   =========================================== */

#screenHome {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.logo-container {
  animation: logoEntry 1s ease-out;
}

@keyframes logoEntry {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.logo-title {
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-line1 {
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.4));
}

.logo-ou {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 400;
  margin: 4px 0;
}

.logo-line2 {
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(236, 72, 153, 0.4));
}

.logo-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 12px;
  letter-spacing: 2px;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 300px;
}
.home-buttons .btn {
  width: 100%;
}

.home-footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sound-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 100;
  -webkit-user-select: none;
  user-select: none;
}
.sound-toggle:hover {
  background: var(--bg-card-hover);
  transform: scale(1.1);
}
.sound-toggle:active {
  transform: scale(0.95);
}

/* ===========================================
   PLAYER REGISTRATION SCREEN
   =========================================== */

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.screen-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  flex: 1;
}
.player-count {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
}

.players-instruction {
  text-align: center;
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px dashed rgba(168, 85, 247, 0.25);
  border-radius: var(--border-radius-sm);
  animation: fadeIn 0.5s ease;
}
.players-instruction p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Players Grid */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
  align-content: start;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-sm);
  padding: 16px 12px;
  text-align: center;
  position: relative;
  animation: cardSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: var(--transition);
}
.player-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.player-card-avatar {
  font-size: 2.5rem;
  margin-bottom: 8px;
  line-height: 1;
}
.player-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  word-break: break-word;
  line-height: 1.2;
}
.player-card-info {
  display: flex;
  gap: 6px;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.player-card-info span {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.player-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}
.player-card:hover .player-card-actions {
  opacity: 1;
}
.player-card-actions button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-card-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* Add Player Section */
.add-player-section {
  margin: 12px 0;
  flex-shrink: 0;
}

.btn-add-player {
  width: 100%;
  border-style: dashed !important;
  font-size: 1.05rem !important;
  padding: 16px !important;
}
.plus-icon {
  font-size: 1.4rem;
  font-weight: 900;
}

/* Add Player Form Overlay */
.add-player-form {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.form-card {
  background: linear-gradient(145deg, #1e1035, #150a28);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--border-radius);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-card h3 {
  font-family: var(--font-display);
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.form-group input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: var(--transition);
}
.form-group input[type="text"]:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}
.form-group input[type="text"]::placeholder {
  color: var(--text-muted);
}
.form-group input[type="text"].error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-error {
  display: block;
  color: var(--accent-red);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 6px;
}

/* Avatar Grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.avatar-option {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  -webkit-user-select: none;
  user-select: none;
}
.avatar-option:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}
.avatar-option.selected {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.15);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
  transform: scale(1.1);
}

/* Option Buttons (Gender / Interaction) */
.option-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.opt-btn {
  flex: 1;
  min-width: 80px;
  padding: 12px 8px;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.opt-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}
.opt-btn.selected {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.form-actions .btn {
  flex: 1;
}

/* Screen Footer */
.screen-footer {
  padding: 16px 0 8px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}
.screen-footer .btn {
  width: 100%;
  max-width: 400px;
}

/* ===========================================
   LEVEL SELECTION SCREEN
   =========================================== */

.levels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
  align-content: start;
}

.level-card {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  font-family: var(--font-body);
  color: var(--text-primary);
}
.level-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s;
}
.level-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.level-card.selected {
  transform: scale(1.02);
}

/* Level-specific selected styles */
.level-card[data-level="1"].selected {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.3);
}
.level-card[data-level="2"].selected {
  border-color: var(--accent-orange);
  background: rgba(249, 115, 22, 0.08);
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.3);
}
.level-card[data-level="3"].selected {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}
.level-card[data-level="4"].selected {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.1);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
}

.level-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  line-height: 1;
}
.level-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.level-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 14px;
}

/* Heat Bar */
.heat-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.heat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.level-card[data-level="1"] .heat-fill {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
}
.level-card[data-level="2"] .heat-fill {
  background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
}
.level-card[data-level="3"] .heat-fill {
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-red));
}
.level-card[data-level="4"] .heat-fill {
  background: linear-gradient(90deg, var(--accent-red), var(--accent-purple));
}

/* Progressive Mode Toggle */
.progressive-toggle {
  margin: 16px 0 8px;
  flex-shrink: 0;
}
.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}
.toggle-container:hover {
  background: var(--bg-card-hover);
}
.toggle-slider {
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.toggle-container input:checked + .toggle-slider {
  background: var(--accent-purple);
}
.toggle-container input:checked + .toggle-slider::after {
  left: 25px;
}
.toggle-container input {
  display: none;
}
.toggle-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.3;
}

/* ===========================================
   GAME SCREEN
   =========================================== */

#screenGame {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Game Header */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.game-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.round-info {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.level-badge {
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.game-actions {
  display: flex;
  gap: 8px;
}

/* Game States */
.game-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* --- Waiting State (Spin) --- */
.spin-area {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.spin-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.12), rgba(236, 72, 153, 0.12));
  border: 3px solid rgba(168, 85, 247, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  animation: spinPulse 2s infinite;
}
.spin-circle:hover {
  border-color: var(--accent-purple);
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.22), rgba(236, 72, 153, 0.22));
  transform: scale(1.05);
}
.spin-circle:active {
  transform: scale(0.95);
}

@keyframes spinPulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.15);
  }
  50% {
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.35),
                0 0 100px rgba(236, 72, 153, 0.15);
  }
}

.spin-text {
  font-size: 3.5rem;
  line-height: 1;
}
.spin-circle p {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Spinning State --- */
.spinner-container {
  width: 100%;
  max-width: 320px;
  height: 100px;
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  background: var(--bg-card);
}
.spinner-highlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(10, 0, 21, 0.9) 0%,
    transparent 30%,
    transparent 70%,
    rgba(10, 0, 21, 0.9) 100%
  );
  z-index: 2;
  pointer-events: none;
  border: 2px solid var(--accent-purple);
  border-radius: var(--border-radius);
  box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.3);
}
.spinner-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.1s linear;
}
.spinner-name {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 800;
  width: 100%;
  flex-shrink: 0;
}
.spinner-name-avatar {
  font-size: 2.2rem;
  line-height: 1;
}

/* --- Revealed State --- */
.revealed-player {
  text-align: center;
  animation: revealBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes revealBounce {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.revealed-avatar {
  font-size: 5rem;
  margin-bottom: 16px;
  line-height: 1;
  animation: avatarGlow 1.5s infinite;
}

@keyframes avatarGlow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(236, 72, 153, 0.7));
  }
}

.revealed-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1.3;
}
.revealed-name span {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Choose State --- */
#gameStateChoose {
  flex-direction: column;
  gap: 8px;
}

.choose-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 28px;
  text-align: center;
}
.choose-title span {
  color: var(--accent-purple);
}

.choose-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

.choose-btn {
  flex: 1;
  padding: 32px 16px;
  border: 3px solid;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  color: var(--text-primary);
  animation: choiceSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.choose-btn:nth-child(1) {
  animation-delay: 0.1s;
}
.choose-btn:nth-child(2) {
  animation-delay: 0.2s;
}

@keyframes choiceSlideIn {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Truth button */
.truth-btn {
  border-color: rgba(59, 130, 246, 0.35);
}
.truth-btn:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
  transform: scale(1.04);
}
.truth-btn:active {
  transform: scale(0.97);
}

/* Dare button */
.dare-btn {
  border-color: rgba(239, 68, 68, 0.35);
}
.dare-btn:hover {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
  transform: scale(1.04);
}
.dare-btn:active {
  transform: scale(0.97);
}

.choose-icon {
  font-size: 2.5rem;
  line-height: 1;
}
.choose-label {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

/* Timer Bar */
.timer-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 20px;
}
.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-yellow), var(--accent-red));
  border-radius: 3px;
  transition: width 0.1s linear;
  width: 100%;
}

/* --- Truth & Dare Cards --- */
.card-display {
  width: 100%;
  max-width: 420px;
  border-radius: var(--border-radius);
  overflow: hidden;
  animation: cardReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardReveal {
  from {
    transform: scale(0.8) rotateY(10deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotateY(0);
    opacity: 1;
  }
}

.truth-card {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.12), rgba(6, 182, 212, 0.08));
  border: 2px solid rgba(59, 130, 246, 0.3);
}
.dare-card {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.08));
  border: 2px solid rgba(239, 68, 68, 0.3);
}

.card-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-type-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.card-body {
  padding: 32px 24px;
}
.card-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.dare-target {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-sm);
  animation: fadeIn 0.4s ease 0.3s both;
}
.dare-target-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.dare-target-avatar {
  font-size: 1.8rem;
  line-height: 1;
}
.dare-target-name {
  font-weight: 800;
  color: var(--accent-pink);
  font-size: 1.1rem;
}

.card-actions {
  padding: 18px 24px;
  display: flex;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.card-actions .btn {
  flex: 1;
  font-size: 0.9rem;
}

/* --- Punishment State --- */
.punishment-display {
  text-align: center;
  animation: bounceIn 0.5s ease;
  max-width: 380px;
}
.punishment-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  line-height: 1;
}
.punishment-display h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
  line-height: 1.4;
}
.punishment-display .punishment-text {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 28px;
  line-height: 1.5;
  color: var(--accent-orange);
}

/* --- Next Round State --- */
.next-round-display {
  text-align: center;
  animation: slideUp 0.4s ease;
  max-width: 380px;
}
.result-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  line-height: 1;
}
.next-round-display h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.4;
}
.score-change {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 28px;
}
.score-change.positive {
  color: var(--accent-green);
}
.score-change.negative {
  color: var(--accent-red);
}

/* --- Players Bar (Bottom) --- */
.players-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  scrollbar-width: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.players-bar::-webkit-scrollbar {
  display: none;
}

.player-pip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 56px;
  transition: var(--transition);
  cursor: default;
}
.player-pip-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 2px solid transparent;
  transition: var(--transition);
  line-height: 1;
}
.player-pip.active .player-pip-avatar {
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
  transform: scale(1.1);
}
.player-pip-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.player-pip.active .player-pip-name {
  color: var(--accent-purple);
}
.player-pip-score {
  font-size: 0.6rem;
  color: var(--accent-yellow);
  font-weight: 800;
}

/* --- Scoreboard --- */
.scoreboard-box h2 {
  font-family: var(--font-display);
  margin-bottom: 20px;
  font-size: 1.3rem;
}
.scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 55vh;
  overflow-y: auto;
}
.scoreboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}
.scoreboard-item:first-child {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
}
.scoreboard-item:nth-child(2) {
  background: rgba(192, 192, 192, 0.06);
  border: 1px solid rgba(192, 192, 192, 0.15);
}
.scoreboard-item:nth-child(3) {
  background: rgba(205, 127, 50, 0.06);
  border: 1px solid rgba(205, 127, 50, 0.15);
}
.scoreboard-rank {
  font-size: 1.2rem;
  font-weight: 900;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.scoreboard-avatar {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}
.scoreboard-name {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
}
.scoreboard-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.scoreboard-score {
  font-weight: 800;
  color: var(--accent-purple);
  font-size: 1.1rem;
}
.scoreboard-detail {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.scoreboard-close-btn {
  width: 100%;
}

/* ===========================================
   GAME OVER SCREEN
   =========================================== */

#screenGameOver {
  justify-content: center;
  align-items: center;
}

.game-over-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 480px;
  width: 100%;
  animation: slideUp 0.6s ease;
}

.game-over-header {
  text-align: center;
}
.game-over-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.game-over-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.game-over-stats {
  width: 100%;
}

/* Podium */
.final-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  min-height: 200px;
}
.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.5s ease both;
}
.podium-place:nth-child(1) { animation-delay: 0.3s; }
.podium-place:nth-child(2) { animation-delay: 0.1s; }
.podium-place:nth-child(3) { animation-delay: 0.5s; }

.podium-avatar {
  font-size: 2.5rem;
  line-height: 1;
}
.podium-name {
  font-weight: 800;
  font-size: 0.85rem;
  max-width: 80px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-score {
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent-yellow);
}
.podium-bar {
  width: 80px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  padding-top: 12px;
}
.podium-bar.first {
  height: 120px;
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.3), rgba(234, 179, 8, 0.08));
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.podium-bar.second {
  height: 90px;
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.25), rgba(192, 192, 192, 0.06));
  border: 1px solid rgba(192, 192, 192, 0.25);
}
.podium-bar.third {
  height: 65px;
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.25), rgba(205, 127, 50, 0.06));
  border: 1px solid rgba(205, 127, 50, 0.25);
}

/* Final Rankings */
.final-rankings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

/* Badges */
.game-over-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.badge-item {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  text-align: center;
  min-width: 140px;
  animation: scaleIn 0.4s ease both;
}
.badge-item:nth-child(1) { animation-delay: 0.2s; }
.badge-item:nth-child(2) { animation-delay: 0.35s; }
.badge-item:nth-child(3) { animation-delay: 0.5s; }

.badge-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
  line-height: 1;
}
.badge-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.badge-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent-purple);
}

.game-over-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.game-over-actions .btn {
  width: 100%;
}

/* ===========================================
   TOAST NOTIFICATION
   =========================================== */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #1e1035, #2d1b4e);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 3000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.4s ease forwards;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* ===========================================
   LEVEL-UP BANNER
   =========================================== */

.level-up-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(236, 72, 153, 0.95));
  color: #fff;
  padding: 32px 48px;
  border-radius: var(--border-radius);
  text-align: center;
  z-index: 2500;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.6),
              0 0 120px rgba(236, 72, 153, 0.3);
  animation: levelUpIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.level-up-banner.out {
  animation: levelUpOut 0.4s ease forwards;
}

.level-up-banner h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.level-up-banner p {
  font-size: 1rem;
  opacity: 0.9;
}
.level-up-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  line-height: 1;
}

@keyframes levelUpIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes levelUpOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

/* Small phones */
@media (max-width: 360px) {
  .logo-line1,
  .logo-line2 {
    font-size: 2.8rem;
  }

  .avatar-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .choose-buttons {
    flex-direction: column;
  }

  .choose-btn {
    padding: 24px 16px;
  }

  .players-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .level-card {
    padding: 18px;
  }

  .podium-bar {
    width: 65px;
  }
  .podium-bar.first { height: 100px; }
  .podium-bar.second { height: 75px; }
  .podium-bar.third { height: 55px; }
}

/* Regular phones */
@media (max-width: 480px) {
  .modal-box {
    padding: 24px;
    margin: 10px;
  }

  .avatar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }

  .card-text {
    font-size: 1.1rem;
  }

  .revealed-avatar {
    font-size: 4rem;
  }

  .revealed-name {
    font-size: 1.5rem;
  }
}

/* Tablets */
@media (min-width: 600px) {
  .levels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .players-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .choose-buttons {
    max-width: 500px;
  }

  .choose-btn {
    padding: 40px 20px;
  }

  .card-display {
    max-width: 500px;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .screen {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 40px;
  }

  #screenGame {
    max-width: 100%;
    padding: 0;
  }

  .game-header {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
  }

  .players-bar {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
  }

  .levels-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .level-card {
    padding: 28px;
  }

  .players-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
  }

  .logo-line1,
  .logo-line2 {
    font-size: 4.5rem;
  }

  .modal-box {
    max-width: 520px;
  }

  .podium-bar {
    width: 100px;
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .levels-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Landscape on phones */
@media (max-height: 500px) and (orientation: landscape) {
  .spin-circle {
    width: 150px;
    height: 150px;
  }
  .spin-text {
    font-size: 2.5rem;
  }

  .choose-btn {
    padding: 20px 16px;
  }

  .revealed-avatar {
    font-size: 3rem;
  }

  .game-over-content {
    gap: 20px;
  }

  .final-podium {
    min-height: 140px;
  }
  .podium-bar.first { height: 80px; }
  .podium-bar.second { height: 60px; }
  .podium-bar.third { height: 45px; }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
  .game-header {
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .players-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .pulse-btn,
  .glow-btn {
    animation: none !important;
  }
}

/* Print (hide everything unnecessary) */
@media print {
  #particlesCanvas,
  #confettiCanvas,
  .sound-toggle,
  .modal-overlay {
    display: none !important;
  }
}