/* =========================================================================
   HALLOWEEN EVENT -- /halloween and the home page banner
   (views/pages/halloween.php, views/pages/home.php, src/halloween_event.php)

   ⭐ AN EVENT LAYER, NOT A NEW THEME. Loaded only by the two pages that use
     it (the `styles` list in public/index.php), after style.css and
     candy.css, and built from candy.css's own tokens: the kit's SHOP orange
     carries the pumpkin, the panels and slabs are the ones every page uses.
     When the event is retired, delete this file and the two `styles` entries.
   ========================================================================= */

:root {
    --hw-orange:      var(--orange, #fdab4e);
    --hw-orange-deep: var(--orange-deep, #b3651d);
    --hw-glow:        rgba(253, 171, 78, .32);
    --hw-line:        rgba(253, 171, 78, .42);
}

.hw-accent { color: var(--hw-orange); }
.kicker.hw-kicker { color: var(--hw-orange); }

/* ------------------------------------------------------------ head --- */
/* The page head over the event map itself: the in-game screenshot of the
   Halloween Special, dimmed and faded in from the right so the text side
   stays calm. */
.hw-head { padding: 70px 0 64px; }
.hw-head-shot {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    mask-image: linear-gradient(90deg, transparent 18%, rgba(0, 0, 0, .9) 70%);
    -webkit-mask-image: linear-gradient(90deg, transparent 18%, rgba(0, 0, 0, .9) 70%);
}
.hw-head-shot img {
    width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%;
    opacity: .22; filter: saturate(.85);
}
.hw-head .wrap { z-index: 1; }
.hw-head-grid {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    gap: 48px; align-items: center;
}
.hw-head h1 { text-transform: uppercase; }
.hw-head p { max-width: 58ch; }

.hw-facts {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none;
}
.hw-facts li {
    padding: 6px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600; line-height: 1.2;
    color: var(--text); background: rgba(253, 171, 78, .1); border: 1px solid var(--hw-line);
}
.hw-facts strong { color: var(--hw-orange); font-weight: 700; }
.hw-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.hw-hero-art { margin: 0; justify-self: center; text-align: center; }
.hw-hero-art img {
    width: 100%; max-width: 300px; height: auto; border-radius: var(--radius-lg);
    border: 1px solid var(--hw-line);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 30px 70px -30px var(--hw-glow), 0 0 60px -18px var(--hw-glow);
}
.hw-hero-art figcaption {
    margin-top: 14px; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
    letter-spacing: .06em; color: var(--text-dim);
}
.hw-new {
    display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 4px;
    font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink, #0f1733);
    background: linear-gradient(180deg, #ffc879, var(--hw-orange));
}

/* ----------------------------------------------------------- steps --- */
.hw-steps {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
    margin: 0; padding: 0; list-style: none; counter-reset: none;
}
.hw-step { position: relative; display: flex; flex-direction: column; gap: 10px; padding-top: 30px; }
.hw-step-n {
    font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 2.6rem; line-height: 1;
    color: var(--hw-orange); text-shadow: 0 6px 22px var(--hw-glow);
}
.hw-step h3 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: .02em; }
.hw-step p { color: var(--text-dim); font-size: .93rem; }
.hw-step strong { color: var(--text); }
.hw-step code {
    padding: 1px 6px; border-radius: 4px; background: rgba(9, 11, 32, .55);
    border: 1px solid var(--border-soft); color: var(--cyan-bright); font-size: .86em;
}
.hw-step-art { margin-top: auto; display: flex; justify-content: flex-end; }
.hw-step-art img {
    width: 104px; height: 104px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}

.hw-candy-grid { margin-top: 22px; }
.hw-candy-grid .stat-tile .n { color: var(--hw-orange); }

.hw-rules {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px;
    margin: 26px 0 0; padding: 0; list-style: none;
}
.hw-rules li {
    position: relative; padding-left: 20px; color: var(--text-dim); font-size: .92rem;
}
.hw-rules li::before {
    content: ""; position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 2px;
    background: var(--hw-orange); transform: skewX(-18deg);
}
.hw-rules strong { color: var(--text); }

/* --------------------------------------------------------- renders --- */
/* Flex, not grid, so a short last row sits centred instead of leaving a hole. */
.hw-renders {
    --hw-cols: 4; --hw-gap: 22px;
    display: flex; flex-wrap: wrap; justify-content: center; gap: var(--hw-gap);
}
.hw-render {
    margin: 0; min-width: 0;
    flex: 0 0 calc((100% - (var(--hw-cols) - 1) * var(--hw-gap)) / var(--hw-cols));
}
.hw-render-frame {
    aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius);
    border: 1px solid var(--border); background: #1c1a27;
    box-shadow: inset 0 1px 0 var(--panel-hi, rgba(255, 255, 255, .06)), var(--shadow);
    transition: border-color .2s ease, transform .16s ease;
}
.hw-render:hover .hw-render-frame { border-color: var(--hw-orange); transform: translateY(-3px); }
.hw-render-frame img { width: 100%; height: 100%; object-fit: cover; }
.hw-render figcaption { margin-top: 10px; }
.hw-render figcaption strong {
    display: block; font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: .02em;
}
.hw-render figcaption span { display: block; color: var(--text-mute); font-size: .84rem; margin-top: 2px; }

/* -------------------------------------------------------- exchange --- */
.hw-group { margin-top: 10px; }
.hw-group + .hw-group { margin-top: 46px; }
.hw-group-title {
    font-size: 1.45rem; text-transform: uppercase; letter-spacing: .02em;
}
.hw-group-title::before {               /* the kit's slash mark, in pumpkin */
    content: ""; display: inline-block; width: .2em; height: .78em; margin-right: .34em;
    vertical-align: .02em; border-radius: 2px; transform: skewX(-18deg);
    background: linear-gradient(180deg, var(--hw-orange), var(--pink));
}
.hw-group-lede { color: var(--text-dim); max-width: 70ch; margin: 8px 0 18px; font-size: .94rem; }

/* One column count per group, so every row is full on a desktop: the
   Skeleton set reads as one row per chassis. */
.hw-grid { display: grid; gap: 14px; }
.hw-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hw-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* A shop-style panel laid on its side: the icon tile left, the facts right. */
.hw-item {
    display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center;
    padding: 12px 14px 12px 12px; border-radius: var(--radius);
    background-color: var(--surface); border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 var(--panel-hi, rgba(255, 255, 255, .06)), var(--shadow);
    transition: border-color .2s ease, transform .16s ease;
}
.hw-item:hover { border-color: var(--hw-orange); transform: translateY(-2px); }
.hw-item.is-new { border-color: var(--hw-line); }
.hw-item-art {
    position: relative; width: 96px; height: 96px; border-radius: var(--radius-sm);
    background: radial-gradient(circle at 50% 40%, #323782, #10132e);
    display: flex; align-items: center; justify-content: center;
}
/* The icons are the client's own 128 px cells, shown at 88 px (crisp on a
   2x screen) -- not at the 64 px the shop uses for its old 1x atlases. */
.hw-item-art img.hw-icon {
    width: 88px; height: 88px; object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .55));
}
.hw-item-flag { position: absolute; top: -7px; left: -6px; margin: 0; z-index: 1; }
.hw-item-text { min-width: 0; }
.hw-item-name {
    font-family: var(--font-display); font-weight: 700; font-size: 1.04rem; line-height: 1.15; letter-spacing: .01em;
}
.hw-item-meta {
    margin: 3px 0 0; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mute);
}
.hw-item-price {
    margin: 6px 0 0; font-family: var(--font-display); font-weight: 700; font-size: .8rem;
    letter-spacing: .1em; text-transform: uppercase; color: var(--hw-orange);
}
.hw-item-price strong { font-size: 1.12rem; font-style: italic; font-weight: 800; letter-spacing: .02em; margin-right: 2px; }
.hw-item-stats { margin: 4px 0 0; color: var(--text-dim); font-size: .78rem; line-height: 1.4; }
.hw-foot { margin-top: 34px; color: var(--text-mute); font-size: .9rem; }

