/* Red Planet Apps: Halloween 2026 treatment for the Games line (v1.0.0)
   Scope: only pages that load this file (Games hub + game pages). Never loaded on /learn/ or educational pages.
   HOW IT REVERTS
   - Automatically: js/halloween.js removes body classes "hw26"/"hw26-lite" after Nov 5 2026 00:00 Phoenix
     and hides every .hw-sale-only block when the sale ends (Nov 4 2026 18:00 UTC = 11:00 AM Phoenix).
   - By hand: remove "hw26" from <body>, or delete the <link> to this file. Everything is namespaced hw-* / body.hw26.
   Safety: nothing flashes faster than 3 times a second, effects are tiny in contrast, and they stop for
   prefers-reduced-motion and for the visitor's own "Effects" switch (body.hw-calm). */

:root {
  --hw-orange: #ff7a1a;
  --hw-orange-deep: #c2410c;
  --hw-candle: #ffc15a;
  --hw-ember: #ff5a2a;
  --hw-ink: #0b0507;
  --hw-card: rgba(20, 9, 8, .78);
  --hw-line: rgba(255, 122, 26, .38);
}

/* ---------- Atmosphere (full theme only: body.hw26) ---------- */
body.hw26 main, body.hw26 footer { position: relative; z-index: 1; }

/* two slow layers of low fog that sit under the content, over the star canvas */
body.hw26::before, body.hw26::after {
  content: ""; position: fixed; left: -50%; width: 200%; bottom: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 26% 62% at 10% 72%, rgba(206, 188, 232, .15), transparent 70%),
    radial-gradient(ellipse 22% 52% at 34% 64%, rgba(255, 150, 70, .09), transparent 70%),
    radial-gradient(ellipse 28% 58% at 62% 70%, rgba(206, 188, 232, .13), transparent 70%),
    radial-gradient(ellipse 22% 50% at 88% 62%, rgba(255, 150, 70, .08), transparent 70%);
  will-change: transform;
}
body.hw26::before { height: 46vh; opacity: .8; animation: hw-fog-a 80s linear infinite alternate; }
body.hw26::after  { height: 34vh; opacity: .6; animation: hw-fog-b 120s linear infinite alternate; }
@keyframes hw-fog-a { from { transform: translate3d(-9%, 0, 0); } to { transform: translate3d(9%, 0, 0); } }
@keyframes hw-fog-b { from { transform: translate3d(8%, 0, 0); }  to { transform: translate3d(-8%, 0, 0); } }

body.hw26 .header { border-bottom-color: rgba(255, 122, 26, .28); box-shadow: 0 1px 26px rgba(255, 122, 26, .12); }
body.hw26 .hub-badge, body.hw26 .hal-kicker { border-color: var(--hw-line); box-shadow: 0 0 22px rgba(255, 122, 26, .22); }
body.hw26 .hub-badge .dot { background: var(--hw-orange); box-shadow: 0 0 12px var(--hw-orange); }
body.hw26 .hub-hero .title span, body.hw26 .hal-title .text-ember {
  background: linear-gradient(135deg, #ffd08a 0%, #ff8a2a 50%, #d9480f 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(255, 122, 26, .38));
}
body.hw26 .shelf-head { border-bottom-color: var(--hw-line); }
body.hw26 .hub-note { border-color: var(--hw-line); }

/* jack-o'-lantern glow on horror cards: a soft halo that breathes (opacity only, compositor-friendly) */
body.hw26 .portfolio-card.card-holiday-paths { position: relative; }
body.hw26 .portfolio-card.card-holiday-paths::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 0;
  box-shadow: 0 0 44px 2px rgba(255, 122, 26, .42), inset 0 0 0 1px rgba(255, 150, 60, .5);
  animation: hw-flicker 7.5s linear infinite;
}
@keyframes hw-flicker {
  0%, 100% { opacity: .8; } 7% { opacity: .55; } 11% { opacity: .9; } 19% { opacity: .68; } 27% { opacity: 1; }
  38% { opacity: .74; } 52% { opacity: .92; } 60% { opacity: .6; } 66% { opacity: .88; } 83% { opacity: .72; }
}

