:root {
    --ar-bg-dark: #444552;
    --ar-bg-light: #f2f2f7;
    --ar-card: #555668;
    --ar-gold: #f4c770;
    --ar-red: #e60000;
    --ar-blue: #1e6dff;
    --ar-text-main: #ffffff;
    --ar-text-muted: #d5d5e3;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(circle at 40% 0%, #3c4659 0%, #232a34 45%, #1a2029 100%);
    min-height: 100vh;
    color: var(--ar-text-main);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

/* Landing Page Styles */
.landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    background: 
        radial-gradient(ellipse at center, rgba(30, 36, 48, 0.3) 0%, rgba(15, 18, 24, 0.8) 100%),
        radial-gradient(circle at 40% 0%, #2a3342 0%, #1a1f2b 45%, #0f1218 100%);
    color: var(--ar-text-main);
    padding: 40px 20px;
    animation: landingFadeIn 0.5s ease-out;
}

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

.landing-hero {
    background: linear-gradient(180deg, rgba(48, 54, 66, 0.90) 0%, rgba(38, 44, 56, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 0.5px solid var(--ar-gold);
    border-radius: 22px;
    padding: 41px 50px 50px;
    max-width: 860px;
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    position: relative;
    animation: heroSlideUp 0.6s ease-out;
}

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

.landing-tagline {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--ar-gold);
    border-radius: 999px;
    padding: 4px 14px;
    box-shadow: 0 0 10px rgba(255, 215, 130, 0.22);
    margin-bottom: 14px;
    color: var(--ar-gold);
    font-weight: 600;
}

.landing-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 18px;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.50);
    line-height: 1.08;
    color: #ffffff;
    letter-spacing: 1.5px;
}

.landing-subtitle {
    font-size: 1.45rem;
    margin-bottom: 32px;
    opacity: 0.75;
    font-weight: 500;
    color: #d1d5db;
    letter-spacing: 0.3px;
}

.landing-features {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.landing-feature {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.landing-feature-icon {
    font-size: 2.3rem;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: 
        radial-gradient(circle, rgba(30, 36, 48, 0.95) 0%, rgba(20, 24, 32, 1) 70%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.45),
        inset 0 2px 8px rgba(251, 191, 36, 0.08);
    transition: all 0.3s ease;
}

.landing-feature-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(251, 191, 36, 0.4) 0%, 
        rgba(251, 191, 36, 0.15) 35%, 
        rgba(251, 191, 36, 0.05) 70%, 
        rgba(251, 191, 36, 0.3) 100%);
    z-index: -1;
}

.landing-feature-icon:hover {
    transform: scale(1.05);
    filter: brightness(1.15);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.55),
        inset 0 2px 10px rgba(251, 191, 36, 0.12);
}

.landing-feature-text {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: 0.2px;
}

