  :root {
    --paper: #F5F1E8;
    --paper-deep: #ECE5D3;
    --ink: #1C1A17;
    --ink-soft: #4A4640;
    --ink-muted: #8A847A;
    --rule: #D8D1BD;
    --accent: #7B2D26;
    --accent-deep: #5A1F1A;
    --correct: #4A6B2A;
    --correct-soft: #DDE7C8;
    --wrong: #9B2226;
    --wrong-soft: #F2D7D5;
    --pending: #C9C0A8;
    --gold: #B08D3D;
    --shadow-sm: 0 2px 8px rgba(28, 26, 23, 0.06);
    --shadow-md: 0 8px 24px rgba(28, 26, 23, 0.10);
    --shadow-lg: 0 20px 60px rgba(28, 26, 23, 0.15);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

  html, body {
    font-family: 'Manrope', system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
  }

  body {
    background-image:
      radial-gradient(circle at 20% 10%, rgba(176, 141, 61, 0.04) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(123, 45, 38, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
  }

  /* Header */
  .site-header {
    padding: 24px 24px 0;
    max-width: 720px;
    margin: 0 auto;
  }
  .brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    justify-content: center;
  }
  .brand-mark {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144, "SOFT" 50;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
  }
  .brand-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent);
    font-weight: 700;
    padding: 4px 8px;
    border: 1px solid var(--accent);
    border-radius: 2px;
  }
  .brand-sub {
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-top: 8px;
    font-weight: 500;
  }

  /* Container */
  .container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px 80px;
  }

  /* Views */
  .view { display: none; animation: fadeIn 0.4s ease; }
  .view.active { display: block; }

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

  /* HOME */
  .home-hero {
    text-align: center;
    margin-bottom: 40px;
  }
  .home-hero h1 {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144;
    font-weight: 500;
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 16px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .home-hero h1 em {
    font-style: italic;
    color: var(--accent);
    font-variation-settings: "opsz" 144, "SOFT" 100;
  }
  .home-hero p {
    color: var(--ink-soft);
    font-size: 15px;
    max-width: 440px;
    margin: 0 auto;
  }

  /* Mode toggle */
  .mode-section {
    margin-bottom: 32px;
  }
  .section-label {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
  }
  .mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--paper-deep);
    padding: 6px;
    border-radius: 12px;
    max-width: 380px;
    margin: 0 auto;
  }
  .mode-btn {
    background: transparent;
    border: none;
    padding: 14px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    text-align: center;
  }
  .mode-btn .mode-title {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 2px;
  }
  .mode-btn .mode-desc {
    display: block;
    font-size: 11px;
    color: var(--ink-muted);
  }
  .mode-btn.active {
    background: var(--ink);
    box-shadow: var(--shadow-sm);
  }
  .mode-btn.active .mode-title { color: var(--paper); }
  .mode-btn.active .mode-desc { color: var(--paper-deep); opacity: 0.75; }

  /* Rosco list */
  .rosco-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .rosco-card {
    background: white;
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    font-family: inherit;
    position: relative;
    overflow: hidden;
  }
  .rosco-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(123, 45, 38, 0.03));
    pointer-events: none;
  }
  .rosco-card:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  .rosco-card:active { transform: translateY(0); }
  .rosco-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
  }
  .rosco-card-title {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 24;
    font-weight: 500;
    font-size: 18px;
    color: var(--ink);
    line-height: 1.25;
  }
  .rosco-card-meta {
    font-size: 12px;
    color: var(--ink-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
  }
  .rosco-card-meta .dot { color: var(--rule); }
  .rosco-best {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    white-space: nowrap;
  }
  .difficulty-pip {
    display: inline-flex;
    gap: 2px;
    align-items: center;
  }
  .difficulty-pip span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--rule);
  }
  .difficulty-pip span.on { background: var(--accent); }
  .status-badge {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 3px;
  }
  .status-validated {
    background: var(--correct-soft);
    color: var(--correct);
  }
  .status-review {
    background: var(--paper-deep);
    color: var(--ink-soft);
  }

  /* GAME VIEW */
  .game-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
  }
  .back-btn {
    background: transparent;
    border: none;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
  }
  .back-btn:hover { color: var(--ink); }
  .timer {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 24;
    font-weight: 700;
    font-size: 22px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    padding: 4px 12px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: white;
    min-width: 72px;
    text-align: center;
  }
  .timer.warning { color: var(--accent); border-color: var(--accent); }
  .timer.critical {
    color: var(--wrong);
    border-color: var(--wrong);
    animation: pulse 0.6s infinite;
  }
  @keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
  }

  .score-mini {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }
  .score-mini .correct-count { color: var(--correct); }
  .score-mini .wrong-count { color: var(--wrong); }

  .rosco-title {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 24;
    font-weight: 500;
    font-size: 18px;
    color: var(--ink);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.3;
  }

  /* Rosco ring */
  .rosco-ring-container {
    position: relative;
    width: min(340px, calc(100vw - 48px));
    aspect-ratio: 1;
    margin: 0 auto 24px;
  }
  .rosco-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 5;
    padding: 8px;
  }
  .rosco-center-letter {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144;
    font-weight: 700;
    font-size: clamp(40px, 11vw, 56px);
    color: var(--accent);
    line-height: 1;
    margin-bottom: 4px;
  }
  .rosco-center-mode {
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
    font-weight: 700;
  }
  .letter-node {
    position: absolute;
    width: 11.5%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: white;
    border: 1.5px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 24;
    font-weight: 700;
    font-size: clamp(13px, 3vw, 16px);
    color: var(--ink-soft);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
  }
  .letter-node.pending { background: white; }
  .letter-node.active {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
    transform: scale(1.25);
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(28, 26, 23, 0.08), var(--shadow-md);
  }
  .letter-node.correct {
    background: var(--correct);
    color: white;
    border-color: var(--correct);
  }
  .letter-node.incorrect {
    background: var(--wrong);
    color: white;
    border-color: var(--wrong);
  }
  .letter-node.skipped {
    background: var(--paper-deep);
    color: var(--ink-soft);
    border-color: var(--pending);
    border-style: dashed;
  }

  /* Pista panel */
  .pista-panel {
    background: white;
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 22px 22px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
  }
  .pista-prefix {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .pista-prefix::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--accent);
  }
  .pista-text {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 24;
    font-weight: 400;
    font-size: clamp(16px, 4vw, 18px);
    line-height: 1.45;
    color: var(--ink);
    min-height: 80px;
  }
  .pista-revealed {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--rule);
    display: none;
  }
  .pista-revealed.show { display: block; animation: fadeIn 0.4s ease; }
  .pista-answer-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
    font-weight: 700;
    margin-bottom: 4px;
  }
  .pista-answer {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 24;
    font-weight: 700;
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
  }
  .pista-tip {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft);
    font-style: italic;
    padding: 10px 14px;
    background: var(--paper);
    border-left: 2px solid var(--gold);
    border-radius: 2px;
  }

  /* Input + controls */
  .input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
  }
  .answer-input {
    flex: 1;
    padding: 14px 16px;
    border: 1.5px solid var(--rule);
    background: white;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
  }
  .answer-input:focus { border-color: var(--ink); }
  .answer-input::placeholder { color: var(--ink-muted); }

  .btn-submit {
    background: var(--ink);
    color: var(--paper);
    border: none;
    padding: 14px 22px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
  }
  .btn-submit:hover { background: var(--accent); }
  .btn-submit:active { transform: scale(0.97); }

  .secondary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .btn-secondary {
    background: white;
    color: var(--ink-soft);
    border: 1.5px solid var(--rule);
    padding: 12px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .btn-secondary:hover {
    border-color: var(--ink);
    color: var(--ink);
  }
  .btn-secondary:active { transform: scale(0.97); }

  /* Continue button when answer revealed */
  .btn-continue {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all 0.2s;
  }
  .btn-continue:hover { background: var(--accent-deep); }

  /* RESULTS */
  .results-hero {
    text-align: center;
    margin-bottom: 32px;
  }
  .results-hero h2 {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144;
    font-weight: 500;
    font-size: 32px;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
  }
  .results-hero h2 em {
    font-style: italic;
    color: var(--accent);
  }
  .results-subtitle {
    color: var(--ink-soft);
    font-size: 14px;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 28px;
  }
  .stat-box {
    background: white;
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
  }
  .stat-value {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 144;
    font-weight: 700;
    font-size: 32px;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
  }
  .stat-value.correct { color: var(--correct); }
  .stat-value.wrong { color: var(--wrong); }
  .stat-value.skipped { color: var(--gold); }
  .stat-label {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
    font-weight: 700;
  }

  .review-section {
    margin-bottom: 32px;
  }
  .review-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
  }
  .review-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--rule);
    border-radius: 8px;
    align-items: center;
  }
  .review-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 14px;
    color: white;
  }
  .review-letter.correct { background: var(--correct); }
  .review-letter.incorrect { background: var(--wrong); }
  .review-letter.skipped { background: var(--gold); }
  .review-content { font-size: 13px; line-height: 1.4; }
  .review-answer {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    color: var(--ink);
  }
  .review-pista {
    color: var(--ink-soft);
    font-size: 12px;
  }

  .results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 28px;
  }

  /* Feedback */
  .feedback-card {
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 22px 22px 20px;
    margin-top: 12px;
  }
  .feedback-card h3 {
    font-family: 'Fraunces', serif;
    font-variation-settings: "opsz" 24;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 4px;
    color: var(--ink);
  }
  .feedback-card p {
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 16px;
  }
  .rating-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
  }
  .rating-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--rule);
    background: white;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.2s;
  }
  .rating-btn:hover { border-color: var(--ink); }
  .rating-btn.selected {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }

  textarea.feedback-input {
    width: 100%;
    background: white;
    border: 1.5px solid var(--rule);
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    resize: vertical;
    min-height: 70px;
    outline: none;
    margin-bottom: 12px;
  }
  textarea.feedback-input:focus { border-color: var(--ink); }

  .feedback-submit {
    width: 100%;
    background: var(--ink);
    color: var(--paper);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 0.02em;
  }
  .feedback-submit:hover { background: var(--accent); }
  .feedback-thanks {
    text-align: center;
    padding: 20px;
    color: var(--correct);
    font-weight: 600;
    display: none;
  }
  .feedback-thanks.show { display: block; }

  /* Beta notice */
  .beta-notice {
    background: var(--paper-deep);
    border-left: 3px solid var(--gold);
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 24px;
    line-height: 1.45;
  }
  .beta-notice strong { color: var(--ink); }

  /* Footer */
  .footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--ink-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  .footer-rule {
    width: 40px;
    height: 1px;
    background: var(--rule);
    margin: 0 auto 16px;
  }

  /* Utilities */
  .hidden { display: none !important; }

  /* Flash animations for input */
  .answer-input.shake { animation: shake 0.4s; }
  @keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
  }

  @media (max-width: 380px) {
    .container { padding: 20px 16px 60px; }
    .site-header { padding: 20px 16px 0; }
    .secondary-row { grid-template-columns: 1fr 1fr; }
    .pista-panel { padding: 18px 18px 16px; }
  }
