/* ===== Quest Zone — shared site styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Exo+2:wght@400;600;700&display=swap');

:root {
  --bg-deep: #000000;
  --bg-panel: #090b12;
  --bg-panel-alt: #0c0f1a;
  --border: rgba(110,140,220,0.14);
  --border-strong: rgba(110,140,220,0.3);
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --blue-light: #7fb3ff;
  --green: #39ff8f;
  --green-dark: #12a85a;
  --text: #e8ecff;
  --text-dim: #a9b1d6;
  --text-faint: rgba(232,236,255,0.45);
  --radius: 10px;
  --header-h: 134px;
  --metal-hi: #aab6d6;
  --metal-mid: #454e63;
  --metal-low: #12151f;

  /* sci-fi dashboard panels (profile + its sub-pages, and the homepage
     game-selection grid — one shared component family) */
  --qp-fill: linear-gradient(165deg, #0d1830 0%, #081222 55%, #050a16 100%);
  --qp-border: rgba(110,175,255,0.55);
  --qp-border-dim: rgba(90,140,220,0.28);
  --qp-glow: rgba(60,140,255,0.35);
  --chrome-frame: linear-gradient(135deg, #e9eefa 0%, #a6b2c9 10%, #4c5670 24%, #212637 38%, #6f9fdc 52%, #8fd2ff 58%, #212637 72%, #4c5670 84%, #cdd7ea 100%);
  --chrome-frame-soft: linear-gradient(135deg, #dbe3f2 0%, #929fbc 12%, #3f4760 30%, #232838 46%, #5f8fd0 58%, #212637 74%, #a3aec6 100%);
  --edge-blue: linear-gradient(90deg, rgba(80,160,255,0) 0%, rgba(110,190,255,0.9) 50%, rgba(80,160,255,0) 100%);
  --gunmetal: #2c313f;
  --seam: rgba(110,195,255,0.85);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  min-height: 100%;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 18px;
}

/* background starfield — sits behind everything, so it only ever shows
   through the open black space around the header/nav panels */
#site-starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- header ---------- */
.site-header {
  position: relative;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(127,179,255,0.08);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo img {
  height: 158px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 14px rgba(90,150,255,0.4));
}

.site-search {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.site-search form {
  width: 100%;
  max-width: 480px;
  position: relative;
}

.site-search input {
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0) 40%), #0a0c14;
  border: 1px solid rgba(150,160,180,0.3);
  color: var(--text);
  border-radius: 10px;
  padding: 16px 52px 16px 20px;
  font-family: 'Exo 2', sans-serif;
  font-size: 15.5px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-search input::placeholder { color: var(--text-faint); }
.site-search input:focus { border-color: var(--blue-light); box-shadow: inset 0 1px 3px rgba(0,0,0,0.6), 0 0 0 3px rgba(59,130,246,0.15); }

.site-search button {
  position: absolute;
  right: 7px;
  top: 7px;
  bottom: 7px;
  width: 38px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* header buttons scaled up slightly beyond the shared .btn/.btn-chrome
   base sizing — scoped to the header only so Profile/Signup/Login read
   bold next to the bigger logo, without resizing this button family
   everywhere else it's reused (placeholder "back" links, etc). */
.site-header .btn {
  font-size: 14.5px;
  padding: 13px 24px;
}

.btn {
  position: relative;
  overflow: hidden;
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  isolation: isolate;
  transition: box-shadow 0.1s ease, transform 0.1s ease;
}

/* diagonal glare sweep — the glossy "AAA button" highlight.
   Sits parked off the left edge, then sweeps across on hover like light
   catching a metallic surface. */
.btn::before {
  content: '';
  position: absolute;
  top: -80%; left: -40%;
  width: 30%; height: 260%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%);
  transform: rotate(22deg);
  pointer-events: none;
  z-index: 1;
}
.btn:hover::before {
  animation: btn-shimmer 0.7s ease;
}
@keyframes btn-shimmer {
  from { left: -40%; }
  to { left: 140%; }
}
.btn > * { position: relative; z-index: 2; }

/* extruded "keycap" depth: a solid shadow ledge under the button that
   compresses on click, like a physical arcade button */
.btn-primary {
  background: linear-gradient(180deg, #bcdcff 0%, #3b82f6 42%, #1a4fc4 78%, #123a91 100%);
  border: 1px solid rgba(200,212,230,0.6);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,20,60,0.45);
  box-shadow: 0 4px 0 #0f2c73, 0 8px 16px rgba(20,60,160,0.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #0f2c73, 0 10px 22px rgba(59,130,246,0.6); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #0f2c73, 0 2px 6px rgba(20,60,160,0.35); }

/* Login — dark charcoal metallic, visually related to the nav bar */
.btn-charcoal {
  background: linear-gradient(180deg, #4a4e57 0%, #2b2d33 45%, #1a1b1f 100%);
  border: 1px solid rgba(190,196,210,0.35);
  color: #f2f3f6;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
  box-shadow: 0 4px 0 #0a0a0c, 0 8px 16px rgba(0,0,0,0.5);
}
.btn-charcoal:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #0a0a0c, 0 10px 20px rgba(0,0,0,0.6); }
.btn-charcoal:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a0a0c, 0 2px 6px rgba(0,0,0,0.5); }

.btn-outline, .btn-ghost, .btn-metal {
  background: linear-gradient(180deg, #dbe2f2 0%, #9aa5bc 45%, #566079 100%);
  border: 1px solid rgba(255,255,255,0.4);
  color: #0b0d14;
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
  box-shadow: 0 4px 0 #14161e, 0 8px 16px rgba(0,0,0,0.5);
}
.btn-outline:hover, .btn-ghost:hover, .btn-metal:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #14161e, 0 10px 20px rgba(180,190,210,0.3); }
.btn-outline:active, .btn-ghost:active, .btn-metal:active { transform: translateY(3px); box-shadow: 0 1px 0 #14161e, 0 2px 6px rgba(0,0,0,0.4); }

.btn-play {
  background: linear-gradient(180deg, #9dffcb 0%, var(--green) 55%, var(--green-dark) 100%);
  color: #04160c;
  border: 1px solid rgba(220,255,235,0.5);
  text-shadow: 0 1px 1px rgba(0,40,20,0.3);
  box-shadow: 0 4px 0 #0a5c30, 0 8px 18px rgba(20,180,110,0.4);
}
.btn-play:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #0a5c30, 0 10px 22px rgba(20,180,110,0.55); }
.btn-play:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a5c30, 0 2px 6px rgba(20,180,110,0.35); }

/* ---------- AAA chrome buttons: Profile / Signup / Login ----------
   Double-layer background trick: one gradient clipped to padding-box
   (the fill) and a second clipped to border-box (the metallic frame),
   separated by a transparent border. Frame gradient carries the silver
   highlights plus the faint blue/purple reflections from the reference. */
.btn-chrome-dark, .btn-chrome-blue {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
/* the old diagonal ::before sweep is replaced by .chrome-sweep below */
.btn-chrome-dark::before, .btn-chrome-blue::before { display: none; }

.btn-chrome-dark {
  background-image:
    linear-gradient(180deg, #272b34 0%, #16181d 55%, #0a0b0e 100%),
    linear-gradient(135deg, #f2f5fb 0%, #aab3c4 12%, #565c6b 28%, #2c2e35 42%, #6f86c9 56%, #8a6fcf 64%, #2c2e35 76%, #c3cad6 90%, #f2f5fb 100%);
  color: #eef1f7;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6), 0 0 8px rgba(140,170,255,0.15);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -6px 10px -6px rgba(0,0,0,0.7),
    0 2px 10px rgba(0,0,0,0.5),
    0 0 14px rgba(90,120,220,0.12);
}
.btn-chrome-dark:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -6px 10px -6px rgba(0,0,0,0.7),
    0 2px 12px rgba(0,0,0,0.55),
    0 0 20px rgba(120,150,255,0.25);
}

.btn-chrome-blue {
  background-image:
    linear-gradient(180deg, #5b86ff 0%, #2a55dc 42%, #1a2f8f 78%, #291f6b 100%),
    linear-gradient(135deg, #f2f5fb 0%, #bdccff 14%, #5b76d6 30%, #24306e 45%, #7fa8ff 58%, #9a7fff 66%, #24306e 78%, #c3cad6 92%, #f2f5fb 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,10,40,0.6), 0 0 10px rgba(150,190,255,0.5);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -6px 12px -6px rgba(0,10,50,0.6),
    0 2px 10px rgba(20,40,120,0.5),
    0 0 26px rgba(70,120,255,0.5);
}
.btn-chrome-blue:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -6px 12px -6px rgba(0,10,50,0.6),
    0 2px 12px rgba(20,40,120,0.55),
    0 0 34px rgba(70,120,255,0.75);
}

.btn-chrome-dark:active, .btn-chrome-blue:active { transform: scale(0.98); }

/* glossy diagonal shimmer — light sweeping across glass/chrome on hover */
.chrome-sweep {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.chrome-sweep::after {
  content: '';
  position: absolute;
  top: -120%; left: -40%;
  width: 32%; height: 340%;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.4) 45%,
    rgba(190,215,255,0.3) 55%,
    rgba(255,255,255,0) 100%);
  transform: rotate(18deg);
}
.btn-chrome-dark:hover .chrome-sweep::after,
.btn-chrome-blue:hover .chrome-sweep::after {
  animation: chrome-shimmer 1.1s ease;
}
@keyframes chrome-shimmer {
  from { left: -40%; }
  to { left: 140%; }
}

/* interactive lens flare — a small sparkle on the frame that drifts
   opposite the cursor (site.js drives its position); dim at rest,
   brightens on hover */
.flare {
  position: absolute;
  top: 22%;
  left: 18%;
  width: 1px;
  height: 1px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  opacity: 0.3;
  transition: transform 0.35s cubic-bezier(0.22, 0.7, 0.3, 1), opacity 0.3s ease;
}
.flare::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(190,220,255,0.5) 35%, rgba(140,170,255,0) 72%);
}
.flare::after {
  content: '';
  position: absolute;
  inset: -13px;
  background:
    linear-gradient(90deg, transparent 46%, rgba(255,255,255,0.85) 49.5%, rgba(255,255,255,0.85) 50.5%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(255,255,255,0.85) 49.5%, rgba(255,255,255,0.85) 50.5%, transparent 54%);
}
.btn-chrome-dark:hover .flare, .btn-chrome-blue:hover .flare { opacity: 1; }

.btn-disabled {
  background: linear-gradient(180deg, #23283a, #14161f);
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}
.btn-disabled::before { display: none; }

/* ---------- nav ---------- */
.site-nav {
  position: relative;
  z-index: 1;
  padding: 16px 0 0;
}

.site-nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  /* dark charcoal metallic strip: gradient body, silver outer border,
     a soft top highlight and inner shadow for a beveled/glossy edge */
  background: linear-gradient(180deg, #34363c 0%, #232428 8%, #1c1d21 50%, #131418 100%);
  border: 1px solid rgba(190,196,210,0.3);
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    inset 0 6px 10px -6px rgba(0,0,0,0.5),
    0 3px 8px rgba(0,0,0,0.4);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.site-nav ul::-webkit-scrollbar { display: none; }

.site-nav li {
  flex: 1 1 0;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.site-nav li:last-child { border-right: none; }

.site-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #c7cbd4;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.site-nav a .ic { font-size: 13px; filter: grayscale(1) brightness(2.1) contrast(0.9); }

/* ---------- layout rows ---------- */
main.home { padding: 22px 0 10px; position: relative; z-index: 1; }

.row { display: grid; gap: 16px; margin-bottom: 16px; }
.row-hero { grid-template-columns: 1.7fr 1.35fr 1.15fr; }
.row-b { grid-template-columns: 0.85fr 0.85fr 1.3fr 0.85fr 0.5fr; }
.row-c { grid-template-columns: 1.3fr 0.85fr 0.85fr; }
.row-d { grid-template-columns: 0.75fr 0.75fr 0.75fr 1.2fr 0.45fr; }
.row-e { grid-template-columns: 1.1fr 0.8fr 0.9fr 0.45fr; }

@media (max-width: 1100px) {
  .row-hero { grid-template-columns: 1fr; }
  .row-b { grid-template-columns: 1fr 1fr; }
  .row-c { grid-template-columns: 1fr; }
  .row-d { grid-template-columns: 1fr 1fr; }
  .row-e { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .row-b, .row-d, .row-e { grid-template-columns: 1fr; }
}

/* ---------- panel (list/box) ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Orbitron', sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--text);
  margin: 0 0 12px;
}

.panel-title .more {
  font-family: 'Exo 2', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-faint);
  text-decoration: none;
}

/* numbered list */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.rank-list li { display: flex; align-items: center; gap: 10px; }
.rank-list .num {
  width: 20px; height: 20px; border-radius: 5px;
  background: rgba(59,130,246,0.15); color: var(--blue-light);
  font-family: 'Orbitron', sans-serif; font-size: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-list a.live { color: var(--green); font-weight: 700; text-decoration: none; font-size: 13px; }
.rank-list a.live:hover { text-decoration: underline; }
.rank-list span.soon { color: var(--text-faint); font-size: 13px; }

/* tabs */
.tabbar { display: flex; gap: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.tabbar button {
  background: none; border: none; color: var(--text-faint);
  font-family: 'Exo 2', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.03em; padding: 0 0 8px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tabbar button.active { color: var(--text); border-bottom-color: var(--blue); }

/* ---------- mini tile grid (coming soon squares) ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.mini-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* narrow side-column icon strips (row-b/row-d/row-e trailing columns) —
   capped so they don't blow up into giant squares when the row collapses
   to fewer, wider tracks on medium screens */
.icon-col { max-width: 230px; margin-left: auto; align-self: start; }
@media (max-width: 1100px) { .icon-col { margin-left: 0; max-width: 320px; } }

.mini-tile {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: linear-gradient(150deg, var(--bg-panel-alt), var(--bg-panel));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  overflow: hidden;
}
.mini-tile .icon { font-size: 18px; opacity: 0.55; filter: grayscale(0.2); }
.mini-tile .soon-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 6.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  text-align: center;
}

/* ---------- big promo tile ---------- */
.tile-lg {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 230px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--bg-panel-alt), var(--bg-panel));
}

.tile-lg .content {
  position: relative;
  z-index: 2;
  padding: 20px;
  width: 100%;
}

.tile-lg h2, .tile-lg h3 {
  font-family: 'Orbitron', sans-serif;
  margin: 0 0 6px;
  text-transform: uppercase;
  line-height: 1.05;
}
.tile-lg h2 { font-size: 26px; }
.tile-lg h3 { font-size: 19px; }

.tile-lg p { margin: 0 0 14px; font-size: 12.5px; color: var(--text-dim); max-width: 320px; }

.tile-lg.soon {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.tile-lg.soon .content { display: flex; flex-direction: column; align-items: center; }
.tile-lg.soon .big-icon { font-size: 34px; opacity: 0.5; margin-bottom: 8px; }
.tile-lg.soon h3 { color: var(--text-faint); font-size: 15px; letter-spacing: 0.08em; }
.tile-lg.soon p { font-size: 11.5px; }

.tile-lg.hero-snake {
  min-height: 300px;
}
.tile-lg.hero-snake .scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(4,6,15,0.92) 0%, rgba(4,6,15,0.35) 55%, rgba(4,6,15,0.15) 100%);
}
.tile-lg.hero-snake svg.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tile-lg.hero-snake h2 { text-shadow: 0 0 18px rgba(57,255,143,0.35); }

/* medium tile (used in row-c / row-e) */
.tile-md { min-height: 170px; }

/* half-height stacked tiles */
.tile-stack { display: flex; flex-direction: column; gap: 16px; }
.tile-stack .tile-lg { min-height: calc(50% - 8px); flex: 1; }

/* ---------- footer ---------- */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(6,9,20,0.75);
  margin-top: 30px;
  padding: 34px 0 20px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.footer-intro {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.footer-intro h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 0 0 8px;
}
.footer-intro p { margin: 0; line-height: 1.6; color: var(--text-dim); }

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.footer-links h5 {
  font-family: 'Exo 2', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-links a { font-size: 12px; color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--blue-light); }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-faint); flex-wrap: wrap; gap: 8px;
}

@media (max-width: 800px) {
  .footer-intro { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- toast ---------- */
#qz-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}
#qz-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ---------- search empty state ---------- */
#search-note {
  display: none;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-panel);
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- placeholder sub-page panel (profile/skills/inventory/etc.) ---------- */
.placeholder-panel {
  max-width: 640px;
  margin: 40px auto;
  text-align: center;
  background: var(--qp-fill);
  border: 1px solid var(--qp-border);
  border-radius: 16px;
  padding: 44px 30px;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 40px rgba(40,100,220,0.15);
}
.placeholder-panel .icon { font-size: 40px; margin-bottom: 12px; filter: drop-shadow(0 0 14px rgba(120,170,255,0.45)); }
.placeholder-panel h1 {
  font-family: 'Orbitron', sans-serif; font-size: 24px; letter-spacing: 0.08em;
  margin: 0 0 12px; text-shadow: 0 0 16px rgba(120,170,255,0.5);
}
.placeholder-panel p { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; margin: 0 0 22px; }
#search-note.show { display: block; }

/* ================================================================
   Shared sci-fi HUD component family — chrome/gunmetal/blue-seam
   material, used by the Profile dashboard and the homepage game grid
   alike, so both are genuinely the same component, not lookalikes.
   ================================================================ */

/* corner accent brackets — angled ticks with a bright glint at the tip */
.corner-brackets { position: absolute; inset: -3px; pointer-events: none; border-radius: inherit; overflow: hidden; }
.corner-brackets i {
  position: absolute;
  width: 32px; height: 32px;
  border: 2px solid #cfe6ff;
  opacity: 0.95;
  filter: drop-shadow(0 0 5px rgba(140,195,255,0.75));
}
.corner-brackets i::before {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #eaf5ff;
  box-shadow: 0 0 8px 2px rgba(160,210,255,0.9);
}
.corner-brackets i:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 16px 0 0 0; }
.corner-brackets i:nth-child(1)::before { top: -2.5px; left: -2.5px; }
.corner-brackets i:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 16px 0 0; }
.corner-brackets i:nth-child(2)::before { top: -2.5px; right: -2.5px; }
.corner-brackets i:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 16px; }
.corner-brackets i:nth-child(3)::before { bottom: -2.5px; left: -2.5px; }
.corner-brackets i:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 16px 0; }
.corner-brackets i:nth-child(4)::before { bottom: -2.5px; right: -2.5px; }

.corner-brackets.sm { inset: -2px; }
.corner-brackets.sm i { width: 17px; height: 17px; border-width: 1.5px; opacity: 0.8; }
.corner-brackets.sm i::before { width: 3.5px; height: 3.5px; }
.corner-brackets.sm i:nth-child(1) { border-radius: 11px 0 0 0; }
.corner-brackets.sm i:nth-child(2) { border-radius: 0 11px 0 0; }
.corner-brackets.sm i:nth-child(3) { border-radius: 0 0 0 11px; }
.corner-brackets.sm i:nth-child(4) { border-radius: 0 0 11px 0; }

/* concentric ring stack — chrome border (set separately per element) ->
   gunmetal ring -> glowing blue seam -> dark interior begins. Distinct
   solid bands, not a blur, so the frame reads as manufactured layers. */
.bezel-lg {
  box-shadow:
    inset 0 0 0 3px var(--gunmetal),
    inset 0 0 0 6px var(--seam),
    inset 0 0 0 8px rgba(6,10,20,0.9),
    inset 0 0 18px 6px rgba(90,180,255,0.35),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 0 70px rgba(30,80,180,0.14),
    0 0 0 1px rgba(0,0,0,0.6),
    0 14px 44px rgba(0,0,0,0.5),
    0 0 60px rgba(40,110,230,0.2);
}
.bezel-sm {
  box-shadow:
    inset 0 0 0 2px var(--gunmetal),
    inset 0 0 0 4px var(--seam),
    inset 0 0 0 5.5px rgba(6,10,20,0.9),
    inset 0 0 12px 3px rgba(90,180,255,0.32),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 0 20px rgba(20,50,110,0.15);
}

/* bottom illuminated seam on a section shell */
.hud-edge-glow {
  content: '';
  position: absolute;
  left: 8%; right: 8%; bottom: -3px;
  height: 2px;
  background: var(--edge-blue);
  filter: blur(0.5px);
  box-shadow: 0 0 14px 2px rgba(90,180,255,0.5);
  pointer-events: none;
}

/* metallic heading — large title style shared by the Profile heading
   and the homepage section titles */
.hud-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.1em;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #cfd9ee 40%, #93a3c4 60%, #eef3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(120,170,255,0.6), 0 2px 1px rgba(0,0,0,0.6);
}
.hud-heading .dash {
  flex: 1 1 60px;
  max-width: 90px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-light), transparent);
  box-shadow: 0 0 8px rgba(120,170,255,0.6);
  opacity: 0.9;
}

