/* ============================================================
   FOLLOW THE HERD — Main Stylesheet
   Mobile-first, base 375px, max content width 420px
   ============================================================ */

/* ============================================================
   0. (reserved)
   ============================================================ */

/* ============================================================
   1. GOOGLE FONTS IMPORT
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Galindo&family=Nunito:wght@400;500;600;700;800&display=swap');

/* ── Font Awesome global color ── */
.fa-solid, .fa-regular, .fa-brands { color: #f05021; }


/* ============================================================
   2. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Colors */
  --bg:           #F5F0E8;
  --primary:      #E8471A;
  --primary-dark: #B03010;
  --secondary:    #F5A623;
  --secondary-dark: #C8800A;
  --green:        #2ECC71;
  --green-dark:   #1A9A50;
  --dark:         #1A1A1A;
  --white:        #FFFFFF;
  --light-orange: #FFF0EB;
  --gray:         #888888;
  --light-gray:   #E8E8E8;

  /* Typography */
  --font-display: 'Galindo', cursive;
  --font-body:    'Nunito', sans-serif;

  /* Spacing */
  --space-4:   4px;
  --space-6:   6px;
  --space-8:   8px;
  --space-10:  10px;
  --space-12:  12px;
  --space-14:  14px;
  --space-16:  16px;
  --space-20:  20px;
  --space-24:  24px;
  --space-32:  32px;

  /* Radius */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-pill: 50px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card:   0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-coin:   0 2px 8px rgba(0, 0, 0, 0.10);
  --shadow-nav:    0 -2px 16px rgba(0, 0, 0, 0.08);
  --shadow-btn-primary: 0 5px 0 var(--primary-dark);
  --shadow-btn-dark:    0 5px 0 #000000;
  --shadow-btn-secondary: 0 5px 0 var(--secondary-dark);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-mid:  0.3s ease;
  --transition-slow: 0.4s ease;
}


/* ============================================================
   3. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--dark);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* ── Page transitions ────────────────────────────────────────────────────── */
/* Fade only — no translateX so the page never has horizontal overflow        */
@keyframes fth-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
  animation: fth-fade-in 0.22s ease both;
}

.fth-page-exit {
  opacity: 0 !important;
  transition: opacity 0.18s ease !important;
  pointer-events: none !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--dark);
}

h1 { font-size: 32px; }
h2 { font-size: 26px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--dark);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Button-style links — applies to standalone <a> tags used as CTAs */
.home-link,
.btn-link {
  display: inline-block;
  background: var(--primary);
  color: var(--white) !important;
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none !important;
  padding: 15px 24px;
  border-radius: 50px;
  box-shadow: 0 5px 0 var(--primary-dark);
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.home-link:active,
.btn-link:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--primary-dark);
}

.home-link:hover,
.btn-link:hover {
  text-decoration: none !important;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font-display);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  font-family: var(--font-body);
  outline: none;
  border: none;
  background: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
}


/* ============================================================
   4. LAYOUT
   ============================================================ */

/* Full-screen page wrapper */
.screen {
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: clip; /* blocks horizontal overflow without creating a scroll container */
  padding-bottom: 100px;
}

/* Ensure body always has room below fixed nav */
body {
  padding-bottom: 100px;
}

/* Centered content column */
.container {
  width:100%;
  margin: 0 auto;
  padding: 0 var(--space-16);
}

/* Ensure foreground content sits above decorative elements */
.content {
  position: relative;
  z-index: 1;
}


/* ============================================================
   5. CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-16);
}

.card-lg {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-24);
}


/* ============================================================
   6. BUTTONS
   ============================================================ */

/* -- Shared base -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active {
  transform: translateY(3px);
}

/* -- Primary (orange) -- */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-btn-primary);
}

.btn-primary:active {
  box-shadow: 0 2px 0 var(--primary-dark);
}

.btn-primary:hover:not(:active) {
  background: #F05020;
}

/* -- Dark -- */
.btn-dark {
  background: var(--dark);
  color: var(--white);
  box-shadow: var(--shadow-btn-dark);
}

.btn-dark:active {
  box-shadow: 0 2px 0 #000000;
}

.btn-dark:hover:not(:active) {
  background: #2A2A2A;
}

/* -- White / Outline -- */
.btn-outline {
  background: var(--white);
  color: var(--dark);
  border: 2.5px solid var(--dark);
  box-shadow: none;
}

.btn-outline:active {
  transform: translateY(2px);
}

.btn-outline:hover:not(:active) {
  background: var(--bg);
}

