/* =========================================================
   Sahara Cup · stadium experience
   Builds on style.css tokens and glass system.
   ========================================================= */

.stadium-page { background: #F3E6CC; }

/* ---------- Stage ---------- */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.stage svg, .stage canvas { display: block; width: 100%; height: 100%; }
.is-exploring .stage { pointer-events: auto; cursor: grab; }
.is-exploring .stage:active { cursor: grabbing; }

.hotspots { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.hotspot {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: inline-flex; align-items: center; gap: .4rem; margin: -18px 0 0 -18px;
  min-height: 36px; padding: 0 .55rem 0 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 252, 245, .82); border: 1px solid rgba(255, 255, 255, .95); color: var(--indigo);
  box-shadow: 0 6px 18px rgba(31, 42, 68, .22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 700 .82rem/1 var(--font-body);
}
.hotspot__num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--oasis); color: var(--ivory); font-family: var(--font-display); font-size: .95rem; flex: none; }
.hotspot__label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s ease; }
.hotspot:hover .hotspot__label, .hotspot:focus-visible .hotspot__label, .hotspot.is-labelled .hotspot__label { max-width: 320px; }
.hotspot:not(:hover):not(:focus-visible):not(.is-labelled) { padding-right: 0; gap: 0; }
.hotspot.is-active .hotspot__num { background: var(--terracotta); box-shadow: 0 0 0 4px rgba(232, 163, 61, .45); }
.hotspot--ad .hotspot__num { background: var(--indigo); font-size: .72rem; letter-spacing: .04em; }
.hotspot[hidden] { display: none; }

.stage-loader { position: fixed; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 1.2rem 1.4rem; text-align: center; display: grid; gap: .6rem; }
.stage-loader[hidden] { display: none; }

/* ---------- Header, toolbar, chapters ---------- */
.st-header { position: fixed; top: 10px; left: 10px; right: 10px; z-index: 30; display: grid; gap: 8px; justify-items: start; pointer-events: none; }
.st-header > * { pointer-events: auto; }
.st-nav { width: 100%; display: flex; align-items: center; gap: 1rem; padding: .45rem .55rem .45rem 1rem; border-radius: 18px; }
.st-nav__links { display: flex; gap: .1rem; list-style: none; margin: 0 0 0 auto; }
.st-nav__links a { display: block; padding: .45rem .65rem; border-radius: 10px; color: var(--ink); font-weight: 700; font-size: .93rem; text-decoration: none; white-space: nowrap; }
.st-nav__links a:hover { background: rgba(255, 255, 255, .6); }
.st-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .35rem; border-radius: 16px; position: relative; overflow: hidden; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(31, 42, 68, .08); }
.seg button, .tool {
  min-height: 38px; min-width: 38px; padding: .35rem .75rem; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--indigo); font: 800 .9rem/1 var(--font-body);
}
.seg button[aria-pressed="true"] { background: var(--oasis); color: var(--ivory); }
.tool { background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .9); }
.tool:hover { background: rgba(255, 255, 255, .9); }
.tool[aria-pressed="true"], .tool[aria-expanded="true"] { background: var(--indigo); color: var(--ivory); }
.tool--icon { font-size: 1.25rem; padding: 0 .55rem; }
.tool[hidden] { display: none; }
.tool-counter { min-width: 5.2rem; text-align: center; font: 600 .9rem/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--indigo); }
.journey-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(31, 42, 68, .08); }
.journey-bar span { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--dune-gold), var(--terracotta)); }
.explore-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .4rem .6rem; border-radius: 14px; font-size: .88rem; font-weight: 700; }
.explore-bar[hidden] { display: none; }
.chapters { width: min(420px, calc(100vw - 20px)); max-height: calc(100vh - 150px); overflow: auto; padding: 1rem 1.1rem; }
.chapters[hidden] { display: none; }
.chapters__title { margin: .2rem 0 .5rem; font: 600 .8rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--clay); }
.chapters ol { margin: 0 0 1rem; padding-left: 1.5rem; display: grid; gap: .15rem; }
.chapters a { display: block; padding: .35rem .2rem; color: var(--ink); font-weight: 700; text-decoration: none; }
.chapters a:hover { color: var(--oasis); text-decoration: underline; }
.chapters__pages { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; font-size: .92rem; }

/* ---------- Journey steps ---------- */
.journey-steps { position: relative; } /* no stacking context: cards and panels must sit above the hotspot layer */
.step { position: relative; min-height: 125vh; padding: 150px 24px 40px; }
.step--hero { min-height: 100vh; display: flex; align-items: center; padding-top: 140px; }
.hero-card { position: relative; z-index: 8; max-width: 520px; padding: clamp(1.4rem, 3vw, 2.2rem); }
.hero-card__title { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; font-size: clamp(3rem, 7vw, 5rem); line-height: .95; color: var(--indigo); }
.hero-card__tag { font-family: var(--font-display); font-size: 1.5rem; color: var(--clay); margin: .3rem 0 .8rem; }
.hero-card__cue { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--oasis-deep); }
.cue-ball { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 30%, #1F2A44 32% 45%, #fff 47%); box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.motion-ok .cue-ball { animation: cue-bounce 1.6s ease-in-out infinite; }
@keyframes cue-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.hero-card__alt { font-size: .92rem; color: var(--ink-soft); }

.cp-card { position: sticky; z-index: 8; top: 140px; max-width: 330px; padding: 1rem 1.1rem 1.1rem; display: grid; gap: .35rem; }
.cp-card h2 { font: 600 1.35rem/1.1 var(--font-display); text-transform: uppercase; color: var(--indigo); margin: 0; }
.cp-card p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.cp-card .btn { justify-self: start; margin-top: .35rem; }
.cp-card__num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--oasis); color: var(--ivory); font-family: var(--font-display); }