/* ---- homepage game-selection section ---- */
.game-section {
  position: relative;
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 26px clamp(14px, 3vw, 32px) 32px;
  background: var(--qp-fill) padding-box, var(--chrome-frame) border-box;
  margin-bottom: 26px;
}
.game-section .hud-heading { font-size: clamp(19px, 2.8vw, 28px); margin: 0 0 clamp(18px, 2.6vw, 26px); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(8px, 1.2vw, 14px);
}
@media (max-width: 900px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 1 / 1;
  border: 2px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  isolation: isolate;
  padding: 8px 6px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(60,130,255,0.1), transparent 60%),
    linear-gradient(165deg, #0e1a30 0%, #081020 60%, #060b16 100%) padding-box,
    var(--chrome-frame-soft) border-box;
  box-shadow:
    inset 0 0 0 1.5px var(--gunmetal),
    inset 0 0 0 3px var(--seam),
    inset 0 0 0 4px rgba(6,10,20,0.9),
    inset 0 1px 0 rgba(255,255,255,0.08);
  transform: perspective(700px) rotateX(0deg) rotateY(0deg) scale(1);
  transition: box-shadow 0.2s ease, transform 0.15s ease-out;
  will-change: transform;
}
.game-card:hover {
  box-shadow:
    inset 0 0 0 1.5px var(--gunmetal),
    inset 0 0 0 3px rgba(150,215,255,1),
    inset 0 0 0 4px rgba(6,10,20,0.9),
    inset 0 0 14px 4px rgba(90,180,255,0.5),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 8px 20px rgba(0,0,0,0.45),
    0 0 22px rgba(60,140,255,0.35);
}
.game-card .icon {
  width: clamp(20px, 3.4vw, 30px);
  height: clamp(20px, 3.4vw, 30px);
  color: #cfe4ff;
  filter: drop-shadow(0 0 6px rgba(120,190,255,0.55));
}
.game-card .icon svg { width: 100%; height: 100%; }
.game-card:hover .icon { filter: drop-shadow(0 0 10px rgba(140,200,255,0.8)); }
.game-card .label {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(6.5px, 0.85vw, 8.5px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
  color: var(--text-faint);
}
.game-card .number {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: clamp(12px, 1.6vw, 16px);
  background: linear-gradient(180deg, #ffffff 0%, #d3ddf0 45%, #9fb0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.game-card > * { position: relative; z-index: 3; }
.game-card .flare { z-index: 4; }
.game-card:hover .flare { opacity: 1; }

.game-card .tile-light {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity 0.25s ease;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(150,195,255,0.16), transparent 42%);
}
.game-card:hover .tile-light { opacity: 1; }

.game-card .tile-shimmer { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; border-radius: inherit; }
.game-card .tile-shimmer::after {
  content: '';
  position: absolute; top: -140%; left: -45%;
  width: 26%; height: 380%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.22) 45%, rgba(190,220,255,0.16) 55%, rgba(255,255,255,0) 100%);
  transform: rotate(18deg);
}
.game-card:hover .tile-shimmer::after { animation: tile-shimmer 1.3s ease; }
@keyframes tile-shimmer { from { left: -45%; } to { left: 145%; } }