/* -- Secondary (yellow) -- */
.btn-secondary {
  background: var(--secondary);
  color: var(--dark);
  box-shadow: var(--shadow-btn-secondary);
}

.btn-secondary:active {
  box-shadow: 0 2px 0 var(--secondary-dark);
}

.btn-secondary:hover:not(:active) {
  background: #F7B030;
}

/* -- Auto width modifier -- */
.btn-auto {
  width: auto;
}

/* -- Small size modifier -- */
.btn-sm {
  padding: 10px 18px;
  font-size: 13px;
}

/* -- Disabled state -- */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* ============================================================
   7. TOP BAR
   ============================================================ */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-14) var(--space-16);
}

.top-bar-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--dark);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}


/* ============================================================
   8. ORANGE HEADER BAR (Question screen)
   ============================================================ */
.orange-header {
  background: var(--primary);
  padding: var(--space-14) var(--space-16);
  display: flex;
  align-items: center;
}

.orange-header-title {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--white);
  flex: 1;
  text-align: center;
}

.header-back-btn {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dark);
  font-size: 18px;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.header-back-btn:active {
  opacity: 0.7;
}

/* Spacer to balance centered title when only left button exists */
.header-spacer {
  width: 36px;
  flex-shrink: 0;
}


/* ============================================================
   9. PROGRESS BAR (15-segment)
   ============================================================ */
.progress-bar {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-16);
  background: var(--primary);
}

.progress-segment {
  height: 8px;
  flex: 1;
  border-radius: var(--space-4);
}

.progress-segment.done {
  background: var(--white);
}

.progress-segment.current {
  background: var(--secondary);
}

.progress-segment.empty {
  background: rgba(255, 255, 255, 0.3);
}


/* ============================================================
   10. BOTTOM NAVIGATION BAR
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1000;
  background: var(--dark);
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  will-change: bottom;
}

.bottom-nav-inner {
  background: #1d2d3d;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 0 20px;
  border-radius: 0 !important;
  margin: 0 !important;
  width: 100%;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.nav-item.active,
.nav-item--active {
  opacity: 1;
}

.nav-item:active {
  opacity: 0.7;
}

.nav-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.nav-admin-link {
  opacity: 0.5;
}

.nav-admin-link .fa-gear {
  font-size: 24px;
  color: #E8471A;
}

.nav-item--groups {
  color: #E8471A !important;
}
.nav-item--groups i {
  font-size: 22px;
  color: #E8471A;
}
.nav-item--groups.nav-item--active i {
  color: #E8471A;
  filter: drop-shadow(0 0 4px rgba(232,71,26,0.4));
}


/* ============================================================
   11. AVATAR
   ============================================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--secondary);
  display: block;
  flex-shrink: 0;
}

.avatar-sm {
  width: 36px;
  height: 36px;
}

.avatar-md {
  width: 48px;
  height: 48px;
}

.avatar-lg {
  width: 80px;
  height: 80px;
}

.avatar-xl {
  width: 100px;
  height: 100px;
}

/* Placeholder avatar (when no image) */
.avatar-placeholder {
  border-radius: 50%;
  border: 3px solid var(--secondary);
  background: var(--light-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-family: var(--font-display);
  flex-shrink: 0;
}


/* ============================================================
   12. COIN / POINTS DISPLAY
   ============================================================ */
.coin-display {
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: var(--space-6) var(--space-12);
  box-shadow: var(--shadow-coin);
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--dark);
}

