/* Halloween component palette. Scope every rule to the selected account theme.
   Scratch canvases, portraits and item artwork keep their original colours. */

body[data-site-theme="halloween"] {
  --site-bg: #f7fbff;
  --site-panel: #ffffff;
  --site-inset: #f1f7ff;
  --site-border: #bbcee2;
  --site-text: #23374e;
  --site-muted: #53677c;
  --site-accent: #1d5b89;
  color-scheme: dark;
  color: var(--site-text);
  background: radial-gradient(ellipse at 8% 0, #2e1f37 0, transparent 48%),
              radial-gradient(ellipse at 94% 14%, #2e1f37 0, transparent 42%), var(--site-bg);
  background-attachment: fixed;
}
body[data-site-theme="halloween"] .site-header {
  background: linear-gradient(115deg, #211627, #211627);
  border-color: var(--site-border);
  box-shadow: 0 8px 28px #140f0b10;
}
body[data-site-theme="halloween"] :is(.logo a, .site-user-name-link, .site-user-points) { color: var(--site-accent); }
body[data-site-theme="halloween"] .site-header .nav-links a { background: #211627; color: #bda2cd; border-color: #745388; }
body[data-site-theme="halloween"] .site-header .nav-links a:hover { background: #2e1f37; color: #f4b27b; }
body[data-site-theme="halloween"] .user-section { background: #211627; color: var(--site-text); border-color: var(--site-border); }
body[data-site-theme="halloween"] .site-footer { background: #211627; border-color: var(--site-border); color: var(--site-muted); }
body[data-site-theme="halloween"] :is(.site-footer p, .editor-web-theme-note) { color: var(--site-muted); }


body[data-site-theme="halloween"] :is(
  .mypage-card, .mypage-navigation, .shop-category-filter,
  .shop-item:not([data-emoji-pack-theme]), .post-board, .post-list-toolbar,
  .problem-list-page .board, .problem-detail-refresh, .post-detail-card, .comments-card,
  .home-hero-panel, .home-card, .home-panel, .home-ranking-panel, .home-attendance-calendar-panel, .notification-box
) { background: var(--site-panel); border-color: var(--site-border); color: var(--site-text); box-shadow: 0 10px 30px #140f0b0d; }
body[data-site-theme="halloween"] :is(.mypage-profile-card, .home-hero-panel, .post-detail-header) {
  background: linear-gradient(120deg, #2e1f37, #211627);
  border-color: var(--site-border);
}
body[data-site-theme="halloween"] .post-detail-header { border-radius: 10px; padding: 16px; }
body[data-site-theme="halloween"] :is(
  .mypage-stat-item, .mypage-overview-tile, .editor-theme-choice, .item-description-box,
  .post-board-item, .post-content, .comment-item, .comment-reply-item,
  .problem-list-page .board-item, .problem-detail-refresh .code-submit, .problem-description,
  .home-stat-card
) { background: var(--site-inset); border-color: var(--site-border); color: var(--site-text); }
body[data-site-theme="halloween"] :is(.mypage-page-heading, .shop-header, .shop-grid, .post-page-size-form,
  .post-comment-form, .post-like-form, .post-boost-actions form) { background: transparent; }
body[data-site-theme="halloween"] :is(.post-board-item:hover, .problem-list-page .board-item:hover, .mypage-overview-tile:hover) { background: #2e1f37; border-color: #745388; }


body[data-site-theme="halloween"] :is(
  .shop-title, .post-list-heading, .post-title, .problem-title, .problem-list-page h2,
  .mypage-page-heading h2, .mypage-panel-heading h3, .mypage-section-head h3,
  .mypage-identity-copy h3, .mypage-wallet-item strong, .mypage-stat-value,
  .mypage-overview-tile strong, .editor-theme-choice h4, .item-name,
  .comments-head h2, .comment-form-block h3, .comment-content,
  .home-hero-copy h1, .home-stat-value, .home-panel-title
) { color: var(--site-text); }
body[data-site-theme="halloween"] :is(
  .post-list-subtitle, .problem-list-subtitle, .post-list-count, .post-pagination-summary,
  .mypage-page-heading p, .mypage-panel-heading p, .mypage-stat-label, .mypage-title-guide,
  .mypage-identity-role, .mypage-identity-copy p, .mypage-identity-copy h3 span,
  .mypage-wallet-item > span, .mypage-wallet-item small, .mypage-overview-tile,
  .editor-theme-choice p, .item-description, .comment-char-count, .comment-date,
  .comment-empty, .comment-login-guide, .home-hero-desc, .home-stat-label, .home-attendance-meta
) { color: var(--site-muted); }
body[data-site-theme="halloween"] :is(.profile-shop-link, .mypage-text-link, .post-title-link,
  .problem-board-item-link, .problem-board-item-link .problem-title,
  .post-content a, .post-file-list a, .section-title, .comment-reply-toggle,
  .comment-reply-cancel, .comment-reply-mark, .comment-manage-link:not(.comment-manage-delete)) { color: var(--site-accent); }
body[data-site-theme="halloween"] :is(.post-meta-chip, .comment-count, .comment-reply-label, .item-description-label, .shop-purchase-count) {
  background: #2e1f37; border-color: #745388; color: #bda2cd;
}
body[data-site-theme="halloween"] :is(.mypage-wallet-item, .comment-form-block, .comment-replies, .comment-empty, .post-content pre) { border-color: var(--site-border); }


body[data-site-theme="halloween"] :is(.shop-category-tab, .mypage-navigation a, .mypage-navigation a small, .mypage-nav-caption) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.shop-category-tab.is-active, .mypage-navigation a[aria-selected="true"], .post-pagination-link.is-current) {
  background: #2e1f37; border-color: #745388; color: #f4b27b;
}
body[data-site-theme="halloween"] :is(.shop-category-tab:hover, .mypage-navigation a:hover) { background: #2e1f37; color: #f4b27b; }
body[data-site-theme="halloween"] :is(.mypage-btn-primary, .post-write-btn, .comment-submit-btn, .comment-inline-edit-submit,
  [data-shop-category="editor"] .purchase-btn:not(:disabled)) { background: #f4ac71; color: #211528; border-color: #886b53; }
body[data-site-theme="halloween"] :is(.mypage-btn-primary, .post-write-btn, .comment-submit-btn, .comment-inline-edit-submit,
  [data-shop-category="editor"] .purchase-btn:not(:disabled)):hover { background: #f4ac71; }
body[data-site-theme="halloween"] :is(.mypage-btn-subtle, .post-action-list, .post-action-edit, .comment-inline-edit-cancel,
  .post-pagination-link, .post-pagination-nav, .shop-load-more, .post-search-button) { background: #2e1f37; color: #f4b27b; border-color: #745388; }
body[data-site-theme="halloween"] .editor-theme-choice.is-selected { border-color: #745388; box-shadow: 0 0 0 1px #100b14; }
body[data-site-theme="halloween"] .post-action-delete { color: #f4b27b; background: #2e1f37; border-color: #745388; }
body[data-site-theme="halloween"] .comment-manage-delete { color: #f4b27b; }
body[data-site-theme="halloween"] :is(.post-like-button, .comment-like-button) { color: #f4b27b; background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] :is(.post-like-button.is-liked, .comment-like-button.is-liked) { color: #211528; background: #f4ac71; border-color: #886b53; }
body[data-site-theme="halloween"] :is([data-comment-like-count], [data-post-like-count]) { color: inherit; }
body[data-site-theme="halloween"] .post-detail-card .post-boost-panel { background: #2e1f37; border-color: #745388; }
body[data-site-theme="halloween"] .post-boost-copy :is(h2, p),
body[data-site-theme="halloween"] .post-boost-point { color: #f7c296; }


body[data-site-theme="halloween"] :is(.post-search-form, .post-page-size-form select, .shop-sort-select, .teacher-student-select,
  .comments-card textarea, .comment-inline-edit-form, .comment-reply-form,
  .problem-detail-refresh #input-data, .mypage-account-info) {
  background: #211627; color: var(--site-text); border-color: #745388; caret-color: var(--site-accent);
}
body[data-site-theme="halloween"] .post-search-input { color: var(--site-text); }
body[data-site-theme="halloween"] :is(.comments-card textarea, .post-search-input, #input-data)::placeholder { color: #bda2cd; }
body[data-site-theme="halloween"] .comments-card textarea:focus { border-color: #886b53; box-shadow: 0 0 0 2px #140f0b20; }
body[data-site-theme="halloween"] :is(.site-nav, .mypage-navigation, .post-detail-page, .post-list-toolbar, .shop-category-filter) :is(a, button, select, input, textarea):focus-visible {
  outline: 2px solid #886b53; outline-offset: 3px;
}
body[data-site-theme="halloween"] .post-content pre code { background: #211627; color: #cbb6d7; }
body[data-site-theme="halloween"] .post-content :is(.hljs-keyword, .hljs-selector-tag, .hljs-literal) { color: #f4b27b; }
body[data-site-theme="halloween"] .post-content :is(.hljs-string, .hljs-attr) { color: #9cd3b5; }
body[data-site-theme="halloween"] .post-content .hljs-number { color: #f4b27b; }
body[data-site-theme="halloween"] .post-content :is(.hljs-title, .hljs-built_in) { color: #bda2cd; }
body[data-site-theme="halloween"] .post-content .hljs-comment { color: #bda2cd; }


body[data-site-theme="halloween"] :is(.welcome-mypage-link, .welcome-mypage-link span, .welcome-mypage-icon) { color: #f4b27b; }
body[data-site-theme="halloween"] :is(.profile-wardrobe-intro, .shop-category-summary, .shop-category-tab small,
  .shop-purchase-count strong, .shop-sort-form label, .editor-font-label, .editor-comment-status, .error-translation-cost) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.item-price, .shop-point-status, .shop-ticket-status) { color: #f4b27b; background: #2e1f37; border-color: #745388; }
body[data-site-theme="halloween"] :is(.shop-point-status strong, .shop-ticket-status strong) { color: #f4b27b; }
body[data-site-theme="halloween"] .shop-sort-form { background: transparent; }
body[data-site-theme="halloween"] .shop-sort-form select { background: #211627; color: #cbb6d7; border-color: #745388; }
body[data-site-theme="halloween"] .problem-detail-refresh :is(.editor-font-btn, .editor-font-value, .editor-auto-btn, .editor-comment-btn) {
  background: #2e1f37; color: #f4b27b; border-color: #745388;
}
body[data-site-theme="halloween"] .problem-detail-refresh .editor-auto-btn.is-off { background: #2e1f37; color: #bda2cd; border-color: #745388; }
body[data-site-theme="halloween"] .problem-detail-refresh .difficulty-badge { color: #cbb6d7; }
body[data-site-theme="halloween"] .flash-message--success { background: #1f3729; border-color: #489362; color: #a0d5b3; }
body[data-site-theme="halloween"] .flash-message--error { background: #2e1f37; border-color: #745388; color: #f4b27b; }
body[data-site-theme="halloween"] .flash-message--warning { background: #2e1f37; border-color: #745388; color: #f7c296; }
body[data-site-theme="halloween"] .flash-message--info { background: #2e1f37; border-color: #745388; color: #bda2cd; }


body[data-site-theme="halloween"] :is(.post-page-size-form label, .post-list-count strong, .post-search-icon,
  .comment-author, .post-boost-panel .post-boost-kicker) { color: var(--site-accent); }
body[data-site-theme="halloween"] .problem-list-page .problem-title-text { color: #f4b27b; }
body[data-site-theme="halloween"] .problem-list-page .board-item:hover .problem-title-text { color: #f6bd8e; }
body[data-site-theme="halloween"] .problem-list-page .board-item.solved-problem .problem-title-text:not(.level-event),
body[data-site-theme="halloween"] .problem-list-page .board-item.student-solved-problem .problem-title-text:not(.level-event) { color: #9cd3b6; }
body[data-site-theme="halloween"] .problem-list-page .level-links a { background: #211627; }
body[data-site-theme="halloween"] :is(.homework-only-link, .problem-jump-input, .problem-jump-button) { color: #bda2cd; background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] :is(.home-attendance-calendar-year, .home-attendance-calendar-month,
  .home-attendance-calendar-copy, .home-attendance-calendar th) { color: #f4b27b; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell { background: #211627; color: #bda2cd; border-color: #745388; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell.is-outside { opacity: .55; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell.is-attended { background: #2e1f37; color: #f4b27b; border-color: #745388; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell:is(.is-today, .is-birthday-selected) { border-color: #886b53; box-shadow: 0 0 0 1px #140f0b; }
body[data-site-theme="halloween"] .home-attendance-calendar-nav-link { background: #c271f4; border-color: #745388; }
body[data-site-theme="halloween"] .home-attendance-calendar thead th:first-child,
body[data-site-theme="halloween"] .home-attendance-calendar tbody td:first-child .home-attendance-calendar-day { color: #f4b27b; }
body[data-site-theme="halloween"] .home-attendance-calendar thead th:last-child,
body[data-site-theme="halloween"] .home-attendance-calendar tbody td:last-child .home-attendance-calendar-day { color: #f4b27b; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell.is-student-birthday:not(.is-special-birthday):not(.is-attended) .home-attendance-calendar-day { color: #bda2cd; text-shadow: none; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell.is-special-birthday .home-attendance-calendar-day { color: #f4b27b; text-shadow: none; }
body[data-site-theme="halloween"] .home-calendar-birthday-setting { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] :is(.home-calendar-birthday-form, .home-calendar-birthday-dismiss-form) { background: transparent; }
body[data-site-theme="halloween"] :is(.home-calendar-birthday-copy, .home-calendar-birthday-selected) { color: #bda2cd; }
body[data-site-theme="halloween"] .home-calendar-birthday-submit { background: #f4ac71; color: #211528; border-color: #886b53; }
body[data-site-theme="halloween"] .home-calendar-birthday-dismiss-btn { background: #2e1f37; color: #bda2cd; border-color: #745388; }


body[data-site-theme="halloween"] :is(.home-feature-card, .home-notice-board, .home-notice-item,
  .home-ranking-wrap, .profile-wardrobe-card, .mypage-title-option, .mypage-emoji-pack-option,
  .shop-treasure-count, .shop-treasure-open-card, .example-item, .turtle-runtime,
  .turtle-input-card) {
  background: var(--site-panel); border-color: var(--site-border); color: var(--site-text);
  box-shadow: 0 8px 24px #140f0b0d;
}
body[data-site-theme="halloween"] .home-feature-card--points { background: #2e1f37; border-color: #745388; }
body[data-site-theme="halloween"] .home-feature-card--custom { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] .home-feature-card--community { background: #1f3722; border-color: #489352; }
body[data-site-theme="halloween"] :is(.home-feature-card h3, .home-point-scale, .home-feature-meta,
  .home-feature-card .home-inline-link, .home-section-head h2, .home-notice-text,
  .profile-wardrobe-card strong, .mypage-title-copy strong, .mypage-collapsible-title,
  .mypage-emoji-pack-copy strong, .shop-treasure-count strong, .example-header,
  .turtle-runtime-title, .turtle-input-prompt) { color: var(--site-text); }
body[data-site-theme="halloween"] :is(.home-feature-card p, .home-section-meta, .home-notice-subhead,
  .home-notice-date, .home-empty-text, .home-attendance-streak, .profile-wardrobe-card small,
  .profile-preview-note, .mypage-subtle, .mypage-title-copy small, .mypage-title-current,
  .mypage-title-progress-head, .mypage-emoji-pack-copy small, .shop-treasure-count small,
  .turtle-runtime-status, .turtle-speed-label) { color: var(--site-muted); }
body[data-site-theme="halloween"] :is(.home-notice-archive-summary, .mypage-count-chip, .mypage-title-toggle-label,
  .mypage-title-filters button, .home-btn-secondary, .home-btn-student-page, .home-btn-game,
  .turtle-display-button, .turtle-speed-button, .turtle-speed-value) {
  background: #2e1f37; color: #f4b27b; border-color: #745388;
}
body[data-site-theme="halloween"] :is(.home-hero-actions .btn, .purchase-btn:not(:disabled),
  .home-ai-contest-reward-button, .shop-treasure-open-close) {
  background: #f4ac71; color: #211528; border-color: #886b53;
}
body[data-site-theme="halloween"] :is(.home-hero-actions .btn, .purchase-btn):disabled,
body[data-site-theme="halloween"] .home-ai-contest-reward-button:is(.is-disabled, .is-claimed),
body[data-site-theme="halloween"] .profile-wardrobe-card button:disabled {
  background: #2e1f37; color: #bda2cd; border-color: #745388; opacity: 1;
  box-shadow: none;
}
body[data-site-theme="halloween"] :is(.profile-wardrobe-card.is-equipped, .mypage-title-option.is-selected,
  .mypage-emoji-pack-option.is-selected) { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] .mypage-title-option.is-locked { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] :is(.mypage-title-progress, .mypage-title-progress-track) { background: #2e1f37; }
body[data-site-theme="halloween"] :is(.profile-wardrobe-card form, .mypage-title-form, .mypage-emoji-pack-form) { background: transparent; }


body[data-site-theme="halloween"] .home-ai-contest-results {
  background: linear-gradient(125deg, #2e1f37, #211627 55%, #211627);
  color: var(--site-text); border-color: #745388; box-shadow: 0 12px 30px #140f0b14;
}
body[data-site-theme="halloween"] .home-ai-contest-winner {
  background: #211627; border-color: #745388; box-shadow: 0 6px 18px #140f0b12;
}
body[data-site-theme="halloween"] :is(.home-ai-contest-results-copy h2, .home-ai-contest-winner h3,
  .home-ai-contest-winner-total, .home-ai-contest-winner-detail dd) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.home-ai-contest-results-kicker, .home-ai-contest-results-copy p,
  .home-ai-contest-results-footer, .home-ai-contest-winner-gap, .home-ai-contest-winner-detail dt,
  .home-ai-contest-reward-copy span, .home-ai-contest-participants summary,
  .home-ai-contest-participants summary small, .home-ai-contest-participant-list li,
  .home-ai-contest-participant-list time) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.home-ai-contest-reward-row, .home-ai-contest-participant-list li) { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] :is(.home-ai-contest-reward-copy strong, .home-ai-contest-winner-rank,
  .home-ai-contest-participant-list strong, .home-ai-contest-participant-rank) { color: #f4b27b; }
body[data-site-theme="halloween"] .home-ai-contest-winner-detail { border-color: #745388; }


body[data-site-theme="halloween"] .home-ranking-panel.home-ranking-panel--tabs { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] .home-ranking-panel.home-ranking-panel--tabs.is-points-active { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] .home-ranking-panel--tabs::before,
body[data-site-theme="halloween"] .home-ranking-panel--tabs::after { opacity: .12; }
body[data-site-theme="halloween"] :is(.home-ranking-hero, .home-ranking-tab, .home-ranking-table thead) { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] .home-ranking-panel .home-ranking-tab.is-active { background: #2e1f37; border-color: #745388; }
body[data-site-theme="halloween"] .home-ranking-panel :is(h2, .home-ranking-hero-name, .home-ranking-hero-score strong,
  .home-rank-user, .home-rank-score strong, .home-ranking-tab-title, .home-ranking-table th,
  .home-rank-comment-text) { color: #bda2cd; }
body[data-site-theme="halloween"] .home-ranking-panel :is(.home-ranking-copy, .home-ranking-tab-meta,
  .home-ranking-hero-copy, .home-ranking-hero-kicker, .home-ranking-hero-score span,
  .home-rank-score span, .home-rank-comment-empty, .home-rank-comment-lock-text) { color: #bda2cd; }
body[data-site-theme="halloween"] .home-ranking-table :is(td, th) { border-color: #745388; }
body[data-site-theme="halloween"] .home-ranking-table tbody tr { background: #211627; }
body[data-site-theme="halloween"] .home-ranking-table tbody tr:hover { background: #211627; }


body[data-site-theme="halloween"] [data-emoji-pack-theme] {
  --pack-card-from: #745388; --pack-card-to: #745388;
  background: linear-gradient(135deg, rgba(var(--pack-accent-rgb), .24), #211627);
  border-color: #745388; box-shadow: 0 8px 24px #140f0b0d;
}
body[data-site-theme="halloween"] .shop-item :is(.item-image-container, .exchange-image-container) {
  background: radial-gradient(ellipse at center, #211627, #211627); box-shadow: none; border-color: #745388;
}
body[data-site-theme="halloween"] .shop-item.is-premium-profile .item-image-container { background: radial-gradient(ellipse at center, #2e1f37, #2e1f37); }
body[data-site-theme="halloween"] .problem-list-page .problem-progress-card {
  --problem-progress-surface: linear-gradient(115deg, #302039, #211a2b);
  --problem-progress-border: #705678;
  --problem-progress-kicker-color: #ffbf75;
  --problem-progress-title-color: #fff3df;
  --problem-progress-copy-color: #d3c1d9;
  --problem-progress-percent-color: #ffbf75;
  --problem-progress-stats-color: #fff3df;
  --problem-progress-badge-bg: #211a2b;
  --problem-progress-badge-border: #705678;
  --problem-progress-badge-shadow: rgba(0, 0, 0, .2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
body[data-site-theme="halloween"] .problem-progress-track { background: #2e1f37; }
body[data-site-theme="halloween"] .problem-reward-preview { background: linear-gradient(115deg, #2e1f37, #211627); border-color: #745388; box-shadow: 0 8px 24px #140f0b12; }
body[data-site-theme="halloween"] .problem-reward-preview :is(.problem-reward-preview-kicker,
  .problem-reward-preview-points, .problem-reward-preview-copy, .problem-reward-preview-pill) { color: #f7c296; }
body[data-site-theme="halloween"] .problem-reward-preview-pill { background: #2e1f37; border-color: #745388; }
body[data-site-theme="halloween"] .problem-reward-preview.is-solved { background: #1f3728; border-color: #489362; }
body[data-site-theme="halloween"] :is(.example-content, .turtle-runtime-header, .turtle-runtime-footer,
  .turtle-console-output, .home-rank-comment-input) { background: #211627; color: #cbb6d7; border-color: #745388; }
body[data-site-theme="halloween"] > footer { background: #211627; border-color: #745388; color: #bda2cd; }


body[data-site-theme="halloween"] :is(.mypage-current-card h4, .home-ai-contest-winner-rank span,
  .home-ai-contest-results-badge) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.mypage-current-card p, .mypage-eyebrow, .mypage-overview-tile small,
  .profile-progressive-price, .shop-item.is-premium-profile .item-price small) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.mypage-quick-links a, .home-ranking-tabs, .home-ranking-hero-rank,
  .home-ai-contest-winner-crown) { background: #2e1f37; border-color: #745388; color: #bda2cd; box-shadow: none; }
body[data-site-theme="halloween"] .home-rank-badge:not(.is-first):not(.is-second):not(.is-third) { color: #bda2cd; }
body[data-site-theme="halloween"] .user-section .btn { background: #2e1f37; color: #f4b27b; border-color: #745388; }
body[data-site-theme="halloween"] :is(.shop-purchase-confirm-card, .shop-notice-card) { background: #211627; color: #cbb6d7; border-color: #745388; box-shadow: 0 18px 50px #140f0b30; }
body[data-site-theme="halloween"] :is(.shop-purchase-confirm-card, .shop-notice-card) :is(strong, p, small) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.shop-purchase-confirm-button--accept, .shop-notice-close) { background: #f4ac71; color: #211528; border-color: #886b53; }
body[data-site-theme="halloween"] .shop-purchase-confirm-button--cancel { background: #2e1f37; color: #f4b27b; border-color: #745388; }

body[data-site-theme="halloween"] .level-links [data-level-key] { color: var(--light-level-ink, #bda2cd) !important; }
body[data-site-theme="halloween"] [data-level-key="beginner"] { --light-level-ink: #489369; }
body[data-site-theme="halloween"] [data-level-key="bronze"] { --light-level-ink: #886b53; }
body[data-site-theme="halloween"] [data-level-key="silver"] { --light-level-ink: #745388; }
body[data-site-theme="halloween"] [data-level-key="gold"] { --light-level-ink: #886b53; }
body[data-site-theme="halloween"] [data-level-key="diamond"] { --light-level-ink: #886b53; }
body[data-site-theme="halloween"] [data-level-key="master"] { --light-level-ink: #935248; }
body[data-site-theme="halloween"] [data-level-key="turtle"] { --light-level-ink: #739348; }
body[data-site-theme="halloween"] [data-level-key="olympiad"] { --light-level-ink: #886b53; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-beginner { color: #9cd3b5; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-bronze { color: #f4b27b; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-silver { color: #bda2cd; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-gold { color: #f4b27b; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-diamond { color: #f4b27b; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-master { color: #d3a49c; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-turtle { color: #bcd39c; }
body[data-site-theme="halloween"] .problem-list-page .post-info .level-olympiad { color: #f4b27b; }
body[data-site-theme="halloween"] .problem-list-page :is(.post-date, .solved-at, .problem-jump-unit,
  .problem-jump-form label, .problem-jump-form button, .problem-jump-form input,
  .level-links .homework-only-link) { color: #bda2cd; }
body[data-site-theme="halloween"] .problem-jump-form input { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] .problem-detail-refresh :is(.example-header h4, #execution-result h4) { color: #cbb6d7; }
body[data-site-theme="halloween"] .problem-detail-refresh .copy-link { color: #f4b27b; }
body[data-site-theme="halloween"] .problem-detail-refresh :is(.problem-reward-preview, .example-item) { box-shadow: 0 8px 24px #140f0b0d; }
body[data-site-theme="halloween"] .problem-detail-refresh .problem-reward-preview:not(.is-solved):not(.is-homework-pending) { animation-name: lightRewardGlow; }
body[data-site-theme="halloween"] .problem-detail-refresh .problem-reward-preview.is-homework-pending { background: #211627; border-color: #745388; }
body[data-site-theme="halloween"] .problem-detail-refresh .problem-reward-preview:is(.is-solved, .is-homework-pending) :is(.problem-reward-preview-kicker, .problem-reward-preview-points, .problem-reward-preview-copy) { color: #bda2cd; text-shadow: none; }
@keyframes lightRewardGlow {
  0%, 100% { box-shadow: 0 6px 20px #140f0b0a; }
  50% { box-shadow: 0 8px 24px #140f0b20; }
}
body[data-site-theme="halloween"] :is(#execution-result, #execution-output, .execution-error-translation) { background: #211627; color: #cbb6d7; border-color: #745388; }
body[data-site-theme="halloween"] #history-slider { background: #211627 !important; color: #cbb6d7 !important; border-color: #745388 !important; }
body[data-site-theme="halloween"] .submit-button-container .btn:not(.btn-danger) { background: #2e1f37; color: #f4b27b; border-color: #745388; }
body[data-site-theme="halloween"] .submit-button-container .submit-btn { background: #f4ac71; color: #211528; border-color: #886b53; }
body[data-site-theme="halloween"] :is(.mypage-list-item, .mypage-account-info) { background: #211627; color: #cbb6d7; border-color: #745388; }
body[data-site-theme="halloween"] :is(.mypage-empty, .mypage-list-item strong, .mypage-item-link) { color: #bda2cd; }


body[data-site-theme="halloween"] .problem-detail-refresh {
  background: #211627;
  border-color: #745388;
  color: #cbb6d7;
  box-shadow: 0 16px 42px rgba(141, 95, 32, .1);
}
body[data-site-theme="halloween"] .problem-detail-refresh hr {
  height: 2px;
  border: 0 !important;
  background: #2e1f37 !important;
  opacity: 1;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .problem-description, .example-section, .example-item, .code-submit,
  .solved-info, .peer-solutions, .solved-students-container
) {
  background: #211627;
  border-color: #745388;
  color: #cbb6d7;
}
body[data-site-theme="halloween"] .problem-detail-refresh .problem-description {
  color: #cbb6d7;
}

body[data-site-theme="halloween"] .problem-detail-refresh .problem-description :is(h1, h2, h3, h4, h5, h6),
body[data-site-theme="halloween"] .problem-detail-refresh .problem-description :is(h1, h2, h3, h4, h5, h6) *,
body[data-site-theme="halloween"] .problem-detail-refresh .example-header h4,
body[data-site-theme="halloween"] .problem-detail-refresh #execution-result h4 {
  color: #c8b2d5 !important;
  font-weight: 800;
  opacity: 1;
  text-shadow: none;
}
body[data-site-theme="halloween"] .problem-detail-refresh .example-content {
  background: #211627;
  color: #d0bddc;
  border-color: #745388;
}
body[data-site-theme="halloween"] .problem-detail-refresh .problem-description :is(pre, code) {
  background: #2e1f37 !important;
  color: #c7b1d5 !important;
  border-color: #745388 !important;
  text-shadow: none !important;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .problem-title, .example-header h4, .solved-info h4, .peer-solutions h4,
  .solved-students-container h4, .student-name
) {
  color: #cbb6d7;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .text-muted, .solved-time, .editor-comment-status, .error-translation-cost,
  #auto-save-status, #slide-indicator, [id^="rev-indicator-"]
) {
  color: #bda2cd !important;
  opacity: 1;
}
body[data-site-theme="halloween"] .problem-detail-refresh .submit-button-container {
  box-sizing: border-box;
  width: 100%;
  padding: 8px;
  border: 1px solid #745388;
  border-radius: 11px;
  background: #211627 !important;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(.peer-list, .student-code) {
  background: #211627 !important;
  border-color: #745388 !important;
  color: #cbb6d7;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(.peer-item, .student-item) {
  border-bottom-color: #745388 !important;
}
body[data-site-theme="halloween"] .problem-detail-refresh .student-header:hover {
  background: #2e1f37;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(.code-block, .peer-solutions pre, .peer-solutions code) {
  color: #cbb6d7;
}


body[data-site-theme="halloween"] .problem-detail-refresh :is(.turtle-goal-panel, .turtle-runtime) {
  background: #211627;
  border-color: #745388;
  color: #cbb6d7;
  box-shadow: 0 12px 30px rgba(141, 95, 32, .08);
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-runtime:fullscreen {
  background: #211627;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(.turtle-runtime-header, .turtle-runtime-footer) {
  background: #2e1f37;
  border-color: #745388;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .turtle-goal-panel h2, .turtle-goal-panel p, .turtle-runtime-title strong,
  .turtle-example-runtime .turtle-runtime-title strong
) {
  color: #bea3ce;
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-runtime-title small {
  color: #bda2cd;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(.turtle-speed-control, .turtle-example-runtime .turtle-speed-control) {
  background: #2e1f37;
  border-color: #745388;
  color: #bda2cd;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .turtle-speed-label, .turtle-speed-value, .turtle-example-runtime .turtle-speed-value,
  .turtle-runtime-status
) {
  color: #bda2cd;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .turtle-speed-button, .turtle-example-runtime .turtle-speed-button,
  .turtle-display-button
) {
  background: #2e1f37;
  border-color: #745388;
  color: #f4b27b;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .turtle-speed-button, .turtle-example-runtime .turtle-speed-button,
  .turtle-display-button
):hover:not(:disabled) {
  background: #2e1f37;
  border-color: #745388;
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-input-overlay {
  background: rgba(91, 73, 48, .38);
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-input-card {
  background: #211627;
  border-color: #745388;
  color: #cbb6d7;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(.turtle-input-kicker, .turtle-input-prompt) {
  color: #f4b27b;
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-input-field {
  background: #211627;
  border-color: #745388;
  color: #cbb6d7;
  caret-color: #f4b27b;
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-input-button:not(.is-confirm) {
  background: #2e1f37;
  border-color: #745388;
  color: #f4b27b;
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-input-button.is-confirm {
  background: #f4ac71;
  border-color: #886b53;
  color: #211528;
}
body[data-site-theme="halloween"] .problem-detail-refresh .turtle-editor-guide h2 {
  color: #bda2cd;
  text-shadow: none;
}


body[data-site-theme="halloween"] .problem-detail-refresh :is(#history-slider, .history-slider) {
  background: #211627 !important;
  color: #cbb6d7 !important;
  border-color: #745388 !important;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(#history-slider, .history-slider) input[type="range"] {
  background: linear-gradient(180deg, #2e1f37, #2e1f37);
  box-shadow: inset 1px 1px 3px rgba(118, 84, 38, .18);
}
body[data-site-theme="halloween"] .problem-detail-refresh .teacher-chat-modal,
body[data-site-theme="halloween"] .problem-detail-refresh #problem-question-rooms-modal {
  background: #211627 !important;
  color: #cbb6d7 !important;
  border-color: #745388 !important;
  box-shadow: 0 20px 48px rgba(91, 67, 35, .22);
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .teacher-chat-header, .teacher-chat-form, .teacher-chat-messages,
  .teacher-chat-history-panel, #problem-question-rooms-summary,
  #problem-question-rooms-list
) {
  background: #211627 !important;
  color: #cbb6d7 !important;
  border-color: #745388 !important;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .teacher-chat-form textarea, .teacher-chat-history-code
) {
  background: #211627;
  color: #cbb6d7;
  border-color: #745388;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .teacher-chat-history-meta, .teacher-chat-history-indicator,
  #problem-question-rooms-summary
) {
  color: #bda2cd !important;
}
body[data-site-theme="halloween"] .problem-detail-refresh #problem-question-rooms-list > button {
  background: #211627 !important;
  color: #cbb6d7 !important;
  border-color: #745388 !important;
}
body[data-site-theme="halloween"] .problem-detail-refresh :is(
  .teacher-chat-fab, .teacher-question-fab, .teacher-chat-close-btn,
  .teacher-chat-send-btn
) {
  background: #f4ac71;
  color: #211528;
  border-color: #886b53;
}
body[data-site-theme="halloween"] .problem-detail-refresh .teacher-chat-history-toggle {
  background: #2e1f37;
  color: #f4b27b;
  border-color: #745388;
}
body[data-site-theme="halloween"] .problem-detail-refresh .teacher-chat-history-toggle[aria-pressed="true"] {
  background: #f4ac71;
  color: #211528;
  border-color: #886b53;
}


body[data-site-theme="halloween"] .problem-list-page .board-item:is(.solved-problem, .student-solved-problem) {
  background: #1f372a;
  border-color: #745388;
  box-shadow: inset 4px 0 0 #0b140f;
}
body[data-site-theme="halloween"] .problem-list-page .board-item:is(.solved-problem, .student-solved-problem):hover {
  background: #1f3729;
  border-color: #489366;
}
body[data-site-theme="halloween"] .problem-list-page .board-item:is(.solved-problem, .student-solved-problem) :is(.post-title, .problem-title-text:not(.level-event), .solved-by-student) {
  color: #a7d7bb;
}
body[data-site-theme="halloween"] .problem-list-page .board-item:is(.solved-problem, .student-solved-problem):hover .problem-title-text:not(.level-event) {
  color: #bce1cb;
}
body[data-site-theme="halloween"] .problem-list-page .board-item:is(.solved-problem, .student-solved-problem) .solved-at {
  color: #a7d7bb;
}


body[data-site-theme="halloween"] .post-list-page .post-board-item.is-boosted {
  background: linear-gradient(110deg, #2e1f37, #211627);
  border-color: #745388;
  box-shadow: inset 4px 0 0 #140f0b, 0 6px 18px #100b1414;
  animation-name: lightBoostPulse;
}
body[data-site-theme="halloween"] .post-list-page .post-board-item.is-boosted:hover {
  background: linear-gradient(110deg, #2e1f37, #2e1f37);
}
body[data-site-theme="halloween"] .post-list-page .post-board-item.is-boosted::after {
  background: linear-gradient(115deg, transparent, #2e1f371a, transparent);
  mix-blend-mode: normal;
}
body[data-site-theme="halloween"] .post-list-page .post-board-item.is-boosted .post-title-link,
body[data-site-theme="halloween"] .post-list-page .post-board-item.is-boosted .post-board-item-link:hover .post-title-link {
  color: #f5b580;
  text-shadow: none;
}
body[data-site-theme="halloween"] .post-list-page .post-board-item.is-boosted :is(.post-meta-chip, .post-comments, .post-boost-chip) {
  background: #211627;
  border-color: #745388;
  color: #bda2cd;
  box-shadow: none;
}
body[data-site-theme="halloween"] .post-list-page .post-boost-badge {
  background: #f4ac71;
  border-color: #886b53;
  color: #211528;
  box-shadow: none;
}
@keyframes lightBoostPulse {
  0%, 100% { box-shadow: inset 4px 0 0 #140f0b, 0 6px 18px #100b1414; }
  50% { box-shadow: inset 4px 0 0 #140f0b, 0 8px 24px #100b1426; }
}


body[data-site-theme="halloween"] .submit-result-page {
  color: #cbb6d7;
  background: transparent;
}
body[data-site-theme="halloween"] .submit-result-page :is(.result-card, .result-body, .submit-flow-modal) {
  background: #211627;
  color: #cbb6d7;
  border-color: #745388;
  box-shadow: 0 12px 32px #140f0b14;
}
body[data-site-theme="halloween"] .submit-result-page .result-header {
  background: #211627;
  border-color: #745388;
}
body[data-site-theme="halloween"] .submit-result-page :is(
  .result-header h2, .result-section h4, .submit-flow-title,
  .judge-progress-status, .submit-flow-progress-copy strong, .reward-summary-copy h3
) { color: #c8b2d5; }
body[data-site-theme="halloween"] .submit-result-page :is(
  .test-case-container, .judge-progress-card, .submit-flow-progress-card,
  .submit-flow-message-card, .reward-summary-card
) {
  background: #211627;
  color: #cbb6d7;
  border-color: #745388;
  box-shadow: 0 6px 18px #140f0b0d;
}
body[data-site-theme="halloween"] .submit-result-page .test-case-container:hover { background: #2e1f37; }
body[data-site-theme="halloween"] .submit-result-page :is(.judge-progress-card[data-state="success"], .test-case-container.case-pass) {
  background: #1f3724;
  border-color: #745388;
  color: #a7d7b9;
}
body[data-site-theme="halloween"] .submit-result-page :is(.judge-progress-card[data-state="fail"], .judge-progress-card[data-state="error"], .test-case-container.case-fail) {
  background: #271616;
  border-color: #745388;
  color: #f4b27b;
}
body[data-site-theme="halloween"] .submit-result-page :is(
  .judge-progress-detail, .no-results, .submit-flow-progress-copy span,
  .reward-summary-description, .reward-summary-label, .reward-summary-footer
) { color: #bda2cd; }
body[data-site-theme="halloween"] .submit-result-page :is(.judge-progress-percent, .submit-flow-progress-value, .reward-summary-value) { color: #f4b27b; }
body[data-site-theme="halloween"] .submit-result-page .judge-progress-card[data-state="success"] .judge-progress-percent { color: #a1d5b3; }
body[data-site-theme="halloween"] .submit-result-page :is(.judge-progress-card[data-state="fail"], .judge-progress-card[data-state="error"]) .judge-progress-percent { color: #f4b27b; }
body[data-site-theme="halloween"] .submit-result-page :is(.judge-progress-track, .submit-flow-progress-track) {
  background: #2e1f37;
  box-shadow: none;
}
body[data-site-theme="halloween"] .submit-result-page :is(.submit-flow-step-kicker, .reward-summary-kicker, .reward-summary-badge, .reward-summary-row) {
  background: #2e1f37;
  color: #bda2cd;
  border-color: #745388;
}
body[data-site-theme="halloween"] .submit-result-page .submit-flow-promotion {
  background: #2e1f37;
  color: #f4b27b;
  border-color: #745388;
}
body[data-site-theme="halloween"] .submit-result-page .back-button { background: #f4ac71; color: #211528; border-color: #886b53; }
body[data-site-theme="halloween"] .submit-result-page .back-button:hover { background: #f4ac71; }
body[data-site-theme="halloween"] .submit-result-page .submit-flow-backdrop { background: rgba(83, 67, 44, .38); }

@media (max-width: 600px) {
  body[data-site-theme="halloween"] .site-nav-inner .nav-links { width: 100%; margin: 0; padding: 0; justify-content: flex-start; flex-direction: row; }
  body[data-site-theme="halloween"] .site-nav-inner .nav-links li { width: auto; }
  body[data-site-theme="halloween"] .site-user-tools { max-width: 100%; flex-wrap: wrap; min-width: 0; }
  body[data-site-theme="halloween"] .user-section { max-width: 100%; min-width: 0; flex-wrap: wrap; white-space: normal; }
  body[data-site-theme="halloween"] .user-section p { overflow-wrap: anywhere; }
}


body[data-site-theme="halloween"] {
  --site-bg: #f7fbff;
  --site-panel: #ffffff;
  --site-inset: #f1f7ff;
  --site-border: #bbcee2;
  --site-text: #23374e;
  --site-muted: #53677c;
  --site-accent: #1d5b89;
  background: radial-gradient(ellipse at 86% 0, #2e1f37 0, transparent 40%),
              radial-gradient(ellipse at 7% 10%, #2e1f37 0, transparent 50%), #211627;
  background-attachment: fixed;
}
body[data-site-theme="halloween"] .site-header {
  background: linear-gradient(115deg, #211627, #211627 72%);
  border-top: 3px solid #886b53;
  border-bottom-color: #745388;
  box-shadow: 0 8px 24px #140f0b16;
}
body[data-site-theme="halloween"] .logo a { color: #f5b47e; font-weight: 900; }
body[data-site-theme="halloween"] .home-hero-panel,
body[data-site-theme="halloween"] .mypage-profile-card {
  background: linear-gradient(120deg, #211627, #211627 68%, #211627);
  border: 1px solid #745388;
}
body[data-site-theme="halloween"] :is(.shop-item[data-shop-category="editor"], .editor-theme-choice) {
  box-shadow: 0 8px 24px #140f0b14;
}
body[data-site-theme="halloween"] .post-list-page .post-login-guide { color: #bda2cd; }
body[data-site-theme="halloween"] .post-list-page .post-login-guide a { color: #f4b27b; }
body[data-site-theme="halloween"] :is(input, textarea, select):not(.CodeMirror textarea) {
  accent-color: #f4b27b;
}
body[data-site-theme="halloween"] :is(input, textarea, select)::placeholder {
  color: #bda2cd;
  opacity: 1;
}
body[data-site-theme="halloween"] :is(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid #886b53;
  outline-offset: 2px;
}
body[data-site-theme="halloween"] .scratch-page :is(.scratch-card, .scratch-author-workspace, .scratch-upload-options, .scratch-editor-shell, .scratch-history) {
  background: #211627;
  color: #cbb6d7;
  border-color: #745388;
}
body[data-site-theme="halloween"] .scratch-page .scratch-language-control select,
body[data-site-theme="halloween"] .scratch-page input:not([type="file"]),
body[data-site-theme="halloween"] .scratch-page textarea {
  background: #211627;
  color: #cbb6d7;
  border-color: #745388;
}
body[data-site-theme="halloween"] .scratch-page .scratch-reward-unlock button {
  background: #f4ac71;
  color: #211528;
  border-color: #886b53;
}
body[data-site-theme="halloween"] .scratch-page .scratch-delete-link { color: #d39ca8 !important; }
body[data-site-theme="halloween"] .scratch-page :is(.scratch-work-header p, .scratch-author-step small, .scratch-author-project > p) {
  color: #bda2cd;
}

body[data-site-theme="halloween"] :is(.login-panel, .signup-panel, .pw-panel, .pw-done-panel) {
  background: linear-gradient(135deg, #211627, #211627);
  color: #cbb6d7;
  border: 1px solid #745388;
  box-shadow: 0 18px 38px #140f0b18;
}
body[data-site-theme="halloween"] :is(.login-title, .signup-title, .pw-title, .pw-done-title,
  .login-field label, .signup-field label, .pw-field label) { color: #cbb6d7; }
body[data-site-theme="halloween"] :is(.login-desc, .signup-desc, .pw-desc, .pw-done-desc,
  .signup-text-modern, .login-text-modern) { color: #bda2cd; }
body[data-site-theme="halloween"] :is(.login-kicker, .signup-kicker, .pw-kicker, .pw-done-kicker,
  .signup-link-modern, .login-link-modern) { color: #f4b27b; }
body[data-site-theme="halloween"] :is(.login-field, .signup-field, .pw-field) {
  background: #211627; border-color: #745388;
}
body[data-site-theme="halloween"] :is(.login-form-modern, .signup-form-modern, .pw-form-modern) {
  background: transparent; box-shadow: none;
}
body[data-site-theme="halloween"] :is(.login-input, .signup-form-modern input, .signup-form-modern select, .pw-input) {
  background: #211627; color: #cbb6d7; border-color: #745388;
}
body[data-site-theme="halloween"] :is(.btn-login-modern, .btn-signup-modern, .pw-btn-primary, .pw-done-btn-primary) {
  background: #f4ac71; color: #211528; border-color: #886b53;
}
body[data-site-theme="halloween"] :is(.pw-btn-subtle, .pw-done-btn-subtle) {
  background: #2e1f37; color: #f4b27b; border-color: #745388;
}
body[data-site-theme="halloween"] :is(.login-error-box, .signup-error-box, .pw-error-box) {
  background: #271617; color: #d39ca9; border-color: #934857;
}
@media (prefers-reduced-motion: reduce) {
  body[data-site-theme="halloween"] :is(.shop-item, .home-hero-panel, .post-board-item) { animation: none; transition: none; }
}

/* Core palette and Halloween identity. */
body[data-site-theme="halloween"] {
 --site-bg:#17121f; --site-panel:#282032; --site-inset:#211a2b;
 --site-border:#705678; --site-text:#fff3df; --site-muted:#d3c1d9; --site-accent:#ffbf75;
 color-scheme:dark;
 background:radial-gradient(ellipse at 88% 0, #4a2940 0, transparent 45%), radial-gradient(ellipse at 5% 8%, #352149 0, transparent 50%), #17121f;
 background-attachment:fixed;
}
body[data-site-theme="halloween"] .site-header { background:linear-gradient(115deg,#30203f,#211a2b); border-top:3px solid #ffad55; }
body[data-site-theme="halloween"] .logo a { color:#ffbf75; }
body[data-site-theme="halloween"] :is(.home-hero-panel,.mypage-profile-card) { background:linear-gradient(120deg,#362342,#282032); }
body[data-site-theme="halloween"] :is(input,textarea,select)::placeholder { color:#bfaec8; opacity:1; }
body[data-site-theme="halloween"] :is(a,button,input,textarea,select,summary):focus-visible { outline:3px solid #ffbf75; outline-offset:3px; }
body[data-site-theme="halloween"] :is(.mypage-btn-primary,.post-write-btn,.comment-submit-btn,.btn-login-modern,.btn-signup-modern,.pw-btn-primary,.pw-done-btn-primary,[data-shop-category="editor"] .purchase-btn:not(:disabled)) { background:#ffbf75; color:#281628; border-color:#ffbf75; }
body[data-site-theme="halloween"] :is(.mypage-btn-primary,.post-write-btn,.comment-submit-btn,[data-shop-category="editor"] .purchase-btn:not(:disabled)):hover { background:#ffd39b; }
body[data-site-theme="halloween"] :is(.shop-category-tab.is-active,.mypage-navigation a[aria-selected="true"],.editor-theme-choice.is-selected) { background:#47303b; border-color:#ffbf75; color:#ffe0b5; }
body[data-site-theme="halloween"] :is(.site-user-name-link,.site-user-points,.section-title) { color:#ffbf75; }
body[data-site-theme="halloween"] :is(.problem-list-page .board-item.solved-problem:not(.student-solved-problem) .problem-title-text,.problem-list-page .board-item.solved-problem:not(.student-solved-problem) .post-title) { color:#a8efba; }
body[data-site-theme="halloween"] .problem-list-page .board-item.student-solved-problem { background:#193a30; border-color:#71c695; }
body[data-site-theme="halloween"] .problem-list-page .board-item.student-solved-problem :is(.problem-title-text,.post-title) { color:#b5f3c9; }
body[data-site-theme="halloween"] :is(.post-action-delete,.scratch-page .scratch-delete-link) { color:#ffb3b8 !important; }
body[data-site-theme="halloween"] .shop-item[data-shop-category="editor"]:has(.cm-s-hm-halloween) { border-color:#ffbf75; background:linear-gradient(145deg,#382443,#241a2e); }
body[data-site-theme="halloween"] .shop-item:has(.cm-s-hm-halloween) .item-name::before { content:"🎃 "; }
body[data-site-theme="halloween"] .scratch-page :is(.scratch-title,.scratch-heading,.scratch-work-header h2) { color:#fff3df; }
/* Keep calendar navigation and attendance legible in every date state. */
body[data-site-theme="halloween"] .home-attendance-calendar-nav-link { background:#46304e; color:#fff3df; border-color:#b08cba; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell.is-attended { border-color:#e9b864; box-shadow:inset 0 0 0 1px #e9b864; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell.is-student-birthday:not(.is-special-birthday) { background:#302439; }
body[data-site-theme="halloween"] .home-attendance-calendar-cell.is-student-birthday .home-attendance-calendar-day { color:#fff3df; }
body[data-site-theme="halloween"] :is(.flash-message--error,.login-error-box,.signup-error-box,.pw-error-box) { background:#3d202d; color:#ffb7bd; border-color:#b76a7c; }
body[data-site-theme="halloween"] .submit-result-page :is(.judge-progress-card[data-state="fail"],.judge-progress-card[data-state="error"],.test-case-container.case-fail) { background:#3d202d; color:#ffb7bd; border-color:#b76a7c; }
body[data-site-theme="halloween"] .submit-result-page :is(.judge-progress-card[data-state="fail"],.judge-progress-card[data-state="error"]) .judge-progress-percent { color:#ffb7bd; }
/* Scratch uses the same heading, tool strip and result overlay as coding pages. */
body[data-site-theme="halloween"] #scratch-workspace .scratch-problem-header { padding:16px 18px 4px; border:1px solid var(--site-border); border-radius:14px; background:linear-gradient(115deg,#362342,#282032); }
body[data-site-theme="halloween"] #scratch-workspace .scratch-problem-header .problem-title { color:var(--site-text); text-shadow:none; }
body[data-site-theme="halloween"] #scratch-workspace .difficulty-badge.difficulty-scratch { background:#47303b; color:#ffe0b5; border-color:#be8b55; }
body[data-site-theme="halloween"] #scratch-workspace :is(.scratch-description,.scratch-editor-shell,.scratch-work-header,.scratch-work-controls) { background:var(--site-inset); color:var(--site-text); border-color:var(--site-border); }
body[data-site-theme="halloween"] #scratch-workspace .scratch-work-header { border:1px solid var(--site-border); border-radius:10px; padding:12px 14px; }
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh) .submit-flow-modal { background:var(--site-panel); color:var(--site-text); border-color:var(--site-border); }
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh) :is(.submit-flow-progress-card,.submit-flow-message-card,.reward-summary-card,.reward-summary-row,.reward-summary-badge,.submit-flow-step-kicker) { background:var(--site-inset); color:var(--site-text); border-color:var(--site-border); }
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh) :is(.submit-flow-title,.reward-summary-copy h3,.reward-summary-value) { color:var(--site-text); }
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh) :is(.reward-summary-label,.reward-summary-description,.reward-summary-footer) { color:var(--site-muted); }
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh) .submit-flow-modal .back-button { background:#ffbf75; color:#281628; border-color:#ffbf75; }
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh) .reward-summary-row.is-curse,
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh) .reward-summary-badge.is-curse { background:#39234e; color:#e5baff; border-color:#ba83db; }
/* Account/student forms, menus and readable file upload controls. */
body[data-site-theme="halloween"] .public-student-page { color:var(--site-text); }
body[data-site-theme="halloween"] .public-student-page :is(.public-student-hero,.public-student-card,.public-student-stats article,.public-student-cycle-group summary,.public-student-lesson-private) { background:var(--site-panel); color:var(--site-text); border-color:var(--site-border); }
body[data-site-theme="halloween"] .public-student-page :is(header,form) { background:transparent; box-shadow:none; }
body[data-site-theme="halloween"] .scratch-page input[type="file"] { background:var(--site-inset); color:var(--site-text); border:1px solid var(--site-border); border-radius:8px; }
body[data-site-theme="halloween"] .scratch-page input::file-selector-button { background:#47303b; color:#ffe0b5; border:1px solid #be8b55; border-radius:6px; padding:6px 10px; }
body[data-site-theme="halloween"] #notification-list { background:var(--site-panel); color:var(--site-text); border-color:var(--site-border); }
body[data-site-theme="halloween"] .logo a::before { content:"🎃 "; }
@media (max-width:600px) {
 body[data-site-theme="halloween"] .user-section p { display:flex; flex-wrap:wrap; gap:8px; min-width:0; max-width:100%; }
 body[data-site-theme="halloween"] .site-user-name-link { min-width:0; overflow-wrap:anywhere; }
 body[data-site-theme="halloween"] .site-header .logo a { font-size:18px; white-space:normal; line-height:1.5; }
 body[data-site-theme="halloween"] .online-students-panel { left:auto; right:0; max-width:calc(100vw - 32px); }
}
body[data-site-theme="halloween"] :is(.scratch-page,.problem-detail-refresh,.submit-result-page) .reward-summary-row.is-curse :is(.reward-summary-label,.reward-summary-value) { color:#e5baff; }
/* Preview is an outline action; buying keeps the solid pumpkin button. */
body[data-site-theme="halloween"] [data-shop-category="editor"] .purchase-btn.editor-theme-preview-btn:not(:disabled) { background:transparent; color:#ffbf75; border:1px solid #ffbf75; }
body[data-site-theme="halloween"] [data-shop-category="editor"] .purchase-btn.editor-theme-preview-btn:not(:disabled):hover { background:#47303b; color:#ffe0b5; }

/* Scratcher identity uses the Halloween palette, including its weekly homework. */
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher {
  --student-accent: var(--site-accent);
  --student-accent-deep: var(--site-accent);
  --student-soft: #3b2b38;
  --student-border: var(--site-border);
  --student-ink: #281628;
  --student-paper: var(--site-panel);
  --student-paper-soft: var(--site-inset);
  --student-text: var(--site-text);
  --student-muted: var(--site-muted);
  background: transparent;
}
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-hero,.public-student-card,.public-student-stats article) {
  background: var(--site-panel);
  border-color: var(--site-border);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher .public-student-hero {
  background: linear-gradient(115deg,#362342,var(--site-panel));
}
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-records li,.public-student-lesson-list li,.public-student-selected-lessons,.public-student-selected-lessons li,.public-student-cycle-group,.public-student-calendar-day,.public-student-scratch-current,.public-student-scratch-history li) {
  background: var(--site-inset);
  border-color: var(--site-border);
}
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-scratch-current strong,.public-student-scratch-current p,.public-student-scratch-history strong) { color:var(--site-text); }
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-scratch-current small,.public-student-hero h1 span,.public-student-hero p) { color:var(--site-muted); }
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-scratch-history h3,.public-student-scratch-history span) { color:var(--site-accent); }
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-cycle-group summary,.public-student-calendar-day.has-lessons:not(.is-selected),.public-student-avatar-wrap) { background:#3b2b38; border-color:var(--site-border); }
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-btn-muted,.public-student-btn-disabled,.public-student-cycle-group summary::after) { background:var(--site-inset); color:var(--site-accent); border-color:var(--site-border); }
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher :is(.public-student-calendar-day.is-selected,.public-student-btn-primary,.public-student-cycle-group[open] summary::after) { background:var(--site-accent); color:#281628; border-color:var(--site-accent); }
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher .public-student-calendar-day.is-selected :is(span,strong) { color:#281628; }
body[data-site-theme="halloween"] .public-student-page.public-student-level-scratcher .public-student-upcoming-more-btn:hover { background:#3b2b38; }

/* Pair foreground and background so shared button rules cannot hide labels. */
body[data-site-theme="halloween"] .scratch-page .scratch-card .scratch-author-project { --project-accent:#ffbf75; }
body[data-site-theme="halloween"] .scratch-page .scratch-card .scratch-author-project[data-author-project="starter"] { --project-accent:#dbc0ff; }
body[data-site-theme="halloween"] .scratch-page .scratch-card :is(.scratch-author-project-buttons button,.scratch-author-save-actions button,[data-fullscreen]) {
  background:#30223d;
  color:#fff3df;
  border:1px solid #b995c7;
  box-shadow:0 3px 8px rgba(0,0,0,.18);
}
body[data-site-theme="halloween"] .scratch-page .scratch-card :is(button[data-new-project="example"],button[data-use-project="example"],.scratch-author-submit) {
  background:#ffbf75;
  color:#281628;
  border:1px solid #ffd39b;
}
body[data-site-theme="halloween"] .scratch-page .scratch-card :is(button[data-new-project="starter"],button[data-use-project="starter"]) {
  background:#dbc0ff;
  color:#281628;
  border:1px solid #ead9ff;
}
body[data-site-theme="halloween"] .scratch-page .scratch-author-workspace button:disabled {
  opacity:.8;
  border-style:dashed;
  box-shadow:none;
}
