/* "The base" home page (author 27.10, mockup H2b): the hero's terrace with the game's machines, device panels from the game's UI kit.
   Loaded after site.css (header, buttons, devlog, press kit, footer come from there). Art: assets/base, 1 art px = 1 css px. */
@font-face { font-family: 'm6x11plus'; src: url('../assets/fonts/m6x11plus.ttf') format('truetype'); font-display: swap; }
:root {
  --qg-text: #e8dec9; --qg-text-soft: #cfc6b2; --qg-text-muted: #a5b0b0;
  --qg-brass: #bf9b62; --qg-brass-dark: #8a6a3a; --qg-line: #3b4042; --qg-steel-raised: #292a31;
  --qg-teal: #40ecdc; --qg-teal-text: #d2fffa; --qg-ink: #100c0a; --qg-select: #d2c9b6;
  --tk-light: #eeebff; --tk-mid: #a99cff; --tk-edge: #6b57f0;
}
.intro { text-align: center; padding-top: 10px; }
.intro .logo { margin: 0 auto 4px; width: min(230px, 60vw); height: auto; }
.intro h1 { font-size: clamp(20px, 2.6vw, 30px); margin-bottom: 0; }
.base { padding: 10px 0 8px; }
.base > h2 { font: 18px/1.3 'm6x11plus', monospace; letter-spacing: 1px; color: var(--soft); text-align: center; margin: 4px auto 0; }
.about { text-align: center; padding-top: 18px; }
.about .lead { max-width: 820px; margin: 0 auto 14px; }
.about .cta { justify-content: center; }