.coin-icon {
  background: var(--secondary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.coin-amount {
  font-family: var(--font-display);
  color: var(--dark);
}


/* ============================================================
   13. STREAK DISPLAY
   ============================================================ */
.streak-badge {
  background: var(--secondary);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: var(--space-8) var(--space-20);
  font-family: var(--font-display);
  font-size: 20px;
  display: inline-block;
}

.streak-best {
  color: var(--gray);
  font-size: 13px;
  margin-top: var(--space-6);
  font-family: var(--font-body);
}


/* ============================================================
   14. USERNAME BADGE
   ============================================================ */
.username-badge {
  background: var(--light-orange);
  color: var(--primary);
  border-radius: var(--radius-pill);
  padding: 4px 16px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  display: inline-block;
}


/* ============================================================
   15. LEADERBOARD PODIUM
   ============================================================ */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-16) 0 0;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-avatar-wrap {
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.podium-username {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--dark);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-block {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px 12px 0 0;
}

.podium-1st {
  background: var(--primary);
  height: 110px;
  width: 100px;
  box-shadow: 0 4px 0 var(--primary-dark);
  border-radius: 12px 12px 0 0;
}

.podium-2nd {
  background: var(--secondary);
  height: 80px;
  width: 90px;
  box-shadow: 0 4px 0 var(--secondary-dark);
  border-radius: 12px 12px 0 0;
}

.podium-3rd {
  background: var(--green);
  height: 60px;
  width: 80px;
  box-shadow: 0 4px 0 var(--green-dark);
  border-radius: 12px 12px 0 0;
}

.podium-number {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--white);
  line-height: 1;
}


/* ============================================================
   16. STAT CARDS (2x2 grid)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  margin-top: 24px;
}

.stats-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stats-icon {
  font-size: 24px;
  line-height: 1;
}

.stats-value {
  font-family: 'Galindo', cursive;
  font-size: 22px;
  color: var(--dark);
  line-height: 1.1;
}

.stats-label {
  font-size: 14px;
  color: var(--gray);
  text-align: center;
}

.stats-sublabel {
  font-size: 11px;
  color: #E8471A;
  font-family: var(--font-body);
  font-weight: 700;
  text-align: center;
  margin-top: 2px;
}

.stat-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: var(--space-14);
  display: flex;
  align-items: center;
  gap: var(--space-10);
}

.stat-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--dark);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-body);
}

.stat-sublabel {
  font-size: 11px;
  color: #E8471A;
  font-family: var(--font-body);
  font-weight: 700;
  margin-top: 2px;
}


/* ============================================================
   17. FORMS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-16);
}

.form-label {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--dark);
  display: block;
  margin-bottom: var(--space-6);
}

.form-input {
  width: 100%;
  padding: var(--space-14) var(--space-16);
  border-radius: var(--radius-md);
  border: 2px solid var(--light-gray);
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--white);
  color: var(--dark);
  transition: border-color var(--transition-fast);
  display: block;
}

.form-input::placeholder {
  color: var(--gray);
}

.form-input:focus {
  border-color: var(--primary);
  outline: none;
}

.form-input:disabled {
  background: var(--bg);
  color: var(--gray);
  cursor: not-allowed;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: var(--primary);
  font-size: 12px;
  margin-top: var(--space-4);
  font-family: var(--font-body);
}

.form-hint {
  color: var(--gray);
  font-size: 12px;
  margin-top: var(--space-4);
  font-family: var(--font-body);
}


/* ============================================================
   18. ANSWER OPTIONS (Question carousel)
   ============================================================ */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.answer-option {
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: var(--space-14) var(--space-20);
  display: flex;
  align-items: center;
  gap: var(--space-12);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.answer-option:active {
  opacity: 0.85;
}

.answer-option.selected {
  background: var(--light-orange);
  border-color: var(--primary);
}

.answer-option-text {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--dark);
  font-weight: 600;
  flex: 1;
}

.radio-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--light-gray);
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-dot.selected {
  background: var(--primary);
  border-color: var(--primary);
}

.radio-dot.selected::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
}


/* ============================================================
   19. COUNTDOWN TIMER
   ============================================================ */
.countdown {
  display: flex;
  gap: var(--space-8);
  justify-content: center;
}

.countdown-unit {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-12) var(--space-16);
  text-align: center;
  min-width: 64px;
  box-shadow: var(--shadow-card);
}

.countdown-number {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--primary);
  display: block;
  line-height: 1;
}

.countdown-label {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-top: 4px;
}


/* ============================================================
   20. LEADERBOARD ROWS
   ============================================================ */
.lb-list {
  padding: 0;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  transition: background var(--transition-fast);
}

.lb-row.current-user {
  background: var(--light-orange);
}

.lb-rank {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--dark);
  min-width: 36px;
}

.lb-rank-gold   { color: var(--secondary); }
.lb-rank-silver { color: var(--gray); }
.lb-rank-bronze { color: #CD7F32; }

.lb-avatar {
  margin: 0 var(--space-10);
}

.lb-name {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--dark);
  flex: 1;
  font-weight: 600;
}

.lb-points {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--dark);
}


/* ============================================================
   21. RESULTS SECTIONS
   ============================================================ */
.results-section {
  margin-bottom: var(--space-8);
}

.results-first-place {
  background: var(--secondary);
  padding: var(--space-24) var(--space-16);
}

.results-wtf {
  background: var(--dark);
  color: var(--white);
  padding: var(--space-24) var(--space-16);
}

.results-mcneal {
  background: var(--light-gray);
  padding: var(--space-24) var(--space-16);
}

.results-gif {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}


/* ============================================================
   22. ANSWER BREAKDOWN (Results)
   ============================================================ */
