.halloween-view{color:#f5efff;background:#0b0b22;min-height:85vh;border:1px solid #40265c;border-radius:20px;overflow:hidden}
.halloween-view[hidden]{display:none!important}
.hw-art{position:relative;background-position:center;background-size:cover;background-repeat:no-repeat}
.hw-cover{height:230px;background-image:linear-gradient(#0d071422,#0c061dc4),url('../halloween/banner.webp');display:flex;align-items:flex-end}
.hw-cover-title{padding:24px 20px;background:linear-gradient(0deg,#110c26ee,transparent);width:100%;text-shadow:0 3px 10px #10041e}
.hw-cover-title span{font-weight:800;letter-spacing:.3em;color:#fd9d56}.hw-cover-title h1{font-family:Georgia,serif;font-size:clamp(24px,6vw,42px);line-height:1.1;color:#ffd8a5;margin:8px 0}.hw-cover-title small{color:#e4cce5}
.hw-inner{display:grid;gap:17px;padding:14px}
/* Event clock: server deadline is an absolute Unix timestamp (timezone-safe). */
.hw-countdown{grid-column:1/-1;padding:15px 13px 13px;border:1px solid #bb7d55;
  border-radius:16px;background:radial-gradient(ellipse at 50% 0%,#6b305488,transparent 75%),linear-gradient(135deg,#291531,#15112d);
  box-shadow:inset 0 1px #ffdbab2b,0 6px 24px #06041236;text-align:center;min-width:0}
.hw-countdown-heading{display:flex;justify-content:center;align-items:center;gap:8px;color:#ffddae;
  font-size:15px;font-weight:750;margin-bottom:12px}
.hw-countdown-units{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.hw-countdown-units>div{min-width:0;border:1px solid #75486d;background:#120e29b8;border-radius:10px;padding:9px 2px 7px;display:grid;gap:4px}
.hw-countdown-units strong{font-size:clamp(20px,5vw,30px);line-height:1.2;color:#ffe5c0;font-variant-numeric:tabular-nums}
.hw-countdown-units small{font-size:11px;color:#d6bddb}
.hw-countdown-date{display:block;margin-top:11px;color:#ebc8d5;font-size:11px}
.hw-countdown.hw-countdown-ended{border-color:#6c587b;background:linear-gradient(135deg,#241a37,#131125)}
.hw-countdown.hw-countdown-ended .hw-countdown-units strong{color:#d1bbd5}
.hw-notice{border:1px solid #714682;background:#26173c;padding:10px 13px;border-radius:12px;margin:0;font-size:13px;color:#f3b37e}
.hw-counter-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hw-counter,.hw-card{background:linear-gradient(140deg,#151b39,#100d2c);border:1px solid #484078;border-radius:14px;padding:14px;box-shadow:inset 0 1px #8f5dbc20}
.hw-counter{display:grid;gap:6px}.hw-counter small,.hw-card small{color:#cab3e1}.hw-counter strong{font-size:28px;font-variant-numeric:tabular-nums;color:#ffe2ae}
.hw-card h2{color:#fff1d9;font-size:20px;margin:8px 0}.hw-card p{color:#e0cbe9;line-height:1.45;font-size:14px;margin:8px 0 12px}.hw-game>img{width:100%;height:auto;aspect-ratio:2.5;object-fit:cover;border-radius:10px;border:1px solid #6a3888}
.hw-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:10px}
.hw-actions button,.hw-rewards button,.hw-primary{border:1px solid #8544c9;background:linear-gradient(145deg,#422577,#6f2bab);border-radius:10px;color:white;font-weight:650;padding:11px 5px;cursor:pointer;min-height:42px;font-size:13px}
.hw-primary{width:100%;margin-top:12px;background:linear-gradient(120deg,#a44817,#d96a1b)}
.hw-actions button:disabled,.hw-rewards button:disabled,.hw-primary:disabled{opacity:.45;cursor:default}
.hw-king label{display:block;font-size:13px;color:#d9bbee;margin-top:10px}.hw-king select{display:block;width:100%;background:#101328;color:#f7eaff;border:1px solid #6c568f;border-radius:9px;padding:10px;margin-top:5px}
.hw-progress{height:13px;border-radius:20px;overflow:hidden;background:#423456;margin:15px 0 6px}.hw-progress span{height:100%;width:0%;display:block;background:linear-gradient(90deg,#ff9a26,#e1448f);transition:width .35s}
.hw-rewards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.hw-rewards article{display:grid;justify-items:center;align-content:start;gap:7px;background:#201638;border:1px solid #473464;border-radius:11px;padding:10px;text-align:center;min-width:0}.hw-rewards img,.hw-reward-symbol{width:100px;max-width:100%;height:100px;object-fit:contain;border-radius:9px}.hw-reward-symbol{font-size:56px;display:grid;place-content:center}.hw-rewards strong{font-size:13px}.hw-rewards small{font-size:12px}.hw-rewards button{width:100%}.hw-board{display:grid;gap:9px}.hw-board>div{display:flex;justify-content:space-between;border-bottom:1px solid #49325c;padding:6px 3px;gap:7px}.hw-board span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(min-width:640px){.hw-inner{grid-template-columns:repeat(2,1fr)}.hw-counter-row,.hw-notice,.hw-card:has(.hw-rewards),.hw-card:has(.hw-board),#hwReload{grid-column:span 2}}

.games-view #halloweenEntry[hidden]{display:none!important}

/* Halloween chapter II: fully static, decorative assets / responsive layout. */
.hw-feature-icon{font-size:48px;letter-spacing:.12em;text-align:center;background:radial-gradient(ellipse,#5b257e99,transparent 70%);padding:26px 0;color:#ffb66b;border-radius:12px}
.hw-chip-grid{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}.hw-chip-grid span{border:1px solid #814594;background:#291739;border-radius:20px;padding:8px 11px;font-size:12px;color:#f5ddf3}
.hw-artifacts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:12px}
.hw-artifacts .hw-item{background:#1d1737;border:1px solid #59416f;border-radius:10px;padding:12px 6px;text-align:center;font-size:12px;line-height:1.35;min-width:0;overflow-wrap:anywhere}
.hw-artifacts .hw-item.locked{opacity:.48;filter:grayscale(.6)}
.hw-artifacts .hw-item span{display:block;font-size:24px;margin-bottom:6px}
.hw-achievement-card .hw-artifacts{grid-template-columns:repeat(2,minmax(0,1fr))}
.hw-collection>button{margin-top:12px;min-height:42px;width:100%;background:#48216c;color:#fff;border:1px solid #a060c7;border-radius:10px}
.hw-collection>button:disabled{opacity:.45}
.hw-actions button small{color:#edc9ef;font-size:10px;font-weight:400}
.hw-cauldron .hw-actions button{min-height:68px}
@media(min-width:640px){.hw-collection,.hw-achievement-card{grid-column:span 2}.hw-artifacts{grid-template-columns:repeat(6,minmax(0,1fr))}}

.halloween-owned-cosmetics{display:inline-flex;max-width:100%;flex-wrap:wrap;margin:8px 10px;padding:7px 12px;border:1px solid #9e62d4;border-radius:15px;color:#ffd8a5;background:#231333dd;font-size:12px;font-weight:650;box-shadow:0 0 15px #b852eb33}

.profile-hero.halloween-dark-lord{border:3px solid #eba45e!important;outline:2px solid #863cb0;outline-offset:-9px;box-shadow:inset 0 0 0 2px #7b438e,inset 0 0 40px #3c114daa;background-image:linear-gradient(145deg,#2c103433,#1d102733)!important}

/* Curse is an explicit, accessible status, not a hidden timer. */
.hw-curse-state{border:1px solid #bb618d;border-radius:10px;background:#4c1935;color:#ffe3ef!important;padding:10px 12px;margin:10px 0!important}
.hw-curse-state[hidden]{display:none!important}
.hw-candy-actions button{min-height:82px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;line-height:1.3}
.hw-candy-actions button small{font-weight:400;font-size:11px;line-height:1.35;color:#f1cde5}

/* Persistent multi-stage ghost investigation. */
.hw-ghost-story{border:1px solid #6b5a9d;border-radius:11px;background:#231936;padding:12px;margin-top:12px;color:#f5dded;font-size:13px;line-height:1.5}
.hw-ghost-story strong{display:block;color:#ffdcb5;margin-bottom:5px}
.hw-ghost-clue{padding:10px 12px;border-left:3px solid #d0a1ff;background:#25193f;border-radius:4px;font-size:13px}
.hw-ghost-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.hw-ghost-actions button{border:1px solid #9254bb;background:#39225e;color:#fff5e8;border-radius:10px;padding:12px 8px;min-height:48px;font-weight:650;cursor:pointer}
.hw-ghost-actions button:disabled{opacity:.45;cursor:default}
.hw-ghost-actions button:first-child:nth-last-child(1){grid-column:span 2}
.hw-ghost-actions button small{display:block;color:#dbb9ee;font-size:11px;font-weight:400;margin-top:4px}

/* DEV tools and fixed viewport feedback. The notice is attached to <body>,
   outside the scrolled and clipped Halloween view. */
.hw-dev-tools[hidden]{display:none!important}
.hw-dev-tools summary{cursor:pointer;color:#ffdfa8;font-weight:750;min-height:38px}
.hw-dev-tools summary small{display:block;font-size:11px;font-weight:400;margin-top:3px}
.hw-dev-tools p{font-size:12px}
.hw-dev-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}
.hw-dev-actions button{min-height:48px;padding:8px 7px;border:1px solid #9a70be;background:#382351;color:#fff0dc;font-weight:600;border-radius:10px;font-size:12px;cursor:pointer}
.hw-dev-actions button:disabled{opacity:.45;cursor:default}
.hw-dev-actions button:last-child:nth-child(odd){grid-column:span 2}
.hw-floating-notice{position:fixed;top:calc(72px + env(safe-area-inset-top,0px));left:50%;width:min(420px,calc(100vw - 28px));max-height:min(44dvh,320px);overflow:auto;box-sizing:border-box;z-index:3005;transform:translate(-50%,-22px);opacity:0;pointer-events:none;border:1px solid #b881ef;border-radius:16px;background:linear-gradient(145deg,#332052,#1e1839);color:#fff3e1;padding:13px 16px;box-shadow:0 14px 40px #000b;transition:opacity .22s ease,transform .22s ease;text-align:center}
.hw-floating-notice.is-visible{opacity:1;transform:translate(-50%,0)}
.hw-floating-notice strong{display:block;font-size:15px;margin-bottom:5px}
.hw-floating-notice span{display:block;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.hw-floating-notice[data-type="success"]{border-color:#e9b775;background:linear-gradient(145deg,#4c2b42,#221a3c)}
.hw-floating-notice[data-type="error"]{border-color:#f18f9c;background:linear-gradient(145deg,#57202e,#29182f)}
@media(prefers-reduced-motion:reduce){.hw-floating-notice{transition:none}}

/* Cauldron: three explicit server-validated fire modes and confirmation. */
.hw-brew-section-label{font-size:13px;font-weight:750;color:#efd1ff;margin:13px 0 7px}
.hw-brew-recipes,.hw-fire-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.hw-brew-recipes button,.hw-fire-actions button{min-width:0;padding:9px 5px;min-height:72px;background:#302048;border:1px solid #76528b;border-radius:10px;color:#fff;font-size:12px;cursor:pointer;overflow-wrap:anywhere}
.hw-brew-recipes button small,.hw-fire-actions button small{display:block;margin-top:5px;font-size:10px;font-weight:400;color:#e2c6eb}
.hw-brew-recipes button.hw-selected,.hw-fire-actions button.hw-selected{border-color:#ffd485;background:linear-gradient(145deg,#51316c,#6b356f);box-shadow:inset 0 0 0 1px #d39d59}
.hw-brew-recipes button:disabled,.hw-fire-actions button:disabled{opacity:.5;cursor:default}
.hw-brew-summary,.hw-brew-confirm{background:#241a3b;border:1px solid #654683;border-radius:11px;padding:12px;margin-top:11px;font-size:13px;line-height:1.5}
.hw-brew-summary div{display:flex;justify-content:space-between;gap:9px;margin:4px 0}
.hw-brew-summary small{display:block;margin-top:7px;color:#e7c6e5;line-height:1.5}
.hw-brew-confirm[hidden]{display:none!important}
.hw-brew-confirm p{margin:7px 0;font-size:12px;color:#e7d2e7}
.hw-brew-confirm-actions{display:flex;gap:8px}
.hw-brew-confirm-actions button{flex:1;min-height:42px;border-radius:9px;color:#fff;border:1px solid #a76dcc;background:#51316d;font-weight:700}
.hw-brew-confirm-actions #hwBrewCommit{background:#9b4b1d;border-color:#efad56}
.hw-dev-brew{display:grid;grid-template-columns:1fr 1fr;gap:7px;align-items:center;padding:11px 0;margin-top:9px;border-top:1px solid #654683}
.hw-dev-brew strong,.hw-dev-brew small,.hw-dev-brew button,.hw-dev-brew .hw-dev-toggle{grid-column:span 2}
.hw-dev-brew label{font-size:12px}
.hw-dev-brew select{min-width:0;width:100%;background:#1e1831;color:#fff;border:1px solid #9861b8;border-radius:7px;padding:8px}
.hw-dev-brew button{min-height:43px;background:#4e326b;color:#fff;border:1px solid #a16fbe;border-radius:9px}
.hw-dev-brew .hw-dev-toggle{display:flex;align-items:center;gap:8px}
@media(max-width:380px){.hw-brew-recipes,.hw-fire-actions{grid-template-columns:1fr}.hw-brew-recipes button,.hw-fire-actions button{min-height:48px}}

/* Manor chapter: persistent story and visible three-room journal. */
.hw-manor-story{padding:13px;border:1px solid #8155a2;border-radius:11px;background:#241735;line-height:1.5;font-size:13px;margin-top:12px}
.hw-manor-story[hidden],#hwManorFinale[hidden]{display:none!important}
.hw-manor-story strong{display:block;font-size:15px;color:#ffdda9;margin-bottom:7px}
.hw-manor-actions{display:grid;grid-template-columns:1fr;gap:8px;margin:11px 0}
.hw-manor-actions button{padding:12px 10px;min-height:49px;border:1px solid #a36fce;border-radius:10px;background:#382254;color:#fff4e4;font-weight:650;text-align:left;cursor:pointer}
.hw-manor-actions button:disabled{opacity:.45;cursor:default}
.hw-manor-actions small{display:block;font-weight:400;color:#e2d0eb;margin-top:4px}
.hw-manor-journal{padding:11px;border:1px solid #624874;border-radius:10px;background:#1e1835;font-size:12px;line-height:1.6}
.hw-manor-journal strong{display:block;color:#ffdda9;margin-bottom:4px}

/* Keep every control's real disabled state intact during an API request.
   Avoid re-enabling exhausted attempts or already-claimed rewards. */
.halloween-view.hw-processing button,
.halloween-view.hw-processing select{pointer-events:none}
.halloween-view.hw-processing{cursor:progress}

/* Horror Book: four navigable chapters, read-only once the event has ended. */
.hw-book{margin-top:12px;border:1px solid #624a87;border-radius:14px;background:linear-gradient(140deg,#24162f,#18172e);padding:12px;color:#f3e2f4}
.hw-book-heading{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:12px;flex-wrap:wrap}
.hw-book-heading strong{color:#ffd7a8;font-size:15px}
.hw-book-heading small{color:#c7a1df;font-size:11px}
.hw-book-chapters{display:grid;gap:8px}
.hw-book-chapter,.hw-book-items button,.hw-book-page button{border:1px solid #865da1;border-radius:10px;background:#322244;color:#fff2df;min-height:46px;padding:11px 12px;text-align:left;font-size:13px;line-height:1.4;cursor:pointer}
.hw-book-chapter{width:100%}
.hw-book-finale{border-color:#b58d61;background:#3b2746}
.hw-book-page{display:grid;gap:12px}
.hw-book-page h3{font-size:17px;color:#ffdbab;margin:4px 0}
.hw-book-page>button{justify-self:start}
.hw-book-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.hw-book-items button{min-width:0;font-size:12px;padding:10px 7px;text-align:center;overflow-wrap:anywhere}
.hw-book-items .hw-book-locked{opacity:.65;background:#231b30}
.hw-book-page button:disabled{opacity:.55;cursor:default}
.hw-book-page .hw-book-secret{border-color:#9470c3;background:#42285b;width:100%}
.hw-book-story{white-space:pre-line;background:#1b182d;border:1px solid #564366;border-radius:11px;padding:15px;line-height:1.72;font-size:13px;margin:0;overflow-wrap:anywhere}
.hw-book-page[hidden],.hw-book-chapters[hidden]{display:none!important}
.hw-notice-read{display:block;margin:9px auto 0;padding:8px 18px;border:1px solid #dba5fa;background:#583073;border-radius:9px;color:white;font-weight:700;pointer-events:auto;cursor:pointer}
.halloween-view.hw-archive-mode .hw-card:not(.hw-collection):not(.hw-permanent-collection),
.halloween-view.hw-archive-mode .hw-counter-row,
.halloween-view.hw-archive-mode #hwReload,
.halloween-view.hw-archive-mode #hwNightmareTitle{display:none!important}
.halloween-view.hw-archive-mode .hw-collection{grid-column:1/-1}
.halloween-view.hw-archive-mode .hw-cover-title small{display:none}
.games-view #halloweenArchiveEntry[hidden]{display:none!important}
@media(max-width:400px){.hw-book-items{grid-template-columns:1fr}.hw-book-items button{text-align:left}}

/* Achievements: keep hidden criteria server-side; accessible mobile progress. */
.hw-achievement-filters{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}
.hw-achievement-filters button{background:#30224b;border:1px solid #8259aa;border-radius:10px;color:#f5eafa;padding:9px 12px;cursor:pointer}
.hw-achievement-filters button.is-active{background:#6a398c;border-color:#d8a2ff}
.hw-achievement-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:10px}
.hw-achievement{background:#251c38;border:1px solid #614580;border-radius:14px;padding:14px;min-width:0;overflow-wrap:anywhere}
.hw-achievement.unlocked{border-color:#947449}
.hw-achievement-heading{display:flex;align-items:center;gap:9px}
.hw-achievement-heading span{font-size:22px}
.hw-achievement-heading strong{flex:1;font-size:14px}
.hw-achievement-heading small{font-size:11px;color:#ddc9e6}
.hw-achievement p{font-size:13px;color:#d6c6e0;line-height:1.45;margin:9px 0}
.hw-achievement>small{display:block;margin-top:7px;color:#d1b8db;font-size:12px}
.hw-achievement-progress{height:7px;border-radius:99px;background:#48345f;overflow:hidden}
.hw-achievement-progress span{display:block;height:100%;border-radius:inherit;background:#e9a24c}

/* Permanent, owned-only cosmetics are available in the post-event archive. */
.hw-permanent-collection{grid-column:1/-1}
.hw-permanent-collection .hw-rewards article{min-height:138px}
.hw-permanent-collection .hw-rewards button{min-height:36px}
.hw-cosmetic-dialog[hidden]{display:none!important}
.hw-cosmetic-dialog{position:fixed;inset:0;z-index:4050;background:#080514d9;
 display:grid;place-items:center;padding:18px;box-sizing:border-box}
.hw-cosmetic-sheet{max-width:420px;width:100%;background:#211735;border:1px solid #875ab3;
 color:#fff;border-radius:18px;padding:18px;max-height:86dvh;overflow:auto;box-sizing:border-box}
.hw-cosmetic-sheet h3{margin:0 0 12px;font-size:18px}
.hw-cosmetic-sheet button{background:#7041a1;color:white;border:1px solid #b180d1;
 border-radius:9px;padding:11px 15px;width:100%;min-height:42px}
.hw-cosmetic-sample{min-height:200px;border-radius:14px;display:grid;justify-items:center;
 align-content:center;gap:12px;background:linear-gradient(140deg,#271a4b,#130f27);padding:20px}
.hw-cosmetic-sample.is-night{background:#14102c url('../halloween/background.webp') center/cover}
.hw-cosmetic-sample.is-darklord{border:3px double #b189eb;box-shadow:inset 0 0 25px #9548b866}
.hw-cosmetic-avatar{height:92px;width:92px;object-fit:cover;border-radius:50%;background:#40325e}
.hw-cosmetic-avatar.is-pumpkin{border:5px solid #ff9f39;box-shadow:0 0 12px #f57528}
.hw-cosmetic-name{font-weight:700;text-shadow:0 1px 5px #000}
.halloween-view.hw-archive-mode .hw-permanent-collection{display:block!important}

/* Three-boss raid: accessible, touch-sized controls and read-only group board. */
.hw-king .hw-boss-options{display:grid;gap:8px;margin:13px 0}
.hw-king .hw-boss-options label{display:flex;gap:9px;align-items:center;margin:0;padding:11px 12px;border:1px solid #72518e;border-radius:10px;background:#23193a;color:#f8e7ff;cursor:pointer}
.hw-king .hw-boss-options input{width:19px;height:19px;accent-color:#ef934a;flex-shrink:0}
.hw-king #hwEcho{width:100%;min-height:42px;padding:10px;margin:10px 0;border-radius:10px;border:1px solid #956abf;background:#2c204b;color:#f7e6ff;cursor:pointer}
.hw-king #hwEcho[hidden]{display:none!important}
.hw-king .hw-boss-ranking{margin-top:18px;padding-top:14px;border-top:1px solid #604477}
.hw-king .hw-boss-ranking h3{font-size:16px;color:#ffe0a9;margin:0 0 10px}
.hw-king .hw-boss-ranking p{font-size:12px;margin:8px 0}
.hw-king .hw-boss-ranking #hwBossRank{display:grid;gap:7px}
.hw-king .hw-boss-ranking #hwBossRank>div{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px;border-radius:8px;background:#251b3e;font-size:12px}
.hw-king .hw-boss-ranking #hwBossRank span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hw-king .hw-boss-ranking #hwBossRank b{flex-shrink:0;color:#ffcb83}
.hw-notice[hidden]{display:none!important}
