/* ─── Reset & Base ───────────────────────────────────────── */

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

:root {
  --bg-dark: #46178f;
  --bg-darker: #2d0a5c;
  --red: #e21b3c;
  --blue: #1368ce;
  --yellow: #d89e00;
  --pink: #e94f96;
  --green: #26890c;
  --white: #ffffff;
  --light-gray: #f2f2f2;
  --text-dark: #333333;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --radius: 8px;
  --radius-lg: 16px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: linear-gradient(135deg, var(--bg-dark), var(--bg-darker));
  color: var(--white);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  width: 100%;
  max-width: 900px;
  padding: 2rem 1.5rem;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ─── Typography ─────────────────────────────────────────── */

h1 {
  font-size: 2rem;
  font-weight: 800;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ─── Home Page ──────────────────────────────────────────── */

.home-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.logo h1 {
  font-size: 3.5rem;
  letter-spacing: -1px;
}

.accent {
  color: var(--yellow);
}

.tagline {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-top: 0.25rem;
  margin-bottom: 3rem;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  color: var(--white);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

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

.btn-create {
  background: var(--pink);
}

.btn-host {
  background: var(--blue);
}

.btn-play {
  background: var(--red);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-danger {
  background: linear-gradient(135deg, #8f1329, #c2213c);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.25rem;
  width: 100%;
  max-width: 400px;
  margin: 1.5rem auto 0;
  display: flex;
}

.btn-icon {
  font-size: 1.3em;
}

.btn-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.btn-remove:hover {
  color: var(--red);
  background: rgba(255, 255, 255, 0.1);
}

/* ─── Page Header ────────────────────────────────────────── */

.page-header {
  margin-bottom: 2rem;
}

.back-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--white);
}

/* ─── Forms ──────────────────────────────────────────────── */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.form-group input[type='text'],
.form-group input[type='password'],
.form-group input[type='number'] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus {
  border-color: rgba(255, 255, 255, 0.6);
}

.form-actions {
  margin-top: 2rem;
  text-align: center;
}

.danger-zone {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 27, 60, 0.45);
  background: rgba(226, 27, 60, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.danger-zone-copy h3 {
  margin-bottom: 0.25rem;
}

.danger-zone-copy p {
  color: rgba(255, 255, 255, 0.8);
}

.form-help {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

/* ─── Create Quiz ────────────────────────────────────────── */

.question-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.question-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.question-number {
  font-size: 1rem;
  font-weight: 700;
  color: var(--yellow);
}

.btn-move {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.btn-move:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.answer-option {
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.answer-option input[type='text'] {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  outline: none;
}

.answer-option input[type='text']::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.correct-label {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  opacity: 0.9;
}

.answer-red {
  background: var(--red);
}
.answer-blue {
  background: var(--blue);
}
.answer-yellow {
  background: var(--yellow);
}
.answer-pink {
  background: var(--pink);
}

.success-message {
  text-align: center;
  padding: 3rem 1rem;
}

.success-message h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ─── Image Upload ───────────────────────────────────────── */

.image-upload-area {
  position: relative;
}

.question-image-input {
  width: 100%;
  padding: 0.6rem;
  font-size: 0.9rem;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  cursor: pointer;
  transition: border-color 0.2s;
}

.question-image-input:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.image-preview {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.2);
  object-fit: contain;
}

.btn-remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.btn-remove-image:hover {
  transform: scale(1.1);
}

/* ─── Player Profile Images ─────────────────────────────── */

.player-chip-avatar,
.leaderboard-avatar,
.vote-player-avatar,
.podium-avatar,
.waiting-profile-image,
.profile-preview-image,
.avatar-option-image {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.player-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
}

/* ─── Question Image (Game) ──────────────────────────────── */

.question-image {
  display: block;
  max-width: 100%;
  max-height: 300px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius-lg);
  object-fit: contain;
  box-shadow: var(--shadow);
}

/* ─── Quiz List (Host) ───────────────────────────────────── */

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s;
}

.quiz-card:hover {
  background: rgba(255, 255, 255, 0.12);
}

.quiz-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.quiz-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quiz-protection-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(216, 158, 0, 0.2);
  color: #ffd55f;
  border: 1px solid rgba(255, 213, 95, 0.35);
}

.quiz-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quiz-card small {
  color: rgba(255, 255, 255, 0.5);
}

.empty-state {
  text-align: center;
  opacity: 0.7;
  padding: 2rem;
}

.empty-state a {
  color: var(--yellow);
}

/* ─── Lobby ──────────────────────────────────────────────── */

.lobby-header {
  text-align: center;
  margin-bottom: 2rem;
}

.game-code {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1.5rem;
  display: inline-block;
  margin: 0.5rem 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lobby-hint {
  opacity: 0.7;
  font-size: 1.1rem;
}

.players-section {
  text-align: center;
  margin-bottom: 1rem;
}

.player-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
  min-height: 2.5rem;
}

.player-chip-card {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  animation: popIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.player-chip-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.player-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ─── Question Display (Host) ────────────────────────────── */

.question-display {
  text-align: center;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.timer-display {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.3rem;
  min-width: 60px;
  text-align: center;
}

.question-text-display {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 2rem;
  line-height: 1.3;
}

.answers-display-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.answer-display {
  padding: 1.25rem;
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 80px;
}

.answer-shape {
  font-size: 1.5rem;
  opacity: 0.7;
}

.answer-progress {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  opacity: 0.8;
}

/* ─── Answer Chart ───────────────────────────────────────── */

.answer-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  height: 200px;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.chart-bar-wrapper {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-wrapper.correct .chart-bar {
  outline: 4px solid var(--green);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(38, 137, 12, 0.2);
}

.chart-bar {
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.5rem;
  transition: height 0.6s ease;
  min-height: 20px;
}

.chart-count {
  font-weight: 800;
  font-size: 1.2rem;
}

.chart-label {
  margin-top: 0.5rem;
  font-size: 1.5rem;
}

.vote-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.vote-group {
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vote-group.correct {
  border-color: rgba(77, 197, 58, 0.9);
  box-shadow: 0 0 0 3px rgba(38, 137, 12, 0.45);
}

.vote-group.answer-red {
  background: rgba(226, 27, 60, 0.2);
}

.vote-group.answer-blue {
  background: rgba(19, 104, 206, 0.2);
}

.vote-group.answer-yellow {
  background: rgba(216, 158, 0, 0.24);
}

.vote-group.answer-pink {
  background: rgba(233, 79, 150, 0.24);
}

.vote-group-muted {
  background: rgba(255, 255, 255, 0.08);
}

.vote-group-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.vote-group-shape {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.35rem;
  font-weight: 800;
}

.vote-group-copy h4 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.vote-group-copy p {
  opacity: 0.78;
  font-size: 0.95rem;
}

.vote-player-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.vote-player-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.vote-player-card.answer-red {
  background: rgba(226, 27, 60, 0.28);
}

.vote-player-card.answer-blue {
  background: rgba(19, 104, 206, 0.3);
}

.vote-player-card.answer-yellow {
  background: rgba(216, 158, 0, 0.28);
}

.vote-player-card.answer-pink {
  background: rgba(233, 79, 150, 0.3);
}

.vote-player-card-muted {
  background: rgba(255, 255, 255, 0.08);
}

.vote-player-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.vote-player-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.vote-player-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.vote-player-name {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vote-player-time {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.vote-player-score {
  font-size: 0.85rem;
  opacity: 0.85;
}

.vote-empty {
  opacity: 0.72;
  padding: 0.2rem 0;
}

/* ─── Leaderboard ────────────────────────────────────────── */

.leaderboard {
  max-width: 500px;
  margin: 0 auto 2rem;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s;
}

.leaderboard-row.top-1 {
  background: rgba(255, 215, 0, 0.2);
}

.leaderboard-row.top-2 {
  background: rgba(192, 192, 192, 0.15);
}

.leaderboard-row.top-3 {
  background: rgba(205, 127, 50, 0.15);
}

.lb-rank {
  font-weight: 800;
  font-size: 1.1rem;
  width: 2rem;
  text-align: center;
}

.lb-name {
  font-weight: 600;
}

.lb-score {
  font-weight: 700;
  color: var(--yellow);
}

.lb-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.leaderboard-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

/* ─── Podium ─────────────────────────────────────────────── */

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin: 2rem 0;
  min-height: 200px;
}

.podium-place {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: rgba(255, 255, 255, 0.1);
  width: 140px;
  animation: slideUp 0.5s ease;
}

.podium-1 {
  min-height: 180px;
  background: rgba(255, 215, 0, 0.2);
}

.podium-2 {
  min-height: 140px;
  background: rgba(192, 192, 192, 0.15);
}

.podium-3 {
  min-height: 110px;
  background: rgba(205, 127, 50, 0.15);
}

.podium-medal {
  font-size: 2.5rem;
}

.podium-avatar {
  width: 70px;
  height: 70px;
  margin: 0.75rem auto 0.5rem;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.podium-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0.5rem 0 0.25rem;
}

.podium-score {
  font-size: 0.9rem;
  opacity: 0.8;
}

.final-title {
  text-align: center;
  font-size: 2rem;
}

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

/* ─── Player Join ────────────────────────────────────────── */

.join-form {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.join-form .btn {
  margin-top: 1rem;
  width: 100%;
}

.join-profile-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.join-profile-header h3 {
  margin-bottom: 0.25rem;
}

.join-profile-header p,
.upload-help {
  opacity: 0.78;
  font-size: 0.95rem;
}

.profile-mode-switch {
  display: inline-flex;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
  flex-wrap: wrap;
}

.profile-mode-option {
  position: relative;
}

.profile-mode-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.profile-mode-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.profile-mode-option input:checked + span {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.75rem;
}

.avatar-option {
  border: 2px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.65rem 0.5rem 0.75rem;
  color: var(--white);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.avatar-option:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.avatar-option.selected {
  border-color: var(--yellow);
  background: rgba(255, 255, 255, 0.18);
}

.avatar-option-image {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 0.5rem;
}

.avatar-option-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.upload-panel {
  margin-top: 0.25rem;
}

.upload-panel-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.profile-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
}

.profile-preview-image {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.profile-preview-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.error-text {
  color: #ff6b6b;
  margin-top: 0.75rem;
  font-weight: 600;
}

#gamePin {
  font-size: 2rem;
  text-align: center;
  letter-spacing: 6px;
  font-weight: 700;
}

/* ─── Player Waiting ─────────────────────────────────────── */

.waiting-content {
  text-align: center;
  padding-top: 20vh;
}

.waiting-content h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.waiting-profile-image {
  width: 108px;
  height: 108px;
  margin: 0 auto 1rem;
  border: 4px solid rgba(255, 255, 255, 0.4);
}

.player-display-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 1rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--white);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 1s linear infinite;
}

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

/* ─── Player Answers ─────────────────────────────────────── */

.player-question {
  font-size: 1.3rem;
  text-align: center;
}

.player-meta {
  padding: 0 0.5rem;
}

.player-answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.player-answer-btn {
  padding: 1.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 90px;
  transition: transform 0.15s, opacity 0.2s;
  box-shadow: var(--shadow);
}

.player-answer-btn:hover:not(:disabled) {
  transform: scale(1.03);
}

.player-answer-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.player-answer-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.player-answer-btn.selected {
  opacity: 1;
  outline: 4px solid var(--white);
  outline-offset: -4px;
}

/* ─── Player Feedback ────────────────────────────────────── */

.feedback-content {
  text-align: center;
  padding-top: 15vh;
}

.feedback-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.feedback-content.correct .feedback-icon {
  color: var(--green);
}

.feedback-content.incorrect .feedback-icon {
  color: var(--red);
}

.feedback-content h2 {
  font-size: 2.5rem;
}

.feedback-content p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  opacity: 0.9;
}

.streak-text {
  color: var(--yellow);
  font-weight: 700;
  font-size: 1.3rem !important;
  margin-top: 1rem !important;
}

/* ─── Player Final ───────────────────────────────────────── */

.player-final {
  text-align: center;
  padding-top: 15vh;
}

.player-rank {
  font-size: 2rem;
  font-weight: 800;
  margin: 1.5rem 0 0.5rem;
}

.rank-medal {
  font-size: 3rem;
}

.player-final-score {
  font-size: 1.5rem;
  color: var(--yellow);
  font-weight: 700;
  margin-bottom: 2rem;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  .logo h1 {
    font-size: 2.5rem;
  }

  .game-code {
    font-size: 2.5rem;
    letter-spacing: 5px;
  }

  .question-text-display {
    font-size: 1.3rem;
  }

  .answers-display-grid {
    grid-template-columns: 1fr;
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }

  .player-answers-grid {
    grid-template-columns: 1fr;
  }

  .profile-preview-card {
    flex-direction: column;
    text-align: center;
  }

  .danger-zone {
    flex-direction: column;
    align-items: stretch;
  }

  .player-list {
    grid-template-columns: 1fr;
  }

  .vote-summary-grid {
    grid-template-columns: 1fr;
  }

  .podium-place {
    width: 100px;
    padding: 1rem 0.5rem;
  }

  .podium-medal {
    font-size: 2rem;
  }
}

/* ─── Utility ────────────────────────────────────────────── */

.loading {
  text-align: center;
  opacity: 0.7;
  padding: 2rem;
}

.error {
  text-align: center;
  color: #ff6b6b;
  padding: 2rem;
}

.screen {
  animation: fadeIn 0.3s ease;
}

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

/* ─── Emoji Picker ───────────────────────────────────────── */

.input-with-emoji {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-emoji input {
  flex: 1;
  padding-right: 2.8rem !important;
}

.emoji-trigger {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.15s;
  line-height: 1;
}

.emoji-trigger:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
}

.emoji-picker {
  position: fixed;
  z-index: 9999;
  width: 320px;
  height: 360px;
  background: #2a1052;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

.emoji-picker.hidden {
  display: none !important;
}

.emoji-picker-header {
  padding: 0.5rem;
}

.emoji-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  outline: none;
}

.emoji-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.emoji-search:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

.emoji-tabs {
  display: flex;
  gap: 2px;
  padding: 0 0.4rem 0.4rem;
  flex-shrink: 0;
}

.emoji-tab {
  flex: 1;
  background: none;
  border: none;
  font-size: 1.1rem;
  padding: 0.3rem 0;
  cursor: pointer;
  border-radius: 6px;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
}

.emoji-tab:hover {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.08);
}

.emoji-tab.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.emoji-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 0 0.4rem 0.5rem;
  align-content: start;
}

.emoji-grid::-webkit-scrollbar {
  width: 6px;
}

.emoji-grid::-webkit-scrollbar-track {
  background: transparent;
}

.emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s, transform 0.1s;
  line-height: 1;
  text-align: center;
}

.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.2);
}

.emoji-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 0.5rem;
  opacity: 0.5;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .emoji-picker {
    width: calc(100vw - 16px);
    left: 8px !important;
  }
}