.question-breakdown {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  margin-bottom: var(--space-12);
  box-shadow: var(--shadow-card);
}

.breakdown-question {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--dark);
  margin-bottom: var(--space-12);
}

.answer-row {
  display: flex;
  align-items: center;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--bg);
}

.answer-row:last-of-type {
  border-bottom: none;
}

.answer-row-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dark);
  flex: 1;
}

.answer-row-pct {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gray);
  margin-left: var(--space-8);
}

.answer-bar-wrap {
  width: 100%;
  margin-top: 4px;
  background: var(--light-gray);
  border-radius: 3px;
  height: 6px;
}

.answer-bar {
  height: 6px;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.answer-bar.correct {
  background: var(--green);
}


/* ============================================================
   23. SLIDE TO START (Splash / Login)
   ============================================================ */
.slide-to-start {
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: var(--space-8);
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.slide-text {
  font-family: var(--font-body);
  color: var(--gray);
  flex: 1;
  padding-left: var(--space-16);
  font-size: 15px;
}

.slide-btn {
  background: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 20px;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  transition: transform var(--transition-fast), background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.slide-btn:active {
  transform: scale(0.92);
  background: var(--primary-dark);
}


/* ============================================================
   24. GAME STATE CARDS
   ============================================================ */
.game-state-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.game-live-banner {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: var(--space-8) var(--space-20);
  font-family: var(--font-display);
  font-size: 14px;
  display: inline-block;
  margin-bottom: var(--space-16);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-state-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--dark);
  margin-bottom: var(--space-8);
}

.game-state-subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray);
}


/* ============================================================
   25. DECORATIVE ELEMENTS
   ============================================================ */
.squiggle,
.deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.sparkle {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

/* Deco corner positioning (used by pages as .deco--tl etc.) */
.deco--tl { top: -10px; left: -10px; width: 120px; height: 120px; }
.deco--tr { top: -10px; right: -10px; width: 120px; height: 120px; }
.deco--bl { bottom: 60px; left: -10px; width: 100px; height: 80px; }
.deco--br { bottom: 60px; right: -10px; width: 100px; height: 80px; }
.deco--star { width: 20px; height: 20px; }
.deco--star-1 { top: 18%; left: 8%; }
.deco--star-2 { top: 35%; right: 10%; }
.deco--star-3 { top: 55%; left: 15%; }
.deco--star-4 { bottom: 25%; right: 8%; }
.deco--star-5 { top: 70%; left: 5%; }

/* Common squiggle/sparkle positions */
.squiggle-top-left {
  top: -20px;
  left: -10px;
}

.squiggle-top-right {
  top: -20px;
  right: -10px;
}

.squiggle-bottom-left {
  bottom: -20px;
  left: -10px;
}

.squiggle-bottom-right {
  bottom: -20px;
  right: -10px;
}

/* CSS-only decorative wavy underline / divider */
.squiggle-divider {
  width: 100%;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='12' viewBox='0 0 40 12'%3E%3Cpath d='M0 6 Q10 0 20 6 Q30 12 40 6' stroke='%23E8471A' stroke-width='2.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.25;
}


/* ============================================================
   26. QUESTION CARD
   ============================================================ */
.question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-20);
  margin-bottom: var(--space-16);
}

.question-number {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-8);
}

.question-text {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: var(--space-16);
}

.question-image {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-16);
}


/* ============================================================
   27. SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-12);
}

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--dark);
}

.section-link {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}


/* ============================================================
   28. SPLASH / ONBOARDING SCREEN
   ============================================================ */
.splash-screen {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 60px var(--space-24) var(--space-32);
  position: relative;
  overflow: hidden;
}

.splash-logo {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--dark);
  text-align: center;
}

.splash-logo span {
  color: var(--primary);
}

.splash-tagline {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--gray);
  text-align: center;
  margin-top: var(--space-8);
}

.splash-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}


/* ============================================================
   29. PROFILE SCREEN
   ============================================================ */
.profile-header {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-24) var(--space-16);
  text-align: center;
  margin-bottom: var(--space-16);
}

.profile-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-12);
}

.profile-name {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--dark);
  margin-bottom: var(--space-6);
}

.profile-badges {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  margin-top: var(--space-12);
}


/* ============================================================
   30. EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-32) var(--space-24);
  color: var(--gray);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-12);
  display: block;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--dark);
  margin-bottom: var(--space-8);
}

.empty-state-text {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}


/* ============================================================
   31. TOAST / ALERT BANNERS
   ============================================================ */