.play-game-btn {
    background: linear-gradient(180deg, #d91825 0%, #b81018 100%);
    color: #ffffff;
    border: none;
    padding: 22px 60px;
    font-size: 1.6rem;
    font-weight: 800;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 
        0 8px 24px rgba(201, 15, 26, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
    letter-spacing: 2px;
    outline: none;
    margin-top: 14px;
    animation: ctaFadeIn 0.6s ease-out 0.2s backwards;
}

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

.play-game-btn:hover {
    background: linear-gradient(180deg, #e61f2d 0%, #c7141f 100%);
    transform: scale(1.02);
    box-shadow: 
        0 12px 32px rgba(201, 15, 26, 0.50),
        0 0 24px rgba(201, 15, 26, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.play-game-btn:focus-visible {
    outline: 2px solid var(--ar-gold);
    outline-offset: 3px;
}

.play-game-btn:active {
    transform: translateY(-1px);
}

.prize-highlight {
    background: linear-gradient(135deg, var(--ar-gold) 0%, #d4a12a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    font-size: 2rem;
    margin: 24px 0 18px;
    text-shadow: 0 2px 4px rgba(251, 191, 36, 0.30);
    letter-spacing: 0.5px;
}

/* Admin Panel Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.admin-header {
    background: linear-gradient(135deg, #C90F1A 0%, #a50e16 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.admin-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.admin-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.admin-content {
    padding: 30px;
}

.controls-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.controls-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.bulk-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.bulk-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.bulk-btn.enable {
    background: #28a745;
    color: white;
}

.bulk-btn.enable:hover {
    background: #218838;
}

.bulk-btn.disable {
    background: #dc3545;
    color: white;
}

.bulk-btn.disable:hover {
    background: #c82333;
}

.bulk-btn.neutral {
    background: #6c757d;
    color: white;
}

.bulk-btn.neutral:hover {
    background: #5a6268;
}

.status-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.status-loading {
    background: #ffc107;
    color: #856404;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.admin-stages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.admin-stage-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.admin-stage-card.enabled {
    border-color: #28a745;
    background: #f8fff9;
}

.admin-stage-card.disabled {
    border-color: #dc3545;
    background: #fff5f5;
}

.admin-stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.admin-stage-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.stage-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.stage-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #28a745;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.admin-stage-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.admin-info-item {
    display: flex;
    flex-direction: column;
}

.admin-info-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.admin-stage-notes {
    margin-top: 10px;
}

.admin-notes-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.admin-update-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.admin-update-btn:hover {
    background: #0056b3;
}

.admin-update-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.admin-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.admin-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

.admin-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #c3e6cb;
}

.admin-refresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #C90F1A;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(201, 15, 26, 0.3);
    transition: all 0.3s ease;
}

.admin-refresh-btn:hover {
    background: #a50e16;
    transform: scale(1.1);
}

/* Game Styles */
/* --- Stage Header Card --- */
/* Game Hero - Premium dark container for header + video + input */
.game-hero {
  max-width: 980px;
  margin: 0 auto 2.5rem auto;
  padding: 1.5rem 1.75rem 1.75rem;
  border-radius: 20px;
  background: radial-gradient(circle at top, #2a2f3b 0%, #1c2027 70%, #171b21 100%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.30), 0 -2px 10px rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top: 2px solid rgba(255, 196, 90, 0.45);
  outline: 1px solid rgba(255, 255, 255, 0.03);
  animation: goldPulse 1.2s ease-out 1;
}

/* Stage header - Cinematic bar */
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-radius: 20px;
  background: radial-gradient(circle at top, #2a2f3b 0%, #1c2027 70%, #171b21 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  outline: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 1.2rem;
}

.stage-header__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
}

.stage-header .stage-title {
  margin: 0;
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.3px;
}

.stage-header__profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stage-header__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stage-header__user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e7eb;
}

.stage-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage-header__actions button {
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
}

.stage-header__actions .btn-profile {
  background: transparent;
  color: #fbbf24;
  border: 1px solid #fbbf24;
}

.stage-header__actions .btn-profile:hover {
  background: rgba(251, 191, 36, 0.1);
}

/* How to play text */
.game-hero .how-to-play-text {
  margin: 0.75rem 0 1.2rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e5e7eb !important;
  text-align: center;
}

/* Premium dark video card */
.game-video-card {
  background: linear-gradient(180deg, #323843 0%, #20262f 100%);
  border-radius: 20px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.50);
  margin-bottom: 1rem;
}

.game-video-card .video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  margin: 0;
}

.game-video-card iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  border: none;
}

/* Answer input row */
.game-answer-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.game-answer-row input[type="text"],
.game-answer-row input[type="search"] {
  flex: 1;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: rgba(24, 31, 42, 0.96);
  color: #e5e7eb;
  font-size: 1rem;
}

.game-answer-row input::placeholder {
  color: #6b7280;
}

.game-answer-row input:focus {
  outline: none;
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .game-hero {
    padding: 1.25rem 1.1rem 1.4rem;
    border-radius: 22px;
  }
  .stage-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .stage-header__profile {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .game-answer-row {
    flex-direction: column;
    align-items: stretch;
  }
  .game-answer-row button {
    width: 100%;
  }
  
  /* Landing page responsive */
  .landing-hero {
    padding: 40px 28px;
  }
  
  .landing-title {
    font-size: 2.8rem;
    letter-spacing: 0.5px;
  }
  
  .landing-subtitle {
    font-size: 1.3rem;
  }
  
  .landing-features {
    gap: 24px;
  }
  
  .landing-feature {
    min-width: 150px;
  }
  
  .landing-feature-icon {
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
  }
  
  .play-game-btn {
    padding: 18px 40px;
    font-size: 1.3rem;
  }
  
  .prize-highlight {
    font-size: 1.8rem;
  }
}

.stage-panel {
    background: white;
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    overflow: hidden;
}

.stage-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

/* Stage Instructions - Clean typography matching design system */
.stage-instructions {
    font-size: 0.95rem;
    color: #2b2b2b !important;   /* dark grey used across light surfaces */
    font-weight: 500;            /* consistent with header typography */
    letter-spacing: 0.2px;
    text-align: center;
    padding: 10px 0 14px 0;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Legacy support for old class name */
.stage-subtitle {
    font-size: 0.95rem;
    color: #2b2b2b !important;
    font-weight: 500;
    letter-spacing: 0.2px;
    text-align: center;
    padding: 10px 0 14px 0;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Stage 1 Helper Bar (new player guidance) */
.stage-helper-bar {
    margin: 12px 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(0, 255, 153, 0.5);
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.5;
    /* Micro-animation: Start hidden with slight upward offset */
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.stage-helper-visible {
    opacity: 1;
    transform: translateY(0);
}

.stage-helper-text {
    margin: 0;
}

.stage-helper-text strong {
    font-weight: 600;
    color: rgba(0, 255, 153, 0.95);
}

.stage-helper-hidden {
    display: none;
}

.stage-status-banner {
    margin: 0 0 12px 0;
    padding: 8px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    backdrop-filter: blur(8px);
}

.stage-status-banner::before {
    content: "🔥";
    font-size: 1rem;
}

.stage-status-banner.hidden {
    display: none;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 18px;
    margin-bottom: 16px;
    background: radial-gradient(circle at top, #2a2f3b 0%, #1c2027 70%, #171b21 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    outline: 1px solid rgba(255, 255, 255, 0.03);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Alias selectors for other possible wrapper classnames used in the codebase */
.video-wrapper,
.stage-video {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(0,0,0,0.30);
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.answer-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
}

.answer-input:focus {
    border-color: #C90F1A;
    box-shadow: 0 0 0 3px rgba(201, 15, 26, 0.1);
}

.submit-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    background: #C90F1A;
    color: white;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: #a50e16;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    color: #c62828;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.success-panel {
    display: none;
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #f8fff9;
    border-color: #4caf50;
}

.success-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #2e7d32;
}

.success-text {
    opacity: 0.9;
    margin-bottom: 12px;
}

.continue-btn {
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    background: #C90F1A;
    color: white;
    transition: all 0.2s;
}

.continue-btn:hover {
    background: #a50e16;
}

.second-riddle-panel {
    display: none;
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #ffa726;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.second-riddle-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #e65100;
}

.second-riddle-clue {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    color: #bf360c;
}

/* Stage Disabled Notification Panel */
.stage-disabled-panel {
    display: none;
    margin-top: 20px;
    padding: 24px;
    border: 2px solid #ff9800;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    text-align: center;
}

.stage-disabled-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #e65100;
}

.stage-disabled-message {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #bf360c;
}

.youtube-notification-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #FF0000;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.youtube-notification-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
    text-decoration: none;
    color: white;
}

.youtube-icon {
    font-size: 20px;
}

/* --- Your Journey Section (Modernized AR Brand) --- */

/* Journey Section Header */
.journey-section-header {
    text-align: center;
    margin-bottom: 16px;
}

.journey-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.journey-section-subtitle {
    font-size: 14px;
    color: var(--ar-text-muted);
    margin-top: 4px;
}

/* Outer Your Journey card */
.journey-section,
.journey-card,
.ar-journey-card {
  background: radial-gradient(circle at top, #2b313d 0%, #1f252f 60%, #191e26 100%);
  border-radius: 20px;
  padding: 20px 24px 24px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

/* Header row */
.journey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.journey-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

/* Meta row: user info + progress summary */
.journey-meta,
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ar-text-muted);
}

.user-name {
  font-weight: 600;
  color: #ffffff;
}

.sign-out-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ar-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
}

.sign-out-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Header avatar and user info container */
.ar-header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ar-header-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--ar-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.ar-header-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Profile and Sign Out pill buttons */
#btnProfile,
#btnSignOut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  margin-left: 8px;

  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;

  border: none;
  background: var(--ar-gold);
  color: #000;

  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(244, 199, 112, 0.3);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

#btnProfile:hover,
#btnSignOut:hover {
  background: #f59e0b;
  box-shadow: 0 4px 12px rgba(244, 199, 112, 0.4);
  transform: translateY(-1px);
}

#btnSignOut {
  opacity: 0.95;
}

#btnSignOut:hover {
  opacity: 1;
}

.profile-trigger-btn {
  padding: 6px 12px;
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.1);
  color: var(--ar-gold);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 90px;
  font-weight: 500;
}

