/* ============================================
   BASTA! — Fun, modern, mobile-first styles
   ============================================ */

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

:root {
  /* Warm orange/yellow palette */
  --primary: #ff8c42;
  --primary-light: #ffad6e;
  --primary-dark: #e06d20;
  --accent: #ffd166;
  --accent-dark: #f0b830;
  --danger: #ef476f;
  --danger-dark: #d62b55;
  --success: #06d6a0;
  --success-dark: #05b588;
  --warning: #f7b731;
  --purple: #a78bfa;

  --bg: #1a1215;
  --bg-warm: #231a1d;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #faf0e6;
  --text-dim: rgba(250, 240, 230, 0.5);
  --text-mid: rgba(250, 240, 230, 0.7);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-round: 50px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html {
  background: var(--bg);
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Animated background blobs ---- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
}

.blob-1 {
  width: 340px;
  height: 340px;
  background: var(--primary);
  top: -80px;
  right: -60px;
  animation: blobFloat1 14s ease-in-out infinite;
}

.blob-2 {
  width: 260px;
  height: 260px;
  background: var(--accent);
  bottom: 10%;
  left: -40px;
  animation: blobFloat2 18s ease-in-out infinite;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: var(--danger);
  top: 50%;
  right: 20%;
  animation: blobFloat3 20s ease-in-out infinite;
  opacity: 0.2;
}

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 60px) scale(1.1); }
  66% { transform: translate(30px, -30px) scale(0.95); }
}

@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.9); }
}

@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, -40px) scale(1.15); }
}

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

/* ---- Sound toggle ---- */
.sound-toggle {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: calc(12px + var(--safe-right));
  z-index: 100;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s, background 0.2s;
}

.sound-toggle:active {
  transform: scale(0.9);
}

/* ---- End session button (host floating) ---- */
.btn-end-session {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: calc(12px + var(--safe-left));
  z-index: 100;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s, background 0.2s;
  opacity: 0.85;
}
.btn-end-session:active {
  transform: scale(0.95);
  background: var(--danger-dark);
}

/* ---- Views ---- */
#app {
  position: relative;
  z-index: 1;
}

.view {
  display: none;
  min-height: 100dvh;
  padding: calc(28px + var(--safe-top)) calc(18px + var(--safe-right)) calc(28px + var(--safe-bottom)) calc(18px + var(--safe-left));
  opacity: 0;
  transform: scale(0.96) translateY(10px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.view.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.view.active.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.container.center {
  text-align: center;
}

/* ---- Glass cards ---- */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- Typography ---- */
.logo-wrapper {
  margin-bottom: 2.5rem;
}

.logo {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary-light));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: none;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.logo-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  color: var(--text-dim);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 4px;
}

h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  color: var(--text-mid);
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--text-dim);
  text-align: center;
  font-size: 0.95rem;
}

/* ---- Dot loader ---- */
.dot-loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dot-loader span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotBounce 1.4s ease-in-out infinite;
}

.dot-loader span:nth-child(2) { animation-delay: 0.16s; }
.dot-loader span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Buttons ---- */
.btn {
  border: none;
  border-radius: var(--radius-round);
  padding: 12px 28px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: white;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 20px rgba(255, 140, 66, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(255, 140, 66, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-hover);
  border: 1px solid var(--glass-border);
}

.btn-danger {
  background: var(--danger);
  color: white;
  margin-top: 10px;
}
.btn-danger:active {
  background: var(--danger-dark);
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 1.15rem;
  margin-top: 16px;
}

.btn-glow {
  animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 140, 66, 0.3); }
  50% { box-shadow: 0 4px 35px rgba(255, 140, 66, 0.55); }
}

.btn-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}

.btn-icon:active { transform: scale(0.9); }

.btn-round {
  background: var(--surface-hover);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  transition: transform 0.2s;
}

.btn-round:active { transform: scale(0.9); }

.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.6rem;
  padding: 8px;
  transition: color 0.2s;
}

.btn-link:hover { color: var(--primary); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  animation: none;
}

/* ---- Inputs ---- */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.2);
}

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

/* ---- Home ---- */
#home-host {
  text-align: center;
  margin-top: 2rem;
}

#host-form {
  margin-top: 1rem;
}

#host-admin {
  margin-top: 1rem;
}

.waiting-animation {
  margin-bottom: 0.75rem;
}

/* ---- Avatar picker ---- */
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.avatar-option {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.avatar-option:active {
  transform: scale(0.9);
}

.avatar-option.selected {
  border-color: var(--primary);
  background: rgba(255, 140, 66, 0.15);
  box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.25);
  transform: scale(1.1);
}

/* ---- Lobby ---- */
.lobby-header-card {
  text-align: center;
}