/* ---------- the terrace scene (960 x 600, scaled to the box) ---------- */
.box { position: relative; max-width: 1440px; margin: 14px auto 0; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.scene { position: relative; width: 960px; height: 600px; transform-origin: 0 0; image-rendering: pixelated; user-select: none; -webkit-user-select: none; }
.scene .sky-art { position: absolute; inset: 0; background: url('../assets/base/sky-nebula.webp') center top / 1200px auto; }
.scene .floor { position: absolute; left: 0; top: 52px; width: 960px; height: 548px; background: url('../assets/base/terrace.webp') 0 0 no-repeat; }
.scene .thing { position: absolute; padding: 0; border: 0; background-color: transparent; background-repeat: no-repeat; cursor: pointer; transform-origin: 50% 100%; transition: filter .2s; }
.scene .thing:hover, .scene .thing:focus-visible { filter: drop-shadow(0 0 3px #b9aeff) drop-shadow(0 0 8px #7d6bff); outline: none; }
.scene .thing.press { animation: press .45s; }
@keyframes press { 30% { transform: scale(1.04, .93); } 60% { transform: scale(.98, 1.03); } }
/* what telekinesis holds gets the game's 1 px outline in the light indigo band */
.scene .thing.held { filter: drop-shadow(1px 0 0 var(--tk-light)) drop-shadow(-1px 0 0 var(--tk-light)) drop-shadow(0 1px 0 var(--tk-light)) drop-shadow(0 -1px 0 var(--tk-light)) drop-shadow(0 0 6px var(--tk-edge)); }
.scene .label { position: absolute; transform: translate(-50%, -100%); font: 18px 'm6x11plus', monospace; letter-spacing: 1px; white-space: nowrap; padding: 1px 7px; background: #12112aee; border: 1px solid var(--qg-brass); color: #f2d79b; pointer-events: none; z-index: 900; }
.scene .hero { position: absolute; width: 128px; height: 128px; margin: -118px 0 0 -64px; background-repeat: no-repeat; pointer-events: none; z-index: 50; }
.scene .hero.flip { transform: scaleX(-1); }
.scene svg.rope { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 800; overflow: visible; }
.scene .spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--tk-light); box-shadow: 0 0 8px var(--tk-edge); pointer-events: none; animation: spark .6s forwards; z-index: 801; }
@keyframes spark { to { transform: translate(var(--sx), var(--sy)) scale(.2); opacity: 0; } }

/* the same machines as plain buttons: keyboard, screen readers, phones */
.dock { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 14px; padding-bottom: 8px; }
.dock button, .dock a { display: flex; align-items: center; gap: 8px; font: 18px 'm6x11plus', monospace; letter-spacing: 1px; padding: 0 12px 0 4px; height: 30px; color: var(--qg-text); cursor: pointer; text-decoration: none; box-sizing: content-box;
  border: 7px solid transparent; border-image: url('../assets/base/ui/plate.png') 7 fill stretch; background: none; image-rendering: pixelated; }
.dock button:hover, .dock a:hover { border-image-source: url('../assets/base/ui/plate-hover.png'); color: #fff6e2; }
.dock button:focus-visible, .dock a:focus-visible { border-image-source: url('../assets/base/ui/plate-focus.png'); color: var(--qg-teal-text); outline: none; }
.dock i { width: 26px; height: 26px; background: center / contain no-repeat; image-rendering: pixelated; }

/* ---------- device panel, rebuilt from the game's UI kit (Kit2 panel / socket / plate / tag, Kit node-gear) ---------- */
.dp-veil { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; background: rgba(6, 8, 10, .6); padding: 8px; }
.dp-veil.on { display: flex; }
.dp { position: relative; width: min(1000px, 100%); max-height: calc(100vh - 16px); overflow: auto; font: 18px/1.35 'm6x11plus', monospace; letter-spacing: 1px; color: var(--qg-text);
  border: 14px solid transparent; border-image: url('../assets/base/ui/panel.png') 14 fill round; image-rendering: pixelated; padding: 6px 8px 8px; }
.dp.open { animation: dpin .16s ease-out; }
@keyframes dpin { from { transform: scale(.96); opacity: 0; } }
.dp h2 { font: inherit; letter-spacing: inherit; margin: 0; }
.dp-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.dp-head .cap { width: 26px; height: 32px; background: no-repeat center / contain; image-rendering: pixelated; flex: none; }
.dp-title { color: var(--qg-brass); border-bottom: 2px solid var(--acc); padding-bottom: 1px; }
.dp-esc { margin-left: auto; min-width: 34px; height: 22px; padding: 0 6px; display: grid; place-items: center; color: var(--qg-ink); cursor: pointer; font: inherit; letter-spacing: inherit;
  border: 5px solid transparent; border-image: url('../assets/base/ui/tag.png') 5 fill stretch; background: none; box-sizing: content-box; }
.dp-esc:hover, .dp-esc:focus-visible { border-image-source: url('../assets/base/ui/tag-hover.png'); outline: none; }
.dp-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; }
.dp-well { border: 5px solid transparent; border-image: url('../assets/base/ui/socket.png') 5 fill stretch; padding: 10px; min-width: 0; }
.dp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.dp-chip { padding: 0 5px; min-height: 20px; border: 1px solid var(--qg-line); background: var(--qg-steel-raised); color: var(--qg-text-soft); }
.dp-chip.title { border-color: var(--qg-brass-dark); color: var(--qg-text); }
.dp-chip.fam { border-color: var(--acc); color: var(--qg-text); }
/* rank map: glass for ranks, the gear for master tiers, solid line along a row, dashed down to a gear */
.dp-map { position: relative; }
.dp-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dp-map line { stroke: var(--qg-line); stroke-width: 2; }
.dp-map line.dash { stroke-dasharray: 3 4; }
.dp-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; color: var(--qg-text-soft); }
.dp-node .glass { width: 35px; height: 46px; border-radius: 7px; border: 2px solid var(--acc); background: var(--acc); color: #14181b; display: grid; place-items: center; transition: transform .12s; box-sizing: border-box; }
.dp-node .gear { width: 40px; height: 40px; background: url('../assets/base/ui/node-gear.png') center / 100% 100% no-repeat; image-rendering: pixelated; display: grid; place-items: center; transition: transform .12s; }
.dp-node .gear::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 1px #14181b; }
.dp-node.teaser .glass { background: #1d2327; border-color: var(--qg-line); color: var(--tint); }
.dp-node.teaser .glass svg { width: 22px; height: 22px; fill: currentColor; }
.dp-node .lbl { position: absolute; top: 100%; width: 128px; margin-top: 3px; text-align: center; line-height: 1.1; }
.dp-node:hover .glass, .dp-node:focus-visible .glass { border-color: var(--qg-text); }
.dp-node:focus { outline: none; }
.dp-node.sel .glass { transform: scale(1.12); border: 3px solid var(--qg-select); }
.dp-node.sel .gear { transform: scale(1.12); filter: brightness(1.25); }
.dp-node.sel .lbl { color: var(--qg-text); }
/* detail pane */
.dp-detail { display: flex; flex-direction: column; min-height: 420px; }
.dp-preview { position: relative; aspect-ratio: 16 / 10; border: 5px solid transparent; border-image: url('../assets/base/ui/socket.png') 5 fill stretch; overflow: hidden; margin-bottom: 8px; background: #0c0b14; }
.dp-preview.wide { aspect-ratio: 16 / 9; }
.dp-preview video, .dp-preview img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.dp-preview.contain video, .dp-preview.contain img { object-fit: contain; }
.dp-preview .sprite { width: 128px; height: 128px; margin: auto; position: absolute; inset: 0; background-repeat: no-repeat; background-size: auto 100%; image-rendering: pixelated; }
.dp-preview .cap-big { position: absolute; inset: 0; margin: auto; width: 51px; height: 64px; transform: scale(1.6); image-rendering: pixelated; }
.dp-preview .glyph { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; color: var(--tint); fill: currentColor; opacity: .8; }
.dp-name { margin-bottom: 6px; color: var(--qg-text); }
.dp-name b { color: var(--acc); font-weight: normal; margin-right: 8px; }
.dp-text { color: var(--qg-text-soft); margin-bottom: 8px; }
.dp-text p { margin: 0 0 6px; }
.dp-text a { color: var(--qg-teal); }
.dp-state { color: #fede8c; margin-bottom: 8px; }
.dp-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; color: var(--qg-text-muted); }
.dp-key { min-width: 20px; height: 18px; padding: 0 4px; display: inline-grid; place-items: center; color: var(--qg-ink); border: 5px solid transparent; border-image: url('../assets/base/ui/tag.png') 5 fill stretch; box-sizing: content-box; line-height: 1; }
.dp-actions { margin-top: auto; display: grid; gap: 5px; }
.dp-plate { display: flex; justify-content: space-between; align-items: center; height: 26px; padding: 0 10px; color: var(--qg-text); font: inherit; letter-spacing: inherit; text-decoration: none; cursor: pointer; box-sizing: content-box;
  border: 7px solid transparent; border-image: url('../assets/base/ui/plate.png') 7 fill stretch; background: none; }
.dp-plate:hover { border-image-source: url('../assets/base/ui/plate-hover.png'); color: #fff6e2; }
.dp-plate:focus-visible, .dp-plate.focus { border-image-source: url('../assets/base/ui/plate-focus.png'); color: var(--qg-teal-text); outline: none; }
/* training mat: style emblems in a column, the move list with key tags */
.dp-mat { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
.dp-styles { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.dp-style { display: flex; flex-direction: column; align-items: center; background: none; border: 0; color: var(--qg-text-soft); font: inherit; letter-spacing: inherit; cursor: pointer; opacity: .65; }
.dp-style img { width: 48px; height: 48px; image-rendering: pixelated; }
.dp-style.on, .dp-style:focus-visible { opacity: 1; color: var(--qg-text); outline: none; }
.dp-moves { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dp-group { color: var(--qg-text-muted); display: flex; gap: 4px; align-items: center; margin: 8px 0 4px; }
.dp-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 8px; border: 0; border-left: 3px solid transparent; background: none; font: inherit; letter-spacing: inherit; color: var(--qg-text); cursor: pointer; text-align: left; }
.dp-row.sub { padding-left: 26px; }
.dp-row i { width: 9px; height: 9px; background: #2ec480; }
.dp-row.sel, .dp-row:focus-visible { background: #235e5b; border-left-color: var(--qg-teal); outline: none; }
.dp-row .keys { display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }
/* watch service: the watch and its four sockets */
.dp-watch { position: relative; height: 380px; }
.dp-watch svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dp-watch .dial { position: absolute; left: 50%; top: 44%; width: 128px; transform: translate(-50%, -50%); image-rendering: pixelated; }
.dp-sock { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; background: none; border: 0; cursor: pointer; font: inherit; letter-spacing: inherit; color: var(--qg-text-soft); }
.dp-sock .well { width: 56px; height: 66px; border: 5px solid transparent; border-image: url('../assets/base/ui/socket.png') 5 fill stretch; display: grid; place-items: center; box-sizing: border-box; }
.dp-sock .dp-key { position: absolute; left: -10px; top: -12px; }
.dp-sock.sel .well, .dp-sock:focus-visible .well { outline: 2px solid #2ec480; }
.dp-sock:focus { outline: none; }
.dp-locked { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; margin-top: 16px; }
.dp-locked div { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border: 1px dashed var(--qg-line); color: var(--qg-text-muted); }
.dp-locked svg { width: 18px; height: 18px; flex: none; fill: var(--tint); opacity: .8; }

/* ---------- the world tree, switched on from the console ---------- */
.tree-veil { position: fixed; inset: 0; z-index: 1900; display: none; background: radial-gradient(circle at 50% 40%, #2a2470, #07061a 75%); align-items: center; justify-content: center; }
.tree-veil.on { display: flex; }
.tree-veil .tv { position: relative; height: min(84vh, 110vw); aspect-ratio: 700 / 640; max-width: 96vw; }
.tree-veil .tv img { width: 100%; height: 100%; image-rendering: pixelated; }
.tree-veil .orbhit { position: absolute; width: 9%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid transparent; background: none; cursor: pointer; padding: 0; }
.tree-veil .orbhit.open { border-color: #8ff4ff; animation: orbpulse 1.4s infinite; }
.tree-veil .orbhit:hover, .tree-veil .orbhit:focus-visible { border-color: #f2c86b; outline: none; }
@keyframes orbpulse { 50% { box-shadow: 0 0 0 10px #4be3ff33; } }
.tree-veil .tv-title { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); font: 18px 'm6x11plus', monospace; letter-spacing: 1px; color: #f2c86b; white-space: nowrap; }
.tree-veil .tv-close { position: absolute; right: 14px; top: 14px; }
.tree-veil .tv-tip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font: 18px 'm6x11plus', monospace; letter-spacing: 1px; color: var(--soft); text-align: center; width: min(90vw, 520px); }

@media (max-width: 760px) {
  .scene .label { display: none; }
  .dp-body { grid-template-columns: minmax(0, 1fr); }
  .dp-detail { order: -1; min-height: 0; }
  .dp-node .lbl { width: 76px; }
  .dp-mat { grid-template-columns: minmax(0, 1fr); }
  .dp-styles { flex-direction: row; justify-content: space-around; }
  .dp-row { grid-template-columns: 12px minmax(0, 1fr); }
  .dp-row .keys { grid-column: 2; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .scene .thing.press, .dp.open, .tree-veil .orbhit.open, .scene .spark { animation: none; }
}