.profile-trigger-btn:hover:not(:disabled) {
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.15);
  transform: translateY(-1px);
}

.sign-out-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}

/* "8 / 16 solved" pill */
.journey-count,
.journey-progress-summary {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Stage grid */
.stages-grid,
.journey-stages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* Stage cards – base */
.stage-tile,
.journey-stage-card {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out, opacity 0.15s ease-out, border-color 0.15s ease-out;
  min-height: 140px;
}

/* Micro-animation: Hover lift (desktop only) */
@media (hover: hover) {
  .stage-tile:not(.locked):not(.admin-disabled):hover,
  .journey-stage-card:not(.locked):not(.admin-disabled):hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.40);
  }

  /* Gold Pulse Animation for Hero */
  @keyframes goldPulse {
    0% {
      border-top-color: rgba(255,196,90, 0.70);
      box-shadow: 0 -2px 10px rgba(255,196,90,0.30);
    }
    70% {
      border-top-color: rgba(255,196,90, 0.95);
      box-shadow: 0 -2px 16px rgba(255,196,90,0.45);
    }
    100% {
      border-top-color: rgba(255,196,90, 0.45);
      box-shadow: 0 -2px 10px rgba(255,196,90,0.25);
    }
  }

  /* Stage 16 Gold Card Pulse Animation */
  @keyframes stage16Pulse {
    0% {
      transform: translateY(0) scale(1);
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 28px rgba(255, 207, 120, 0.65);
    }
    50% {
      transform: translateY(-3px) scale(1.03);
      box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 207, 120, 0.85);
    }
    100% {
      transform: translateY(0) scale(1);
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 28px rgba(255, 207, 120, 0.65);
    }
  }

  .final-stage-card:not(.locked):hover,
  .stage-16-winner-card:not(.locked):hover {
    animation: stage16Pulse 420ms ease-out;
  }
}

/* Stage solve highlight animation */
@keyframes stageJustSolved {
  0% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transform: translateY(0) scale(1);
  }
  30% {
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.18);
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transform: translateY(0) scale(1);
  }
}

@keyframes stageWinnerSolved {
  0% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transform: translateY(0) scale(1);
  }
  30% {
    box-shadow: 0 0 28px rgba(255, 215, 128, 0.8), 0 12px 36px rgba(255, 183, 77, 0.4);
    transform: translateY(-3px) scale(1.03);
  }
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    transform: translateY(0) scale(1);
  }
}

.stage-tile.journey-card--just-solved,
.journey-stage-card.journey-card--just-solved {
  background: var(--ar-card);
  border: 1px solid var(--ar-gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.18);
  transform: translateY(-4px);
  animation: stageJustSolved 650ms ease-out;
}

.stage-tile.journey-card--stage-winner,
.journey-stage-card.journey-card--stage-winner {
  animation: stageWinnerSolved 700ms ease-out;
}

.stage-tile,
.journey-stage-card {
  width: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .stage-tile:hover,
  .journey-stage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.16);
  }
}

/* Active (pressed) state for clickable cards */
.stage-tile:active:not(.locked):not(.stage-status-locked):not(.admin-disabled),
.journey-stage-card:active:not(.locked):not(.stage-status-locked):not(.admin-disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0.9;
}

/* Solved state */
.stage-tile.solved,
.journey-stage-card.solved {
  border-color: rgba(46, 204, 113, 0.5);
  background: rgba(10, 10, 15, 0.85);
}

.stage-tile.solved .stage-icon,
.journey-stage-card.solved .journey-stage-check {
  background: rgba(46, 204, 113, 0.22);
  color: #2ecc71;
}

/* Locked state */
.stage-tile.locked,
.journey-stage-card.locked {
  cursor: not-allowed;
  opacity: 0.75;
}

.stage-tile.locked:hover,
.journey-stage-card.locked:hover {
  transform: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 0.8;
}

.stage-tile.locked .stage-icon,
.journey-stage-card.locked .journey-stage-check {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
}

.stage-tile.locked .stage-name,
.stage-tile.locked .journey-stage-title {
  color: rgba(255, 255, 255, 0.75);
}

/* Locked/disabled state - neutral styling */
.stage-tile.stage-status-locked,
.journey-stage-card.stage-status-locked {
  cursor: not-allowed;
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.15);
}

.stage-tile.stage-status-locked:hover,
.journey-stage-card.stage-status-locked:hover {
  transform: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  opacity: 0.65;
}

/* Legacy admin-disabled support (maps to stage-status-locked) */
.stage-tile.admin-disabled,
.journey-stage-card.admin-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.15);
}

.stage-tile.admin-disabled:hover,
.journey-stage-card.admin-disabled:hover {
  transform: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  opacity: 0.65;
}

/* Icon + status text */
.stage-icon,
.journey-stage-check {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 6px;
}

.stage-icon.solved {
  background: rgba(46, 204, 113, 0.22);
  color: #2ecc71;
}

.stage-icon.open {
  background: #e60000;
  color: #ffffff;
}

/* Current stage card - premium highlight */
.stage-tile:has(.stage-icon.open),
.journey-stage-card:has(.stage-icon.open) {
  border: 1px solid rgba(255, 196, 90, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

.stage-icon.locked {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
}

.stage-icon.stage-status-locked {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
}

.stage-icon.admin-disabled {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
}

.stage-name,
.journey-stage-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
}

/* ===== Shared Stage Status Label ===== */
/* Base class for all stage status text (Solved, Open, Opens as your journey unfolds) */
.stage-status-label,
.stage-status,
.journey-stage-status {
  font-size: 0.9rem;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
  text-align: center;
  font-weight: 500;
}

/* Solved status - subtle success color */
.stage-status-label.is-solved,
.stage-status.is-solved {
  color: rgba(46, 204, 113, 0.9);
}

/* Open status - default white */
.stage-status-label.is-open,
.stage-status.is-open {
  color: rgba(255, 255, 255, 0.85);
}

/* Locked/disabled status - muted */
.stage-status-label.is-locked,
.stage-status.is-locked {
  color: rgba(255, 255, 255, 0.65);
  opacity: 0.9;
}

/* Reward badge in the top-right corner of each card */
.prize-badge,
.journey-stage-reward {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    transition: transform 200ms ease-out;
    cursor: pointer;
}

.prize-badge:hover,
.journey-stage-reward:hover {
    transform: scale(1.03);
}

.prize-badge-line {
    display: block;
}

/* ===== Journey Progress Bar ===== */
.stage-progress-wrapper {
    max-width: 760px;
    margin: 0 auto 22px;
    text-align: center;
}

.stage-progress-label {
    font-size: 0.95rem;
    color: var(--ar-text-muted);
    margin-bottom: 8px;
}

.stage-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin-bottom: 10px;
}

