/* ============================================
   EXPEDITION-418 — Tutorial Styles
   Unified with main site design system
   v2 — View-switching, modules, simulation
   ============================================ */

@import url('tokens.css');

:root {
    /* Tutorial-specific */
    --sidebar-width: 300px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(circle at 14% 6%, rgba(236, 84, 76, 0.12), transparent 40%),
        radial-gradient(circle at 84% 8%, rgba(247, 136, 64, 0.08), transparent 34%),
        linear-gradient(135deg, var(--bg-base) 0%, var(--bg-layer) 100%);
    color: var(--text-main);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}
.skip-link {
    position: fixed;
    top: -100%;
    left: 1rem;
    z-index: 220;
    background: var(--accent-bright);
    color: var(--bg-base);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   LAYOUT
   ============================================ */
.tutorial-container {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: clip;
}

/* ---- View switching ---- */
.tutorial-view {}

.tutorial-view.hidden {
    display: none !important;
}

.tutorial-view.view-entering {
    animation: fadeSlide 0.28s ease-out;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-layer);
    border-right: 1px solid var(--line-soft);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 1.8rem 1.4rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 1.8rem;
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.back-link {
    color: var(--accent-bright);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-soft);
    text-decoration: underline;
}

/* ---- Track progress ---- */
.track-progress-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.9rem;
}

.track-progress-card {
    padding: 0.85rem 0.9rem;
    background: rgba(8, 19, 41, 0.55);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.track-progress-card[data-track="droid"] {
    border-color: rgba(247, 136, 64, 0.18);
}

.track-progress-card[data-track="operator"] {
    border-color: rgba(125, 183, 255, 0.18);
}

.track-progress-card-inline {
    margin: 0.2rem 0 0.5rem 0.9rem;
}

.track-progress-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.track-progress-copy {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.track-progress-title {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-bright);
}

.track-progress-meta {
    font-size: 0.76rem;
    color: var(--text-dim);
    line-height: 1.35;
}

.track-progress-count {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-soft);
    white-space: nowrap;
}

.track-progress-track {
    height: 5px;
    background: var(--bg-panel);
    border-radius: 999px;
    overflow: hidden;
}

.track-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-bright), var(--accent));
    transition: width 0.35s ease;
    border-radius: 999px;
}

.track-progress-card[data-track="operator"] .track-progress-fill {
    background: linear-gradient(90deg, var(--accent-operator), var(--accent-operator-dark));
}

/* ---- TOC (Table of Contents) ---- */
.toc {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.toc-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 0.35rem 0 0.35rem 0.9rem;
    border-left: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s, padding-left 0.2s;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-link:hover {
    color: var(--text-soft);
}

.toc-link.active {
    color: var(--accent-bright);
    border-left-color: var(--accent-bright);
    font-weight: 600;
}

.toc-link.visited {
    color: var(--text-soft);
}

.toc-link.visited .toc-badge {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--bg-base);
}

.toc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-family: var(--font-ui);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.toc-divider {
    border: none;
    border-top: 1px dashed var(--line-soft);
    margin: 0.6rem 0 0.3rem;
}

.toc-label {
    font-family: var(--font-ui);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding-left: 0.9rem;
    margin-bottom: 0.15rem;
}


/* ---- Mobile hamburger ---- */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-layer);
    color: var(--accent-bright);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ---- Content area ---- */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    position: relative;
}

/* ============================================
   WELCOME / DISPATCHER
   ============================================ */
.course-header {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(to bottom, var(--bg-base), var(--bg-layer));
}

.dispatcher-tag {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 1.2rem;
    opacity: 0.85;
}

.course-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.welcome-intro {
    max-width: 720px;
    margin-bottom: 1.2rem;
}

.welcome-intro p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 720px;
    margin-bottom: 0;
    line-height: 1.7;
}

.welcome-track-grid {
    width: min(1020px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    margin-top: 1.6rem;
}

.welcome-track-card {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    padding: 1.45rem;
    text-align: left;
    background: rgba(8, 19, 41, 0.7);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.welcome-track-card[data-track="droid"] {
    border-color: rgba(247, 136, 64, 0.22);
}

.welcome-track-card[data-track="operator"] {
    border-color: rgba(125, 183, 255, 0.22);
}

.welcome-track-kicker {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.55rem;
}

.welcome-track-card h2 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    color: var(--text-bright);
    margin-bottom: 0.6rem;
}

.welcome-track-copy p:not(.welcome-track-kicker) {
    font-size: 0.98rem;
    color: var(--text-muted);
    margin-bottom: 0.95rem;
    line-height: 1.6;
}

.welcome-track-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.welcome-track-list li {
    position: relative;
    padding-left: 0.95rem;
    font-size: 0.92rem;
    color: var(--text-soft);
    line-height: 1.55;
}

.welcome-track-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-bright);
}