/* ---------- Checkpoint panels ---------- */
.cp-details { position: relative; z-index: 8; padding: 1.4rem 1.4rem 1.6rem; margin-top: 1.2rem; max-width: 760px; }
.cp-details h3 { font: 600 clamp(1.4rem, 2.2vw, 1.8rem)/1.1 var(--font-display); text-transform: uppercase; color: var(--indigo); margin: 0 0 .8rem; padding-right: 2.6rem; }
.cp-details h3:focus { outline: none; }
.cp-details h4 { font: 600 1.05rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .03em; color: var(--oasis-deep); margin: 1.2rem 0 .5rem; }
.cp-details p, .cp-details li, .cp-details dd { font-size: .97rem; }
.cp-close { position: absolute; top: .8rem; right: .8rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .7); color: var(--indigo); cursor: pointer; }
.cp-close svg { width: 18px; height: 18px; }
.cp-close:hover { background: #fff; }
html:not(.stadium-js) .cp-close { display: none; }
.cp-cta { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.cp-photo { margin: .8rem 0; }
.cp-photo img, .cp-duo img { width: 100%; border-radius: 14px; object-fit: cover; }
.cp-photo figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .3rem; }
.cp-duo { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .6rem 0; }
.cp-duo img { aspect-ratio: 4 / 3; }
.promise-list { padding-left: 1.3rem; display: grid; gap: .55rem; }
.day-list { padding-left: 1.2rem; display: grid; gap: .3rem; font-size: .93rem; }
.table--compact { min-width: 0; font-size: .9rem; }
.table--compact th, .table--compact td { padding: .5rem .6rem; }
.label-proposed { padding: .55rem .8rem; border-radius: 12px; background: rgba(31, 42, 68, .08); border-left: 4px solid var(--indigo); font-weight: 700; font-size: .9rem !important; }
.placement-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.placement-list button { min-height: 40px; padding: .4rem .8rem; border-radius: 999px; border: 1px solid rgba(31, 42, 68, .2); background: rgba(255, 255, 255, .75); color: var(--indigo); font: 700 .88rem/1.2 var(--font-body); cursor: pointer; }
.placement-list button:hover { background: #fff; border-color: var(--oasis); }
.pl-facts { margin: 0; display: grid; gap: .2rem .8rem; grid-template-columns: max-content 1fr; }
.pl-facts dt { font-weight: 800; color: var(--oasis-deep); font-size: .9rem; }
.pl-facts dd { margin: 0; }
.mini-road { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; align-items: end; height: 140px; margin: .6rem 0; }
.mini-road span { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; font-size: .78rem; color: var(--ink-soft); }
.mini-road span::before { content: ""; order: 1; height: calc(var(--v) * 80px); min-height: 8px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #F2BA62, var(--dune-gold)); }
.mini-road span:last-child::before { background: linear-gradient(180deg, #D8683F, var(--terracotta)); }
.mini-road b { order: 0; font: 600 1.1rem/1.2 var(--font-display); color: var(--indigo); }
.mini-road span { gap: 2px; }
.mini-road span > b + * { order: 2; }

/* With JS: details become panels shown one at a time */
.js .cp-details { display: none; }
.js.no-stadium .cp-details { display: block; }
.stadium-js .cp-details.is-open {
  display: block; position: fixed; z-index: 20; margin: 0;
  right: 16px; top: 132px; bottom: 16px; width: min(460px, 40vw); max-width: none; overflow-y: auto; overscroll-behavior: contain;
}
.placements { margin-top: 1rem; display: grid; gap: 1rem; }

/* ---------- Final step and invitation ---------- */
.step--final { min-height: 130vh; }
.finale { padding: clamp(1.4rem, 3.5vw, 2.6rem); margin-top: 1.2rem; max-width: 980px; position: relative; }
.js .finale { display: none; }
.js.no-stadium .finale { display: block; }
.is-finale .finale {
  display: block; position: fixed; z-index: 50; inset: 0; margin: 0; max-width: none; border-radius: 0; overflow-y: auto;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 246, 225, .96), rgba(247, 238, 221, .97));
}
.is-finale .finale > * { max-width: 1000px; margin-left: auto; margin-right: auto; }
.is-finale .finale__close { position: fixed; top: 16px; right: 16px; }
.motion-ok.is-finale .finale { animation: finale-in .5s ease-out; }
@keyframes finale-in { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.finale .eyebrow { margin-top: 1rem; }
.finale__title { font: 600 clamp(2.4rem, 6vw, 4.2rem)/1 var(--font-display); text-transform: uppercase; color: var(--indigo); margin: 0 0 .6rem; }
.finale__title:focus { outline: none; }
.finale__lede { font: 500 clamp(1.2rem, 2.4vw, 1.6rem)/1.3 var(--font-display); color: var(--indigo); }
.finale__lede span { color: var(--clay); }
.pathways { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.pathways a {
  display: grid; gap: .3rem; height: 100%; padding: 1rem 1.1rem; border-radius: 18px; text-decoration: none;
  background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 8px 22px rgba(74, 56, 26, .1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pathways a:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(74, 56, 26, .16); }
.pathways strong { font: 600 1.12rem/1.15 var(--font-display); text-transform: uppercase; color: var(--oasis-deep); }
.pathways span { font-size: .88rem; color: var(--ink-soft); }
.finale__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.is-finale body { overflow: hidden; }

/* ---------- Footer ---------- */
.st-footer { position: relative; z-index: 8; padding: 0 16px 16px; }
.st-footer__inner { max-width: 1200px; margin: 0 auto; padding: 1.2rem 1.4rem; display: grid; gap: .6rem; }
.st-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.st-footer a { color: var(--ink); font-weight: 700; }

/* ---------- 2D stadium artwork ---------- */
.s2-fascia, .s2-board-text, .s2-score { font-family: var(--font-display); font-weight: 600; fill: #FFFCF5; letter-spacing: .06em; }
.s2-score { fill: #FFFCF5; }
.s2-zone { fill: transparent; stroke: none; }
.s2-zone.is-active { fill: rgba(232, 163, 61, .34); stroke: #FFF1CC; stroke-width: 2.2; }
.motion-ok .s2-zone.is-active { animation: zone-pulse 2s ease-in-out infinite; }
@keyframes zone-pulse { 50% { fill: rgba(232, 163, 61, .5); } }
.s2-shadow { fill: rgba(31, 42, 68, .45); }
.s2-trail { stroke: var(--dune-gold); stroke-width: 4; stroke-linecap: round; opacity: .8; }
.is-scored .s2-net--east { fill: rgba(255, 241, 204, .7); }
.s2-num { font-family: var(--font-display); }

/* ---------- Map and explore states ---------- */
.is-map .cp-card { opacity: .35; }
.is-exploring .cp-card { opacity: .3; pointer-events: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .st-nav__links { display: none; }
  .st-nav { justify-content: space-between; }
  .pathways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .st-header { top: 6px; left: 6px; right: 6px; gap: 6px; }
  .st-nav { padding: .35rem .4rem .35rem .8rem; }
  .st-toolbar { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: .25rem; padding: .3rem; }
  .seg button, .tool { min-height: 36px; min-width: 34px; padding: .3rem .5rem; font-size: .8rem; }
  .tool--icon { padding: 0 .4rem; font-size: 1.1rem; }
  .tool-counter { min-width: 2.8rem; font-size: .76rem; }
  .step { padding: 116px 10px 30px; min-height: 135vh; }
  /* Entrance: dock the card at the bottom so the stadium shows above it */
  .step--hero { min-height: 100vh; min-height: 100svh; padding: 0 10px 64px; align-items: flex-end; } /* room for the ecosystem badge */
  .hero-card { padding: 1.1rem 1.1rem 1rem; }
  .hero-card__title { font-size: 2.6rem; }
  .hero-card__tag { font-size: 1.2rem; margin: .2rem 0 .5rem; }
  .hero-card p { font-size: .92rem; margin-bottom: .55rem; }
  .hero-card__status { display: none; }
  .cp-card { top: 112px; max-width: none; padding: .6rem .8rem .7rem; }
  .cp-card p { display: none; }
  .stadium-js .cp-details.is-open { left: 6px; right: 6px; top: auto; bottom: 6px; width: auto; max-height: 52vh; border-radius: 22px; }
  .chapters__pages { grid-template-columns: 1fr; }
  .pathways { grid-template-columns: 1fr; }
  .pl-facts { grid-template-columns: 1fr; }
  .hotspot { min-height: 30px; margin: -15px 0 0 -15px; }
  .hotspot__num { width: 30px; height: 30px; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hotspot__label { transition: none; }
}

/* ---------- No JavaScript (or the stadium could not start): a plain readable page ---------- */
html:not(.js) .st-toolbar, .no-stadium .st-toolbar, html:not(.js) .stage, .no-stadium .stage { display: none; }
html:not(.js) .step, .no-stadium .step { min-height: 0; padding-bottom: 8px; }
html:not(.js) .step--hero, .no-stadium .step--hero { align-items: flex-start; padding-top: 96px; min-height: 0; }
html:not(.js) .cp-card, .no-stadium .cp-card { position: relative; top: auto; }
html:not(.js) .cp-card .btn, .no-stadium .cp-card .btn { display: none; }
html:not(.js) .hero-card__cue, .no-stadium .hero-card__cue { display: none; }