/* cobwebs in the hero corners + a few bats; pure CSS/SVG, hidden on small screens */
.hw-web, .hw-bats { display: none; }
body.hw26 .hw-web, body.hw26 .hw-bats { display: block; }
.hw-web { position: absolute; top: 0; width: 120px; height: 120px; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23d8cfe6' stroke-width='.7' stroke-linecap='round'%3E%3Cpath d='M0 0L100 0M0 0L100 30M0 0L100 62M0 0L84 100M0 0L40 100M0 0L0 100'/%3E%3Cpath d='M24 0Q22 18 0 24M48 0Q42 36 0 48M72 0Q62 54 0 72M96 0Q80 72 0 96'/%3E%3C/svg%3E") no-repeat top left / contain; }
.hw-web.r { right: 0; transform: scaleX(-1); }
.hw-web.l { left: 0; }
.hw-bats { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hw-bats i { position: absolute; left: -60px; width: 34px; height: 16px; opacity: .85;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 16'%3E%3Cpath fill='%2312060a' d='M17 15c-1.2-3-2.6-4.6-4.2-5-1.8 1.4-4.1 1.6-6.3.4 1 1.6.6 3.2-.7 4.2C3.800 12 2.200 9.600 0 8c3.400-.6 5.800-2.800 8-6.500 1.400 1.500 3.500 2.300 5.700 2.400C14.800 2.800 15.900 1.800 17 0c1.100 1.800 2.200 2.800 3.300 3.900 2.200-.1 4.300-.9 5.700-2.400 2.200 3.700 4.600 5.900 8 6.500-2.200 1.600-3.800 4-5.800 6.600-1.300-1-1.700-2.600-.7-4.200-2.200 1.200-4.500 1-6.300-.4-1.600.4-3 2-4.200 5z'/%3E%3C/svg%3E") no-repeat center / contain;
  animation: hw-bat 19s linear infinite; }
.hw-bats i:nth-child(2) { top: 38%; animation-duration: 26s; animation-delay: 6s; width: 26px; }
.hw-bats i:nth-child(3) { top: 62%; animation-duration: 31s; animation-delay: 13s; width: 22px; }
.hw-bats i:nth-child(1) { top: 16%; }
@keyframes hw-bat {
  0% { transform: translate3d(0, 0, 0) scaleY(1); } 10% { transform: translate3d(12vw, -24px, 0) scaleY(.7); }
  20% { transform: translate3d(26vw, 14px, 0) scaleY(1); } 30% { transform: translate3d(40vw, -18px, 0) scaleY(.7); }
  45% { transform: translate3d(58vw, 20px, 0) scaleY(1); } 60% { transform: translate3d(76vw, -20px, 0) scaleY(.7); }
  80%, 100% { transform: translate3d(112vw, 6px, 0) scaleY(1); }
}
.hw-stage { position: relative; }

/* ---------- Sale banner ---------- */
.hw-banner { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .55rem 1.1rem;
  max-width: 1100px; margin: 1rem auto 0; padding: .75rem 3rem .75rem 1.1rem; border-radius: 14px; color: #ffe9d2; font-size: .95rem; line-height: 1.35;
  background: linear-gradient(90deg, rgba(194, 65, 12, .32), rgba(255, 122, 26, .16) 50%, rgba(194, 65, 12, .32));
  border: 1px solid var(--hw-line); box-shadow: 0 0 30px rgba(255, 122, 26, .18); }
.hw-banner[hidden], .hw-sale-only[hidden], .hw-after-only[hidden], .hw-sticky[hidden] { display: none !important; }
.hw-banner strong { color: #fff; letter-spacing: .04em; }
.hw-banner .hw-pumpkin { font-size: 1.25rem; }
.hw-banner s, .hw-price s { color: #b79f95; }
.hw-banner .hw-now { color: var(--hw-candle); font-weight: 800; font-size: 1.1rem; }
.hw-banner-actions { display: inline-flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.hw-banner-close { position: absolute; top: 50%; right: .55rem; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .25); color: #ffd9b3; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.hw-banner-close:hover, .hw-banner-close:focus-visible { background: rgba(255, 122, 26, .3); outline: 2px solid var(--hw-candle); outline-offset: 2px; }

/* countdown */
.hw-count { display: inline-flex; align-items: center; gap: .3rem; font-family: 'JetBrains Mono', monospace; }
.hw-count .u { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.6ch; padding: .15rem .35rem; border-radius: 8px;
  background: rgba(0, 0, 0, .42); border: 1px solid rgba(255, 150, 60, .35); color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.1; }
.hw-count .u small { font-size: .56rem; letter-spacing: .12em; color: #ffb27a; font-weight: 600; text-transform: uppercase; }
.hw-count .sep { color: #ff9a4d; font-weight: 700; }

/* ---------- Buttons ---------- */
.hw-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.25rem; border-radius: 12px;
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; min-height: 44px; }
.hw-btn:focus-visible { outline: 3px solid var(--hw-candle); outline-offset: 3px; }
.hw-btn-primary { color: #fff !important; background: linear-gradient(135deg, #ff8a2a 0%, #d9480f 100%); border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 6px 24px rgba(255, 122, 26, .38); }
.hw-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(255, 122, 26, .55); }
.hw-btn-ghost { color: #ffd9b3 !important; background: rgba(20, 9, 8, .7); border: 1px solid var(--hw-line); }
.hw-btn-ghost:hover { transform: translateY(-2px); background: rgba(255, 122, 26, .14); border-color: var(--hw-orange); }
.hw-btn-sm { padding: .45rem .9rem; min-height: 38px; font-size: .9rem; border-radius: 10px; }

/* ---------- Featured PC hero ---------- */
.hw-feature { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: center;
  max-width: 1240px; margin: 2.2rem auto 0; padding: 1.6rem; border-radius: 24px; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, rgba(194, 65, 12, .28), transparent 55%), var(--hw-card);
  border: 1px solid var(--hw-line); box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 60px rgba(255, 122, 26, .16); }
.hw-feature-media { position: relative; z-index: 1; }
.hw-yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .6); padding: 0; cursor: pointer; text-decoration: none; }
.hw-yt img, .hw-yt iframe { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; border: 0; object-fit: cover; }
.hw-yt img { transition: transform .6s cubic-bezier(.16, 1, .3, 1), filter .3s; filter: saturate(1.05) brightness(.9); }
.hw-yt:hover img { transform: scale(1.04); filter: brightness(1); }
.hw-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-size: 1.9rem; padding-left: 5px; background: rgba(217, 72, 15, .88); border: 2px solid rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 0 rgba(255, 122, 26, .5), 0 8px 30px rgba(0, 0, 0, .5); animation: hw-pulse 3.2s ease-out infinite; }
@keyframes hw-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 122, 26, .5), 0 8px 30px rgba(0, 0, 0, .5); } 70%, 100% { box-shadow: 0 0 0 26px rgba(255, 122, 26, 0), 0 8px 30px rgba(0, 0, 0, .5); } }
.hw-yt-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem 1rem .8rem; color: #f6ebdd; font-family: 'Cinzel', serif; font-size: 1rem; text-align: left;
  background: linear-gradient(to top, rgba(8, 4, 6, .92), transparent); }