.welcome-track-card[data-track="operator"] .welcome-track-list li::before {
    background: var(--accent-operator);
}

.welcome-track-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.welcome-track-meta {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    margin-top: 0.6rem;
    margin-bottom: 0;
}

.resume-hint {
    margin-top: 1rem;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border: 1px dashed var(--line-soft);
    border-radius: var(--radius-sm);
}

.resume-hint:hover {
    color: var(--accent-bright);
    border-color: var(--accent-bright);
}
/* ============================================
   LESSON CONTENT
   ============================================ */
.lesson-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 3.5rem 2rem 8rem;
}

.lesson-section {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
    margin-bottom: 3.5rem;
}

.lesson-note {
    background: rgba(79, 224, 217, 0.07);
    border-left: 3px solid var(--accent-cyan);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-soft);
    font-size: 0.94rem;
    margin: 1rem 0 1.5rem;
}

.luck-outcome {
    background: rgba(196, 181, 253, 0.08);
    border-left: 3px solid var(--luck-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.9rem 1.1rem;
    margin-top: 1.2rem;
}

.luck-outcome-label {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--luck-color);
    margin-bottom: 0.4rem;
}

.luck-outcome strong {
    display: block;
    color: var(--luck-color);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.luck-outcome p {
    color: var(--text-soft);
    font-size: 0.93rem;
    margin: 0 0 0.4rem;
}

.luck-outcome small {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: var(--font-ui);
}

.lesson-section h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--line-soft);
    letter-spacing: 0.02em;
}

.lesson-section h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 2rem 0 0.8rem;
    letter-spacing: 0.02em;
}

.lesson-section h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 1.5rem 0 0.6rem;
}

.lesson-section p {
    font-size: 1.02rem;
    margin-bottom: 1.2rem;
}

.lesson-section ul,
.lesson-section ol {
    margin-bottom: 1.3rem;
    padding-left: 1.8rem;
}

.lesson-section li {
    font-size: 1.02rem;
    margin-bottom: 0.55rem;
}

.lesson-section code {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    background: var(--bg-panel);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    color: var(--accent-soft);
}

/* ---- Terminology Tooltips ---- */
.tut-term {
    cursor: help;
    border-bottom: 1px dashed var(--accent);
    position: relative;
    display: inline-block;
    transition: color 0.2s, border-color 0.2s;
}

.tut-term:hover,
.tut-term:focus {
    color: var(--accent-bright);
    border-color: var(--accent-bright);
    outline: none;
}

.tut-term::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--bg-deep);
    color: var(--text-soft);
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    text-align: left;
}

.tut-term:hover::after,
.tut-term:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ---- Highlight blocks ---- */
.highlight-block {
    background: var(--bg-panel);
    border-left: 3px solid var(--accent-bright);
    padding: 1.2rem 1.4rem;
    margin: 1.5rem 0;
    font-size: 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: border-left-color 0.3s, box-shadow 0.3s;
}

.highlight-block:hover {
    box-shadow: inset 3px 0 12px rgba(247, 136, 64, 0.08);
}

.highlight-block.highlight-success {
    border-left-color: var(--success-color);
}

.highlight-block.highlight-luck {
    border-left-color: var(--luck-color);
}

/* ---- Example blocks ---- */
.example-block {
    background: rgba(8, 19, 41, 0.65);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: 1.3rem 1.5rem;
    margin: 1.5rem 0;
}

.example-block .example-title {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 0.8rem;
}

/* ---- Step list (numbered procedure) ---- */
.step-list {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
    margin: 1.2rem 0;
}

.step-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 2.6rem;
    margin-bottom: 0.9rem;
}

.step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 1.7rem;
    height: 1.7rem;
    border: 1px solid var(--accent-bright);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-bright);
}

/* ============================================
   CONTINUE / CONGRATS BLOCKS
   ============================================ */
.continue-block {
    text-align: center;
    margin: 3rem 0;
    padding: 2.5rem 0;
    border-top: 1px dashed var(--line-soft);
}

.continue-block.hidden {
    display: none;
}

.congrats-block {
    text-align: center;
    padding: 3rem 1.5rem;
    margin: 1.5rem 0;
    background: linear-gradient(165deg, rgba(126, 214, 172, 0.08), rgba(2, 7, 29, 0.5));
    border: 1px solid rgba(126, 214, 172, 0.25);
    border-radius: var(--radius-md);
}

.congrats-block h3 {
    font-family: var(--font-heading);
    color: var(--success-text);
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
}

.congrats-block p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* ============================================
   ACCORDIONS
   ============================================ */
.accordion {
    margin: 1.5rem 0;
}

/* ── Distance Ruler ── */
.distance-ruler {
    display: flex;
    gap: 2px;
    margin: 1rem 0 1.2rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-family: var(--font-ui);
}

