:root {
    --bg: #0a0a0f;
    --card-bg: #111114;
    --border: #1e1e24;
    --accent: #00d47e;
    --accent-hover: #00b368;
    --muted: #9a9ab0;
    --heading: #f5f5f7;
    --text: #e0e0e0;
    --success-bg: #0d2818;
    --success-border: #00d47e;
    --error-bg: #2a0f0f;
    --error-border: #e94560;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(ellipse 70% 40% at 50% 0%, rgba(0, 212, 126, 0.06) 0%, transparent 100%),
        radial-gradient(ellipse 50% 30% at 85% 90%, rgba(0, 100, 60, 0.05) 0%, transparent 100%),
        #0a0a0f;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-username {
    color: var(--accent);
    font-weight: 600;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border);
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover { color: #fff; }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

h1, h2, h3 { color: var(--heading); margin-bottom: 1rem; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

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

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover { background: #2a2a32; }

.btn-success {
    background: #2ecc71;
    color: #fff;
}

.btn-success:hover { background: #27ae60; }

.btn-cancelled {
    background: rgba(233, 69, 96, 0.08);
    color: #e94560;
    border: 1px solid rgba(233, 69, 96, 0.25);
    cursor: default;
}

.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: left;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--heading);
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.stat-cap-info {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: default;
    color: #5dade2;
    opacity: 0.9;
    position: relative;
}
.stat-cap-info:hover,
.stat-cap-info:focus-within,
.stat-cap-info.active {
    opacity: 1;
    outline: none;
}
.stat-cap-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    z-index: 10;
    white-space: normal;
    pointer-events: auto;
}
.stat-cap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
}
.stat-cap-tooltip a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-top: 0.25rem;
}
.stat-cap-info:hover .stat-cap-tooltip,
.stat-cap-info:focus-within .stat-cap-tooltip,
.stat-cap-info.active .stat-cap-tooltip {
    display: block;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-success { background: rgba(0, 212, 126, 0.06); border: 1px solid rgba(0, 212, 126, 0.3); }
.alert-error { background: rgba(233, 69, 96, 0.06); border: 1px solid rgba(233, 69, 96, 0.3); }
.alert-info { background: rgba(52, 152, 219, 0.06); border: 1px solid rgba(52, 152, 219, 0.3); }
.alert-warning { background: rgba(243, 156, 18, 0.06); border: 1px solid rgba(243, 156, 18, 0.3); }

body.no-gradient {
    background: var(--bg);
    background-attachment: unset;
}

#board,
#preview-board {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.board-container {
    max-width: 500px;
    width: 90vw;
    margin: 0 auto 1.5rem;
}

.feedback {
    text-align: center;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.5;
    backdrop-filter: blur(4px);
}

.feedback small {
    font-weight: 400;
    opacity: 0.8;
    font-size: 0.85rem;
}

.feedback-correct {
    background: rgba(0, 212, 126, 0.08);
    border: 1px solid rgba(0, 212, 126, 0.35);
    color: var(--accent);
}

.feedback-incorrect {
    background: rgba(233, 69, 96, 0.08);
    border: 1px solid rgba(233, 69, 96, 0.35);
    color: #e94560;
}

.feedback-move-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    cursor: pointer;
}

.feedback-move-link:hover {
    text-decoration-style: solid;
    opacity: 0.85;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Landing page */
.landing-hero {
    text-align: center;
    padding: 4.5rem 0 3rem;
}

.landing-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(0, 212, 126, 0.08);
    border: 1px solid rgba(0, 212, 126, 0.2);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

.landing-headline {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.landing-headline em {
    font-style: normal;
    color: var(--accent);
}

.landing-sub {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 580px;
    margin: 0 auto 2rem;
    line-height: 1.65;
}

.landing-cta {
    font-size: 1.1rem;
    padding: 0.9rem 2.25rem;
}

.landing-note {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 1rem;
}

.landing-section-label {
    font-size: 1.35rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--heading);
    text-align: center;
    margin-bottom: 2rem;
}

.landing-value {
    padding: 3.5rem 0;
    border-top: 1px solid var(--border);
}

.landing-value-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.landing-value-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.75rem 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}

.landing-value-card:hover {
    border-color: rgba(0, 212, 126, 0.3);
    transform: translateY(-2px);
}

.landing-value-icon {
    color: var(--accent);
    margin-bottom: 1rem;
}

.landing-value-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.landing-value-card p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}

