/* ============================================================================
   WARP ZONE — NEON CONSOLE SHELL  (Mr. Avery's mock, 2026-07-29)
   Load AFTER css/windows.css.  Scoped to .win.w-arcade / .wz-* only.

   WHAT REPLACED WHAT
   ------------------
   This file used to hold the PORTAL FRAME — a 9-slice `border-image` neon gate
   wrapped around the whole window (.wz-portal / .wz-well / .wz-rim, driven by
   SLICE_X/SLICE_Y in js/arcade.js). It is GONE. His mock brings its own chrome
   (wordmark header, nav tabs, neon panel borders), and nesting that inside the
   portal ring would have stacked two competing frames and eaten ~24% of the
   window for the privilege. `img/arcade/portal-frame.webp` and the whole
   _tools/warpzone/ pipeline stay ON DISK — only the wiring is removed. This
   also retires the open "circular vs rectangular" question: no surround, moot.

   SCOPE: the app window ONLY. The mock drew a START bar / search / music
   player / clock along the bottom — that is the real OS taskbar, already on
   screen beneath this window. Nothing in here rebuilds it.

   STRUCTURE
     .win-body.wz-body
       .wz-stars                     drifting starfield, z0, decorative
       #arcade-sites.wz-app          flex column, z1
         .wz-topbar                  brand · HOME/ARCADE/CATEGORIES · player
         .wz-scroll                  THE single scroll container
           .wz-view[data-view=home]    hero + YOUR ZONE + EXPLORE ARCADE
           .wz-view[data-view=arcade]  every tagged section + suggest box
           .wz-view[data-view=cats]    category tiles

   ⚠ ONE scroll container on purpose: the lazy-art IntersectionObserver takes
   .wz-scroll as its root, so the root stays valid whichever tab is showing.
   Cards inside a hidden view have no box, never intersect, and never load
   their tile until that tab is opened — tabs make laziness better, not worse.

   ⚠ SPECIFICITY (inherited from the old file, still true): windows.css has
   `.w-arcade .win-body { overflow-y: auto }` at (0,2,0). The body rule below
   is (0,4,0) so it wins regardless of stylesheet order.

   PALETTE: the mock is cyan/magenta/purple neon, so `--c` is re-pointed to
   cyan INSIDE .wz-app. That one line carries the existing .arc-* rules in
   windows.css (section heads, card borders, ★, rating stars) over to the new
   look without duplicating them here. --c-arcade stays orange elsewhere.
   ========================================================================= */

.win.w-arcade .win-body.wz-body {
  position: relative;
  padding: 0;
  overflow: hidden; overflow-y: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1b1040 0%, #0d0722 55%, #07040f 100%);
  display: flex;
  flex-direction: column;
}

/* ── starfield ─────────────────────────────────────────────────────────────
   Two tiled radial-gradient layers on one slow transform drift. No DOM nodes,
   no per-frame JS. */