.stage-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #2ddf6b 0%, #13b85a 100%);
    box-shadow: 0 0 10px rgba(45, 223, 107, 0.45);
    transition: width 0.3s ease-out;
}

.stage-progress-dots {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
}

.stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    opacity: 0.7;
}

.stage-dot-complete {
    background: #00c978;
    opacity: 1;
}

.stage-dot-current {
    background: var(--ar-gold);
    box-shadow: 0 0 8px rgba(45, 223, 107, 0.7);
    opacity: 1;
}

.stage-dot-locked {
    background: rgba(255, 255, 255, 0.12);
    opacity: 0.5;
}

/* Stage 16 separate container */
/* ===== Stage 16 Master Card (Standalone) - Premium Gold Grand Finale ===== */
.stage16-master-container {
    margin-top: 28px;
    display: flex;
    justify-content: center;
}

.journey-master-stage-card {
    width: 100%;
    max-width: 760px;
    background: linear-gradient(135deg, #fffbf0 0%, #ffe9b8 30%, #ffd980 100%);
    border-radius: 20px;
    padding: 36px 40px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(255, 215, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.6);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Top glow effect */
.journey-master-stage-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.15) 40%, transparent 100%);
    pointer-events: none;
}

.journey-master-stage-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.45),
        0 0 50px rgba(255, 215, 0, 0.35);
}

.journey-master-stage-card.locked,
.journey-master-stage-card.stage-status-locked {
    opacity: 0.88;
    cursor: not-allowed;
}

.journey-master-stage-card.locked:hover,
.journey-master-stage-card.stage-status-locked:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(255, 215, 0, 0.25);
}

.stage16-master-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.stage16-master-icon.locked,
.stage16-master-icon.stage-status-locked {
    background: rgba(139, 92, 0, 0.20);
    color: rgba(139, 92, 0, 0.65);
    border: 2px solid rgba(139, 92, 0, 0.30);
}

.stage16-master-icon.open {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.stage16-master-header {
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.master-stage-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1506;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.master-stage-subtitle {
    font-size: 20px;
    font-weight: 700;
    color: #5b3900;
    opacity: 1;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

.stage16-master-description {
    font-size: 15px;
    line-height: 1.7;
    color: #3d2800;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 18px;
    position: relative;
    z-index: 1;
}

.stage16-master-status {
    font-size: 14px;
    color: #5b3900;
    font-weight: 600;
    margin-top: 10px;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

/* Responsive for Stage 16 Master Card */
@media (max-width: 768px) {
    .journey-master-stage-card {
        padding: 28px 24px;
    }
    
    .stage16-master-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .master-stage-title {
        font-size: 22px;
    }
    
    .master-stage-subtitle {
        font-size: 17px;
    }
    
    .stage16-master-description {
        font-size: 14px;
    }
}

/* Legacy Stage 16 styles (keep for backwards compatibility) */
.stage16-container {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

/* ===== Shared Stage 16 Gold Card Base ===== */
/* Base width and alignment for both Journey and Leaderboard Stage 16 cards */
.stage-16-gold-card-base {
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.stage16-card {
    transition: all 0.2s ease;
    position: relative;
    /* Base styling removed - applied via .final-stage-card when unlocked */
    /* Locked state still uses default background below */
}

/* Default styling for locked Stage 16 (when NOT .final-stage-card) */
.stage16-card:not(.final-stage-card) {
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #ffe9e9 100%);
    border: 1px solid rgba(220, 0, 0, 0.18);
    box-shadow: 0 8px 24px rgba(220,0,0,0.10);
}

.stage16-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(220,0,0,0.16);
}

.stage16-card.locked {
    filter: grayscale(.25);
    opacity: .9;
    cursor: not-allowed;
}

.stage16-card.admin-disabled {
    filter: grayscale(.5);
    opacity: .6;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
}

.stage16-card.stage-status-locked {
    filter: grayscale(.25);
    opacity: .9;
    cursor: not-allowed;
}

.stage16-card.locked:hover,
.stage16-card.admin-disabled:hover,
.stage16-card.stage-status-locked:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(220,0,0,0.10);
}

.stage16-top {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    margin-bottom: 8px;
}

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

.stage16-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.stage16-icon.locked {
    background: #bbb;
}

.stage16-icon.open {
    background: #128c1b;
}

.stage16-icon.admin-disabled {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.65);
}

.stage16-icon.stage-status-locked {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.65);
}

.stage16-title { 
    font-weight: 800; 
    font-size: 18px; 
}

.stage16-status { 
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
    letter-spacing: 0.02em;
    margin-top: 4px;
    font-weight: 500;
}

.stage16-caption {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.88;
    text-align: center;
    margin: 0 auto 14px;
    max-width: 520px;
    color: #5b3900;
}

/* Journey card caption specific styling */
.journey-card--master .stage16-caption {
    color: #5b3900;
    opacity: 0.92;
}

.stage16-prize {
    background: #111; 
    color: #fff; 
    font-weight: 700;
    border-radius: 999px; 
    padding: 6px 12px; 
    font-size: 13px; 
    line-height: 1;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

/* Responsive adjustments for Stage 16 journey card */
@media (max-width: 768px) {
    .final-stage-card {
        padding: 28px 24px;
        margin: 20px 0 28px;
    }

    .journey-card--master .stage16-icon {
        font-size: 2rem;
        margin-bottom: 6px;
    }

    .journey-card--master .stage16-title {
        font-size: 1.15rem;
        margin-bottom: 8px;
    }

    .journey-card--master .stage16-prize {
        font-size: 0.8rem;
        padding: 6px 16px;
        margin-bottom: 12px;
    }

    .stage16-caption {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 14px;
        max-width: 100%;
    }

    .journey-card--master .stage16-status {
        font-size: 12px;
    }
}

/* Leaderboard Styles */
/* --- Stage Winners Leaderboard (Modernized) --- */

/* Leaderboard unified container */
#leaderboard-section,
.leaderboard-section,
.stage-winners-section {
  background: radial-gradient(circle at top, #2b313d 0%, #1f252f 60%, #191e26 100%);
  border-radius: 20px;
  padding: 20px 24px 24px;
  margin-top: 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

/* Header title */
#leaderboard-title,
.leaderboard-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ar-gold);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.3px;
}

.leaderboard-title .emoji {
  font-size: 1.2rem;
}

/* Winners grid */
.leaderboard-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  gap: 20px !important;
  row-gap: 24px !important;
  width: 100% !important;
  margin-top: 24px;
}

/* Leaderboard card (each winner box) */
.lb-card,
.leaderboard-card,
.leaderboard-item {
  background: rgba(10, 10, 15, 0.85);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 160px;
  line-height: 1.5;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}

/* Micro-animation: Hover lift (desktop only) */
@media (hover: hover) {
  .lb-card:hover,
  .leaderboard-card:hover,
  .leaderboard-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.40);
  }
}