/* ---- .has-thumb: real game card with its own artwork (e.g. Space
   Snake) instead of the icon/label/number placeholder. Uses the exact
   same .game-card frame/box-shadow ring stack and :hover state as
   every other card — nothing overridden here. The artwork sits
   inset from the edge (instead of running full-bleed to 0) so that
   shared chrome/gunmetal/seam ring stack stays fully visible around
   it, same thickness as the frame around every placeholder card. ---- */
.game-card .card-thumb {
  position: absolute;
  inset: 10px;
  z-index: 0;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: 6px;
  object-fit: cover;
  object-position: 50% 10%;
}

.game-card .card-thumb-fade {
  position: absolute;
  inset: 10px;
  z-index: 1;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(4,8,18,0) 55%, rgba(4,8,18,0.82) 100%);
  pointer-events: none;
}

.game-card .card-title {
  position: absolute;
  left: 14px; right: 14px; bottom: 14px;
  z-index: 3;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: clamp(7.5px, 1vw, 11px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #d8e6ff 55%, #a9c4f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(90,170,255,0.55);
  pointer-events: none;
}

/* ================================================================
   Reusable Achievement Inspection system (assets/js/achievement-
   inspection.js). Any page that links this stylesheet and that script
   can call window.QZAchievementInspection.open(achievement, sourceEl)
   to pop an achievement out of its source icon into this card, using
   the same chrome/gunmetal/seam frame language as the rest of Quest
   Zone. See the JS file for the achievement data shape.
   ================================================================ */

html.ach-scroll-lock, html.ach-scroll-lock body { overflow: hidden; }

.ach-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2,4,10,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.ach-backdrop.show { opacity: 1; pointer-events: auto; }

/* the flying clone that travels from the clicked icon to the card */
.ach-flyer {
  position: fixed;
  left: 0; top: 0;
  z-index: 210;
  pointer-events: none;
  opacity: 0;
  display: none;
}
.ach-flyer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 22px rgba(120,190,255,0.55)) drop-shadow(0 10px 24px rgba(0,0,0,0.5));
}