.landing-how {
    padding: 3.5rem 0;
    border-top: 1px solid var(--border);
}

.landing-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 560px;
    margin: 0 auto;
}

.landing-step {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}

.landing-step:hover {
    border-color: rgba(0, 212, 126, 0.3);
    transform: translateY(-2px);
}

.landing-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.landing-step-content h3 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.landing-step-content p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.landing-bottom-cta {
    text-align: center;
    padding: 5rem 0 4rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.landing-bottom-cta h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.landing-bottom-cta p {
    color: var(--muted);
    margin-bottom: 1.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ================================================
   MOCKUP WINDOW COMPONENT
   ================================================ */

.mockup-window {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.mockup-window-bar {
    height: 32px;
    background: #0d0d12;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
    border-bottom: 1px solid var(--border);
}

.mockup-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #444;
}

.mockup-window-title {
    font-size: 0.65rem;
    color: var(--muted);
    margin-left: 6px;
}

.mockup-window--lg {
    max-width: 860px;
    margin: 0 auto;
}

/* ================================================
   HERO GRID (two-column with board)
   ================================================ */

.landing-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
}

.landing-hero-text {
    text-align: left;
}

.landing-hero-text .landing-sub {
    margin-left: 0;
    margin-right: 0;
}

.landing-hero-visual {
    display: flex;
    justify-content: center;
}

.landing-hero-visual .mockup-window {
    width: 100%;
    max-width: 320px;
}

.landing-hero-visual #hero-board {
    width: 100%;
    aspect-ratio: 1;
}

.mockup-board-controls {
    padding: 0.5rem 0.6rem;
    border-top: 1px solid var(--border);
}

.mockup-board-controls .mockup-sidebar-buttons {
    margin-bottom: 0;
}

.mockup-board-controls .mockup-sidebar-feedback {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.mockup-board-feedback-slot {
    height: 2.4rem;
    position: relative;
    margin-top: 0.45rem;
}

.mockup-board-feedback-slot .mockup-sidebar-feedback {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    margin: 0;
}

.mockup-sidebar-feedback-slot {
    min-height: 2.4rem;
    position: relative;
}

.mockup-sidebar-feedback-slot .mockup-sidebar-feedback {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    margin: 0;
}

/* ================================================
   TRAINING SCREEN PREVIEW
   ================================================ */

.landing-preview {
    padding: 3.5rem 0;
    border-top: 1px solid var(--border);
}

.landing-preview .landing-section-label {
    margin-bottom: 0.35rem;
}

.landing-preview-sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.mockup-quiz-layout {
    display: flex;
    gap: 0;
}

.mockup-quiz-board {
    flex: 1;
    min-width: 0;
    aspect-ratio: 1;
}

.mockup-quiz-board #preview-board {
    width: 100%;
    aspect-ratio: 1;
}

.mockup-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    border-top: 2px solid rgba(0, 212, 126, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.25rem 1.5rem;
}

.mockup-sidebar-prompt {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
    text-align: left;
    margin-bottom: 0.75rem;
}

.mockup-sidebar-step {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.75rem;
}

.mockup-sidebar-buttons {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.mockup-sidebar-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    text-align: center;
    white-space: nowrap;
}

.mockup-sidebar-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.mockup-sidebar-btn:active {
    background: rgba(255, 255, 255, 0.07);
}

.mockup-sidebar-btn + .mockup-sidebar-btn {
    border-left: 1px solid var(--border);
}

.mockup-sidebar-feedback {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.mockup-sidebar-feedback--mistake {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-border);
}

.mockup-sidebar-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--muted);
}

.highlight-hint {
    box-shadow: inset 0 0 0 3px rgba(0, 212, 126, 0.6) !important;
}

/* ================================================
   DASHBOARD INSIGHTS PREVIEW
   ================================================ */

.landing-insights-preview {
    padding: 3.5rem 0;
    border-top: 1px solid var(--border);
}

.landing-insights-preview .landing-section-label {
    margin-bottom: 0.35rem;
}

.landing-insights-sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.mockup-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.mockup-stat {
    background: var(--card-bg);
    padding: 1rem;
    text-align: center;
}

.mockup-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--heading);
}

.mockup-stat-label {
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

.mockup-insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
}

.mockup-insight-card {
    background: var(--card-bg);
    padding: 1.25rem;
}