.wz-stars {
  position: absolute; inset: -60px; z-index: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #9ad9ff 99%, transparent),
    radial-gradient(1.5px 1.5px at 68% 42%, #ff9ad9 99%, transparent),
    radial-gradient(1px 1px at 34% 76%, #ffffff 99%, transparent),
    radial-gradient(1px 1px at 88% 12%, #c6f542 99%, transparent),
    radial-gradient(1.5px 1.5px at 52% 62%, #16E0E0 99%, transparent);
  background-size: 260px 220px, 340px 300px, 190px 170px, 420px 380px, 300px 260px;
  animation: wz-drift 78s linear infinite;
}
@keyframes wz-drift { to { transform: translate3d(-260px, -220px, 0); } }

.wz-app {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 0; margin: 0; gap: 0;
  overflow: hidden;
  --c: #16E0E0;                    /* re-point the arcade accent to neon cyan */
  --wz-pink: #FF2E7E;
  --wz-purple: #8A6CFF;
  --wz-gold: #FFD400;
}

/* one-shot warp-in on open */
.wz-app.wz-in { animation: wz-warp .46s cubic-bezier(.2,.8,.3,1) both; }
@keyframes wz-warp {
  from { opacity: 0; transform: scale(.965); }
  to   { opacity: 1; transform: none; }
}

/* ── top bar ─────────────────────────────────────────────────────────────── */
.wz-topbar {
  flex: none;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(10,6,26,.92), rgba(10,6,26,.62));
  border-bottom: 2px solid var(--c);
  box-shadow: 0 2px 18px rgba(22,224,224,.22);
}
.wz-brand { display: flex; flex-direction: column; gap: 3px; flex: none; }
.wz-wordmark {
  font-family: 'Press Start 2P', monospace; font-size: 19px; line-height: 1;
  display: flex; align-items: baseline; gap: 7px;
}
.wz-wordmark b {
  color: #eafcff; font-weight: 400;
  text-shadow: 0 0 6px var(--c), 0 0 16px rgba(22,224,224,.75), 2px 2px 0 #0a0618;
}
.wz-wordmark i {
  color: var(--wz-gold); font-style: normal;
  text-shadow: 0 0 6px var(--wz-pink), 0 0 16px rgba(255,46,126,.6), 2px 2px 0 #0a0618;
}
.wz-tagline {
  font: 700 8px 'JetBrains Mono', monospace; letter-spacing: .18em;
  color: rgba(154,217,255,.7); text-transform: uppercase;
}

.wz-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.wz-nav::-webkit-scrollbar { height: 0; }
.wz-tab {
  background: none; border: none; cursor: pointer; white-space: nowrap;
  font: 900 13px 'Geologica', sans-serif; letter-spacing: .06em;
  color: rgba(233,240,255,.66); padding: 8px 12px 6px;
  border-bottom: 3px solid transparent;
  transition: color .12s, border-color .12s;
}
.wz-tab:hover { color: #fff; }
.wz-tab.wz-on { color: #fff; border-bottom-color: var(--wz-gold); text-shadow: 0 0 10px rgba(255,212,0,.6); }
.wz-tab:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }

.wz-player {
  flex: none; display: flex; align-items: center; gap: 9px;
  padding: 7px 13px;
  background: rgba(12,7,30,.85);
  border: 2px solid var(--wz-pink);
  box-shadow: 0 0 14px rgba(255,46,126,.35), inset 0 0 18px rgba(138,108,255,.18);
}
.wz-player-ava { font-size: 19px; line-height: 1; filter: drop-shadow(0 0 5px var(--wz-pink)); }
.wz-player-txt { display: flex; flex-direction: column; gap: 2px; }
.wz-player-name {
  font: 900 11px 'Geologica', sans-serif; letter-spacing: .07em; color: var(--wz-pink);
}
.wz-player-coins-row {
  font: 700 11px 'JetBrains Mono', monospace; color: #fff; display: flex; align-items: center; gap: 4px;
}
.wz-player-coins-row b { color: var(--wz-gold); }

/* ── views + the one scroll container ────────────────────────────────────── */
.wz-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.wz-scroll::-webkit-scrollbar { width: 10px; }
.wz-scroll::-webkit-scrollbar-track { background: rgba(0,0,0,.35); }
.wz-scroll::-webkit-scrollbar-thumb { background: var(--c); border: 2px solid #0a0618; }
/* author `display` would beat the UA [hidden] rule — see CLAUDE.md gotcha #4 */
.wz-view { display: block; }
.wz-view[hidden] { display: none !important; }

/* ── HOME: hero + YOUR ZONE ──────────────────────────────────────────────── */
.wz-app .arc-top {
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  padding: 14px 16px 4px;
  border-bottom: none;
  align-items: stretch;
}
/* ── the hero, mock layout ────────────────────────────────────────────────
   TWO COLUMNS: a solid dark copy panel on the left, artwork filling the right.
   NOT a full-bleed image with the text floated over it — that split is most of
   why the mock reads as a console UI instead of a streaming-service banner. */
.wz-app .arc-hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  border: 2px solid var(--c);
  background: linear-gradient(180deg, #140b30, #0c0720);
  box-shadow: 0 0 20px rgba(22,224,224,.28);
  overflow: hidden;
}
.wz-hero-text {
  position: relative; z-index: 2; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 22px 20px 18px; gap: 2px;
}
.wz-hero-artwrap { position: relative; min-width: 0; overflow: hidden; }
.wz-app .arc-hero-img {
  position: absolute; inset: 0; filter: none;
  background-size: cover; background-position: center;
}
/* feather the art into the copy panel instead of a hard seam */
.wz-hero-artwrap::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, #0c0720 0%, rgba(12,7,32,.55) 14%, transparent 42%);
}
.wz-app .arc-hero-badge {
  position: static; margin-bottom: 10px;
  border: 2px solid var(--c); background: rgba(10,6,26,.75); color: var(--c);
  text-shadow: 0 0 8px rgba(22,224,224,.8);
}
.wz-app .arc-hero-title {
  position: static; margin: 0;
  font-size: clamp(26px, 3.4vw, 46px); line-height: 1.02;
  text-shadow: 3px 3px 0 #0a0618, 0 0 24px rgba(255,255,255,.35);
}
.wz-hero-tag {
  margin-top: 7px;
  font: 900 12px 'Geologica', sans-serif; letter-spacing: .07em; text-transform: uppercase;
  color: var(--wz-pink); text-shadow: 0 0 10px rgba(255,46,126,.55);
}
.wz-hero-desc {
  margin: 9px 0 0; max-width: 40ch;
  font: 600 12.5px 'Inter', sans-serif; line-height: 1.5; color: rgba(233,240,255,.82);
}
.wz-hero-btns { display: flex; align-items: center; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.wz-app .arc-hero-btn {
  background: var(--wz-gold); color: #1a1200; border: 2px solid #0a0618;
  box-shadow: 4px 4px 0 #0a0618, 0 0 18px rgba(255,212,0,.45);
  margin: 0;
}
.wz-app .arc-hero-btn:hover { background: #ffe14d; transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #0a0618, 0 0 22px rgba(255,212,0,.6); }
.wz-hero-details {
  background: rgba(10,6,26,.7); color: var(--c); border: 2px solid var(--c);
  font: 900 12px 'Geologica', sans-serif; letter-spacing: .06em; padding: 9px 16px; cursor: pointer;
  transition: background .1s, color .1s, transform .08s;
}
.wz-hero-details:hover { background: var(--c); color: #06121a; transform: translate(-2px,-2px); }
.wz-hero-details:focus-visible,
.wz-app .arc-hero-btn:focus-visible { outline: 3px solid var(--wz-pink); outline-offset: 3px; }
/* dots sit at the bottom of the COPY column now, not floating over the art */
.wz-app .arc-hero-dots { position: static; z-index: 3; margin-top: auto; padding-top: 16px; transform: none; }
.wz-app .arc-dot { cursor: pointer; }
.wz-app .arc-dot:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.wz-app .arc-hero-prev, .wz-app .arc-hero-next {
  z-index: 4; background: rgba(10,6,26,.72); border: 2px solid rgba(22,224,224,.55);
  color: var(--c); padding: 7px 9px; font-size: 13px; line-height: 1;
}
.wz-app .arc-hero-prev:hover, .wz-app .arc-hero-next:hover { background: var(--c); color: #06121a; }
.wz-app .arc-hero-prev:focus-visible, .wz-app .arc-hero-next:focus-visible { outline: 3px solid var(--wz-pink); outline-offset: 2px; }

/* ── row scrollbars ───────────────────────────────────────────────────────
   windows.css paints these a solid 6px cyan. A full-width bright cyan bar under
   a row reads as a PROGRESS bar, not a scrollbar. Rows that got ‹ › arrows hide
   it entirely (the arrows are the affordance, and the mock shows none); rows
   WITHOUT arrows — the ARCADE tab's sections — keep a slimmed, dimmed one, so
   nothing ever loses its only scroll cue. */
.wz-app .wz-hasarrows .arc-row,
.wz-app .wz-hasarrows .arc-recent-grid { scrollbar-width: none; }
.wz-app .wz-hasarrows .arc-row::-webkit-scrollbar,
.wz-app .wz-hasarrows .arc-recent-grid::-webkit-scrollbar { height: 0; display: none; }

.wz-app .arc-row::-webkit-scrollbar { height: 4px; }
.wz-app .arc-row::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
.wz-app .arc-row::-webkit-scrollbar-thumb { background: rgba(22,224,224,.35); }
.wz-app .arc-row:hover::-webkit-scrollbar-thumb { background: rgba(22,224,224,.7); }

.wz-app .arc-right {
  position: relative;
  background: rgba(12,7,30,.72);
  border: 2px solid var(--wz-purple);
  box-shadow: 0 0 18px rgba(138,108,255,.25);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* ── corner brackets ──────────────────────────────────────────────────────
   The mock's panels carry small L-shaped accents at opposite corners. Two per
   panel (top-left + bottom-right) via ::before/::after — a four-corner version
   would need two extra elements per panel for no real gain. */
.wz-app .arc-hero::before, .wz-app .arc-hero::after,
.wz-app .arc-right::before, .wz-app .arc-right::after {
  content: ''; position: absolute; z-index: 6; pointer-events: none;
  width: 15px; height: 15px; border: 0 solid var(--wz-gold);
}
.wz-app .arc-hero::before, .wz-app .arc-right::before {
  top: 4px; left: 4px; border-top-width: 3px; border-left-width: 3px;
}
.wz-app .arc-hero::after, .wz-app .arc-right::after {
  bottom: 4px; right: 4px; border-bottom-width: 3px; border-right-width: 3px;
}
/* YOUR ZONE — the mock wraps all three sections in ONE titled frame */
.wz-zone-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 2px solid rgba(138,108,255,.45);
  background: linear-gradient(180deg, rgba(138,108,255,.22), transparent);
  font: 900 12px 'Geologica', sans-serif; letter-spacing: .1em; color: #fff;
}
.wz-zone-ico { font-size: 15px; line-height: 1; filter: drop-shadow(0 0 6px var(--wz-pink)); }

.wz-app .arc-panel-head {
  font-family: 'Geologica', sans-serif; font-weight: 900; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--c);
  padding: 9px 12px 6px;
}
.wz-pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wz-viewall {
  background: none; border: none; cursor: pointer; padding: 0;
  font: 800 9.5px 'JetBrains Mono', monospace; letter-spacing: .08em;
  color: rgba(154,217,255,.8);
}
.wz-viewall:hover { color: var(--wz-gold); }
.wz-viewall:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

.wz-app .arc-popular { flex: 1; min-height: 0; overflow-y: auto; }
.wz-app .arc-pop-row { gap: 9px; }
.wz-app .arc-pop-rank {
  color: var(--wz-pink); font-size: 13px; width: 24px; flex: none;
  font-family: 'JetBrains Mono', monospace; font-weight: 800;
}
.wz-app .arc-pop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* real class play counts — only rendered when stats.php actually returned them */
.wz-pop-n {
  flex: none; font: 800 10px 'JetBrains Mono', monospace; color: var(--wz-gold);
  letter-spacing: .02em;
}

/* ── scroll arrows on the horizontal rows (mock's ‹ ›) ────────────────────
   They hide themselves at each end, so an arrow is never a dead control. */
.wz-hasarrows { position: relative; }
.wz-rowarrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 26px; height: 42px; padding: 0; cursor: pointer;
  background: rgba(10,6,26,.9); color: var(--c);
  border: 2px solid var(--c); border-radius: 3px;
  font: 900 17px 'Geologica', sans-serif; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(22,224,224,.4);
}
.wz-rowarrow:hover { background: var(--c); color: #06121a; }
.wz-rowarrow:focus-visible { outline: 3px solid var(--wz-pink); outline-offset: 2px; }
.wz-rowarrow[hidden] { display: none; }
.wz-rowarrow-prev { left: 2px; }
.wz-rowarrow-next { right: 2px; }
.wz-explore .wz-rowarrow { top: 54%; }
.wz-app .arc-recent { border-bottom: 1px solid rgba(138,108,255,.28); }
/* windows.css lays this out as a 3-column grid, so a 4th or 5th game wrapped to
   a second row and left an orphan tile with a dead gap beside it. The mock's
   version is one row you scroll — flex + overflow-x gives that without having
   to build carousel arrows. */
.wz-app .arc-recent-grid {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; padding-bottom: 4px;
}
.wz-app .arc-recent-card { flex: 0 0 104px; min-width: 0; }
.wz-app .arc-recent-grid::-webkit-scrollbar { height: 6px; }
.wz-app .arc-recent-grid::-webkit-scrollbar-thumb { background: var(--wz-purple); }
.wz-app .arc-panel-empty {
  padding: 0 12px 10px; font: 600 11px 'Inter', sans-serif; color: rgba(233,240,255,.55);
}

/* stat tiles — every one of these is REAL state (pet coins / click history /
   favourites). LEVEL, ACHIEVEMENTS and HIGH SCORE from the mock are dropped;
   see the note in js/arcade.js for why. */
.wz-stats {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 8px; border-top: 1px solid rgba(138,108,255,.28);
}
.wz-stat {
  display: flex; align-items: center; gap: 7px; padding: 8px 7px;
  background: rgba(10,6,26,.8); border: 1.5px solid rgba(22,224,224,.4);
  min-width: 0;
}
.wz-stat-ico { font-size: 15px; line-height: 1; flex: none; }
.wz-stat-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wz-stat-label {
  font: 800 8px 'JetBrains Mono', monospace; letter-spacing: .06em;
  color: rgba(154,217,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wz-stat-val { font: 900 14px 'Geologica', sans-serif; color: #fff; line-height: 1; }
#wz-stat-coins .wz-stat-val { color: var(--wz-gold); }

/* ── cards ───────────────────────────────────────────────────────────────── */
.wz-app .arc-card {
  background: rgba(12,7,30,.75);
  border: 2px solid rgba(22,224,224,.45);
  padding-bottom: 2px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.wz-app .arc-card:hover,
.wz-app .arc-card:focus-visible {
  border-color: var(--c);
  box-shadow: 0 0 16px rgba(22,224,224,.45);
  transform: translateY(-3px);
}
.wz-app .arc-card:focus-visible { outline: 3px solid var(--wz-pink); outline-offset: 2px; }
.wz-card-cat {
  font: 800 8.5px 'JetBrains Mono', monospace; letter-spacing: .1em;
  color: rgba(154,217,255,.68); padding: 0 6px 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* DETAILS jump target */
.wz-flash { animation: wz-flash 1.6s ease-out 1; }
@keyframes wz-flash {
  0%, 100% { box-shadow: 0 0 16px rgba(22,224,224,.45); }
  20%, 60% { box-shadow: 0 0 0 4px var(--wz-gold), 0 0 26px rgba(255,212,0,.7); }
}

.wz-explore { padding: 10px 16px 16px; }
.wz-app .arc-section-head {
  color: var(--c); text-shadow: 0 0 10px rgba(22,224,224,.45);
  text-transform: uppercase; letter-spacing: .08em;
}

/* ── CATEGORIES ──────────────────────────────────────────────────────────── */
.wz-view[data-view="cats"] { padding: 14px 16px 20px; }
.wz-catgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
  padding-top: 8px;
}
.wz-cattile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  min-height: 132px; justify-content: flex-end;
  padding: 16px 16px 14px; cursor: pointer; text-align: left;
  background: linear-gradient(140deg, rgba(138,108,255,.28), rgba(22,224,224,.12));
  border: 2px solid var(--c);
  transition: transform .1s, box-shadow .1s;
}
.wz-cattile-ico {
  font-size: 30px; line-height: 1; margin-bottom: auto;
  filter: drop-shadow(0 0 8px rgba(22,224,224,.55));
}
.wz-cattile:hover { transform: translate(-3px,-3px); box-shadow: 5px 5px 0 #0a0618, 0 0 20px rgba(22,224,224,.4); }
.wz-cattile:focus-visible { outline: 3px solid var(--wz-pink); outline-offset: 3px; }
.wz-cattile-name { font: 900 15px 'Geologica', sans-serif; color: #fff; letter-spacing: .03em; }
.wz-cattile-n { font: 700 10px 'JetBrains Mono', monospace; color: var(--wz-gold); letter-spacing: .06em; }

/* ── narrow app window ─────────────────────────────────────────────────────
   ⚠ These are CLASSES, not @media queries, on purpose. A media query measures
   the VIEWPORT, but this is a draggable OS window — at a 380px-wide window on
   a 1440px screen a `max-width: 900px` query never fires and the hero/panel
   grid stays two columns and squashes. A ResizeObserver in renderArcadePortal
   measures the app element itself and sets .wz-narrow / .wz-tiny. (Same trap
   the Photo Booth dock hit; see .cc-bcompact in canvas.css.) */
.wz-app.wz-narrow .arc-top { grid-template-columns: 1fr; }
/* the hero's own split has to collapse too, or the copy column gets ~150px */
.wz-app.wz-narrow .arc-hero { grid-template-columns: 1fr; }
.wz-app.wz-narrow .wz-hero-artwrap { display: none; }
.wz-app.wz-narrow .arc-hero { background: linear-gradient(140deg, #1a0f3c, #0c0720); }
.wz-app.wz-narrow .wz-topbar { flex-wrap: wrap; gap: 10px 14px; }
.wz-app.wz-narrow .wz-nav { order: 3; flex-basis: 100%; }
.wz-app.wz-narrow .wz-player { margin-left: auto; }
.wz-app.wz-narrow .wz-catgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.wz-app.wz-tiny .wz-wordmark { font-size: 15px; }
.wz-app.wz-tiny .wz-tagline { display: none; }
.wz-app.wz-tiny .wz-player-name { display: none; }
.wz-app.wz-tiny .wz-stats { grid-template-columns: 1fr; }
.wz-app.wz-tiny .wz-tab { font-size: 11px; padding: 7px 8px 5px; }
.wz-app.wz-tiny .wz-topbar { padding: 8px 10px; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  .wz-stars { animation: none; }
  .wz-app.wz-in { animation: none; }
  .wz-flash { animation: none; box-shadow: 0 0 0 4px var(--wz-gold) !important; }
}