.distance-seg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.55rem 0.4rem 0.4rem;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    transition: opacity 0.15s;
}

.distance-seg:hover {
    opacity: 0.85;
}

.distance-seg[data-dist="0"] { flex: 1; background: rgba(236, 84, 76, 0.45); color: #f5efe0; }
.distance-seg[data-dist="1"] { flex: 2; background: rgba(247, 136, 64, 0.38); color: #f5efe0; }
.distance-seg[data-dist="2"] { flex: 4; background: rgba(245, 197, 66, 0.28); color: #d9c974; }
.distance-seg[data-dist="3"] { flex: 6; background: rgba(79, 224, 217, 0.2); color: #4fe0d9; }
.distance-seg[data-dist="4"] { flex: 8; background: rgba(125, 183, 255, 0.15); color: var(--accent-operator); }

.distance-seg-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
}

.distance-seg-range {
    display: block;
    opacity: 0.75;
    font-size: 0.6rem;
}

.accordion-item {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.accordion-header {
    background: var(--bg-panel);
    padding: 0.95rem 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    user-select: none;
    transition: background-color 0.2s;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--text-soft);
    font-family: var(--font-body);
}

.accordion-header:hover {
    background: var(--bg-panel-soft);
}

.accordion-icon {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--accent-bright);
    transition: transform 0.3s;
}

.accordion-content {
    background: var(--bg-deep);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    padding: 1.2rem 1.4rem;
    max-height: 2000px;
    border-top: 1px solid var(--line-soft);
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    color: var(--bg-base);
    border: none;
    padding: 0.85rem 1.8rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover,
.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(247, 136, 64, 0.3);
}

.btn-primary:disabled,
.btn-continue:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--accent-bright);
    border: 1px solid var(--accent-bright);
    padding: 0.85rem 1.8rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
    text-decoration: none;
}

.btn-ghost:hover {
    background: rgba(247, 136, 64, 0.12);
    color: var(--text-bright);
    transform: translateY(-1px);
}

.btn-submit {
    background: var(--bg-panel);
    border: 1px solid var(--accent-bright);
    color: var(--accent-bright);
    padding: 0.7rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
}

.btn-submit:hover {
    background: rgba(247, 136, 64, 0.2);
    color: var(--text-bright);
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   INTERACTIVE CONTAINER (shared wrapper)
   ============================================ */
.interactive-container {
    background: var(--bg-deep);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

/* ============================================
   FEEDBACK (shared)
   ============================================ */
.fb-success {
    color: var(--success-text);
    font-weight: 600;
}

.fb-error {
    color: var(--error-text);
    font-weight: 600;
}

/* ============================================
   CYCLE BUILDER (Block 1)
   ============================================ */
.cycle-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.cycle-card {
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, transform 0.15s, opacity 0.3s;
    position: relative;
    font-family: var(--font-body);
    color: var(--text-main);
}

.cycle-card:hover:not(.placed) {
    border-color: var(--accent-bright);
    transform: translateY(-2px);
}

.cycle-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.cycle-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}

.cycle-card.placed {
    border-color: var(--success-color);
    background: rgba(126, 214, 172, 0.08);
    cursor: default;
    opacity: 0.85;
    box-shadow: 0 0 12px rgba(126, 214, 172, 0.15);
}

.cycle-card.just-placed {
    animation: scaleBounce 0.35s ease-out;
}

.cycle-card-num {
    display: none;
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 24px;
    height: 24px;
    background: var(--success-color);
    color: var(--bg-base);
    border-radius: 50%;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.cycle-card.placed .cycle-card-num {
    display: flex;
}

.cycle-card.shake {
    animation: shake 0.35s ease-out;
}

.cycle-feedback {
    font-size: 0.9rem;
    min-height: 1.6rem;
    margin-bottom: 0.8rem;
}

.cycle-reset-btn {
    margin-top: 0.5rem;
}

/* ============================================
   COUNTER TRACK MODULE (factory)
   ============================================ */
.counter-track-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}

.ct-label {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-width: 80px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.ct-goal .ct-label {
    color: var(--success-text);
}

.ct-threat .ct-label {
    color: var(--error-text);
}

.ct-track {
    display: inline-grid;
    gap: 0.35rem;
    width: min(240px, 100%);
}

/* Auto grid columns based on counter size */
.ct-track {
    grid-template-columns: repeat(auto-fill, minmax(22px, 1fr));
}

.ct-seg {
    height: 14px;
    border: 1px solid var(--line-soft);
    background: var(--bg-layer);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.2s;
    border-radius: 2px;
}

.ct-seg.ct-seg-pop {
    animation: scaleBounce 0.3s ease-out;
}

.ct-seg.filled-goal {
    background: rgba(126, 214, 172, 0.6);
    border-color: rgba(126, 214, 172, 0.8);
    box-shadow: 0 0 8px rgba(126, 214, 172, 0.2);
}

.ct-seg.filled-threat {
    background: rgba(247, 136, 64, 0.65);
    border-color: rgba(247, 136, 64, 0.85);
    box-shadow: 0 0 8px rgba(247, 136, 64, 0.2);
}

.ct-seg.filled-critical {
    background: rgba(236, 84, 76, 0.7);
    border-color: rgba(236, 84, 76, 0.9);
    box-shadow: 0 0 10px rgba(236, 84, 76, 0.25);
}

.ct-count {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-dim);
    min-width: 2.4rem;
}

.ct-revealed .ct-label {
    color: var(--warning-text);
    animation: counterFlash 0.6s ease-out;
}

@keyframes counterFlash {
    0% {
        filter: brightness(2);
        transform: scaleY(1.3);
    }

    100% {
        filter: brightness(1);
        transform: scaleY(1);
    }
}

.counter-flash {
    animation: counterFlash 0.4s ease-out;
}

/* ============================================
   COUNTER TRAINER (Block 2)
   ============================================ */
.ct-scenario {
    margin-bottom: 1rem;
}

.ct-scenario h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.4rem;
}