/* Top row */
.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Winner/placeholder pill */
.lb-pill,
.leaderboard-winner-name {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.lb-pill.win,
.lb-winner-name {
  background: rgba(251, 191, 36, 0.15);
  color: var(--ar-gold);
}

.lb-pill.none {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Main content block inside each card */
.lb-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
}

/* Row: check icon + "Stage X" */
.leaderboard-stage-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

/* Stage label – slightly smaller so it's not shouting */
.lb-stage-label {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

/* Winner pill at top */
.lb-winner-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.15);
  color: var(--ar-gold);
}

.lb-icon,
.leaderboard-stage-check {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.lb-icon.lock {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

.lb-icon.check,
.leaderboard-stage-check {
  background: rgba(61, 231, 166, 0.12);
  color: #3de7a6; /* bright green */
}

/* Icons inside leaderboard cards */
.lb-card i,
.lb-card svg {
  color: #3de7a6;
}

.lb-title {
  font-weight: 800;
  margin: 6px 0 2px 0;
  color: #ffffff; /* white for dark cards */
}

/* Footer: prize badge + status – pinned to bottom */
.lb-footer {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}

.lb-prize-badge,
.leaderboard-reward,
.lb-prize {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--ar-gold);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
}

/* Hide status icons */
.lb-status-icon,
.leaderboard-stage-row .lb-status-icon,
.leaderboard-stage-row svg,
.lb-icon {
  display: none !important;
}

.leaderboard-reward span + span {
  margin-left: 4px;
  padding-left: 4px;
  border-left: 1px solid rgba(4, 120, 87, 0.28);
}

.leaderboard-celebrate {
  margin-left: 4px;
  font-size: 0.8rem;
}

.lb-status,
.lb-meta,
.lb-congrats {
  font-size: 0.85rem;
  text-align: center;
  color: #e5e7eb;
  line-height: 1.4;
  margin-top: 4px;
}

.lb-date {
  font-size: 0.75rem;
  opacity: 0.6;
  display: block;
  margin-top: 6px;
  color: var(--ar-text-muted);
  font-style: italic;
}

/* Username truncation */
.lb-username {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #ffffff; /* white for dark cards */
}

/* Stage 16 Big Leaderboard Card - CENTERED AND SPACED */
.lb16-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
    row-gap: 24px;
    margin-top: 24px;
    width: 100%;
}

.lb16-card {
    width: clamp(360px, 72%, 760px);
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #ffe9e9 100%);
    border: 1px solid rgba(220, 0, 0, 0.18);
    box-shadow: 0 8px 24px rgba(220,0,0,0.10);
    transition: all 0.2s ease;
    position: relative;
}

.lb16-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(220,0,0,0.16);
}

.lb16-top {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    margin-bottom: 8px;
}

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

.lb16-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.lb16-icon.locked {
    background: #bbb;
}

.lb16-icon.open {
    background: #128c1b;
}

.lb16-title { 
    font-weight: 800; 
    font-size: 18px; 
}

.lb16-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.lb16-status { 
    font-size: 14px; 
    opacity: .9; 
    text-align: center;
}

.lb16-date {
    font-size: 11px;
    opacity: .75;
    display: block;
    margin-top: 2px;
}

.lb16-prize {
    order: -1;
    background: linear-gradient(135deg, #6B9B6B 0%, #4A7C4A 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.12);
    text-align: center;
    line-height: 1.2;
}

/* FOOTER STYLES */
.app-footer {
    margin-top: 40px;
    padding: 28px 24px;
    text-align: center;
    background: rgba(43, 49, 61, 0.40);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 10px 20px;
    display: inline-block;
    letter-spacing: 0.3px;
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(251, 191, 36, 0.40);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.30);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
}

/* PLAYER STATUS CARD */
.player-status-card {
    background: var(--ar-card);
    color: var(--ar-text-main);
    border-radius: 20px;
    padding: 40px 30px;
    margin: 32px auto;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
    backdrop-filter: blur(10px);
}

.player-status-card.hidden {
    display: none;
}

.player-status-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ar-text-muted);
    margin-bottom: 12px;
}

.player-status-headline {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--ar-text-main);
    line-height: 1.2;
}

.player-status-subline {
    font-size: 1.25rem;
    color: var(--ar-text-muted);
    margin-bottom: 24px;
    font-weight: 500;
}

.player-continue-btn {
    background: var(--ar-red);
    color: #ffffff;
    border: none;
    padding: 16px 40px;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-continue-btn:hover {
    background: #c00000;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.5);
}

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

@media (max-width: 600px) {
    .player-status-card {
        padding: 30px 20px;
        margin: 24px 16px;
    }
    
    .player-status-headline {
        font-size: 1.5rem;
    }
    
    .player-status-subline {
        font-size: 1rem;
    }
    
    .player-continue-btn {
        padding: 14px 32px;
        font-size: 1rem;
    }
    
    /* Larger tagline pill on mobile */
    .landing-tagline {
        font-size: 13px !important;
        padding: 6px 18px !important;
        letter-spacing: 0.12em !important;
        margin-bottom: 14px !important;
    }
}

/* INFO MODAL STYLES */
.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10000;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.info-modal-content {
    background: var(--ar-card) !important;
    border-radius: 18px;
    padding: 32px;
    width: 90%;
    max-width: 700px;
    height: 80vh;
    overflow-y: auto;
    box-shadow: 0 18px 40px rgba(0,0,0,0.55);
    animation: modalSlideIn 0.3s ease-out;
    color: var(--ar-text-main);
    position: relative;
}

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

.info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.info-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ar-text-main);
    line-height: 1.2;
    flex: 1;
    margin-right: 16px;
}

.info-modal-close {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    color: var(--ar-text-main);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    opacity: 0.9;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.info-modal-close:hover {
    opacity: 1;
}

.info-modal-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ar-text-muted);
}

.info-modal-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--ar-text-main);
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.info-modal-body ol {
    margin: 16px 0;
    padding-left: 20px;
}

.info-modal-body li {
    margin-bottom: 12px;
}

.info-modal-body p {
    margin-bottom: 12px;
}

.info-modal-body strong {
    color: var(--ar-gold);
}

.info-modal-body a {
    color: var(--ar-blue);
    text-decoration: underline;
    cursor: pointer;
}

