body.theme-halloween {
    --paper: var(--theme-surface, #fff8ed);
    --paper-deep: var(--theme-surface-elevated, #eadff0);
    --ink: var(--theme-text, #271735);
    --teal: var(--theme-heading, #54306f);
    --gold: var(--theme-border, #d65f16);
    --muted: var(--theme-text-secondary, #57485f);
    --focus: var(--theme-focus, #287a34);
    font-family: var(--theme-font-body, Georgia, 'Times New Roman', serif);
    background:
        radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--theme-reward-accent, #ffae42) 20%, transparent), transparent 14rem),
        radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--theme-progress-unlocked, #adff68) 12%, transparent), transparent 17rem),
        linear-gradient(145deg, var(--theme-page-background, #17111f) 0%, var(--theme-heading, #321745) 48%, var(--theme-page-background, #17111f) 100%);
}

.theme-halloween h1,
.theme-halloween h2,
.theme-halloween h3 { font-family: var(--theme-font-heading, Georgia, 'Times New Roman', serif); }

.theme-halloween .site-header .secondary-button {
    border-color: var(--theme-border-strong, #f29a3f);
    color: var(--theme-button-text, #fff8ed);
    background: rgb(23 17 31 / 0.72);
}

.theme-halloween .secondary-button {
    border-color: var(--theme-border, #d65f16);
    color: var(--theme-button-text, #ffffff);
    background: var(--theme-button-secondary, #54306f);
}

.theme-halloween .escape-card {
    position: relative;
    overflow: hidden;
    border: 3px solid var(--theme-border, #d65f16);
    border-radius: var(--theme-panel-radius, 1rem);
    background: var(--theme-surface, #fff8ed);
    box-shadow:
        0 1.7rem 4rem color-mix(in srgb, var(--theme-shadow, #000000) 42%, transparent),
        0 0 0 0.35rem color-mix(in srgb, var(--theme-heading, #54306f) 40%, transparent);
}

.theme-halloween .escape-card::after {
    position: absolute;
    right: -1.5rem;
    bottom: -2rem;
    width: 9rem;
    height: 9rem;
    border: 2px solid color-mix(in srgb, var(--theme-heading, #54306f) 12%, transparent);
    border-radius: 50%;
    content: '';
    box-shadow: -2.5rem -2.5rem 0 -0.1rem color-mix(in srgb, var(--theme-heading, #54306f) 5%, transparent);
    pointer-events: none;
}

.theme-halloween .theme-decoration {
    display: flex;
    justify-content: center;
    gap: clamp(0.55rem, 3vw, 1.4rem);
    margin: -0.25rem 0 1.4rem;
    padding: 0.75rem 1rem;
    border: 2px solid color-mix(in srgb, var(--theme-heading, #54306f) 18%, transparent);
    border-radius: 999px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--theme-heading, #54306f) 12%, transparent), color-mix(in srgb, var(--theme-border, #d65f16) 13%, transparent));
    font-size: clamp(1.55rem, 5vw, 2.65rem);
}

.theme-halloween .theme-decoration span:nth-child(even) { transform: translateY(0.18rem); }
.theme-halloween .theme-decoration--complete { border-color: color-mix(in srgb, var(--theme-border, #d65f16) 45%, transparent); }

.theme-halloween .eyebrow,
.theme-halloween .lock-label,
.theme-halloween .timer { color: var(--theme-heading, #54306f); }

.theme-halloween .story-copy,
.theme-halloween .puzzle-prompt {
    border-left-color: var(--theme-border, #d65f16);
    background: color-mix(in srgb, var(--theme-border-strong, #ffdfb5) 40%, transparent);
}

.theme-halloween .primary-button {
    border-color: var(--theme-button-primary-active, #45235e);
    color: var(--theme-button-text, #ffffff);
    background: var(--theme-button-primary, #54306f);
}

.theme-halloween .primary-button:hover,
.theme-halloween .primary-button:focus-visible { background: var(--theme-button-primary-hover, #3b1d50); }
.theme-halloween .completion-card .primary-button { background: var(--theme-completion-action, #54306f); }

.theme-halloween .lock-current {
    border-color: var(--theme-progress-current, #d65f16);
    color: var(--theme-text, #271735);
    background: color-mix(in srgb, var(--theme-progress-current, #ffae42) 22%, transparent);
}

.theme-halloween .lock-completed {
    border-color: var(--theme-progress-completed, #287a34);
    color: var(--theme-progress-completed, #1d6328);
    background: color-mix(in srgb, var(--theme-progress-completed, #5cb54c) 13%, transparent);
}

.theme-halloween .student-fieldset,
.theme-halloween .choice-card,
.theme-halloween .sequence-item,
.theme-halloween .matching-student-row { border-color: color-mix(in srgb, var(--theme-heading, #54306f) 24%, transparent); }

.theme-halloween .choice-card:hover,
.theme-halloween .choice-card:focus-within {
    border-color: var(--theme-border, #d65f16);
    background: var(--theme-choice-hover, #fff9ed);
}

.theme-halloween .reward-modal-backdrop { background: color-mix(in srgb, var(--theme-dialog-backdrop, #17111f) 82%, transparent); }
.theme-halloween .reward-modal-card {
    border-color: var(--theme-reward-accent, #d65f16);
    color: var(--theme-reward-text, #271735);
    background: var(--theme-dialog-surface, #fff8ed);
}
.theme-halloween .reward-letter { color: var(--theme-reward-accent, #a64008); }
.theme-halloween .completion-card { background: var(--theme-victory-surface, #fff8ed); }
.theme-halloween .completion-card h1 { color: var(--theme-completion-heading, #54306f); }
.theme-halloween .completion-stats { color: var(--theme-completion-stats, #57485f); }
.theme-halloween .completion-card h1 { max-width: 18ch; }
.theme-halloween .scramble-note strong { color: var(--theme-reward-accent, #a64008); font-size: 1.25em; }