.ct-scenario p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.ct-tracks {
    margin-bottom: 1rem;
}

.ct-analysis {
    margin-bottom: 1rem;
    min-height: 1rem;
}

.ct-analysis-text {
    background: var(--bg-panel);
    border-left: 3px solid var(--success-color);
    padding: 0.9rem 1.1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.92rem;
    color: var(--text-soft);
}

.ct-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* ============================================
   THRESHOLD CALCULATOR (Block 3)
   ============================================ */
.threshold-calc {
    background: var(--bg-deep);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.threshold-calc-header {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 1rem;
}

.threshold-calc-row {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.threshold-calc-row label {
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 120px;
}

.threshold-calc-row input[type="range"] {
    flex: 1;
    min-width: 120px;
    accent-color: var(--accent-bright);
}

.threshold-calc-result {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-soft);
}

.threshold-calc-result strong {
    color: var(--accent-bright);
    font-size: 1.1rem;
}

/* Die face grid */
.die-face-grid {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.die-face {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-layer);
    transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.die-face.is-success {
    border-color: rgba(126, 214, 172, 0.7);
    background: rgba(126, 214, 172, 0.15);
    color: var(--success-text);
    box-shadow: 0 0 8px rgba(126, 214, 172, 0.2);
}

.die-face.is-threat {
    border-color: rgba(236, 84, 76, 0.5);
    background: rgba(236, 84, 76, 0.1);
    color: var(--error-text);
}

.die-face.is-empty {
    color: var(--text-dim);
}

/* ============================================
   DICE ROLLER
   ============================================ */
.dice-roller {
    background: var(--bg-deep);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.dice-roller-inner {
    /* Inner wrapper created by factory */
}

.dice-config {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.dice-config-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.dice-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 110px;
}

/* Pool buttons */
.dr-pool-buttons,
.pool-buttons {
    display: flex;
    gap: 0.4rem;
}

.pool-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.pool-btn:hover {
    border-color: rgba(247, 136, 64, 0.7);
    color: var(--text-bright);
    transform: scale(1.06);
}

.pool-btn.selected {
    border-color: rgba(247, 136, 64, 0.9);
    background: rgba(247, 136, 64, 0.2);
    color: var(--accent-bright);
    box-shadow: 0 0 10px rgba(247, 136, 64, 0.2);
}

/* Difficulty buttons */
.dr-diff-buttons,
.diff-buttons {
    display: flex;
    gap: 0.4rem;
}

.diff-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.15s;
}

.diff-btn:hover {
    border-color: rgba(236, 84, 76, 0.6);
    color: var(--text-bright);
    transform: scale(1.06);
}

.diff-btn.selected {
    border-color: rgba(236, 84, 76, 0.8);
    background: rgba(236, 84, 76, 0.15);
    color: var(--error-text);
}

/* Roll button */
.roll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.6rem 1.6rem;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    color: var(--bg-base);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

.roll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(247, 136, 64, 0.3);
}

.roll-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Dice display area */
.dice-display {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    min-height: 56px;
    align-items: center;
    margin-bottom: 0.8rem;
}

/* D10 die styling */
.tut-die {
    width: 48px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s;
}

.tut-die-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.tut-die .d10-shape {
    fill: rgba(24, 33, 60, 0.72);
    stroke: rgba(80, 92, 100, 0.85);
    stroke-width: 3;
    stroke-linejoin: round;
    transition: fill 0.2s, stroke 0.2s, filter 0.2s;
}

.tut-die .d10-inner {
    fill: none;
    stroke: rgba(80, 92, 100, 0.5);
    stroke-width: 2;
    stroke-linejoin: round;
    transition: stroke 0.2s;
}

.tut-die-value {
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 0.92rem;
    z-index: 2;
    margin-top: 2px;
}

/* Die states */
.tut-die.success .d10-shape {
    stroke: rgba(126, 214, 172, 0.85);
    fill: rgba(126, 214, 172, 0.24);
    filter: drop-shadow(0 0 6px rgba(126, 214, 172, 0.3));
}

.tut-die.success .d10-inner {
    stroke: rgba(126, 214, 172, 0.5);
}

.tut-die.success .tut-die-value {
    color: var(--success-text);
}

.tut-die.consequence .d10-shape {
    stroke: rgba(236, 84, 76, 0.78);
    fill: rgba(236, 84, 76, 0.2);
    filter: drop-shadow(0 0 6px rgba(236, 84, 76, 0.3));
}

.tut-die.consequence .d10-inner {
    stroke: rgba(236, 84, 76, 0.5);
}

.tut-die.consequence .tut-die-value {
    color: var(--error-text);
}

.tut-die.luck .d10-shape {
    stroke: rgba(196, 181, 253, 0.85);
    fill: rgba(196, 181, 253, 0.18);
    filter: drop-shadow(0 0 6px rgba(196, 181, 253, 0.3));
}

.tut-die.luck .d10-inner {
    stroke: rgba(196, 181, 253, 0.5);
}

.tut-die.luck .tut-die-value {
    color: var(--luck-color);
}

.tut-die.both .d10-shape {
    stroke: rgba(255, 186, 145, 0.85);
    fill: rgba(255, 186, 145, 0.18);
    filter: drop-shadow(0 0 6px rgba(255, 186, 145, 0.3));
}

.tut-die.both .d10-inner {
    stroke: rgba(255, 186, 145, 0.5);
}

.tut-die.both .tut-die-value {
    color: var(--warning-text);
}

/* Dice animations */
.tut-die.shuffling {
    animation: diceShake 0.15s ease-in-out infinite;
}

.tut-die.revealing {
    animation: diePop 0.32s ease-out;
}

/* Roll summary */
.roll-summary {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    min-height: 1.4rem;
}

.roll-summary.has-result {
    color: var(--text-soft);
}

.roll-summary .s-success {
    color: var(--success-text);
    font-weight: 600;
}

.roll-summary .s-threat {
    color: var(--error-text);
    font-weight: 600;
}

.roll-summary .s-luck {
    color: var(--luck-color);
    font-weight: 600;
}

/* Spend buttons */
.spend-buttons,
.spend-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.spend-btn {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, padding-left 0.2s;
}

.spend-btn:hover:not(:disabled) {
    border-color: var(--accent-bright);
    color: var(--text-bright);
    background: rgba(247, 136, 64, 0.12);
}

.spend-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Final result */
.roll-final {
    padding: 0.9rem 1.1rem;
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-soft);
    min-height: 2.5rem;
    display: none;
}