.info-modal-body a:hover {
    opacity: 0.9;
}

/* Custom scrollbar for modal */
.info-modal-content::-webkit-scrollbar {
    width: 8px;
}

.info-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.info-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.info-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    width: min(400px, 90%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-weight: 800;
    font-size: 18px;
}

.close-btn {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 24px;
    text-align: center;
}

.modal-message {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

/* Solve Celebration Modal */
.solve-celebration-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.solve-celebration-backdrop.hidden {
    display: none;
}

.solve-celebration-modal {
    background: radial-gradient(
        circle at top,
        rgba(255, 215, 0, 0.22),
        rgba(17, 24, 39, 0.96) 35%,
        rgba(17, 24, 39, 1) 100%
    );
    width: min(480px, 90%);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--ar-gold);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
    animation: modalSlideUp 0.3s ease-out;
}

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

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

.solve-celebration-header {
    padding: 32px 32px 20px;
    text-align: center;
    background: transparent;
    color: white;
}

.solve-celebration-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.solve-celebration-body {
    padding: 28px 32px;
    text-align: center;
}

.solve-celebration-message {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #e5e7eb;
    margin: 0;
}

.solve-celebration-actions {
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.solve-celebration-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.03em;
}

.solve-celebration-btn.primary {
    background: var(--ar-gold);
    color: #111827;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.solve-celebration-btn.primary:hover {
    background: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.solve-celebration-btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.solve-celebration-btn.secondary {
    background: #f0f0f0;
    color: #555;
}

.solve-celebration-btn.secondary:hover {
    background: #e0e0e0;
}

/* Auth Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.auth-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}

.auth-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.auth-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.auth-close:hover {
    background: #f5f5f5;
    color: #333;
}

.auth-tabs {
    display: flex;
    margin: 0 24px 24px 24px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    color: #666;
}

.auth-tab.active {
    background: white;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-form {
    display: none;
    padding: 0 24px 24px 24px;
}

.auth-form.active {
    display: block;
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: #4285F4;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn.primary {
    background: #4285F4;
    color: white;
}

.auth-btn.primary:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.auth-link {
    text-align: center;
    margin-top: 16px;
}

.auth-link a {
    color: #4285F4;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.auth-message {
    margin: 16px 24px 0 24px;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* OAuth Button Styles */
/* OAuth Button (Light Modal Safe) */
.oauth-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  border-radius: 10px;

  background: #ffffff;
  border: 1px solid #dadce0;
  color: #3c4043;

  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
  margin-bottom: 12px;
}

.oauth-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.oauth-btn:active {
  transform: translateY(1px);
}

.oauth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.oauth-btn__icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234285F4' d='M24 9.5c3.54 0 6.72 1.22 9.22 3.6l6.86-6.86C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%2334A853' d='M46.5 24.5c0-1.64-.15-3.22-.43-4.75H24v9h12.7c-.55 2.97-2.2 5.49-4.7 7.18l7.2 5.59c4.21-3.88 6.3-9.6 6.3-17.02z'/%3E%3Cpath fill='%23FBBC05' d='M10.54 28.59c-.48-1.43-.76-2.96-.76-4.59s.27-3.16.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.98-6.19z'/%3E%3Cpath fill='%23EA4335' d='M24 48c6.48 0 11.93-2.14 15.9-5.81l-7.2-5.59c-2 1.34-4.57 2.14-8.7 2.14-6.26 0-11.57-4.22-13.46-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
}

.oauth-btn__text {
  line-height: 1;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  opacity: 0.7;
  font-size: 14px;
  color: #999;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.15);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .landing-hero {
        padding: 40px 20px;
    }

    .landing-title {
        font-size: 2.5rem;
    }

    .landing-features {
        gap: 20px;
    }

    /* Mobile: Switch to single column for stages grid */
    .stages-grid,
    .journey-stages-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .leaderboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 12px !important;
    }

    .input-group {
        flex-direction: column;
        gap: 8px;
    }

    .answer-input {
        width: 100%;
    }

    .info-modal-content {
        padding: 20px;
    }

    .footer-separator {
        display: none;
    }

    .stage16-card {
        width: clamp(260px, 90%, 400px);
    }

    /* Mobile: Stage 16 Leaderboard Card */
    .lb16-card {
        width: clamp(260px, 90%, 400px);
    }

    /* Mobile: Admin Panel */
    .admin-content {
        padding: 20px;
    }

    .admin-stages-grid {
        grid-template-columns: 1fr;
    }

    .bulk-controls {
        justify-content: center;
    }

    .admin-stage-info {
        grid-template-columns: 1fr;
    }

    /* Mobile: Stage Disabled Panel */
    .stage-disabled-panel {
        padding: 20px;
    }

    .stage-disabled-title {
        font-size: 20px;
    }

    .stage-disabled-message {
        font-size: 15px;
    }

    .youtube-notification-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