.toast {
  position: fixed;
  top: var(--space-16);
  left: var(--space-16);
  right: var(--space-16);
  max-width: 420px;
  margin: 0 auto;
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-14) var(--space-16);
  font-family: var(--font-body);
  font-size: 14px;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: var(--space-10);
  animation: slideDown 0.3s ease;
}

.toast-success { background: var(--green); color: var(--white); }
.toast-error   { background: var(--primary); color: var(--white); }
.toast-warning { background: var(--secondary); color: var(--dark); }

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


/* ============================================================
   32. MODAL / BOTTOM SHEET
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.bottom-sheet {
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-24) var(--space-16);
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.35s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--light-gray);
  border-radius: 2px;
  margin: 0 auto var(--space-20);
}

.bottom-sheet-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--dark);
  text-align: center;
  margin-bottom: var(--space-16);
}


/* ============================================================
   33. DIVIDERS & SEPARATORS
   ============================================================ */
.divider {
  height: 1px;
  background: var(--light-gray);
  margin: var(--space-16) 0;
  border: none;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin: var(--space-20) 0;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--light-gray);
}

.divider-label span {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gray);
  white-space: nowrap;
}


/* ============================================================
   34. PILL / TAG BADGES
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font-display);
}

.pill-primary  { background: var(--light-orange); color: var(--primary); }
.pill-secondary { background: #FFF8EC; color: var(--secondary); }
.pill-dark     { background: var(--dark); color: var(--white); }
.pill-gray     { background: var(--light-gray); color: var(--gray); }
.pill-green    { background: #EAFAF3; color: var(--green); }


/* ============================================================
   35. LOADING STATES
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--light-gray) 25%,
    #F0F0F0 50%,
    var(--light-gray) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s infinite;
}

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

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--light-gray);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 240, 232, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}


/* ============================================================
   36. ANIMATIONS / KEYFRAMES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes bounceIn {
  0%   { transform: scale(0.8);  opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

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

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(-4deg); }
  75%       { transform: rotate(4deg); }
}

/* Animation utility classes */
.fade-in  { animation: fadeIn  0.3s ease both; }
.slide-up { animation: slideUp 0.4s ease both; }
.bounce-in { animation: bounceIn 0.5s ease both; }
.pulse    { animation: pulse  1.5s ease infinite; }

/* Staggered children */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }


/* ============================================================
   37. UTILITY CLASSES
   ============================================================ */

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Text colors */
.text-primary   { color: var(--primary);   }
.text-secondary { color: var(--secondary); }
.text-gray      { color: var(--gray);      }
.text-white     { color: var(--white);     }
.text-dark      { color: var(--dark);      }
.text-green     { color: var(--green);     }

/* Font families */
.font-galindo { font-family: var(--font-display); }
.font-nunito  { font-family: var(--font-body);    }

/* Font weights */
.fw-400 { font-weight: 400; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* Display */
.d-flex         { display: flex; }
.d-grid         { display: grid; }
.d-block        { display: block; }
.d-inline-block { display: inline-block; }
.d-inline-flex  { display: inline-flex; }
.d-none         { display: none; }

/* Flex helpers */
.flex-1          { flex: 1; }
.flex-col        { flex-direction: column; }
.align-center    { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap       { flex-wrap: wrap; }
.gap-4  { gap: var(--space-4);  }
.gap-8  { gap: var(--space-8);  }
.gap-12 { gap: var(--space-12); }
.gap-16 { gap: var(--space-16); }

/* Margin top */
.mt-4  { margin-top: var(--space-4);  }
.mt-6  { margin-top: var(--space-6);  }
.mt-8  { margin-top: var(--space-8);  }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }
.mt-20 { margin-top: var(--space-20); }
.mt-24 { margin-top: var(--space-24); }
.mt-32 { margin-top: var(--space-32); }

/* Margin bottom */
.mb-4  { margin-bottom: var(--space-4);  }
.mb-6  { margin-bottom: var(--space-6);  }
.mb-8  { margin-bottom: var(--space-8);  }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }
.mb-20 { margin-bottom: var(--space-20); }
.mb-24 { margin-bottom: var(--space-24); }
.mb-32 { margin-bottom: var(--space-32); }

/* Margin inline */
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Padding */
.p-0  { padding: 0; }
.p-8  { padding: var(--space-8);  }
.p-12 { padding: var(--space-12); }
.p-16 { padding: var(--space-16); }
.p-24 { padding: var(--space-24); }

.px-16 { padding-left: var(--space-16); padding-right: var(--space-16); }
.py-16 { padding-top: var(--space-16);  padding-bottom: var(--space-16); }