.lobby-count-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lobby-count {
  font-family: 'Fredoka', sans-serif;
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.lobby-count-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

#player-list {
  list-style: none;
}

#player-list li {
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: listSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.player-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  font-size: 1.4rem;
  line-height: 1;
}

.host-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 2px 10px;
  border-radius: var(--radius-round);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.disconnected-badge {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---- Categories ---- */
#categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.category-tag {
  background: rgba(255, 140, 66, 0.15);
  border: 1px solid rgba(255, 140, 66, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-tag .remove-cat {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
}

.add-category {
  display: flex;
  gap: 10px;
  align-items: start;
}

.add-category input { flex: 1; margin-bottom: 0; }

/* ---- Rounds ---- */
.rounds-config {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
}

.rounds-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2ch;
  text-align: center;
}

/* ---- Letter roulette ---- */
.letter-roulette-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}

.letter-roulette-ring {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  animation: none;
  transition: border-color 0.3s;
}

.letter-roulette-ring.spinning {
  animation: ringRotate 1s linear infinite;
}

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

.letter-big {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(5rem, 20vw, 8rem);
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  line-height: 1;
  z-index: 1;
  transition: color 0.3s;
}

.letter-big.spinning {
  animation: letterSpin 0.12s infinite alternate;
  color: var(--accent);
}

@keyframes letterSpin {
  from { transform: scale(0.95); opacity: 0.7; }
  to { transform: scale(1.05); opacity: 1; }
}

.letter-big.chosen {
  animation: letterBoom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--success);
}

@keyframes letterBoom {
  0% { transform: scale(2); opacity: 0.5; }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.picker-msg {
  color: var(--text-mid);
  font-size: 1rem;
  margin-top: 4px;
}

.btn-stop {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
}

/* ---- Playing phase ---- */
.playing-header {
  margin-bottom: 6px;
}

.playing-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.letter-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(255, 140, 66, 0.35);
}

.playing-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.round-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.timer {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.used-letters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.used-letters:empty { display: none; }

.used-letter {
  background: var(--surface);
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 700;
}

.player-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.progress-pill {
  padding: 4px 12px;
  border-radius: var(--radius-round);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid transparent;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-pill .pill-avatar {
  font-size: 0.85rem;
}

.progress-pill.done {
  border-color: var(--success);
  background: rgba(6, 214, 160, 0.12);
  color: var(--success);
}

/* ---- BASTA mega button ---- */
.btn-basta-mega {
  width: 100%;
  padding: 22px 16px;
  margin-top: 18px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--danger), #ff6b6b, var(--danger-dark));
  background-size: 200% 200%;
  animation: bastaGradient 3s ease infinite, bastaPulse 2s ease-in-out infinite;
  cursor: pointer;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 6px 30px rgba(239, 71, 111, 0.4);
  transition: transform 0.15s;
  position: relative;
  overflow: hidden;
}

.btn-basta-mega::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: bastaShine 3s ease-in-out infinite;
}

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

@keyframes bastaGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes bastaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

.btn-basta-mega:active {
  transform: scale(0.96) !important;
  animation: none;
}

.btn-basta-mega:disabled {
  opacity: 0.4;
  animation: none;
  cursor: not-allowed;
}

.basta-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.basta-sub {
  font-size: 0.75rem;
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

/* ---- BASTA banner ---- */
.basta-banner {
  margin-bottom: 16px;
  animation: bannerDrop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.basta-banner-inner {
  background: linear-gradient(135deg, var(--danger), var(--danger-dark));
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

@keyframes bannerDrop {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.countdown-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  min-width: 2ch;
  text-align: center;
  animation: countBounce 1s infinite;
}

@keyframes countBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* ---- Answer form ---- */
.answers-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  margin-bottom: 0;
}

.form-group input:disabled {
  opacity: 0.4;
}

/* ---- Review ---- */
.review-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.review-ready-card {
  padding: 16px 18px;
}

.ready-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ready-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.ready-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-light);
  background: rgba(255, 140, 66, 0.12);
  padding: 3px 12px;
  border-radius: var(--radius-round);
}

.ready-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ready-player {
  padding: 5px 14px;
  border-radius: var(--radius-round);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid transparent;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ready-player::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s;
}

.ready-player.is-ready {
  border-color: var(--success);
  background: rgba(6, 214, 160, 0.1);
}

.ready-player.is-ready::before {
  background: var(--success);
}

/* ---- Review table ---- */
.review-category {
  margin-bottom: 20px;
}

.review-category h3 {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--primary-light);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--glass-border);
}

.review-answer {
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: all 0.2s;
  gap: 10px;
  -webkit-user-select: none;
  user-select: none;
}

.review-answer:active:not(.own):not(.empty-row) {
  transform: scale(0.98);
}

.review-answer.own {
  cursor: default;
  border-left-color: var(--primary);
  opacity: 0.65;
}