.reset-modal.hidden { display: none; }
.reset-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.reset-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.55); backdrop-filter: blur(4px); }
.reset-modal-panel { position: relative; max-width: 420px; width: 90%; padding: 1.75rem; background:#0b1120; border-radius:1rem; box-shadow:0 24px 60px rgba(0,0,0,0.55); color:#e5e7eb; }
.reset-modal-title { font-size:1.25rem; font-weight:600; margin-bottom:.35rem; }
.reset-modal-text { font-size:.9rem; color:#9ca3af; margin-bottom:1rem; }
.reset-modal-label { display:block; font-size:.85rem; margin-bottom:.75rem; }
.reset-modal-input-wrap { display:flex; align-items:center; margin-top:.25rem; background:#020617; border-radius:.5rem; border:1px solid #1f2937; overflow:hidden; }
.reset-modal-input { flex:1; border:none; outline:none; padding:.55rem .7rem; font-size:.9rem; background:transparent; color:#e5e7eb; }
.reset-modal-input::placeholder { color:#4b5563; }
.reset-modal-toggle { border:none; background:transparent; padding:.35rem .6rem; cursor:pointer; font-size:.9rem; color:#9ca3af; }
.reset-modal-error { margin-top:.25rem; font-size:.8rem; color:#f97373; }
.reset-modal-success { margin-top:.25rem; font-size:.8rem; color:#4ade80; }
.reset-modal-actions { margin-top:1.1rem; display:flex; justify-content:flex-end; gap:.5rem; }
.reset-modal-btn { border-radius:9999px; padding:.45rem .9rem; font-size:.85rem; border:1px solid transparent; cursor:pointer; font-weight:500; }
.reset-modal-btn.primary { background:linear-gradient(135deg,#22c55e,#16a34a); color:#0b1120; }
.reset-modal-btn.secondary { background:transparent; border-color:#4b5563; color:#e5e7eb; }

.global-toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -10px);
}

.global-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 10000;
    background: #0b1120;
    color: #e5e7eb;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid #22c55e;
    font-size: 0.85rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.global-toast.error {
    border-color: #f97373;
}

#hint-popup {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    z-index: 9999;
    transition: opacity 0.25s ease;
}

.hint-hidden {
    opacity: 0;
    pointer-events: none;
}

.hint-box {
    background: var(--ar-card);
    padding: 24px 28px;
    border-radius: 18px;
    text-align: center;
    max-width: 340px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

.hint-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--ar-text-main);
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.hint-text {
    font-size: 16px;
    margin-bottom: 18px;
    color: var(--ar-text-main);
    line-height: 1.35;
}

.hint-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.hint-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.hint-btn-yes {
    background: #e60000;
    color: #ffffff;
}

.hint-btn-yes:hover {
    background: #c00000;
    transform: translateY(-1px);
}

.hint-btn-no {
    background: var(--ar-card);
    color: var(--ar-text-muted);
    border: 1px solid rgba(255,255,255,0.15);
}

.hint-btn-no:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.25);
}

.hint-btn:hover {
    filter: brightness(1.05);
}

/* === Stage Winners Leaderboard – refreshed look === */

.leaderboard-section {
  background: #ffffff;
  border-radius: 24px;
  padding: 22px 26px 26px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Header row (trophy + title) */
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.leaderboard-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1d1d1f;
}

.leaderboard-title .emoji {
  font-size: 1.25rem;
}

.leaderboard-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Winners grid */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 16px;
  margin-top: 16px;
}

/* Winner card */
.leaderboard-card {
  background: rgba(248, 250, 252, 0.98);
  border-radius: 18px;
  padding: 12px 14px 11px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}

.leaderboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  border-color: rgba(15, 23, 42, 0.12);
}

/* Winner name pill */
.leaderboard-winner-name {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.12);
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Stage row */
.leaderboard-stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #111827;
}

.leaderboard-stage-check {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 0.8rem;
}

/* Reward pill */
.leaderboard-reward {
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.09);
  color: #047857;
  font-size: 0.75rem;
  font-weight: 600;
}

.leaderboard-reward span + span {
  margin-left: 4px;
  padding-left: 4px;
  border-left: 1px solid rgba(4, 120, 87, 0.28);
}

/* Little confetti emoji if you're using it */
.leaderboard-celebrate {
  margin-left: 4px;
  font-size: 0.8rem;
}

/* ===== Premium Section Header ===== */
/* Base section header styling - compact centered vertical stack */
.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto 22px;
  width: 100%;
  max-width: 500px;
  text-align: center;
  position: relative;
  padding-bottom: 10px;
}

/* Subtle divider line under header - close to text, shortened */
.section-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 45%;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 30%,
    rgba(255, 255, 255, 0.1) 70%,
    transparent 100%
  );
}

/* Icon container - prominent circular badge */
.section-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 183, 77, 0.2) 0%, rgba(230, 126, 34, 0.15) 100%);
  box-shadow: 0 0 16px rgba(255, 183, 77, 0.18);
  font-size: 24px;
  flex-shrink: 0;
  margin-bottom: 12px;
  margin-left: auto;
  margin-right: auto;
}

/* Text content container - fully centered with constraints */
.section-header-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  width: 100%;
  max-width: 480px;
  align-items: center;
  margin: 0 auto;
}

/* Title styling - prominent and perfectly centered */
.section-header-text h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  margin: 0 auto;
  line-height: 1.3;
  text-align: center;
  width: 100%;
}

/* Subtitle styling - perfectly centered */
.section-header-text p {
  font-size: 0.9rem;
  color: var(--ar-text-muted, rgba(255, 255, 255, 0.65));
  margin: 0 auto;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-align: center;
  width: 100%;
}

/* Leaderboard-specific adjustments - perfect centering */
.section-header-leaderboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 0;
  margin-bottom: 22px;
  margin-left: auto;
  margin-right: auto;
}

/* Force center the leaderboard title */
#leaderboard-title {
  text-align: center !important;
  display: block !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Ensure parent container centers content */
#leaderboard-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Legacy support - hide old h3 if it exists */
#leaderboard-section h3:not(#leaderboard-title) {
  display: none;
}

