/* tour.css: the 3D warehouse. Three states:
   .tour            no WebGL or no JavaScript: the zones show as plain cards
   .tour.ready      the 3D building is running behind the intro
   .tour.open       full screen, inside the building */

.tour { position: relative; overflow: hidden; overflow: clip; border-bottom: 1px solid var(--stroke); --cy: #5ee6ff; }
.tour-stage, .tour-shade, .tour-hud, .tour-exit, .tour-panel, .tour-bar { display: none; }
.tour-intro { position: relative; z-index: 2; padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: 2rem; }
.tour-intro-in { max-width: 640px; }
.tour-intro h1 { font-size: clamp(2.2rem, 4.8vw, 4rem); line-height: 1.04; letter-spacing: -.02em; max-width: 17ch; background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 12s ease-in-out infinite alternate; }
.tour-intro .lead { color: #c3c5de; }
.tour-intro .hub-card { margin-top: 2rem; }

/* Plain cards (also what search engines and AI read) */
.tour-zones { list-style: none; margin: 0 auto; padding: 1rem var(--gut) 3.5rem; max-width: var(--wrap); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 1rem; position: relative; z-index: 2; }
.tour-zones li { padding: 1.3rem; border: 1px solid var(--stroke); border-radius: 14px; background: rgba(255,255,255,.03); }
.tz-num { font-family: var(--mono); color: var(--cy); font-size: .74rem; margin: 0 0 .4rem; letter-spacing: .1em; }
.tour-zones h3 { margin-bottom: .5rem; }
.tour-zones p { color: var(--mut); font-size: .94rem; }
.tz-fig strong { font: 600 1.5rem var(--display); color: #fff; margin-right: .3rem; }
.tz-fig span { font-size: .85rem; }
.tour-zones a { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; color: var(--kraft); }

/* 3D running */
.tour.ready { min-height: min(980px, calc(100svh - 108px)); display: flex; flex-direction: column; justify-content: space-between; }
.tour-page.ready { min-height: calc(100svh - 108px); }
.tour.ready .tour-stage { display: block; position: absolute; inset: 0; }
.tour-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: 0; touch-action: pan-y; cursor: grab; }
.tour-canvas.drag { cursor: grabbing; }
.tour-canvas.hot { cursor: pointer; }
.tour.ready .tour-shade { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, rgba(5,6,16,.92) 0%, rgba(5,6,16,.7) 28%, rgba(5,6,16,0) 55%), linear-gradient(0deg, rgba(5,6,16,.85), rgba(5,6,16,0) 22%); transition: opacity .6s; }
.tour.ready .tour-intro { pointer-events: none; }
.tour.ready .tour-intro a, .tour.ready .tour-intro button, .tour.ready .tour-intro .hub-card { pointer-events: auto; }
.tour.ready .tour-bar { display: flex; position: relative; z-index: 3; }

/* Floating area labels, placed in 3D by tour.js */
.tour-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.zl { position: absolute; left: 0; top: 0; pointer-events: auto; font: 500 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #dff9ff; white-space: nowrap;
  background: rgba(6,10,26,.88); border: 1px solid rgba(94,230,255,.55); border-radius: 4px; padding: .45rem .6rem; cursor: pointer;
  box-shadow: 0 0 18px rgba(94,230,255,.25); transition: border-color .2s, color .2s, box-shadow .2s, opacity .3s; will-change: transform; }
.zl b { color: var(--cy); font-weight: 500; margin-right: .45rem; }
.zl::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 26px; background: linear-gradient(rgba(94,230,255,.7), rgba(94,230,255,0)); }
.zl:hover, .zl.hot, .zl.on { color: #fff; border-color: var(--kraft); box-shadow: 0 0 24px rgba(220,176,122,.45); }
.zl:hover b, .zl.hot b, .zl.on b { color: var(--kraft); }
.zl.hide { opacity: 0; pointer-events: none; }

/* Area buttons along the bottom */
.tour-bar { align-items: center; gap: .6rem; padding: 0 var(--gut) 1.4rem; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tour-bar::-webkit-scrollbar { display: none; }
.tour-bar ol { display: flex; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.tour-bar button { font: 500 .72rem/1 var(--mono); letter-spacing: .04em; color: var(--mut); background: rgba(8,10,28,.92); border: 1px solid var(--stroke-2); border-radius: 999px; padding: .6rem .85rem; cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s, background .2s; }
.tour-bar button span { color: var(--cy); margin-right: .25rem; }
.tour-bar button:hover, .tour-bar button.on { color: #fff; border-color: var(--kraft); background: rgba(220,176,122,.12); }
.tour-bar .tour-play { color: #14152e; background: linear-gradient(135deg, var(--kraft-2), var(--kraft)); border: 0; }
.tour-bar .tour-play:hover, .tour-bar .tour-play.on { color: #14152e; background: #fff; }

/* Full screen, inside the building */
.tour.open { overflow: hidden; overflow: clip; position: fixed; inset: 0; z-index: 400; min-height: 0; height: 100%; border: 0; background: #04050d; }
.tour.open .tour-intro { opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s; }
.tour.open .tour-shade { opacity: .35; }
.tour.open .tour-canvas { touch-action: none; }
.tour.open .tour-bar { position: absolute; left: 0; right: 0; bottom: 0; justify-content: center; }
.tour.open .tour-hud { display: block; position: absolute; left: var(--gut); top: 1.1rem; z-index: 3; pointer-events: none; }
.tour-brand { font: 500 .76rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #fff; margin: 0 0 .5rem; }
.tour-brand span { color: var(--cy); letter-spacing: .06em; }
.tour-hint { font: 400 .72rem/1.4 var(--mono); color: var(--dim); margin: 0; }
.tour.open .tour-exit { display: block; position: absolute; right: var(--gut); top: 1rem; z-index: 4; font: 500 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #fff;
  background: rgba(8,10,28,.75); border: 1px solid var(--stroke-2); border-radius: 999px; padding: .7rem 1rem; cursor: pointer; }
.tour.open .tour-exit:hover { border-color: var(--kraft); }
.tour.open .tour-panel:not([hidden]) { display: block; position: absolute; right: var(--gut); top: 4.2rem; z-index: 3; width: min(380px, calc(100% - 2 * var(--gut))); max-height: calc(100% - 10rem); overflow: auto;
  padding: 1.4rem 1.5rem; border-radius: 16px; background: rgba(8,10,28,.95); border: 1px solid rgba(94,230,255,.3); box-shadow: 0 0 40px rgba(94,230,255,.12), 0 30px 70px -30px #000;
  animation: panel-in .5s cubic-bezier(.2,.7,.2,1); }
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); filter: blur(6px); } }
.tour-panel-k { font: 500 .72rem/1 var(--mono); letter-spacing: .12em; color: var(--cy); margin: 0 0 .8rem; }
.tour-panel-k span:last-child { color: var(--dim); }
.tour-panel h3 { font-size: 1.6rem; margin-bottom: .6rem; }
.tour-panel p { color: #c9cbe0; font-size: .94rem; }
.tour-panel .tz-num { display: none; }
.tour-panel .tz-fig { padding: .8rem 0; border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); }
.tour-panel .tz-fig strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.9rem; }
.tour-panel a { font: 500 .78rem/1 var(--mono); color: var(--kraft); letter-spacing: .06em; }
.tour-panel-nav { display: flex; gap: .4rem; margin-top: 1.2rem; }
.tour-panel-nav button { flex: 1; font: 500 .7rem/1 var(--mono); color: var(--mut); background: transparent; border: 1px solid var(--stroke-2); border-radius: 999px; padding: .6rem .4rem; cursor: pointer; }
.tour-panel-nav button:hover { color: #fff; border-color: var(--kraft); }
html.tour-lock, html.tour-lock body { overflow: hidden; }

@media (max-width: 900px) {
  .tour.ready .tour-shade { background: linear-gradient(0deg, rgba(5,6,16,.95) 0%, rgba(5,6,16,.75) 45%, rgba(5,6,16,.1) 75%); }
  .tour.ready { min-height: calc(100svh - 70px); justify-content: flex-end; }
  .tour.ready .tour-intro { padding-top: 38vh; }
  .tour-intro .hub-card { display: none; }
  .tour.open .tour-panel:not([hidden]) { left: .6rem; right: .6rem; width: auto; top: auto; bottom: 4.2rem; max-height: 44%; }
  .tour.open .tour-bar { justify-content: flex-start; }
  .tour.open .tour-hint { display: none; }
  .zl { font-size: .6rem; padding: .35rem .45rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-panel { animation: none !important; }
}

@media (max-width: 900px) {
  .tour:not(.open) .tour-labels { display: none; }
}
.tour-intro { width: 100%; }
@media (max-width: 600px) { .tour-brand span { display: none; } }

/* Nothing frosted sits over the moving 3D: re-blurring a live canvas every frame is what slows integrated graphics */
.tour .glass, .tour .hub-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10,12,32,.92); }

/* ---------------------------------------------------------------------------------------------------
   Version 3: the warehouse game. .tour.gaming = the game is on (full screen, chase camera).
   Nothing here uses backdrop-filter: every panel over the canvas is a plain, nearly opaque fill.
   --------------------------------------------------------------------------------------------------- */
.tour-intro-small { font: 400 .8rem/1.5 var(--mono); color: var(--mut); margin: .9rem 0 0; }
.tour-intro-small a, .linkish { color: var(--kraft); }
.linkish { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.tour-bar .tour-walk { color: #fff; border-color: rgba(94,230,255,.45); }

/* The plain HTML route: always visible below the stage */
.tour-text { scroll-margin-top: 84px; padding: clamp(2.5rem, 6vw, 4.5rem) 0 0; border-bottom: 1px solid var(--stroke); }
.tour-text h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 26ch; }
.tour-text-lead { color: var(--mut); max-width: 60ch; }
.tour-text .tour-zones { padding-top: 1.4rem; }
.tour-text h2:focus { outline: 0; }

.game[hidden], .g-card[hidden], .g-zone[hidden] { display: none !important; }
.tour.gaming .tour-hud, .tour.gaming .tour-exit, .tour.gaming .tour-bar, .tour.gaming .tour-panel, .tour.gaming .tour-labels, .tour.gaming .tour-shade, .tour.gaming .tour-intro { display: none !important; }
.game { position: absolute; inset: 0; z-index: 5; pointer-events: none; color: #fff; overflow: hidden; overflow: clip; }
.game button, .game a, .g-zone, .g-card, .g-pad { pointer-events: auto; }
.g-k { display: block; font: 500 .62rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }
.g-clock, .g-score, .g-side, .g-zone { background: rgba(6,9,24,.9); border: 1px solid rgba(94,230,255,.28); border-radius: 12px; }

.g-top { position: absolute; top: .8rem; left: 50%; transform: translateX(-50%); display: flex; gap: .5rem; align-items: stretch; }
.g-clock { padding: .45rem 1rem .5rem; text-align: center; min-width: 10.5rem; }
.g-clock b { display: block; font: 600 1.9rem/1.1 var(--mono); color: var(--live); font-variant-numeric: tabular-nums; }
.g-clock small { display: block; font: 400 .64rem/1.2 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.g-clock.warn { border-color: #ff7a6b; }
.g-clock.warn b { color: #ff7a6b; }
.g-score { padding: .45rem 1rem; text-align: center; min-width: 6rem; }
.g-score b { display: block; font: 600 1.5rem/1.3 var(--mono); color: #fff; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.g-btns { position: absolute; right: var(--gut); top: .8rem; display: flex; gap: .4rem; }
.g-btns button { font: 500 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(6,9,24,.9); border: 1px solid var(--stroke-2); border-radius: 999px; padding: .7rem .95rem; cursor: pointer; }
.g-btns button:hover, .g-btns button:focus-visible { border-color: var(--kraft); }

.g-side { position: absolute; left: var(--gut); top: .8rem; width: 16rem; padding: .8rem .95rem .6rem; }
.g-order { font: 500 .68rem/1.4 var(--mono); color: var(--cy); margin: 0 0 .5rem; }
.g-quest { list-style: none; margin: 0; padding: 0; }
.g-quest li { position: relative; padding: .32rem 0 .32rem 1.5rem; font: 500 .78rem/1.3 var(--body); color: var(--mut); }
.g-quest li::before { content: ""; position: absolute; left: 0; top: .42rem; width: .8rem; height: .8rem; border: 1px solid var(--stroke-2); border-radius: 3px; }
.g-quest li small { display: block; font: 400 .64rem/1.3 var(--mono); color: var(--dim); }
.g-quest li.now { color: #fff; }
.g-quest li.now::before { border-color: var(--kraft); box-shadow: 0 0 10px rgba(220,176,122,.8); }
.g-quest li.opt.now::before { border-color: var(--violet); box-shadow: 0 0 10px rgba(139,141,255,.8); }
.g-quest li.done { color: var(--dim); text-decoration: line-through; }
.g-quest li.done::before { background: var(--live); border-color: var(--live); }

.g-map { position: absolute; right: var(--gut); top: 4.2rem; width: 210px; height: 126px; border-radius: 8px; display: block; }
.g-zone { position: absolute; right: var(--gut); top: 12.4rem; width: min(350px, calc(100% - 2 * var(--gut))); max-height: calc(100% - 14rem); overflow: auto; padding: 1rem 1.15rem 1.05rem; }
.g-zone.pop { animation: panel-in .45s cubic-bezier(.2,.7,.2,1); }
.g-zk { font: 500 .66rem/1.2 var(--mono); letter-spacing: .1em; color: var(--cy); margin: 0 0 .55rem; padding-right: 2rem; }
.g-zx { position: absolute; right: .55rem; top: .45rem; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--stroke-2); background: transparent; color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.g-zb .tz-num { display: none; }
.g-zb h3 { font-size: 1.3rem; margin: 0 0 .4rem; color: #fff; }
.g-zb p { color: #c9cbe0; font-size: .86rem; margin: 0 0 .6rem; line-height: 1.5; }
.g-zb .tz-fig { padding: .5rem 0; border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); }
.g-zb .tz-fig strong { font: 600 1.45rem var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-right: .3rem; }
.g-zb .tz-fig span { font-size: .78rem; color: var(--mut); }
.g-zb a { font: 500 .74rem/1 var(--mono); color: var(--kraft); letter-spacing: .05em; }

.g-toast { position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 2 * var(--gut))); margin: 0; padding: .7rem 1.1rem; text-align: center;
  font: 500 .86rem/1.4 var(--body); color: #fff; background: rgba(6,9,24,.92); border: 1px solid rgba(220,176,122,.55); border-radius: 18px; opacity: 0; transition: opacity .25s; }
.g-toast.on { opacity: 1; }
.game .g-bl { pointer-events: none; cursor: default; border-color: rgba(220,176,122,.75); }

/* Touch controls: a floating thumbstick on the left, boost on the right */
.g-touch { display: none; }
.game.touch .g-touch { display: block; }
.g-pad { position: absolute; left: 0; bottom: 0; width: 58%; height: 44%; touch-action: none; -webkit-user-select: none; user-select: none; }
.g-stick { position: absolute; left: 1.4rem; bottom: 1.6rem; width: 124px; height: 124px; border-radius: 50%; border: 1px solid rgba(94,230,255,.55); background: rgba(6,9,24,.55); box-shadow: 0 0 24px rgba(94,230,255,.18) inset; }
.g-stick span { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(94,230,255,.22); border: 1px solid var(--cy); box-shadow: 0 0 18px rgba(94,230,255,.5); }
.game.sticking .g-stick { border-color: var(--cy); }
.g-boost { position: absolute; right: 1.4rem; bottom: 2.2rem; width: 92px; height: 92px; border-radius: 50%; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none;
  font: 600 .74rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(6,9,24,.7); border: 1px solid var(--kraft); box-shadow: 0 0 20px rgba(220,176,122,.3); }
.g-boost i { position: absolute; left: 22%; right: 22%; bottom: 22%; height: 3px; background: var(--kraft); transform-origin: left center; }
.g-boost.on { background: rgba(220,176,122,.3); }
.game.touch .g-toast { bottom: 11rem; }

/* Start, pause and finished screens */
.g-card { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: var(--gut); background: rgba(4,5,13,.55); pointer-events: auto; }
.g-card-in { width: min(520px, 100%); max-height: 100%; overflow: auto; padding: clamp(1.3rem, 4vw, 2rem); background: rgba(8,10,28,.97); border: 1px solid rgba(94,230,255,.35); border-radius: 18px; box-shadow: 0 0 60px rgba(94,230,255,.15), 0 30px 80px -30px #000; animation: panel-in .45s cubic-bezier(.2,.7,.2,1); }
.g-card h2 { font-size: clamp(1.5rem, 4.4vw, 2.1rem); color: #fff; margin: .5rem 0 .7rem; line-height: 1.1; }
.g-card p { color: #c9cbe0; font-size: .95rem; margin: 0 0 .8rem; }
.g-card .g-k { color: var(--cy); }
.g-card .g-small { font-size: .82rem; color: var(--mut); }
.g-how { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .4rem; }
.g-how li { font: 400 .8rem/1.45 var(--mono); color: #dfe0f2; padding: .55rem .75rem; border: 1px solid var(--stroke); border-radius: 8px; }
.g-how b { color: var(--kraft); font-weight: 500; margin-right: .4rem; }
.g-act { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.g-act .btn { flex: 1 1 auto; }
.g-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: .4rem 0 1rem; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; }
.g-stats div { padding: .6rem .7rem; border-right: 1px solid var(--stroke); }
.g-stats div:last-child { border-right: 0; }
.g-stats dt { font: 500 .6rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.g-stats dd { margin: .25rem 0 0; font: 600 1.15rem/1.1 var(--mono); color: #fff; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .g-top { left: .6rem; transform: none; top: .6rem; }
  .g-clock { min-width: 0; padding: .35rem .7rem; }
  .g-clock b { font-size: 1.35rem; }
  .g-clock small { display: none; }
  .g-score { min-width: 0; padding: .35rem .7rem; }
  .g-score b { font-size: 1.1rem; margin-top: .2rem; }
  .g-btns { right: .6rem; top: .6rem; }
  .g-btns button { padding: .6rem .7rem; font-size: .62rem; }
  .g-side { left: .6rem; top: 4.4rem; width: auto; max-width: calc(100% - 132px - 1.8rem); padding: .5rem .65rem; }
  .g-order { display: none; }
  .g-quest li { display: none; padding-top: .1rem; padding-bottom: .1rem; font-size: .76rem; }
  .g-quest li.now { display: block; }
  .g-quest li small { font-size: .6rem; }
  .g-map { right: .6rem; top: 4.4rem; width: 132px; height: 80px; }
  .g-zone { left: .6rem; right: .6rem; width: auto; top: 10rem; max-height: 34%; padding: .65rem .85rem .7rem; }
  .g-zb p:not(.tz-fig):not(.tz-num) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
  .g-zb .tz-fig { padding: .3rem 0; }
  .g-zb h3 { font-size: 1.05rem; }
  .g-zb p { font-size: .8rem; }
  .g-zb .tz-fig strong { font-size: 1.15rem; }
  .g-stats { grid-template-columns: repeat(2, 1fr); }
  .g-stats div:nth-child(2) { border-right: 0; }
  .g-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--stroke); }
  .g-card { align-items: flex-end; padding: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .g-card-in, .g-zone.pop { animation: none !important; }
  .g-toast { transition: none; }
}
