/* The Halloween casino games: Trick or Treat, the Haunted House Labyrinth and Follow the Coin (static/js/games/trickortreat.js, labyrinth.js, followcoin.js; the lobby section is in js/seasonal.js).
   Temporary, like the rest of the Halloween update: to take them out for good see static/art/halloween-v2/ASSETS.md. The pictures are the graphics pack V2's illustrations placed in inline SVG scenes
   whose named groups the pages move one at a time; every number, label and button is real page text, never part of a picture. (The class prefix is hg-: the Halloween skin owns hw-.) */

/* ---- the round at a glance, in the left panel: a few lines, the rest is one click away ---- */
.hg .hg-sum { display: grid; gap: 7px; padding: 12px 12px 11px; border: var(--bw) dashed var(--line-soft); border-radius: var(--r-1); background: var(--bg-2); color: #F2EADB; }
.hg .hg-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12.5px; line-height: 1.35; }
.hg .hg-line span { color: #BDB19C; min-width: 0; }
.hg .hg-line b { text-align: right; font-weight: 700; flex: none; max-width: 58%; overflow-wrap: anywhere; }
.hg .hg-line.strong b, .hg .hg-line.up b { color: var(--lime); }
.hg .hg-line.down b { color: var(--verm); }
.hg .hg-problem { color: var(--neg); font-size: 12.5px; line-height: 1.45; }
.hg .hg-problem:empty { display: none; }
.hg .hg-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-2); }

.hg .hg-rules, .hg .hg-odds-box { border-top: 1.5px dashed var(--line-soft); padding-top: 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.hg .hg-rules summary, .hg .hg-odds-box summary { cursor: pointer; font-weight: 700; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--text); }
.hg .hg-rules ul, .hg .hg-limits { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 7px; }
.hg .hg-rules b, .hg .hg-limits b { color: var(--text); }
.hg .hg-odds { width: 100%; margin-top: 10px; font-size: 11.5px; border-collapse: collapse; table-layout: fixed; }
.hg .hg-odds th:first-child, .hg .hg-odds td:first-child { width: 38%; }
.hg .hg-odds caption { text-align: left; font-size: 11.5px; color: var(--text-2); padding-bottom: 8px; line-height: 1.45; }
.hg .hg-odds th, .hg .hg-odds td { padding: 5px 4px; overflow-wrap: anywhere; }
.hg .hg-odds tfoot td { color: var(--text-2); padding-top: 8px; }
.hg .hg-odds tr.now td { color: var(--lime); font-weight: 700; }
.hg-confirm { display: grid; gap: 8px; margin: 4px 0 12px; padding: 12px; border: var(--bw) dashed var(--line-soft); border-radius: var(--r-1); }
.hg-confirm .hg-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hg-confirm .hg-line.strong b { color: var(--text); font-size: 17px; }