/* Width */
.w-full  { width: 100%; }
.w-auto  { width: auto; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto;   }

/* Position */
.pos-relative { position: relative; }
.pos-absolute { position: absolute; }
.pos-fixed    { position: fixed;    }

/* Z-index layers */
.z-0   { z-index: 0;   }
.z-1   { z-index: 1;   }
.z-10  { z-index: 10;  }
.z-100 { z-index: 100; }

/* Border radius */
.rounded-sm   { border-radius: var(--radius-sm);   }
.rounded-md   { border-radius: var(--radius-md);   }
.rounded-lg   { border-radius: var(--radius-lg);   }
.rounded-pill { border-radius: var(--radius-pill); }
.rounded-full { border-radius: 50%;                }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }

/* Pointer events */
.pointer-events-none { pointer-events: none; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* User select */
.select-none { user-select: none; }

/* Text truncation */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
   38. RESPONSIVE — Mobile first, capped at 420px
   ============================================================ */

/* Very small phones (< 360px) */
@media (max-width: 359px) {
  .container {
    padding: 0 var(--space-12);
  }

  h1 { font-size: 26px; }
  h2 { font-size: 22px; }

  .stats-grid {
    gap: var(--space-8);
  }

  .stat-number {
    font-size: 20px;
  }

  .podium-1st { width: 88px;  height: 96px;  }
  .podium-2nd { width: 76px;  height: 70px;  }
  .podium-3rd { width: 68px;  height: 54px;  }

  .countdown-unit {
    min-width: 52px;
    padding: var(--space-10) var(--space-12);
  }

  .countdown-number {
    font-size: 26px;
  }

  .btn {
    font-size: 14px;
    padding: 13px 18px;
  }
}

/* Standard mobile (360px–420px) — default styles apply */
@media (min-width: 360px) and (max-width: 420px) {
  /* Styles already optimised for this range — no overrides needed */
}

/* Tablet and above (> 420px) — center content, constrain width */
@media (min-width: 421px) {
  body {
    background: var(--bg);
  }

  .screen {
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
    min-height: 100vh;
  }

  /* bottom-nav stays full-width on tablet, overridden at 1025px for desktop */
  .bottom-nav {
    max-width: 100%;
    left: 0 !important;
    right: 0 !important;
    transform: none;
  }

  .toast {
    max-width: 420px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 390px;
  }

  .modal-overlay {
    align-items: center;
    padding: var(--space-16);
  }

  .bottom-sheet {
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-24);
  }
}

/* Large screens — decorative outer background */
@media (min-width: 768px) {
  body {
    background: #E8E0D4;
  }
}

/* ============================================================
   DESKTOP LAYOUT — Left sidebar + wider content (>= 1025px)
   ============================================================ */
@media (min-width: 1025px) {

  /* ── Body: shift right to clear sidebar, no bottom nav gap ── */
  body {
    padding-left: 80px;
    padding-bottom: 40px;
    background: #DDD5C8;
  }

  /* ── Screen wrapper: wider, softer shadow ── */
  .screen {
    max-width: 820px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
    padding-bottom: 40px;
  }

  /* ── Content container ── */
  .container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 36px;
  }

  /* ── Bottom nav → Left sidebar ── */
  .bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: auto !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 80px !important;
    height: 100vh !important;
    transform: none !important;
    will-change: auto !important;
    border-radius: 0 !important;
    z-index: 1000;
  }

  .bottom-nav-inner {
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 16px 0 20px;
    justify-content: flex-start;
    gap: 4px;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Sheep logo at top of sidebar */
  .bottom-nav-inner::before {
    content: '';
    display: block;
    width: 44px;
    height: 44px;
    background: url('/assets/sheep-logo.png') no-repeat center / contain;
    margin-bottom: 16px;
    flex-shrink: 0;
    opacity: 0.85;
  }

  /* Nav items: square icon buttons */
  .nav-item {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    padding: 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    opacity: 0.45;
    transition: opacity 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
  }

  .nav-item:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
  }

  .nav-item.active,
  .nav-item.nav-item--active {
    opacity: 1;
    background: rgba(232, 71, 26, 0.28);
  }

  .nav-icon {
    width: 30px;
    height: 30px;
  }

  .nav-item--groups i {
    font-size: 22px;
  }

  .nav-admin-link .fa-gear {
    font-size: 20px;
  }

  /* ── Stats grid: 4 columns ── */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* ── Cards: more breathing room ── */
  .card    { padding: 22px; }
  .card-lg { padding: 32px; }

  /* ── Leaderboard rows ── */
  .lb-row {
    padding: 14px 20px;
  }

  /* ── Podium: slightly larger ── */
  .podium-1st { height: 130px; width: 120px; }
  .podium-2nd { height:  96px; width: 110px; }
  .podium-3rd { height:  72px; width: 100px; }
  .podium-number { font-size: 44px; }

  /* ── Countdown units: roomier ── */
  .countdown-unit { min-width: 76px; padding: 16px 20px; }
  .countdown-number { font-size: 38px; }

  /* ── Auth screens: center card vertically ── */
  .auth-screen,
  .screen-inner {
    padding-top: 48px;
  }

  /* ── Referral pill: bottom-right ── */
  .referral-pill {
    bottom: 24px;
    right: 24px;
  }

  /* ── Typography ── */
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 24px; }

  /* ── Form inputs: more comfortable on desktop ── */
  .form-input {
    padding: 16px 18px;
    font-size: 16px;
  }

  .btn {
    font-size: 17px;
    padding: 16px 28px;
  }
}