.ach-card {
  position: relative;
  width: min(88vw, 380px);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox — content still scrolls if it ever needs to, the track just isn't shown */
  -ms-overflow-style: none; /* legacy Edge */
  border: 3px solid transparent;
  border-radius: 18px;
  padding: clamp(20px, 4vw, 34px) clamp(18px, 4vw, 30px) clamp(22px, 4vw, 32px);
  background: var(--qp-fill) padding-box, var(--chrome-frame) border-box;
  box-shadow:
    inset 0 0 0 3px var(--gunmetal),
    inset 0 0 0 6px var(--seam),
    inset 0 0 0 8px rgba(6,10,20,0.9),
    inset 0 0 24px 8px rgba(90,180,255,0.3),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px rgba(0,0,0,0.6),
    0 20px 60px rgba(0,0,0,0.6),
    0 0 70px rgba(40,110,230,0.25);
  text-align: center;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.ach-card.show { opacity: 1; transform: scale(1); }
.ach-card::-webkit-scrollbar { width: 0; height: 0; display: none; }

.ach-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(150,180,220,0.3);
  background: rgba(10,14,24,0.6);
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.ach-close:hover { background: rgba(59,130,246,0.28); color: #fff; transform: scale(1.08); }

.ach-card-icon {
  width: clamp(140px, 40vw, 200px);
  aspect-ratio: 1 / 1;
  margin: 0 auto clamp(14px, 2.4vw, 20px);
}
.ach-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 20px rgba(120,190,255,0.4));
}