.roll-final.visible {
    display: block;
}

.roll-final.success-result {
    border-left: 3px solid var(--success-color);
}

.roll-final.luck-result {
    border-left: 3px solid var(--luck-color);
}

.roll-final.fail-result {
    border-left: 3px solid var(--error-color);
}

/* ============================================
   CHOICE CARDS (factory)
   ============================================ */
.choice-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.choice-card {
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
    color: var(--text-main);
    transition: border-color 0.2s, background-color 0.2s, transform 0.15s, opacity 0.3s;
}

.choice-card:hover:not(.chosen):not(.not-chosen) {
    border-color: var(--accent-bright);
    transform: translateY(-2px);
}

.choice-card-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.4rem;
}

.choice-card-desc {
    display: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
    line-height: 1.45;
}

.choice-cards.revealed .choice-card-desc {
    display: block;
}

.choice-card.chosen {
    border-color: var(--accent-bright);
    background: rgba(247, 136, 64, 0.1);
    cursor: default;
    animation: pulseGlow 0.45s ease-out;
    box-shadow: 0 0 16px rgba(247, 136, 64, 0.12);
}

.choice-card.not-chosen {
    opacity: 0.35;
    cursor: default;
    filter: grayscale(0.5);
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.15s;
}

.choice-result {
    margin-top: 0.5rem;
    min-height: 1rem;
}

/* ============================================
   TYPEWRITER LOG
   ============================================ */
.log-entry-hidden {
    opacity: 0;
    transform: translateX(-10px);
}

.log-entry-visible {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.log-speaker {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--accent-bright);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-right: 0.4rem;
}

.typewriter-cursor {
    display: inline-block;
    color: var(--accent-bright);
    font-size: 0.88rem;
    animation: cursorBlink 0.8s step-end infinite;
    margin-left: 0.2rem;
}