/* ============================================================
   39. ACCESSIBILITY & REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus-visible for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* High contrast mode support */
@media (forced-colors: active) {
  .btn-primary,
  .btn-dark,
  .btn-secondary {
    border: 2px solid ButtonText;
  }
}


/* ============================================================
   40. PRINT
   ============================================================ */
@media print {
  .bottom-nav,
  .toast,
  .modal-overlay {
    display: none !important;
  }

  .screen {
    padding-bottom: 0;
  }
}


/* ============================================================
   41. GLOBAL CONTENT SPACING (consistent across all pages)
   ============================================================ */

/* Better line-height on all body text */
p {
  line-height: 1.6;
}

/* Consistent gap below images in content areas */
.home-main img,
.submitted-main img,
.play-main img,
.container img {
  display: block;
}

/* ── Home / Play page main area ── */
.home-main {
  padding-top: 20px;
  overflow-x: hidden;
}

.home-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

/* ── Submitted page ── */
.submitted-main {
  padding-top: 32px;
  padding-bottom: 32px;
}

.submitted-sheep-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.submitted-sheep-img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  margin: 0 auto;
  animation: bounceIn 0.6s ease both;
}

.submitted-heading {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--dark);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.2;
}

.submitted-subtext {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--gray);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 24px;
}

.submitted-divider {
  border: none;
  border-top: 2px dashed var(--light-gray);
  margin: 8px 0 28px;
}

.submitted-invite-section {
  text-align: center;
  margin-bottom: 28px;
}

.submitted-invite-heading {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--dark);
  margin-bottom: 16px;
  line-height: 1.3;
}

.submitted-invite-btn {
  width: 100%;
  margin-bottom: 16px;
}

.submitted-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.submitted-leaderboard-btn {
  width: 100%;
}

.submitted-home-link {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray);
  text-decoration: none;
  font-weight: 600;
}
.submitted-home-link:hover { color: var(--primary); text-decoration: underline; }

/* Invite share dialog */
.invite-share-dialog {
  margin-top: 16px;
  text-align: left;
}
.invite-share-label {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 8px;
  font-family: var(--font-body);
}
.invite-share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.invite-share-input {
  flex: 1;
  border: 1.5px solid var(--light-gray);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--dark);
}
.invite-share-hint {
  font-size: 12px;
  color: var(--green);
  margin-top: 6px;
  font-family: var(--font-body);
  text-align: center;
}
.invite-error {
  color: var(--primary);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-body);
}

/* ── Username chip (shown in every page top bar) ── */
.topbar-username {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ── Play page question card ── */
.play-main {
  padding-top: 24px;
}

.carousel-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}
.carousel-buttons .btn {
  width: 100%;
  justify-content: center;
}

.btn-outline {
  background: var(--white);
  color: var(--dark);
  border: 2.5px solid var(--dark);
  box-shadow: none;
  flex: 1;
}

.btn-outline:active {
  transform: translateY(2px);
}

/* ── Profile page top breathing room ── */
.profile-top-spacer {
  height: 8px;
}

/* ── Content section spacing ── */
.content-section {
  margin-bottom: 28px;
}

/* ── Consistent heading spacing inside content areas ── */
.home-main h1,
.home-main h2,
.submitted-main h1,
.submitted-main h2,
.play-main h1,
.play-main h2,
.container .section-title {
  margin-bottom: 12px;
}

/* ── Leaderboard/Archive/History top-bar spacing ── */
.lb-top-bar,
.archive-top-bar,
.top-bar {
  padding-top: 18px;
  padding-bottom: 10px;
}