/* ---- the stage ---- */
.hg-stage { display: flex; flex-direction: column; gap: 12px; padding: 16px; align-items: stretch; justify-content: flex-start; }
.hg-scene { position: relative; width: 100%; margin: 0 auto; aspect-ratio: var(--hg-ar, 16 / 9); max-width: 1000px; border: 3px solid #191814; border-radius: 12px; background-color: #2A1D3C; background-size: cover; background-position: center; background-repeat: no-repeat; }
/* the three background plates (the V4 pack: static scenery, drawn behind the game's own pictures, never moved, never changed to hint at a result; centred and cropped at the sides on a narrow stage). The PNG is
   the fallback for a browser that does not know image-set or WebP. */
.hg-bg-tot { background-color: #2B1C3E; background-image: url('/art/halloween-v2/backgrounds/trick-or-treat.png'); background-image: image-set(url('/art/halloween-v2/backgrounds/trick-or-treat.webp') type('image/webp'), url('/art/halloween-v2/backgrounds/trick-or-treat.png') type('image/png')); }
.hg-bg-lab { background-color: #301F2A; background-image: url('/art/halloween-v2/backgrounds/haunted-labyrinth.png'); background-image: image-set(url('/art/halloween-v2/backgrounds/haunted-labyrinth.webp') type('image/webp'), url('/art/halloween-v2/backgrounds/haunted-labyrinth.png') type('image/png')); }
.hg-bg-cups { background-color: #8A4A2C; background-image: url('/art/halloween-v2/backgrounds/follow-the-coin.png'); background-image: image-set(url('/art/halloween-v2/backgrounds/follow-the-coin.webp') type('image/webp'), url('/art/halloween-v2/backgrounds/follow-the-coin.png') type('image/png')); }
@media (max-width: 720px) {
  .hg-bg-tot { background-image: url('/art/halloween-v2/backgrounds/trick-or-treat-960.webp'); }
  .hg-bg-lab { background-image: url('/art/halloween-v2/backgrounds/haunted-labyrinth-960.webp'); }
  .hg-bg-cups { background-image: url('/art/halloween-v2/backgrounds/follow-the-coin-960.webp'); }
}
.hg-art { position: absolute; inset: 0; }
.hg-art .hg-svg { display: block; width: 100%; height: 100%; }
.hg-msg { text-align: center; min-height: 1.4em; font-size: 15px; font-weight: 600; color: #F2EADB; line-height: 1.4; }
.hg-result { align-self: center; width: 100%; max-width: 620px; padding: 12px 16px; border: var(--bw) solid #5A4E41; border-radius: var(--r-1); background: #1C1815; color: #F2EADB; display: grid; gap: 6px; text-align: center; }
.hg-result h3 { margin: 0; font-family: var(--f-display); font-size: 21px; line-height: 1.15; }
.hg-result .hg-gain { margin: 0; font-size: 14px; color: #BDB19C; }
.hg-result .hg-gain b { color: #F2EADB; }
.hg-result .hg-gain b.up { color: var(--lime); }
.hg-result .hg-gain b.down { color: var(--verm); }
.hg-result .muted { color: #BDB19C; font-size: 12.5px; margin: 0; line-height: 1.45; }
.hg-stage.hg-won .hg-scene { border-color: var(--lime); }
.hg-stage.hg-lost .hg-scene { border-color: var(--verm); }

/* the HUD above a corridor or a table: three short facts (and, in the Labyrinth, the rooms) */
.hg-hud { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 8px 26px; color: #F2EADB; }
.hg-hud > div { display: grid; gap: 2px; text-align: center; }
.hg-hud small { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: #BDB19C; }
.hg-hud b { font-size: 17px; }
.hg-pips { flex-basis: 100%; display: flex; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hg-pips li { width: 22px; height: 8px; border-radius: 4px; border: 1.5px solid #5A4E41; background: transparent; }
.hg-pips li.done { background: var(--lime); border-color: var(--lime); }
.hg-pips li.now { border-color: #F2EADB; background: #F2EADB; }

/* ---- Trick or Treat: the door button sits over the door and keeps its place while the leaf opens ---- */
.hg-door-btn { position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 40% 40% 6% 6%; }
.hg-door-btn:hover:not(:disabled), .hg-door-btn:focus-visible { outline: 3px solid #191814; outline-offset: 2px; }
.hg-door-btn:disabled { cursor: default; }
.hg-knock { animation: hgKnock .3s ease-in-out 2; }
@keyframes hgKnock { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-5px); } 70% { transform: translateX(5px); } }
.hg-reveal, .hg-fadein { animation: hgSettle .45s ease-out 1; }
@keyframes hgSettle { 0% { opacity: 0; transform: translateY(-3px); } 100% { opacity: 1; transform: none; } }

/* ---- the Labyrinth: a labelled button over each door, its number under it ---- */
.hg-doors { position: absolute; inset: 0; }
.hg-door { position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 45% 45% 6% 6%; }
.hg-door:disabled { cursor: default; }
.hg-stage.live .hg-door:hover, .hg-door:focus-visible { outline: 4px solid var(--lime); outline-offset: 3px; }
.hg-door-n { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; min-width: 1.8em; padding: 1px 6px; text-align: center; font-weight: 800; font-size: clamp(11px, 1.9vw, 18px); color: #191814; background: #EEE9D6; border: 2px solid #191814; border-radius: 99px; pointer-events: none; }

/* ---- Follow the Coin: three stable buttons over the places a cup can be (the cups move, the buttons do not) ---- */
.hg-slots { position: absolute; inset: 0; }
.hg-slot { position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 12px; }
.hg-slot:disabled { cursor: default; }
.hg-stage.live .hg-slot:hover, .hg-slot:focus-visible { outline: 4px solid var(--lime); outline-offset: 3px; }
.hg-slot-n { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 6px; min-width: 1.8em; padding: 1px 6px; text-align: center; font-weight: 800; font-size: clamp(11px, 1.9vw, 18px); color: #191814; background: #EEE9D6; border: 2px solid #191814; border-radius: 99px; opacity: 0; }
.hg-stage.live .hg-slot-n { opacity: 1; }

/* ---- the lobby section ---- */
.hg-sec { margin: 6px 0 26px; padding: 16px 16px 18px; border: 3px solid #191814; border-radius: 14px; background: #25493D; color: #EEE9D6; }
.hg-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 14px; }
.hg-sec-head h2 { margin: 0; font-family: var(--f-display); font-size: 24px; line-height: 1.1; color: #EEE9D6; }
.hg-sec-head p { flex-basis: 100%; margin: 0; font-size: 13.5px; color: #EEE9D6; opacity: .9; line-height: 1.45; }
.hg-badge { display: inline-block; padding: 3px 9px; border: 2px solid #191814; border-radius: 99px; background: #F45E43; color: #191814; font: 800 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.hg-sec .gcards { margin-top: 0; }
.hg-tag { position: absolute; left: 50%; transform: translateX(-50%); top: 10px; z-index: 2; padding: 2px 8px; border: 2px solid #191814; border-radius: 99px; background: #F45E43; color: #191814; font: 800 10px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 480px) {
  .hg-stage { padding: 10px; }
  .hg-result { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hg-knock, .hg-reveal, .hg-fadein { animation: none; }
}