@keyframes cursorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================
   RECON DEMO (Block 4)
   ============================================ */
.recon-counters {
    margin-bottom: 1rem;
}

.recon-phase-1 h4,
.recon-phase-2 h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-bright);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--line-soft);
}

.recon-phase-2 {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
}

.recon-phase-3 {
    margin-top: 1.5rem;
}

/* ============================================
   DAMAGE DEMO (Block 5)
   ============================================ */
.dd-integrity-bar {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.int-seg {
    flex: 1;
    height: 20px;
    border: 1px solid var(--line-soft);
    background: var(--bg-layer);
    border-radius: 2px;
    transition: background-color 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.int-seg.filled {
    background: rgba(126, 214, 172, 0.55);
    border-color: rgba(126, 214, 172, 0.8);
    box-shadow: 0 0 6px rgba(126, 214, 172, 0.2);
}

.dd-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dd-stat {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.dd-stat strong {
    color: var(--text-bright);
}

.dd-start-btn {
    margin-bottom: 1rem;
}

.dd-steps {
    margin-bottom: 1rem;
}

.dd-step {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--text-soft);
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(47, 63, 88, 0.3);
}

.dd-step.fade-in {
    animation: slideUp 0.4s ease-out;
}

.dd-step:last-child {
    border-bottom: none;
}

.dd-reset-btn {
    margin-bottom: 1.5rem;
}

/* State cards */
.dd-state-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.state-card {
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    transition: border-color 0.2s;
}

.state-card:hover {
    border-color: var(--line);
}

.state-card-name {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.state-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

.state-card-duration {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    color: var(--accent-bright);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.state-card-duration.critical-state {
    color: var(--error-text);
}

/* ============================================
   DILEMMA TRAINER (Block 6)
   ============================================ */
.dilemma-prompt {
    font-size: 1.02rem;
    color: var(--text-soft);
    margin-bottom: 1.2rem;
    line-height: 1.6;
    min-height: 2rem;
}

.dilemma-choices {
    margin-bottom: 1rem;
}

.dilemma-result {
    min-height: 1rem;
    margin-bottom: 0.8rem;
}

.dilemma-analysis {
    background: var(--bg-panel);
    border-left: 3px solid var(--accent-bright);
    padding: 0.9rem 1.1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.92rem;
    color: var(--text-soft);
    line-height: 1.5;
}

.dilemma-analysis .s-success {
    color: var(--success-text);
    font-weight: 600;
}

.dilemma-analysis .s-threat {
    color: var(--error-text);
    font-weight: 600;
}

.dilemma-desync-track {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 1rem 0;
    padding: 0.8rem 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
}

.desync-seg {
    width: 36px;
    height: 16px;
    border: 1px solid var(--line-soft);
    background: var(--bg-layer);
    border-radius: 2px;
    transition: background-color 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.desync-seg.filled {
    background: rgba(236, 84, 76, 0.65);
    border-color: rgba(236, 84, 76, 0.85);
    box-shadow: 0 0 8px rgba(236, 84, 76, 0.25);
    animation: scaleBounce 0.3s ease-out;
}

.desync-label {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-left: 0.6rem;
    letter-spacing: 0.04em;
}

.dilemma-next-btn {
    margin-bottom: 0.5rem;
}

.dilemma-summary {
    margin-top: 1.2rem;
    padding: 1.2rem;
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-bright);
}

.dilemma-summary h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.dilemma-summary p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* ============================================
   OPERATOR TRACK
   ============================================ */
.operator-trainer .choice-cards {
    margin-bottom: 0.9rem;
}

.operator-case-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.operator-case-kind {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(121, 214, 255, 0.35);
    background: rgba(121, 214, 255, 0.08);
    color: var(--text-bright);
}

.operator-case-kind.rule-check {
    border-color: rgba(121, 214, 255, 0.42);
    background: rgba(121, 214, 255, 0.1);
}

.operator-case-kind.gm-guidance {
    border-color: rgba(255, 206, 121, 0.38);
    background: rgba(255, 206, 121, 0.1);
}

.operator-case-title {
    margin-bottom: 0.55rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--text-bright);
}

.operator-case-question {
    margin: 0;
    color: var(--text-main);
}

.operator-sim-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    /* Full-bleed header like sim-console-head */
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--bg-panel);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: none;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--font-ui);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.operator-sim-meta strong {
    color: var(--text-bright);
}

/* ============================================
   PRESET GRID (Block 7) — Redesigned
   ============================================ */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.preset-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: var(--radius-md);
    transition: transform 0.2s ease;
}

.preset-card-link:hover {
    transform: translateY(-3px);
}

.preset-card {
    --preset-accent: var(--accent-bright);
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--preset-accent);
    border-radius: var(--radius-md);
    padding: 1.3rem 1.4rem 1.1rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.preset-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--preset-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.preset-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 20px color-mix(in srgb, var(--preset-accent) 15%, transparent);
    border-color: var(--preset-accent);
}