/* ===== Shared Final Stage Card Styling ===== */
/* Shared class for both Journey and Leaderboard Stage 16 cards */
/* Keyframes for subtle gold shimmer */
@keyframes arGoldSheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.final-stage-card {
  /* Dimensions and spacing */
  width: 100%;
  margin: 24px 0 32px;
  padding: 32px 28px;
  border-radius: 22px;
  min-height: 280px;

  /* Gold gradient background with shimmer */
  background: radial-gradient(circle at top,
    #fff7e3 0%,
    #ffe3b0 40%,
    #f7b351 100%) !important;
  background-size: 200% 200%;
  animation: arGoldSheen 14s linear infinite;

  /* Border and shadow */
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(255, 207, 120, 0.65) !important;

  /* Layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;

  /* Smooth hover transitions */
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}

/* ===== Journey Stage 16 Text Styling ===== */
/* Text color overrides for Journey Stage 16 card (gold background) */
.journey-card--master .stage16-title,
.journey-card--master .stage16-icon,
.journey-card--master .stage16-prize,
.journey-card--master .stage16-status {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Keep status text readable on gold background */
.journey-card--master .stage16-status {
  color: #5b3900;
  opacity: 0.8;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Make the prize pill pop */
.journey-card--master .stage16-prize {
  background: #16a34a;
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
  letter-spacing: 0.02em;
}

/* Stage 16 icon and title styling on gold */
.journey-card--master .stage16-icon {
  font-size: 2.5rem;
  margin-bottom: 6px;
  width: auto;
  height: auto;
  background: none;
}

.journey-card--master .stage16-title {
  color: #5b3900;
  font-weight: 800;
  font-size: 1.35rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* ===== Final Stage 16 Leaderboard Card ===== */
/* Leaderboard Stage 16 card - visual styling in .final-stage-card */
.lb-card--final {
  /* Grid positioning specific to leaderboard */
  grid-column: 1 / -1;
}

/* Keep Stage 16 gold even when it's "locked" */
.final-stage-card.locked {
  filter: none !important;
  opacity: 1 !important;
}

/* Winner name at top (if present) */
.lb-card--final .lb-final-winner {
  font-weight: 600;
  font-size: 0.85rem;
  color: #8b4513;
  margin-bottom: 4px;
}

/* Stage 16 title */
.lb-card--final .lb-final-title {
  font-weight: 700;
  font-size: 1.0rem;
  letter-spacing: 0.03em;
  color: #2a2220;
}

/* 100K Miles pill */
.lb-card--final .lb-final-prize {
  margin-top: 4px;
  display: inline-block;
  padding: 7px 20px;
  border-radius: 999px;
  background: #00954d;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
}

/* "Prize Still Available" text */
.lb-card--final .lb-final-caption {
  font-size: 0.8rem;
  opacity: 0.9;
  color: #3a2a1f;
}

/* ===== Stage 16 Grand Prize Winner Card ===== */
/* Special leaderboard card for Stage 16 that matches journey card styling */
.stage-16-winner-card {
  /* Uses shared width from .stage-16-gold-card-base */
  margin-top: 32px;
  margin-bottom: 0;
  padding: 32px 28px;
  border-radius: 20px;
  min-height: 280px;
  
  /* Gold gradient background - matches journey card */
  background: radial-gradient(circle at top,
    #fff7e3 0%,
    #ffe3b0 40%,
    #f7b351 100%);
  
  /* Border and shadow */
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(255, 207, 120, 0.65);
  
  /* Flexbox layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
}

/* Stage 16 winner card icon */
.stage-16-winner-card .stage16-icon {
  font-size: 2.5rem;
  margin-bottom: 6px;
  width: auto;
  height: auto;
  background: none;
}

/* Stage 16 winner card title */
.stage-16-winner-card .stage16-title {
  color: #5b3900;
  font-weight: 800;
  font-size: 1.35rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* Stage 16 winner card prize pill */
.stage-16-winner-card .stage16-prize {
  background: #16a34a;
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
  letter-spacing: 0.02em;
}

/* Winner name display */
.stage-16-winner-card .winner-name {
  color: #5b3900;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

/* Winner caption lines */
.stage-16-winner-card .winner-caption {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
  color: #5b3900;
  margin: 2px auto;
  max-width: 480px;
}

/* Responsive adjustments for Stage 16 winner card */
@media (max-width: 768px) {
  .stage-16-gold-card-base {
    max-width: 100%;
  }

  .stage-16-winner-card {
    padding: 28px 24px;
    margin-top: 24px;
  }

  .stage-16-winner-card .stage16-icon {
    font-size: 2rem;
  }

  .stage-16-winner-card .stage16-title {
    font-size: 1.15rem;
  }

  .stage-16-winner-card .stage16-prize {
    font-size: 0.8rem;
    padding: 6px 16px;
  }

  .stage-16-winner-card .winner-name {
    font-size: 0.95rem;
  }

  .stage-16-winner-card .winner-caption {
    font-size: 0.875rem;
    max-width: 100%;
  }
}

/* ===== MY PROFILE MODAL ===== */
.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.profile-modal-backdrop.hidden { 
  display: none; 
}

.profile-modal {
  background: #252633;
  border-radius: 18px;
  padding: 22px 24px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  color: #f9fafb;
  max-height: 90vh;
  overflow-y: auto;
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.profile-modal-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.profile-modal-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.profile-modal-close:hover {
  color: #f9fafb;
}

.profile-modal-body {
  display: flex;
  flex-direction: column;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.profile-field span {
  font-size: 0.85rem;
  color: #e5e7eb;
  font-weight: 500;
}

.profile-field input[type="text"],
.profile-field input[type="file"] {
  background: #111827;
  border-radius: 10px;
  border: 1px solid #374151;
  padding: 10px 12px;
  color: #f9fafb;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.profile-field input[type="text"]:focus,
.profile-field input[type="file"]:focus {
  outline: none;
  border-color: var(--ar-gold);
}

.profile-field input[type="file"] {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.profile-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.profile-avatar-option {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 2px solid transparent;
  overflow: hidden;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.profile-avatar-option:hover {
  transform: translateY(-2px);
  border-color: rgba(234, 179, 8, 0.3);
}

.profile-avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-option.selected {
  border-color: var(--ar-gold);
  box-shadow: 0 0 0 2px rgba(234,179,8,0.45);
  transform: translateY(-1px);
}

.profile-hint {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 2px;
}

.profile-save-btn {
  width: 100%;
  margin-top: 6px;
  padding: 12px 20px;
  background: var(--ar-gold);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-save-btn:hover:not(:disabled) {
  background: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234,179,8,0.4);
}

.profile-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-cancel-btn,
.profile-password-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary.profile-cancel-btn {
  background: #111827;
  border: 1px solid #4b5563;
  color: #e5e7eb;
  font-weight: 500;
}

.btn-secondary.profile-cancel-btn:hover {
  background: #1f2937;
  border-color: #6b7280;
}

.profile-password-btn {
  background: transparent;
  border: none;
  color: var(--ar-gold);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 20px;
}

.profile-password-btn:hover {
  text-decoration: underline;
}

/* Password change section styles */
.profile-link-button {
  border: none;
  background: transparent;
  color: var(--ar-text-muted, #aaa);
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.profile-link-button:hover {
  color: var(--ar-gold, #d4af37);
}

.password-change-section {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.password-change-section .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.password-change-section label {
  font-size: 0.8rem;
  color: var(--ar-text-muted, #aaa);
}

.password-change-section input[type="password"] {
  background: #050509;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.55rem;
  color: #fff;
  font-size: 0.9rem;
}

.password-change-section input[type="password"]:focus {
  outline: none;
  border-color: var(--ar-gold, #d4af37);
}

.password-change-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.password-change-feedback {
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.password-change-error {
  color: #ff6b6b;
}

.password-change-success {
  color: #5ad17a;
}

.password-change-info {
  color: var(--ar-text-muted, #aaa);
}

.profile-helper-text {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--ar-text-muted, #aaa);
}

/* Password change section styles */
.profile-link-button {
  border: none;
  background: transparent;
  color: var(--ar-text-muted, #aaa);
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.profile-link-button:hover {
  color: var(--ar-gold, #d4af37);
}

.password-change-section {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.password-change-section .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.password-change-section label {
  font-size: 0.8rem;
  color: var(--ar-text-muted, #aaa);
}

.password-change-section input[type="password"] {
  background: #050509;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.55rem;
  color: #fff;
  font-size: 0.9rem;
}

.password-change-section input[type="password"]:focus {
  outline: none;
  border-color: var(--ar-gold, #d4af37);
}

.password-change-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.password-change-feedback {
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.password-change-error {
  color: #ff6b6b;
}

.password-change-success {
  color: #5ad17a;
}

.password-change-info {
  color: var(--ar-text-muted, #aaa);
}