.hw-feature-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: .9rem; align-items: flex-start; }
.hw-kicker { display: inline-flex; gap: .5rem; align-items: center; padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--hw-line); background: rgba(255, 122, 26, .1);
  font-family: 'JetBrains Mono', monospace; font-size: .74rem; font-weight: 700; letter-spacing: .13em; color: #ffb27a; text-transform: uppercase; }
.hw-feature h2 { font-family: 'Cinzel', serif; font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.1; margin: 0; color: #fff; }
.hw-feature h2 span { background: linear-gradient(135deg, #ffd08a, #ff7a1a 60%, #d9480f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hw-tag { margin: 0; color: #d6c7bd; line-height: 1.6; font-size: 1.05rem; }
.hw-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .8rem; font-family: 'Outfit', sans-serif; }
.hw-price .hw-now { font-size: 2.2rem; font-weight: 800; color: var(--hw-candle); text-shadow: 0 0 20px rgba(255, 193, 90, .35); }
.hw-price .hw-off { padding: .15rem .55rem; border-radius: 6px; background: #ffb347; color: #0d0b12; font-family: 'JetBrains Mono', monospace; font-size: .75rem; font-weight: 800; letter-spacing: .05em; }
.hw-price .hw-until { color: #b9a89d; font-size: .92rem; width: 100%; }
.hw-cta { display: flex; flex-wrap: wrap; gap: .7rem; }
.hw-chips { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.hw-chips li { padding: .28rem .75rem; border-radius: 999px; font-size: .82rem; color: #ffd9b3; border: 1px solid rgba(255, 150, 60, .28); background: rgba(255, 255, 255, .03); }
.hw-small { margin: 0; font-size: .9rem; color: #a99a91; line-height: 1.6; }
.hw-small a { color: #ffb27a; text-decoration: underline; text-decoration-color: rgba(255, 122, 26, .5); text-underline-offset: 3px; }
.hw-small a:hover, .hw-small a:focus-visible { color: #fff; }

/* ---------- "Start free tonight" strip ---------- */
.hw-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 1240px; margin: 1.1rem auto 0; }
.hw-quick a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; border-radius: 16px; text-decoration: none; color: #fff;
  background: var(--hw-card); border: 1px solid rgba(255, 150, 60, .25); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.hw-quick a:hover, .hw-quick a:focus-visible { transform: translateY(-3px); border-color: var(--hw-orange); box-shadow: 0 10px 30px rgba(255, 122, 26, .2); outline: none; }
.hw-quick b { font-family: 'Outfit', sans-serif; font-size: 1.05rem; }
.hw-quick span { color: #b9a89d; font-size: .88rem; line-height: 1.45; }
.hw-quick em { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: .7rem; letter-spacing: .12em; color: #ffb27a; font-weight: 700; text-transform: uppercase; }

/* ---------- Cross-links between the horror games (evergreen; stays after the sale) ---------- */
.hw-cross { max-width: 1100px; margin: 3.2rem auto 0; padding: 1.8rem; border-radius: 22px; border: 1px solid var(--hw-line);
  background: radial-gradient(100% 140% at 100% 0%, rgba(194, 65, 12, .2), transparent 60%), var(--hw-card); }
.hw-cross h2 { margin: 0 0 .35rem; text-align: center; font-family: 'Outfit', sans-serif; font-size: clamp(1.5rem, 3vw, 2rem); color: #fff; }
.hw-cross > p { margin: 0 auto 1.4rem; max-width: 640px; text-align: center; color: #c9b9ae; line-height: 1.6; }
.hw-cross-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.hw-cross-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.2rem; border-radius: 16px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 150, 60, .22); }
.hw-cross-card[aria-current="page"] { border-color: var(--hw-orange); box-shadow: 0 0 24px rgba(255, 122, 26, .2); }
.hw-cross-card h3 { margin: 0; font-family: 'Outfit', sans-serif; font-size: 1.1rem; color: #fff; }
.hw-cross-card p { margin: 0; color: #bcaea5; font-size: .93rem; line-height: 1.55; flex: 1; }
.hw-cross-card .hw-cta { margin-top: .3rem; }
.hw-cross-more { margin: 1.3rem 0 0; text-align: center; color: #a99a91; font-size: .95rem; line-height: 1.7; }
.hw-cross-more a { color: #ffd9b3; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 122, 26, .5); text-underline-offset: 3px; }

/* ---------- Mobile sticky buy bar (hub + PC page) ---------- */
.hw-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: none; gap: .6rem; padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom));
  background: rgba(10, 4, 5, .94); border-top: 1px solid var(--hw-line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform: translateY(110%); transition: transform .3s ease; }
.hw-sticky.on { transform: none; }
.hw-sticky .hw-btn { flex: 1; padding: .6rem .7rem; font-size: .95rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hw-feature { grid-template-columns: 1fr; padding: 1.1rem; gap: 1.2rem; }
  .hw-quick { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .hw-sticky { display: flex; }
  body.hw26 { padding-bottom: 4.2rem; }
  .hw-banner { margin: .8rem .6rem 0; padding: .7rem 2.8rem .7rem .8rem; font-size: .88rem; justify-content: flex-start; }
  .hw-banner-actions { width: 100%; }
  .hw-banner-actions .hw-btn { flex: 1; }
  body.hw26 .hw-web, body.hw26 .hw-bats { display: none; }
  body.hw26::after { display: none; }
  .hw-price .hw-now { font-size: 1.9rem; }
  .hw-cta .hw-btn { width: 100%; }
  .hw-play { width: 60px; height: 60px; margin: -30px 0 0 -30px; font-size: 1.5rem; }
  .hw-cross { margin-left: .4rem; margin-right: .4rem; padding: 1.2rem; }
}

/* ---------- Calm modes: reduced-motion + the visitor's own switch ---------- */
@media (prefers-reduced-motion: reduce) {
  body.hw26::before, body.hw26::after, body.hw26 .portfolio-card.card-holiday-paths::after, .hw-play, .hw-bats i { animation: none !important; }
  body.hw26 .hw-bats { display: none; }
  .hw-btn, .hw-quick a, .hw-yt img, .hw-sticky { transition: none; }
}
body.hw-calm::before, body.hw-calm::after, body.hw-calm .portfolio-card.card-holiday-paths::after, body.hw-calm .hw-play, body.hw-calm .hw-bats i { animation: none !important; }
body.hw-calm.hw26 .hw-bats { display: none; }
.hw-fx { background: none; border: 1px solid rgba(255, 255, 255, .2); color: #ffd9b3; border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; cursor: pointer; min-height: 30px; }
.hw-fx:hover, .hw-fx:focus-visible { border-color: var(--hw-orange); outline: none; }
@media print { .hw-banner, .hw-sticky, .hw-bats, .hw-web { display: none !important; } body.hw26::before, body.hw26::after { display: none; } }

/* PC page: the hero art sits in a centred flex column, so give it a real width for the trailer facade */
.pc-hero-art { width: min(100%, 1100px); }

/* click-to-load trailer iframe (replaces the facade link) */
.hw-yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; background: #000; box-shadow: 0 16px 44px rgba(0, 0, 0, .6); }
/* fixes a pre-existing mobile overflow: the two trailers needed 340px each, wider than a phone */
.trailer-grid { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }

/* --- Image-ratio guard (Oct 30): featured cards, suspect art and the cross-promo art keep their natural proportions at every width --- */
body.hw26 .hp-card-featured { align-items: center; }
body.hw26 .hp-card-featured .hp-card-art { height: auto; min-height: 0; aspect-ratio: 16 / 9; align-self: center; }
body.hw26 .hp-card-featured .hp-card-art img { height: 100%; object-fit: cover; object-position: 50% 40%; }
body.hw26 .suspect-art, body.hw26-lite .suspect-art { height: auto; aspect-ratio: 3 / 2; }
body.hw26 .hollow-cross-promo-art, body.hw26-lite .hollow-cross-promo-art { height: auto; min-height: 0; aspect-ratio: 1200 / 630; align-self: center; }