.preset-card:hover::before {
    opacity: 1;
}

.preset-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.preset-role {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bg-base);
    background: var(--preset-accent);
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    line-height: 1.4;
    flex-shrink: 0;
}

.preset-card h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 0;
}

.preset-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-style: italic;
}

/* Stat bars */
.preset-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.9rem;
}

.preset-stat {
    display: grid;
    grid-template-columns: 2.8rem 1fr 1.2rem;
    align-items: center;
    gap: 0.5rem;
}

.preset-stat-name {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    text-transform: uppercase;
}

.preset-stat-bar {
    height: 6px;
    background: var(--bg-deep);
    border-radius: 3px;
    overflow: hidden;
}

.preset-stat-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.preset-stat-val {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-soft);
    text-align: right;
}

/* Meta info */
.preset-meta {
    margin-bottom: 0.7rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line-soft);
}

.preset-meta p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    line-height: 1.5;
}

.preset-meta-icon {
    color: var(--preset-accent);
    margin-right: 0.15rem;
}

/* Upgrade chips */
.preset-upgrades {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.preset-chip {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--preset-accent);
    border: 1px solid color-mix(in srgb, var(--preset-accent) 40%, transparent);
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    transition: background 0.2s, color 0.2s;
}

.preset-chip:hover {
    background: color-mix(in srgb, var(--preset-accent) 15%, transparent);
}

/* Open in charsheet button */
.preset-open-btn {
    display: block;
    width: 100%;
    margin-top: 0.9rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--preset-accent) 50%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--preset-accent) 8%, transparent);
    color: var(--preset-accent);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.preset-open-btn:hover {
    background: color-mix(in srgb, var(--preset-accent) 20%, transparent);
    border-color: var(--preset-accent);
    transform: translateY(-1px);
}

/* ============================================
   PERSONALITY DEMO (Block 8)
   ============================================ */
.pd-tasks {
    margin-bottom: 1.2rem;
}

.pd-tasks h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.8rem;
}