.ach-card-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(17px, 3vw, 21px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 6px;
  background: linear-gradient(180deg, #ffffff 0%, #cfd9ee 45%, #93a3c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 14px rgba(120,170,255,0.45);
}

.ach-card-tier {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: clamp(13px, 2vw, 15px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 clamp(14px, 2.4vw, 20px);
}
.tier-locked   { color: #7c869e; }
.tier-bronze   { background: linear-gradient(180deg,#f0b878,#a85a2a); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 12px rgba(200,120,50,0.4); }
.tier-silver   { background: linear-gradient(180deg,#ffffff,#9aa8c0); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 12px rgba(200,210,230,0.4); }
.tier-gold     { background: linear-gradient(180deg,#fff3c4,#d9a521); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 14px rgba(230,180,60,0.5); }
.tier-platinum { background: linear-gradient(180deg,#f4f8ff,#b9c8e0); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 14px rgba(200,220,255,0.5); }
.tier-diamond  { background: linear-gradient(180deg,#c9f3ff,#4fc3ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 16px rgba(90,200,255,0.55); }
.tier-mythic   {
  background: linear-gradient(90deg,#ff5fa2,#ffcf5c,#63ffb0,#5fc9ff,#b672ff,#ff5fa2);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(180,120,255,0.5);
  animation: tier-mythic-shift 5s linear infinite;
}
@keyframes tier-mythic-shift { to { background-position: -220% center; } }
@media (prefers-reduced-motion: reduce) { .tier-mythic { animation: none; } }

.ach-card-desc {
  font-family: 'Exo 2', sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
  padding-top: clamp(12px, 2vw, 16px);
  border-top: 1px solid var(--qp-border-dim);
}