/* ── Profile stats grid top margin ── */
.stats-grid {
  margin-top: 20px;
  margin-bottom: 20px;
}

/* ── Home right panel: transparent wrapper on mobile, sidebar on desktop ── */
.home-right-panel {
  display: block;
}

/* ── Section labels: hidden on mobile ── */
.home-panel-label {
  display: none;
}

/* ── Sponsor wrapper (home page) ── */
.home-sponsor-wrap {
  padding: 0 var(--space-16);
}

/* ── Card-lg sections spacing ── */
.card-lg + .card-lg,
.card-lg + .mb-16,
.mb-16 + .card-lg {
  margin-top: 20px;
}

/* ── Auth screens better spacing ── */
.auth-screen,
.screen-inner {
  gap: 0;
}

.auth-logo {
  margin-bottom: 16px;
}

.auth-title {
  margin-bottom: 6px;
}

.auth-subtitle {
  margin-bottom: 28px;
}

/* ── Countdown note spacing ── */
.countdown-note {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

.home-countdown-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 12px;
  margin-top: 20px;
}

/* ── Sheep image in home states ── */
.home-sheep-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

/* ── Button BEM-style aliases (btn-- double-dash variants) ── */
.btn--primary    { background: var(--primary);   color: var(--white); box-shadow: var(--shadow-btn-primary); }
.btn--primary:active { box-shadow: 0 2px 0 var(--primary-dark); }
.btn--secondary  { background: var(--secondary); color: var(--dark);  box-shadow: var(--shadow-btn-secondary); }
.btn--secondary:active { box-shadow: 0 2px 0 var(--secondary-dark); }
.btn--dark       { background: var(--dark);      color: var(--white); box-shadow: var(--shadow-btn-dark); }
.btn--dark:active { box-shadow: 0 2px 0 #000; }
.btn--outline    { background: var(--white);     color: var(--dark);  border: 2.5px solid var(--dark); box-shadow: none; }
.btn--large      { padding: 16px 28px; font-size: 17px; }


/* ============================================================
   DESKTOP LAYOUT — sidebar + tile grid (≥1025px)
   ============================================================ */
@media (min-width: 1025px) {

  /* ── Base desktop chrome ── */
  body {
    background: #EDE8DF;
  }

  .screen {
    margin-left: 240px;
    min-height: 100vh;
    max-width: none;
    overflow-x: visible;
  }

  /* ── Home page desktop layout ── */
  .home-main {
    overflow-x: visible;
  }

  /* ── Desktop tile grid — used on pages that opt in ── */
  .desktop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 32px 36px;
  }

  .desktop-grid .tile {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .desktop-grid .tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  }

  .desktop-grid .tile--wide {
    grid-column: span 2;
  }

  .desktop-grid .tile--full {
    grid-column: 1 / -1;
  }

  /* ── Stat tiles ── */
  .stat-tile {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 18px;
  }

  .stat-tile__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #FFF3EE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
  }

  .stat-tile__icon--green  { background: #EDFAF4; }
  .stat-tile__icon--blue   { background: #EFF6FF; }
  .stat-tile__icon--yellow { background: #FFFBEB; }

  .stat-tile__value {
    font-family: 'Galindo', cursive;
    font-size: 2rem;
    color: #1A1A1A;
    line-height: 1;
    margin-bottom: 2px;
  }

  .stat-tile__label {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    color: #9A8F85;
    font-weight: 600;
  }

  /* ── Desktop page content wrapper ── */
  .desktop-page {
    padding: 32px 36px;
    max-width: 1100px;
  }

  .desktop-page-header {
    margin-bottom: 24px;
  }

  .desktop-page-header h1 {
    font-family: 'Galindo', cursive;
    font-size: 1.6rem;
    color: #1A1A1A;
    margin: 0 0 4px;
  }

  .desktop-page-header p {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #9A8F85;
    margin: 0;
  }

  /* ── Content cards on desktop ── */
  .card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 20px;
  }

  .card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #F5F0E8;
    font-family: 'Galindo', cursive;
    font-size: 1rem;
    color: #1A1A1A;
  }

  .card-body {
    padding: 24px;
  }

  /* ── Responsive container override ── */
  .container {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  /* ── Fix profile/settings pages ── */
  .profile-wrap,
  .policy-wrap {
    max-width: 720px;
    padding: 32px 36px 60px;
    margin: 0;
  }
}
.btn--small      { padding: 8px 16px;  font-size: 13px; width: auto; }