.pd-task {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.pd-task:hover:not(.selected) {
    border-color: var(--accent-bright);
    color: var(--text-soft);
}

.pd-task.selected {
    border-color: var(--success-color);
    background: rgba(126, 214, 172, 0.1);
    color: var(--success-text);
    cursor: default;
}

.pd-progress {
    margin-top: 1rem;
}

.pd-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.pd-core {
    width: 40px;
    height: 40px;
    border: 2px solid var(--line-soft);
    border-radius: 50%;
    background: var(--bg-layer);
    transition: border-color 0.4s, background-color 0.4s, box-shadow 0.4s;
}

.pd-core.filled {
    border-color: var(--success-color);
    background: rgba(126, 214, 172, 0.3);
    box-shadow: 0 0 10px rgba(126, 214, 172, 0.25);
}

.pd-progress p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* ============================================
   SIMULATION CONSOLE
   ============================================ */
.sim-console {
    background: var(--bg-deep);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Console Head */
.sim-console-head {
    background: var(--bg-panel);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sim-console-head .sim-kicker {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-bright);
}

.sim-status-bar {
    display: flex;
    gap: 1.2rem;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.sim-status-bar span {
    white-space: nowrap;
}

/* Console Body */
.sim-console-body {
    padding: 1.5rem;
}

/* Step buttons */
.sim-steps {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.sim-step {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.sim-step:hover {
    border-color: var(--accent-bright);
    color: var(--text-bright);
}

.sim-step.active {
    border-color: var(--accent-bright);
    background: rgba(247, 136, 64, 0.2);
    color: var(--accent-bright);
    box-shadow: 0 0 10px rgba(247, 136, 64, 0.15);
}

/* Main frame */
.sim-main-frame {
    min-height: 200px;
}

.sim-main-frame .sim-kicker {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.sim-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.6rem;
}

.sim-summary {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.sim-counters {
    margin-bottom: 1rem;
}

.sim-log {
    margin-bottom: 1.2rem;
    font-size: 0.92rem;
    line-height: 1.6;
}

.sim-log p {
    margin-bottom: 0.4rem;
}

.sim-action {
    margin-bottom: 1rem;
}

.sim-action-info {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.sim-action-info strong {
    color: var(--text-bright);
}

.sim-roller {
    /* Container for embedded dice roller */
}

.sim-roller .dice-roller {
    margin: 0;
    border: none;
    padding: 0;
    background: transparent;
}

.sim-outcome {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    min-height: 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

.sim-outcome:empty {
    display: none;
}

.sim-outcome.success {
    background: rgba(126, 214, 172, 0.1);
    border-left: 3px solid var(--success-color);
    color: var(--success-text);
}

.sim-outcome.warning {
    background: rgba(247, 136, 64, 0.1);
    border-left: 3px solid var(--accent-bright);
    color: var(--warning-text);
}

.sim-outcome.luck {
    background: rgba(196, 181, 253, 0.1);
    border-left: 3px solid var(--luck-color);
    color: var(--luck-color);
}

.sim-teaching {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 1rem;
    min-height: 1rem;
    line-height: 1.5;
}

.sim-teaching:empty {
    display: none;
}

/* Simulation Damage Demo */
.sim-damage-info {
    margin-bottom: 1rem;
}

.sim-damage-info p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.sim-damage-info strong {
    color: var(--text-bright);
}

.sim-damage-steps {
    margin-top: 1rem;
}

/* Simulation Choice Result */
.sim-choice-result {
    margin-top: 0.5rem;
    padding: 0.9rem 1.1rem;
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text-soft);
}

/* Mission Complete */
.sim-outcome.sim-mission-complete {
    background: linear-gradient(165deg, rgba(126, 214, 172, 0.08), rgba(2, 7, 29, 0.5));
    border: 1px solid rgba(126, 214, 172, 0.25);
    border-left: none;
    padding: 2rem;
    text-align: center;
    color: var(--text-main);
}

.sim-mission-complete h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--success-text);
    margin-bottom: 0.8rem;
}

.sim-mission-complete p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.sim-mission-complete ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.2rem;
}

.sim-mission-complete li {
    font-size: 0.88rem;
    color: var(--text-soft);
    padding: 0.2rem 0;
}

.sim-mission-complete li::before {
    content: '✓ ';
    color: var(--success-text);
}

.sim-final-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

/* Console Footer */
.sim-console-footer {
    background: var(--bg-panel);
    padding: 0.8rem 1.5rem;
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sim-dots {
    display: flex;
    gap: 0.4rem;
}

.sim-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-layer);
    border: 1px solid var(--line-soft);
    transition: background-color 0.3s, border-color 0.3s;
}

/* ============================================
   REFERENCE
   ============================================ */
.ref-state-card {
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.ref-state-card strong {
    color: var(--text-bright);
}

/* ---- Tables ---- */
.rules-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
    font-size: 0.9rem;
}

.rules-table th {
    background: var(--bg-panel);
    color: var(--text-bright);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.7rem 0.8rem;
    text-align: left;
    border-bottom: 2px solid var(--line-soft);
}

.rules-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(47, 63, 88, 0.5);
    vertical-align: top;
}

.rules-table tr:last-child td {
    border-bottom: none;
}

.rules-table tr:hover td {
    background: rgba(32, 43, 73, 0.3);
}

/* ============================================
   HIDDEN UTILITY
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes diceShake {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.05) translate(1px, -1px);
    }

    50% {
        transform: scale(0.97) translate(-1px, 1px);
    }

    75% {
        transform: scale(1.03) translate(1px, 0);
    }
}

@keyframes diePop {
    0% {
        transform: scale(0.7);
        opacity: 0.5;
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(3px);
    }
}

.fade-up {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleBounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(247, 136, 64, 0.4);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(247, 136, 64, 0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateX(12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(2, 7, 29, 0.7);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .content-area {
        margin-left: 0;
        padding-top: 60px;
    }

    .course-header {
        min-height: 80vh;
        padding: 3rem 1.5rem;
    }

    .course-header h1 {
        font-size: 2rem;
    }

    .lesson-content {
        padding: 2rem 1rem 4rem;
    }

    /* Cycle cards stack on mobile */
    .cycle-cards {
        grid-template-columns: 1fr;
    }

    /* Choice cards stack on mobile */
    .choice-cards {
        grid-template-columns: 1fr;
    }

    /* Preset cards stack on mobile */
    .preset-grid {
        grid-template-columns: 1fr;
    }

    /* State cards stack */
    .dd-state-cards {
        grid-template-columns: 1fr;
    }

    /* Simulation steps wrap */
    .sim-steps {
        flex-wrap: wrap;
    }

    .sim-console-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .sim-status-bar {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .sim-console-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .welcome-track-grid {
        grid-template-columns: 1fr;
    }

    .welcome-track-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .dice-config-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .operator-sim-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .dice-label {
        min-width: auto;
    }

    .sim-final-actions {
        flex-direction: column;
    }
}



/* Accessibility polish */
.toc-link:focus-visible {
    color: var(--text-soft);
    border-left-color: var(--accent-bright);
    outline: none;
}

.mobile-toggle:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 2px;
}

.resume-hint {
    background: transparent;
}

.resume-hint:focus-visible {
    color: var(--accent-bright);
    border-color: var(--accent-bright);
    outline: none;
}

.accordion-header:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: -2px;
    background: var(--bg-panel-soft);
}