/* ---------------------------------------------------- home banner --- */
.hw-banner-wrap { padding: 30px 0 48px; }
.hw-banner {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 30px; align-items: center;
    padding: 22px 30px 22px 22px; border-radius: var(--radius-lg);
    border: 1px solid var(--hw-line);
    background:
        radial-gradient(420px 220px at 8% 50%, rgba(253, 171, 78, .22), transparent 70%),
        radial-gradient(520px 260px at 100% 0%, rgba(118, 80, 226, .22), transparent 70%),
        linear-gradient(120deg, #241c3e, var(--surface) 60%);
    box-shadow: inset 0 1px 0 var(--panel-hi, rgba(255, 255, 255, .06)), var(--shadow);
    transition: border-color .2s ease, transform .16s ease, box-shadow .2s ease;
}
.hw-banner:hover {
    border-color: var(--hw-orange); transform: translateY(-2px);
    box-shadow: inset 0 1px 0 var(--panel-hi, rgba(255, 255, 255, .06)), 0 26px 60px -34px var(--hw-glow);
}
.hw-banner-art img {
    width: 150px; height: 150px; border-radius: var(--radius);
    border: 1px solid var(--hw-line); box-shadow: 0 0 40px -12px var(--hw-glow);
}
.hw-banner-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hw-banner-text .kicker { margin-bottom: 2px; }
.hw-banner-title {
    font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase;
    font-size: clamp(1.4rem, 3vw, 2.05rem); line-height: 1.05; color: #fff;
}
.hw-banner-desc { color: var(--text-dim); max-width: 70ch; }
.hw-banner-cta {
    margin-top: 4px; font-family: var(--font-display); font-weight: 700; font-size: .92rem;
    letter-spacing: .16em; text-transform: uppercase; color: var(--hw-orange);
}

/* The "What's new" chip that points at the event */
.hero-new .hero-new-event { padding: 0; background: rgba(253, 171, 78, .12); border-color: var(--hw-line); }
.hero-new .hero-new-event a { display: block; padding: 6px 12px; border-radius: 999px; color: var(--hw-orange); }
.hero-new .hero-new-event a:hover { background: rgba(253, 171, 78, .18); }

/* ------------------------------------------------------ responsive --- */
@media (max-width: 1080px) {
    .hw-steps { grid-template-columns: 1fr; }
    .hw-step-art { justify-content: flex-start; }
    .hw-grid--3, .hw-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hw-renders { --hw-cols: 3; }
}
@media (max-width: 860px) {
    .hw-head-grid { grid-template-columns: 1fr; gap: 34px; }
    .hw-hero-art { justify-self: start; }
    .hw-hero-art img { max-width: 240px; }
    .hw-rules { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .hw-head { padding: 48px 0 44px; }
    .hw-actions .btn { flex: 1; }
    .hw-banner { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
    .hw-banner-art img { width: 120px; height: 120px; }
    .hw-grid--3, .hw-grid--4 { grid-template-columns: 1fr; }
    .hw-renders { --hw-cols: 2; --hw-gap: 12px; }
    .stat-grid.hw-candy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .hw-candy-grid .stat-tile { padding: 18px 12px; }
}
