/* ============================================================
   css/styles.css — Wedding Trivia Game
   Theme: Romantic, elegant, mostly white & soft blue
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* --- CSS Variables (color palette) --- */
:root {
  --white: #FFFFFF;
  --off-white: #F8F6F2;
  --cream: #FDF9F0;
  --blue-light: #D6E8F5;
  --blue-mid: #7AB3D4;
  --blue-deep: #2E6E9E;
  --blue-dark: #1A4A6E;
  --gold: #C8A96E;
  --gold-light: #E8D5A3;
  --text-dark: #2C2C2C;
  --text-mid: #555555;
  --text-light: #888888;
  --success: #4CAF82;
  --error: #E05555;
  --shadow: rgba(46, 110, 158, 0.15);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Lato', Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 8px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--off-white);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(214, 232, 245, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(200, 169, 110, 0.15) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Decorative floral divider --- */
.divider {
  text-align: center;
  color: var(--gold);
  font-size: 1.2rem;
  letter-spacing: 0.5rem;
  margin: 1rem 0;
  opacity: 0.7;
}

/* ============================================================
   LAYOUT CONTAINERS
   ============================================================ */

.page {
  width: 100%;
  max-width: 480px;       /* Mobile-first: cap width for phone look */
  min-height: 100vh;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  width: 100%;
  box-shadow: 0 4px 24px var(--shadow);
  border: 1px solid rgba(200, 169, 110, 0.2);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.brand-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-align: center;
  line-height: 1.2;
}

.brand-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold);
  text-align: center;
  margin-top: 0.25rem;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--blue-dark);
  text-align: center;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--blue-deep);
}

p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.6;
  text-align: center;
}

/* ============================================================
   FORM INPUTS
   ============================================================ */

.input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--blue-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(122, 179, 212, 0.2);
  background: var(--white);
}

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

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  text-decoration: none;
  letter-spacing: 0.03em;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-dark));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(46, 110, 158, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(46, 110, 158, 0.45);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #a8893e);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(200, 169, 110, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--blue-deep);
  border: 2px solid var(--blue-mid);
}

.btn-danger {
  background: linear-gradient(135deg, #e05555, #b83c3c);
  color: var(--white);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #357a5a);
  color: var(--white);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   ANSWER CHOICE BUTTONS (the A/B/C options)
   ============================================================ */

.answer-choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--blue-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--blue-mid);
  background: var(--blue-light);
  transform: translateX(4px);
}

.answer-btn:disabled { cursor: not-allowed; }

.answer-btn .choice-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-deep);
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

/* Selected state */
.answer-btn.selected {
  border-color: var(--blue-deep);
  background: var(--blue-light);
}

.answer-btn.selected .choice-letter {
  background: var(--blue-deep);
  color: var(--white);
}

/* Correct answer reveal */
.answer-btn.correct {
  border-color: var(--success);
  background: rgba(76, 175, 130, 0.1);
}

.answer-btn.correct .choice-letter {
  background: var(--success);
  color: var(--white);
}

/* Wrong answer reveal */
.answer-btn.wrong {
  border-color: var(--error);
  background: rgba(224, 85, 85, 0.08);
  opacity: 0.7;
}

.answer-btn.wrong .choice-letter {
  background: var(--error);
  color: var(--white);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.badge-blue { background: var(--blue-light); color: var(--blue-dark); }
.badge-gold { background: var(--gold-light); color: #6b4c10; }
.badge-green { background: rgba(76, 175, 130, 0.2); color: #2a6b4a; }

/* ============================================================
   SCORE DISPLAY
   ============================================================ */

.score-display {
  text-align: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--blue-light), var(--cream));
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-light);
}

.score-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 1;
}

.score-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* ============================================================
   LEADERBOARD
   ============================================================ */

.leaderboard-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-light);
  transition: transform 0.2s;
}

.leaderboard-item:nth-child(1) {
  background: linear-gradient(135deg, #fff8e1, #fef3c7);
  border-color: var(--gold);
}

.leaderboard-item:nth-child(2) {
  background: linear-gradient(135deg, #f0f4f8, #e8eef4);
  border-color: #9ab4c8;
}

.leaderboard-item:nth-child(3) {
  background: linear-gradient(135deg, #fdf4ec, #fce8d5);
  border-color: #d4956a;
}

.rank-number {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light);
  width: 1.5rem;
  text-align: center;
}

.leaderboard-item:nth-child(1) .rank-number { color: var(--gold); }

.player-name {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.player-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue-deep);
}

/* ============================================================
   WAITING / LOBBY ANIMATION
   ============================================================ */

.waiting-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.waiting-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-mid);
  animation: dotBounce 1.2s infinite ease-in-out;
}

.waiting-dots span:nth-child(1) { animation-delay: 0s; }
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* ============================================================
   QUESTION HEADER / PROGRESS
   ============================================================ */

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

.question-number {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 1.45;
  text-align: center;
  margin: 0.75rem 0 1.25rem;
}

/* ============================================================
   ADMIN PANEL — PLAYER LIST
   ============================================================ */

.player-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.player-chip::before {
  content: '✦';
  font-size: 0.6rem;
  color: var(--gold);
}

/* ============================================================
   ADMIN CONTROL PANEL GRID
   ============================================================ */

.admin-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.admin-stat-row {
  display: flex;
  gap: 0.75rem;
}

.admin-stat {
  flex: 1;
  text-align: center;
  padding: 0.85rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-light);
}

.admin-stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blue-dark);
}

.admin-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

.fade-in {
  animation: fadeIn 0.4s ease-in-out both;
}

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

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   UTILITY
   ============================================================ */

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.w-full { width: 100%; }

/* Small decorative rings/hearts */
.decoration {
  font-size: 1.5rem;
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.5rem;
}

/* ============================================================
   RESPONSIVE TWEAKS (tablet/desktop)
   ============================================================ */

@media (min-width: 768px) {
  .page { padding: 2rem; }
  .brand-title { font-size: 2.6rem; }
  .card { padding: 2.5rem; }
}