.review-answer.own .answer-player::after {
  content: ' (tu)';
  color: var(--primary-light);
  font-size: 0.7rem;
}

.review-answer.discarded {
  border-left-color: var(--danger);
  opacity: 0.45;
  background: rgba(239, 71, 111, 0.06);
}

.review-answer.discarded .answer-text {
  text-decoration: line-through;
}

.review-answer.challenged:not(.discarded) {
  border-left-color: var(--warning);
  background: rgba(247, 183, 49, 0.06);
}

.answer-player {
  font-size: 0.78rem;
  color: var(--text-dim);
  min-width: 55px;
  flex-shrink: 0;
  font-weight: 700;
}

.answer-text {
  flex: 1;
  font-weight: 600;
}

.vote-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.vote-count {
  font-size: 0.75rem;
  color: var(--warning);
  font-weight: 700;
}

.vote-names {
  font-size: 0.68rem;
  color: var(--text-dim);
  max-width: 100px;
  text-align: right;
  line-height: 1.2;
}

.empty-answer {
  color: var(--text-dim);
  font-style: italic;
  font-weight: 400;
}

.review-answer.empty-row {
  cursor: default;
  opacity: 0.3;
}

/* ---- Scores ---- */
.score-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  animation: listSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.score-player-name {
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-player-avatar {
  font-size: 1.3rem;
}

.score-round-pts {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--success);
}

.score-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.score-cat-name {
  color: var(--text-dim);
  font-weight: 600;
}

.score-cat-answer {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-cat-pts {
  color: var(--success);
  font-weight: 700;
  font-size: 0.8rem;
}

.score-cat-answer.discarded {
  color: var(--danger);
  text-decoration: line-through;
  opacity: 0.6;
}

/* ---- Totals leaderboard ---- */
.totals-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  color: var(--accent);
  margin: 1.5rem 0 0.75rem;
  text-align: center;
}

.total-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  animation: listSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.total-row:first-child {
  background: linear-gradient(135deg, rgba(255,140,66,0.15), rgba(255,209,102,0.1));
  border-color: rgba(255, 140, 66, 0.3);
}

.total-rank {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 28px;
}

.total-row:first-child .total-rank {
  color: var(--accent);
}

.total-name {
  flex: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.total-score {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
}

/* ---- Game over / Final scores ---- */
.trophy-wrapper {
  margin-bottom: 1rem;
}

.trophy {
  font-size: 5rem;
  animation: trophyBounce 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes trophyBounce {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.game-over-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2rem, 8vw, 3rem);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.final-entry {
  padding: 18px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: finalSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.final-entry:nth-child(1) { animation-delay: 0.1s; }
.final-entry:nth-child(2) { animation-delay: 0.25s; }
.final-entry:nth-child(3) { animation-delay: 0.4s; }
.final-entry:nth-child(4) { animation-delay: 0.55s; }
.final-entry:nth-child(5) { animation-delay: 0.7s; }

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

.final-entry:first-child {
  background: linear-gradient(135deg, rgba(255,140,66,0.2), rgba(255,209,102,0.12));
  border-color: rgba(255, 140, 66, 0.4);
  font-size: 1.15rem;
}

.final-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.final-rank {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dim);
}

.final-entry:first-child .final-rank {
  color: var(--accent);
}

.final-avatar {
  font-size: 1.5rem;
}

.final-name {
  font-weight: 800;
}

.final-score {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  color: var(--success);
  font-size: 1.1rem;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30, 20, 25, 0.92);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-round);
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ---- Confirm dialog ---- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  animation: overlayIn 0.2s ease;
  padding: 20px;
}

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

.confirm-box {
  background: var(--bg-warm);
  border: 1px solid var(--glass-border);
  padding: 28px 24px;
  border-radius: var(--radius);
  text-align: center;
  max-width: 320px;
  width: 100%;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-box p {
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 1.05rem;
}

.confirm-box .btn {
  margin: 0 6px;
  min-width: 80px;
}

/* ---- Responsive ---- */
@media (max-width: 400px) {
  .view {
    padding-left: calc(12px + var(--safe-left));
    padding-right: calc(12px + var(--safe-right));
  }

  .glass-card {
    padding: 16px;
  }

  .letter-big {
    font-size: 5rem;
  }

  .letter-roulette-ring {
    width: 140px;
    height: 140px;
  }

  .basta-text {
    font-size: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 580px;
  }

  .view {
    padding: calc(48px + var(--safe-top)) 32px calc(48px + var(--safe-bottom)) 32px;
  }

  .glass-card {
    padding: 24px;
    margin-bottom: 22px;
  }

  .avatar-picker {
    gap: 10px;
    margin-bottom: 20px;
  }

  .avatar-option {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }
}

/* ---- Utility animations ---- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease;
}
