/* ======================
   FONT SETUP
====================== */

@font-face {
    font-family: 'Hanson';
    src: url('fonts/Hanson-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
  }
  
  /* ======================
     ROOT BRAND VARIABLES
  ====================== */
  
  :root {
    --black: #000000;
    --white: #FFFFFF;
    --accent: #D72C83;
  }
  
  /* ======================
     GLOBAL STYLES
  ====================== */
  
  body {
    margin: 0;
    background: var(--black);
    color: var(--white);
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px 0;
    box-sizing: border-box;
  }
  
  .container {
    text-align: center;
    width: 90%;
    max-width: 500px;
    background: #111;
    padding: 40px 30px;
    border-radius: 14px;
    border: 1px solid #222;
    position: relative;
    overflow: hidden;
  }
  
  /* ======================
     TYPOGRAPHY
  ====================== */
  
  h1 {
    font-family: 'Hanson', sans-serif;
    font-size: 3rem;
    letter-spacing: 1px;
    margin-bottom: 0.25em;
  }
  
  .subtitle {
    opacity: 0.7;
    margin-bottom: 2em;
  }
  
  .question {
    font-size: 1.5rem;
    margin-bottom: 1.5em;
    min-height: 60px;
    font-weight: 500;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  /* Question fade animation */
  .fade-out {
    opacity: 0;
    transform: translateY(-10px);
  }
  
  .fade-in {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* ======================
     BUTTONS
  ====================== */
  
  .buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 1.5em;
  }
  
  .btn {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    transition: 0.2s ease;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--white);
  }
  
  .btn:hover {
    background: var(--accent);
    color: var(--white);
  }
  
  /* ======================
     FEEDBACK
  ====================== */
  
  .feedback {
    margin: 1em 0;
    font-weight: 700;
    min-height: 24px;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .feedback.show {
    opacity: 1;
  }
  
  /* ======================
     PROGRESS
  ====================== */
  
  .progress {
    opacity: 0.5;
    font-size: 0.9rem;
  }
  
  .hidden {
    display: none;
  }
  
  /* ======================
     RESULTS ANIMATION
  ====================== */
  
  #results {
    animation: fadeResults 0.4s ease forwards;
  }
  
  @keyframes fadeResults {
    from {
      opacity: 0;
      transform: translateY(15px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .media {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 1em;
  }

  .explanation {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5em;
    min-height: 40px;
  }

  .reveal-caption {
    font-size: 0.75rem;
    opacity: 0.45;
    font-style: italic;
    margin-top: 0.4em;
    text-align: center;
  }

  .btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .your-answer-label {
    font-size: 0.65rem;
    opacity: 0;
    font-style: italic;
    letter-spacing: 0.05em;
    transition: opacity 0.2s ease;
  }

  .your-answer-label.shown {
    opacity: 0.45;
  }

  /* ======================
     ANSWER BUTTON STATES
  ====================== */

  .btn.correct {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
  }

  .btn.wrong {
    opacity: 0.25;
    pointer-events: none;
  }

  /* ======================
     NEXT BUTTON
  ====================== */

  .btn.next {
    margin-top: 1em;
  }

  .btn.next::after {
    content: 'Keep Going';
  }

  .btn.next:hover::after {
    content: 'Keep Crowing';
  }

  /* ======================
     RESULTS CTA
  ====================== */

  .reveal-cta {
    font-size: 0.85rem;
    opacity: 0;
    margin: 0.75em 0 1.25em;
    line-height: 1.5;
    transition: opacity 0.6s ease;
  }

  .reveal-cta.show {
    opacity: 0.75;
  }

  .reveal-cta a {
    color: var(--accent);
    text-decoration: none;
  }

  .reveal-cta a:hover {
    text-decoration: underline;
  }

  /* ======================
     TIME DISPLAY
  ====================== */

  .time-display {
    font-size: 0.85rem;
    opacity: 0.5;
    margin: 0.25em 0 0.5em;
    letter-spacing: 0.5px;
  }

  /* ======================
     ASS ENTRY
  ====================== */

  .save-trigger {
    background: none;
    border: none;
    color: #555;
    font-family: 'Roboto', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 4px 0;
    margin: 0.75em 0 0;
    display: block;
    width: 100%;
    text-align: center;
    transition: color 0.2s ease;
  }

  .save-trigger:hover {
    color: #888;
  }

  .ass-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0.75em 0 0.25em;
  }

  .ass-input {
    width: 64px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 6px;
    color: var(--white);
    padding: 8px 4px;
    outline: none;
    transition: border-color 0.2s ease;
  }

  .ass-input:focus {
    border-color: var(--accent);
  }

  .ass-input.saved {
    border-color: var(--accent);
    opacity: 0.5;
  }

  .btn.ass-save {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .score-saved-msg {
    font-size: 0.8rem;
    color: var(--accent);
    min-height: 18px;
    margin: 0 0 0.5em;
  }

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

  .btn.lb-toggle {
    margin-top: 0.5em;
    padding: 10px 18px;
    font-size: 0.85rem;
    border-color: #444;
    color: #aaa;
  }

  .btn.lb-toggle:hover {
    border-color: var(--accent);
    background: transparent;
    color: var(--white);
  }

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

  .leaderboard-panel {
    margin: 0.75em 0 0.5em;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
  }

  .leaderboard-list {
    padding: 6px 0;
  }

  .lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid #1a1a1a;
  }

  .lb-row:last-child {
    border-bottom: none;
  }

  .lb-row.lb-top {
    background: #150a0d;
  }

  .lb-rank {
    width: 18px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.4;
    flex-shrink: 0;
  }

  .lb-top .lb-rank {
    color: var(--accent);
    opacity: 1;
  }

  .lb-name {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent);
    flex-shrink: 0;
    min-width: 40px;
  }

  .lb-score {
    flex: 1;
    text-align: center;
    font-weight: 700;
  }

  .lb-time {
    font-size: 0.8rem;
    opacity: 0.5;
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
  }

  .lb-empty {
    font-size: 0.85rem;
    opacity: 0.4;
    text-align: center;
    padding: 16px 0;
    margin: 0;
  }

  .lb-you {
    font-size: 0.68rem;
    font-weight: 400;
    font-family: 'Roboto', sans-serif;
    color: var(--white);
    opacity: 0.5;
    letter-spacing: 0;
    margin-left: 4px;
  }

  .lb-row.lb-own {
    background: #0e1a0e;
  }

  .lb-row.lb-own .lb-rank {
    color: #6fcf6f;
    opacity: 1;
  }

  .lb-separator {
    height: 1px;
    background: #333;
    margin: 4px 14px;
    position: relative;
  }

  .lb-separator::before {
    content: "· · ·";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #0a0a0a;
    padding: 0 8px;
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 3px;
  }

  /* ======================
     CELEBRATION MODAL
  ====================== */

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    box-sizing: border-box;
  }

  .modal-overlay.hidden {
    display: none;
  }

  /* ======================
     ZOOM IMAGE
  ====================== */

  .zoom-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 1em;
    background: #000;
    position: relative;
  }

  .zoom-wrap {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transition: transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .zoom-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transform-origin: 50% 50%;
    transform: scale(var(--zoom-level, 12));
    transition: transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .zoom-image.revealed {
    transform: scale(1);
  }

  /* ======================
     YOUTUBE PLAYER
  ====================== */

  .yt-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1em;
  }

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

  .yt-cover {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: opacity 0.5s ease;
  }

  .yt-cover.revealed {
    opacity: 0;
    pointer-events: none;
  }

  .yt-cover-label {
    opacity: 0.55;
    font-size: 0.9rem;
    margin: 0 0 1em;
  }

  .yt-play-btn {
    padding: 10px 24px;
  }

  .modal-box {
    background: #111;
    border: 1px solid #333;
    border-radius: 14px;
    padding: 36px 30px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: fadeResults 0.3s ease forwards;
  }

  .modal-message {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0 0 1.25em;
  }

  .modal-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 1.5em;
    font-size: 0.9rem;
    opacity: 0.6;
    font-family: 'Courier New', monospace;
  }

  .modal-initials-row {
    margin-bottom: 1.5em;
  }

  .modal-initials-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.5;
    margin-bottom: 8px;
  }

  .modal-initials-input {
    width: 80px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 6px;
    color: var(--white);
    padding: 8px 4px;
    outline: none;
    transition: border-color 0.2s ease;
  }

  .modal-initials-input:focus {
    border-color: var(--accent);
  }