.mockup-insight-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.mockup-theme-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.mockup-theme-name {
    font-size: 0.85rem;
    color: var(--text);
}

.mockup-theme-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.mockup-insight-subtitle {
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.7;
    margin-bottom: 0.75rem;
}

.mockup-chart {
    display: flex;
    align-items: stretch;
    gap: 6px;
    height: 100px;
    padding-top: 0.5rem;
}

.mockup-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.mockup-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    background: rgba(0, 212, 126, 0.25);
    transition: background 0.2s;
}

.mockup-bar--danger {
    background: rgba(233, 69, 96, 0.6);
}

.mockup-bar-label {
    font-size: 0.55rem;
    color: var(--muted);
}

/* Openings grid — below the two-column insights */
.mockup-openings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
}

.mockup-insight-title--danger {
    color: var(--error-border);
}

.mockup-insight-title--safe {
    color: var(--accent);
}

.mockup-theme-count--danger {
    color: var(--error-border);
}

.mockup-theme-count--safe {
    color: var(--accent);
}

.mockup-pawn {
    font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
    font-size: 0.85em;
    vertical-align: baseline;
}

.mockup-pawn--white { color: #e0e0e0; }
.mockup-pawn--black { color: #888; }

.pricing-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 2px solid var(--border);
    max-width: 400px;
    margin: 0 auto;
}

.pricing-card.featured { border-color: var(--accent); }

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.price span {
    font-size: 1rem;
    color: var(--muted);
}

.pricing-features {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.pricing-features li::before {
    content: "\2713  ";
    color: var(--accent);
    font-weight: 700;
}

/* New pricing page */
.pricing-header {
    text-align: center;
    padding: 2rem 0 2.5rem;
}

.pricing-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pricing-header p {
    color: var(--muted);
    font-size: 1.05rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    max-width: 1050px;
    margin: 0 auto 3rem;
}

.pricing-tier {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pricing-tier-featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 212, 126, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pricing-tier-popular {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
}

.pricing-tier-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.pricing-tier-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--heading);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.pricing-tier-featured .pricing-tier-price {
    color: var(--accent);
}

.pricing-tier-period {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.pricing-tier-features {
    list-style: none;
    margin: 0 0 1.5rem;
    flex: 1;
}

.pricing-tier-features li {
    padding: 0.45rem 0;
    font-size: 0.88rem;
    color: var(--text);
    position: relative;
    padding-left: 1.4rem;
}

.pricing-tier-features li::before {
    content: "\2713";
    color: var(--accent);
    font-weight: 700;
    position: absolute;
    left: 0;
}

.pricing-tier-features li + li {
    border-top: 1px solid var(--border);
}

.pricing-tier-cta {
    margin-top: auto;
}

.pricing-current {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.pricing-page .container {
    max-width: 1100px;
}

.pricing-faq {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.pricing-reasons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.pricing-reason {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem 1.25rem;
}

.pricing-reason h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.pricing-reason p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.6;
}

.pricing-refund-note {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.pricing-guarantee {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.tier-banner {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tier-free {
    background: #0f1a2e;
    border: 1px solid #3498db;
}

.tier-pro {
    background: var(--success-bg);
    border: 1px solid var(--accent);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

.quiz-info {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--muted);
    position: relative;
}

.info-tooltip {
    display: inline-flex;
    align-items: center;
    cursor: default;
    color: var(--muted);
    opacity: 0.7;
}

.info-tooltip:hover {
    opacity: 1;
}

.info-tooltip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: min(280px, calc(100% - 2rem));
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    text-align: left;
    z-index: 10;
    pointer-events: none;
}

.info-tooltip:hover .info-tooltip-text,
.info-tooltip:focus-within .info-tooltip-text {
    display: block;
}

.info-tooltip:focus {
    outline: none;
}

.quiz-controls {
    text-align: center;
    margin-top: 1rem;
}

.step-counter {
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 1.2em;
}

.puzzle-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.wrong-feedback {
    text-align: center;
    color: #e94560;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0.5rem auto;
    padding: 0.5rem 1rem;
    max-width: 280px;
    border-radius: 8px;
    background: rgba(233, 69, 96, 0.08);
    border: 1px solid rgba(233, 69, 96, 0.25);
}

.wrong-feedback-animate {
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.game-meta {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.game-meta span + span {
    margin-left: 0.25rem;
}

.hint-highlight {
    box-shadow: inset 0 0 0 4px var(--accent) !important;
    border-radius: 2px;
    transition: box-shadow 0.2s;
}

/* Landing page steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.step-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-size: 1.25rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}


/* Footer */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

.footer-copy {
    color: var(--muted);
    font-size: 0.8rem;
}

/* Solution feedback (disambiguated from wrong answer) */
.feedback-solution {
    background: rgba(243, 156, 18, 0.06);
    border: 1px solid rgba(243, 156, 18, 0.3);
    color: #f5c542;
}

.feedback-eventually-solved {
    background: rgba(0, 212, 126, 0.06);
    border: 1px solid rgba(0, 212, 126, 0.3);
    color: var(--accent);
}

/* Training mode page */
.training-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.training-header h1 {
    margin-bottom: 0.5rem;
}

.training-header p {
    color: var(--muted);
    font-size: 1rem;
}

.training-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2.25rem;
    border: 1px solid var(--border);
    max-width: 560px;
    margin: 0 auto;
}

.training-options {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.training-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mode-option {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
    /* button reset */
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.mode-option.mode-option-selected {
    border-color: var(--accent);
    background: rgba(0, 212, 126, 0.06);
    box-shadow: 0 0 0 1px rgba(0, 212, 126, 0.15);
}

@media (hover: hover) {
    .mode-option:hover:not(.mode-locked) { border-color: var(--muted); }
}

.mode-locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.mode-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.mode-name {
    font-weight: 600;
    color: var(--heading);
    font-size: 1rem;
}

.mode-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}

.pro-badge {
    display: inline-block;
    background: var(--accent);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    text-decoration: none;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.training-select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8b9e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.training-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 212, 126, 0.15);
}

.training-start {
    text-align: center;
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

/* Dashboard */
.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.dash-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dash-subtitle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.dash-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.plan-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plan-free {
    background: rgba(52, 152, 219, 0.15);
    color: #5dade2;
    border: 1px solid rgba(52, 152, 219, 0.25);
}

.plan-pro {
    background: rgba(0, 212, 126, 0.12);
    color: var(--accent);
    border: 1px solid rgba(0, 212, 126, 0.25);
}

.dash-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dash-section-cta {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
}

.dash-section-cta:hover {
    text-decoration: underline;
}

.dash-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--border);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share:hover {
    color: var(--heading);
    border-color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
}

.btn-share-copied {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(0, 212, 126, 0.08);
}

.stat-unit {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 400;
    margin-left: 0.1rem;
}

.stat-secondary {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.insights-grid {
    grid-template-columns: repeat(2, 1fr);
}

.stat-card--insight {
    display: flex;
    flex-direction: column;
}

.stat-card--locked {
    opacity: 0.7;
}

.insight-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.insight-lock-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.45rem;
    padding: 0.5rem 0;
}

.insight-lock-icon {
    color: var(--muted);
    opacity: 0.4;
}

.insight-lock-sub {
    font-size: 0.7rem;
    color: var(--muted);
    font-style: italic;
}

.insight-lock-preview {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.clock-bars--preview,
.theme-list--preview {
    filter: blur(6px);
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}

.insight-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.stat-value--md {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.btn-insight {
    display: inline-block;
    margin-top: 0.85rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 6px;
    background: var(--accent);
    color: #000;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

.btn-insight:hover {
    opacity: 0.85;
}

.btn-insight--locked {
    background: var(--border);
    color: var(--muted);
}

.btn-insight--locked:hover {
    opacity: 0.75;
}

.theme-breakdown-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.theme-breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.theme-breakdown-name {
    color: var(--text);
}

.theme-breakdown-count {
    color: var(--muted);
    font-weight: 600;
}

a.theme-breakdown-row--link {
    text-decoration: none;
    border-radius: 4px;
    padding: 0.15rem 0.3rem;
    margin: -0.15rem -0.3rem;
    transition: background 0.15s;
    color: var(--accent);
}
a.theme-breakdown-row--link .theme-breakdown-name {
    color: var(--accent);
}
a.theme-breakdown-row--link .theme-breakdown-count {
    color: var(--accent);
    opacity: 0.8;
}
a.theme-breakdown-row--link:hover {
    background: var(--surface-hover, rgba(255,255,255,0.06));
}

.insight-divider {
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    margin: 0.75rem 0;
}

.insights-placeholder {
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dash-grid > *,
.stats-grid > * {
    min-width: 0;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.card-desc {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.import-gate,
.import-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 212, 126, 0.04);
    border: 1px solid rgba(0, 212, 126, 0.15);
    border-radius: 8px;
}

.import-action {
    width: 100%;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    background: rgba(0, 212, 126, 0.1);
    border-color: rgba(0, 212, 126, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 212, 126, 0.08) inset;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.import-action:hover {
    background: rgba(0, 212, 126, 0.16);
    border-color: rgba(0, 212, 126, 0.6);
    box-shadow: 0 0 0 1px rgba(0, 212, 126, 0.12) inset;
}

.import-action:active {
    background: rgba(0, 212, 126, 0.2);
}

.import-action .import-gate-icon {
    color: var(--accent);
    opacity: 1;
}

.import-gate-icon {
    color: var(--muted);
    flex-shrink: 0;
    opacity: 0.7;
}

.import-gate-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.import-gate-msg {
    font-size: 0.8rem;
    color: var(--muted);
    overflow-wrap: break-word;
}

.import-gate-cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

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

.activity-list-wrap {
    position: relative;
}

.activity-list-wrap.has-more::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, var(--card-bg));
    pointer-events: none;
}

.activity-list {
    display: flex;
    flex-direction: column;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:first-child {
    padding-top: 0;
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.activity-correct {
    background: rgba(0, 212, 126, 0.12);
    color: var(--accent);
}

.activity-incorrect {
    background: rgba(233, 69, 96, 0.12);
    color: #e94560;
}

.activity-import {
    background: rgba(139, 139, 158, 0.12);
    color: var(--muted);
}

.activity-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.activity-text {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

/* Training page extras */
.training-empty {
    text-align: center;
    padding: 1.5rem 0;
}

.training-empty svg {
    margin-bottom: 1rem;
}

.training-empty p {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.training-select-locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.training-lock-hint {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.training-lock-hint a {
    color: var(--accent);
    text-decoration: none;
}

.training-lock-hint a:hover {
    text-decoration: underline;
}

.training-count {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

/* Time control selector — individual cards matching mode selector style */
.tc-selector {
    display: flex;
    gap: 0.5rem;
}
.tc-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.7rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.tc-icon { font-size: 1.1rem; line-height: 1; }
.tc-label { font-size: 0.78rem; }
.tc-option.tc-selected {
    border-color: var(--accent);
    background: rgba(0, 212, 126, 0.06);
    box-shadow: 0 0 0 1px rgba(0, 212, 126, 0.15);
    color: var(--accent);
}
@media (hover: hover) {
    .tc-option:hover:not(.tc-selected) { border-color: var(--muted); color: var(--text); }
}
.tc-option:active { background: rgba(0, 212, 126, 0.12); }
.tc-selector-locked {
    opacity: 0.35;
    cursor: not-allowed;
}
.tc-selector-locked .tc-option {
    pointer-events: none;
}

/* Custom date range inputs */
.training-date-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.6rem; }
.training-date-group { display: flex; flex-direction: column; gap: 0.3rem; }
.training-date-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.training-date-input {
    padding: 0.5rem 0.65rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    color-scheme: dark;
}
.training-date-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,212,126,0.15); }
.training-date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7) brightness(1.8);
    cursor: pointer;
    opacity: 0.75;
}

/* Logout page */
.logout-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    max-width: 400px;
    margin: 3rem auto 0;
    text-align: center;
}

.logout-card svg {
    margin-bottom: 1.25rem;
}

.logout-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.logout-text {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.logout-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Engine eval display — base styles overridden by quiz polish section */
.engine-eval {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* Import status partial */
.import-status {
    margin-top: 1rem;
    color: var(--muted);
}

.import-progress-track {
    width: 100%;
    background: var(--border);
    border-radius: 9999px;
    height: 5px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.import-progress-fill {
    background: var(--accent);
    height: 5px;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.import-progress-pulse {
    background: var(--accent);
    height: 5px;
    border-radius: 9999px;
    animation: import-pulse 1.5s ease-in-out infinite;
    opacity: 0.75;
}

@keyframes import-pulse {
    0%   { width: 20%; margin-left: 0; }
    50%  { width: 60%; margin-left: 20%; }
    100% { width: 20%; margin-left: 80%; }
}

/* Import result card */
.import-result-card {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.import-result-title {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.import-result-detail {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
}

.import-trim-notice {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
}

.import-trim-notice a {
    color: var(--accent);
    text-decoration: none;
}

.import-trim-notice a:hover {
    text-decoration: underline;
}

.import-result-cta {
    margin-top: 0.75rem;
}

/* Import card layout */
.card--import,
.card--activity {
    border-top: 2px solid rgba(0, 212, 126, 0.5);
    padding: 1.1rem 1.25rem;
}

.card--import {
    display: flex;
    flex-direction: column;
}

/* Icon inside buttons */
.btn svg {
    vertical-align: -1px;
}

.btn svg:first-child {
    margin-right: 0.35rem;
}

.card--import .import-last {
    margin-top: auto;
    padding-top: 1rem;
}

/* Import criteria hint + last import summary */
.import-hint {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.4rem;
    letter-spacing: 0.01em;
}

.import-last {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.75rem;
    opacity: 0.7;
}

@media (max-width: 900px) {
    .landing-value-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-reasons { grid-template-columns: repeat(2, 1fr); }
    .landing-hero-grid { grid-template-columns: 1fr; text-align: center; }
    .landing-hero-text { text-align: center; }
    .landing-hero-text .landing-sub { margin-left: auto; margin-right: auto; }
    .landing-hero-visual .mockup-window { max-width: 260px; }
    .mockup-sidebar { width: 220px; padding: 1rem 1.15rem; }
}

@media (max-width: 600px) {
    .navbar { padding: 0.75rem 1rem; }
    .nav-links { gap: 1rem; }
    .nav-username { display: none; }
    .hero h1 { font-size: 1.75rem; }
    .container { padding: 1rem 0.75rem; }
    .footer-inner { flex-direction: column; text-align: center; }
    .site-footer { padding: 1rem; }
    .mode-selector { grid-template-columns: 1fr; }
    .dash-header { flex-direction: column; }
    .dash-subtitle { flex-wrap: wrap; }
    .dash-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .insights-grid { grid-template-columns: 1fr; }
    .landing-headline { font-size: 1.85rem; }
    .landing-value-grid { grid-template-columns: 1fr; }
    .landing-value-card:hover { transform: none; }
    .landing-step:hover { transform: none; }
    .landing-hero { padding: 2.5rem 0 2rem; }
    .landing-value { padding: 2.5rem 0; }
    .landing-how { padding: 2.5rem 0; }
    .landing-bottom-cta { padding: 3.5rem 0 2.5rem; }
    .landing-bottom-cta h2 { font-size: 1.75rem; }
    .landing-hero-visual { display: none; }
    .landing-preview .landing-section-label,
    .landing-insights-preview .landing-section-label { font-size: 1.15rem; }
    .mockup-quiz-layout { flex-direction: column; }
    .mockup-sidebar { width: 100%; border-left: none; border-top: 2px solid rgba(0, 212, 126, 0.5); }
    .mockup-insights-grid { grid-template-columns: 1fr; }
    .mockup-openings-grid { grid-template-columns: 1fr; }
    .mockup-stat-value { font-size: 1.1rem; }
    .mockup-stat-label { font-size: 0.6rem; }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-reasons { grid-template-columns: 1fr; }
    .pricing-tier { padding: 1.5rem 1.25rem; }
    .pricing-tier-price { font-size: 2.25rem; }
    .stat-cap-tooltip {
        left: 0;
        transform: none;
        width: 200px;
    }
    .stat-cap-info--right .stat-cap-tooltip {
        left: auto;
        right: 0;
    }
}

/* ================================================
   QUIZ UI — two-column layout (board + sidebar)
   ================================================ */

/* Widen container on quiz page for side-by-side layout */
.quiz-page .container {
    max-width: 960px;
}

/* Two-column layout: board + sidebar side by side */
.quiz-layout {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: start;
}

/* Board column */
.quiz-board-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(500px, 90vw);
    flex-shrink: 0;
}

.quiz-board-col .board-container {
    margin-bottom: 0.5rem;
    width: 100%;
}

/* Nav controls: compact card strip, under the board */
.quiz-board-col .nav-controls {
    gap: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.2rem;
    max-width: 210px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.9rem;
}

.nav-controls .btn {
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 1rem;
    line-height: 1.2;
}

.nav-controls .btn:hover {
    color: var(--heading);
    background: rgba(255, 255, 255, 0.06);
}

.nav-controls .btn:active {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

.nav-controls .btn:focus {
    outline: none;
}

.nav-controls .btn.btn-key-active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--heading);
    transition: none;
}

#nav-step-label {
    flex: 1;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
}

/* Sidebar column */
.quiz-sidebar {
    width: 380px;
    flex-shrink: 0;
    min-width: 0;
}

.quiz-sidebar-inner {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 2px solid rgba(0, 212, 126, 0.5);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Quiz info prompt */
.quiz-sidebar .quiz-info {
    text-align: left;
    margin-bottom: 1rem;
    color: var(--text);
    position: relative;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 500;
}

.quiz-side-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* Step counter */
.quiz-sidebar .step-counter {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    min-height: 1.2em;
    margin-bottom: 0.75rem;
}

/* Puzzle controls: segmented ghost strip */
.quiz-sidebar .puzzle-controls {
    gap: 0;
    width: 100%;
    margin: 0 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.puzzle-controls .btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.puzzle-controls .btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.puzzle-controls .btn:active {
    transform: none;
    background: rgba(255, 255, 255, 0.07);
}

.puzzle-controls .btn + .btn {
    border-left: 1px solid var(--border);
}

/* Wrong feedback — fixed height slot to prevent shift */
.quiz-sidebar .wrong-feedback {
    margin: 0 0 0.5rem;
    text-align: center;
}

/* Engine eval row — chip + tooltip side by side */
.engine-eval-row {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.engine-eval {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.85rem;
    background: rgba(0, 212, 126, 0.06);
    border: 1px solid rgba(0, 212, 126, 0.25);
    border-radius: 20px;
    font-variant-numeric: tabular-nums;
}

.engine-eval-tooltip {
    position: static;
    cursor: help;
}

.engine-eval-tooltip .info-tooltip-text {
    width: min(280px, calc(100vw - 3rem));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.engine-eval-tooltip:hover .info-tooltip-text,
.engine-eval-tooltip:focus-within .info-tooltip-text {
    display: block;
}

/* Feedback slot — always present, content swaps inside */
.quiz-feedback-slot {
    min-height: 0;
}

.quiz-feedback-slot .feedback {
    margin: 0 0 0.5rem;
    text-align: left;
    font-size: 0.95rem;
}

/* Quiz action buttons (Next/Retry) */
.quiz-controls {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.quiz-controls .btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    margin: 0 0.2rem;
}

/* Game meta — anchored at sidebar bottom */
.quiz-sidebar .game-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 0.4rem;
    row-gap: 0.25rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--muted);
}

.game-meta span + span {
    margin-left: 0;
}

/* ---- Mobile: stack vertically ---- */
@media (max-width: 840px) {
    .quiz-layout {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .quiz-board-col {
        width: min(500px, 90vw);
    }

    .quiz-sidebar {
        width: min(500px, 90vw);
    }

    .quiz-sidebar-inner {
        padding: 1rem 1.25rem;
    }

    .quiz-sidebar .quiz-info {
        text-align: center;
    }

    .quiz-sidebar .step-counter {
        text-align: center;
    }

    .quiz-sidebar .puzzle-controls {
        width: fit-content;
        margin: 0 auto 0.75rem;
    }

    .quiz-feedback-slot .feedback {
        text-align: center;
    }
}

/* ================================================
   LANDING PAGE ANIMATIONS
   ================================================ */

@keyframes landing-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hero: staggered entrance — each element cascades in */
.landing-badge    { animation: landing-fade-up 0.5s ease both; animation-delay: 0.05s; }
.landing-headline { animation: landing-fade-up 0.6s ease both; animation-delay: 0.18s; }
.landing-sub      { animation: landing-fade-up 0.6s ease both; animation-delay: 0.32s; }
.landing-hero form { animation: landing-fade-up 0.5s ease both; animation-delay: 0.46s; }
.landing-note     { animation: landing-fade-up 0.45s ease both; animation-delay: 0.58s; }
.landing-hero-visual { animation: landing-fade-up 0.6s ease both; animation-delay: 0.35s; }

/* CTA button: subtle glow on hover */
.landing-cta.btn-primary:hover {
    box-shadow: 0 0 28px rgba(0, 212, 126, 0.25);
}

/* Value card icon: scale on hover */
.landing-value-icon svg {
    transition: transform 0.25s ease;
}
.landing-value-card:hover .landing-value-icon svg {
    transform: scale(1.18);
}

/* Scroll reveal — gated by .js-reveal on <html> (added by JS)
   so without JS, cards are always visible */
.js-reveal .landing-value-card,
.js-reveal .landing-step {
    opacity: 0;
}

/* Value cards: per-property delays so only opacity staggers —
   border-color and transform (hover) stay at 0s delay */
.js-reveal .landing-value-card {
    transition: opacity 0.55s ease 0s, border-color 0.2s 0s, transform 0.2s 0s;
}
.js-reveal .landing-value-card:nth-child(2) {
    transition: opacity 0.55s ease 0.1s, border-color 0.2s 0s, transform 0.2s 0s;
}
.js-reveal .landing-value-card:nth-child(3) {
    transition: opacity 0.55s ease 0.2s, border-color 0.2s 0s, transform 0.2s 0s;
}
.js-reveal .landing-value-card:nth-child(4) {
    transition-delay: 0.27s;
}

/* Steps: simple opacity stagger */
.js-reveal .landing-step              { transition: opacity 0.5s ease 0s; }
.js-reveal .landing-step:nth-child(2) { transition: opacity 0.5s ease 0.12s; }
.js-reveal .landing-step:nth-child(3) { transition: opacity 0.5s ease 0.24s; }

.js-reveal .landing-value-card.is-visible,
.js-reveal .landing-step.is-visible {
    opacity: 1;
}

/* Mockup window scroll reveal */
.js-reveal .mockup-window,
.js-reveal .landing-hero-visual {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-reveal .mockup-window.is-visible,
.js-reveal .landing-hero-visual.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .landing-badge,
    .landing-headline,
    .landing-sub,
    .landing-hero form,
    .landing-note,
    .landing-hero-visual { animation: none; }

    .js-reveal .landing-value-card,
    .js-reveal .landing-step { opacity: 1; transition: border-color 0.2s, transform 0.2s; }

    .js-reveal .mockup-window,
    .js-reveal .landing-hero-visual { opacity: 1; transform: none; transition: none; }

    .landing-cta.btn-primary:hover { box-shadow: none; }
    .landing-value-card:hover .landing-value-icon svg { transform: none; }
}

/* --- Engagement Insights --- */

.engagement-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Personality badge */
.stat-card--personality {
    text-align: center;
}

.personality-badge {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0.6rem 0 0.3rem;
    letter-spacing: -0.02em;
}

.personality-desc {
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.3rem;
}

/* Opening report two-column */
.opening-report {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.opening-col-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.opening-col-label--danger { color: var(--error-border); }
.opening-col-label--safe { color: var(--accent); }

.opening-color {
    font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
    font-size: 0.85em;
    vertical-align: baseline;
}
.opening-color--white { color: #e0e0e0; }
.opening-color--black { color: #888; }

/* Dramatic moments */
.dramatic-moment { margin: 0.3rem 0; }

.dramatic-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dramatic-label--collapse { color: var(--error-border); }
.dramatic-label--comeback { color: var(--accent); }

.dramatic-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--heading);
    margin: 0.15rem 0;
}

.dramatic-link {
    color: var(--accent);
    font-size: 0.7rem;
    margin-left: 0.3rem;
}

/* Blunder O'Clock chart */
.blunder-clock-chart {
    margin-top: 0.5rem;
    flex: 1;
}

.clock-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 80px;
}

.clock-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.clock-bar {
    width: 100%;
    min-height: 2px;
    background: var(--accent);
    opacity: 0.6;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
}

.clock-bar--danger {
    background: var(--error-border);
    opacity: 1;
}

.clock-bar--sharp {
    background: var(--accent);
    opacity: 1;
}

.clock-bar-label {
    font-size: 0.55rem;
    color: var(--muted);
    margin-top: 3px;
    min-height: 0.7rem;
}

.blunder-clock-summary {
    font-size: 0.7rem;
    margin-top: 0.4rem;
}

.clock-danger { color: var(--error-border); }
.clock-sharp { color: var(--accent); }

/* Time control comparison bars */
.tc-comparison {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tc-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tc-bar-label {
    font-size: 0.8rem;
    color: var(--text);
    min-width: 4.5rem;
}

.tc-bar-track {
    flex: 1;
    height: 18px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.tc-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tc-bar-value {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    min-width: 2rem;
    text-align: right;
}

/* Responsive: stack on mobile */
@media (max-width: 640px) {
    .engagement-grid {
        grid-template-columns: 1fr;
    }
    .opening-report {
        grid-template-columns: 1fr;
    }
}
