/* ============================================================
   TechWebster CSS Arcade
   Brand tokens from techwebster.com: Rajdhani + Manrope,
   near-black surfaces, signature orange, hairline borders.
   ============================================================ */

/* Fonts loaded via <link> in index.html for faster preconnect/preload — keep fallbacks below */

:root {
  --bg: #06080b;
  --panel: #0f1420;
  --panel-2: #121826;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f7fb;
  --muted: #9aa4b2;

  --orange: #ff7f00;
  --gold: #ffd37a;
  --orange-soft: rgba(255, 127, 0, 0.12);
  --glow: 0 0 25px rgba(255, 127, 0, 0.35);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);

  --success: #3ddc84;
  --danger: #ff5d5d;

  --font-display: "Rajdhani", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top, #1a2230 0%, #07090d 55%, #040507 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--orange);
  color: #1e1e1e;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* ============================================================
   HUB
   ============================================================ */

.hub-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px 72px;
}

.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  height: 30px;
  display: block;
}

.hub-top .tag {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- hero --- */

.hero {
  margin-top: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  align-items: center;
  gap: clamp(42px, 8vw, 110px);
  min-height: 390px;
}

.hero .kicker {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--orange);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 66px);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 16px 0 0;
}

.hero h1 em {
  font-style: normal;
  color: var(--orange);
}

.cursor-block {
  display: inline-block;
  width: 0.45em;
  height: 0.78em;
  margin-left: 0.12em;
  background: var(--orange);
  vertical-align: baseline;
  transform: translateY(0.08em);
  animation: caret-blink 1.1s steps(2, start) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

.hero .sub {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  max-width: 56ch;
}

.hero .sub strong { color: var(--text); font-weight: 600; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero-stats span { display: inline-flex; align-items: baseline; gap: 7px; }
.hero-stats strong { color: var(--text); font-size: 18px; letter-spacing: 0; }

/* --- live specimen --- */

.specimen {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(18, 24, 38, 0.9), rgba(10, 14, 22, 0.9));
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: none;
  transform: rotate(1.5deg);
  transition: transform .35s ease, border-color .35s ease;
}

.specimen:hover {
  transform: rotate(0deg) translateY(-4px);
  border-color: rgba(255, 127, 0, .48);
}

.specimen-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange);
  box-shadow: var(--glow);
  animation: live-pulse 2s infinite;
}

@keyframes live-pulse { 50% { opacity: 0.35; } }

.specimen-head span {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.specimen-code {
  padding: 14px 18px 4px;
  font-family: var(--font-code);
  font-size: 13.5px;
  color: var(--muted);
}

.specimen-code .prop { color: var(--text); }
.specimen-code .val { color: var(--orange); font-weight: 700; }

.specimen-track {
  display: flex;
  gap: 12px;
  padding: 18px 18px 20px;
}

.specimen-track i {
  width: 52px;
  height: 30px;
  border-radius: 6px;
  background: var(--orange-soft);
  border: 1px solid rgba(255, 127, 0, 0.55);
}

/* --- game cards --- */

.games-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  display: block;
  text-decoration: none;
  background: linear-gradient(160deg, rgba(15, 20, 32, 0.9), rgba(10, 14, 22, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
  min-height: 270px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 1px solid rgba(255, 127, 0, .18);
  box-shadow: 0 0 0 18px rgba(255, 127, 0, .035), 0 0 0 38px rgba(255, 127, 0, .025);
  pointer-events: none;
}

.game-card::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 39px;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 127, 0, .35);
  background: rgba(255, 127, 0, .08);
  transform: rotate(45deg);
  pointer-events: none;
}

.game-card > * { position: relative; z-index: 1; }
.game-card.featured { grid-column: 1 / -1; min-height: 246px; }
.game-card.featured::before { width: 250px; height: 250px; right: 10%; top: -122px; }
.game-card.featured::after { right: 19%; top: 52px; width: 88px; height: 88px; }
.game-card:nth-child(2)::before, .game-card:nth-child(2)::after { border-color: rgba(102, 197, 139, .34); }
.game-card:nth-child(2)::after { background: rgba(102, 197, 139, .1); }
.game-card:nth-child(3)::before, .game-card:nth-child(3)::after { border-color: rgba(116, 160, 255, .34); }
.game-card:nth-child(3)::after { background: rgba(116, 160, 255, .1); }
.game-card:nth-child(4)::before, .game-card:nth-child(4)::after { border-color: rgba(206, 130, 255, .34); }
.game-card:nth-child(4)::after { background: rgba(206, 130, 255, .1); }

.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 127, 0, 0.55);
  box-shadow: 0 16px 40px -18px rgba(255, 127, 0, 0.35);
}

.gc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gc-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--orange);
}

.gc-icon svg { display: block; }

.gc-status {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 2px;
}

.gc-status.done { color: var(--orange); }

.game-card h2 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 16px 0 6px;
  max-width: 58%;
}

.game-card > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 18px;
  min-height: 4.5em;
  max-width: 64ch;
}

.game-card > p strong { color: var(--text); font-weight: 600; }

.gc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gc-count {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.gc-play {
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
}

.gc-bar {
  margin-top: 16px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gc-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  box-shadow: var(--glow);
  transition: width 0.4s ease;
}

.hub-foot {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- TechWebster ecosystem cross-links --- */
.eco-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.eco-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  white-space: nowrap;
}

.eco-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.eco-links li { margin: 0; }

.eco-links a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.eco-links a:hover {
  color: var(--orange);
  border-bottom-color: rgba(255, 127, 0, 0.45);
}

.eco-links a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--orange);
}

.hub-foot-meta,
.eco-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.hub-foot-meta a,
.eco-meta a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hub-foot-meta a:hover,
.eco-meta a:hover {
  color: var(--orange);
  border-bottom-color: rgba(255, 127, 0, 0.5);
}

@media (max-width: 760px) {
  .hub-wrap { padding: 18px 16px 48px; }
  .hub-top { align-items: flex-start; }
  .hub-top .tag { font-size: 11px; letter-spacing: .14em; }
  .hero { grid-template-columns: 1fr; gap: 28px; margin-top: 48px; min-height: 0; }
  .hero h1 { font-size: clamp(42px, 14vw, 66px); }
  .hero .sub { font-size: 15px; }
  .specimen { transform: none; }
  .games-grid { grid-template-columns: 1fr; margin-top: 38px; }
  .game-card.featured { grid-column: auto; }
  .game-card { min-height: 0; }
  .game-card h2 { max-width: 70%; }
}

@media (prefers-reduced-motion: reduce) {
  .specimen, .game-card { transition: none; }
  .specimen { transform: none; }
}

/* ============================================================
   GAME SHELL
   ============================================================ */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(5, 7, 10, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.home-link { display: inline-flex; flex-shrink: 0; }

.home-link img { height: 24px; display: block; }

.top-sep {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
  flex-shrink: 0;
}

.top-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 170px;
}

.tp-track {
  width: 150px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tp-track i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  box-shadow: var(--glow);
  transition: width 0.35s ease;
}

.tp-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.stage-area {
  flex: 1;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
}

/* --- left rail --- */

.rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.card {
  background: linear-gradient(160deg, rgba(15, 20, 32, 0.9), rgba(10, 14, 22, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.lv-tag {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
}

.lv-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 6px 0 10px;
}

.lv-blurb {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.lv-blurb code, .hint-body code {
  font-family: var(--font-code);
  font-size: 0.86em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.editor-card { padding: 12px; }

.editor-head {
  display: flex;
  align-items: center;
  padding: 2px 6px 10px;
}

.editor-head .fname {
  font-family: var(--font-code);
  font-size: 12px;
  color: var(--muted);
}

.editor-head .fname::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--orange);
  opacity: 0.85;
}

.live-badge {
  margin-left: auto;
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.live-badge.on {
  opacity: 1;
  color: var(--orange);
  border-color: rgba(255, 127, 0, 0.55);
}

#editor {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  background: #0a0e16;
  color: #eef2f9;
  caret-color: var(--orange);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-code);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 12px;
  tab-size: 2;
}

#editor:focus {
  outline: none;
  border-color: rgba(255, 127, 0, 0.6);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
  transition: transform 0.12s ease, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover { border-color: rgba(255, 127, 0, 0.6); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(120deg, var(--orange), #ffb15b);
  border: none;
  color: #1b1308;
  box-shadow: var(--glow);
}

.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { filter: none; box-shadow: none; }

.kbd-tip {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-code);
}

.feedback {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(15, 20, 32, 0.9), rgba(10, 14, 22, 0.9));
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.55;
  min-height: 52px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.feedback .ico {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
  flex-shrink: 0;
}

.feedback.ok { border-color: rgba(61, 220, 132, 0.35); }
.feedback.ok .ico { color: var(--success); }

.feedback.err { border-color: rgba(255, 93, 93, 0.35); }
.feedback.err .ico { color: var(--danger); }

.hint-box {
  display: none;
  border: 1px dashed rgba(255, 127, 0, 0.45);
  background: var(--orange-soft);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.6;
}

.hint-box.open { display: block; }

.hint-box .hint-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}

/* --- board --- */

.board-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.board-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease;
}

.board-frame.flash {
  box-shadow: 0 0 0 2px var(--orange), var(--glow);
}

.board-scaler {
  width: 660px;
  height: 430px;
  transform-origin: top left;
}

#board {
  border: 0;
  width: 660px;
  height: 430px;
  display: block;
  background: #fff;
}

.board-caption {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-code);
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 4px;
}

/* --- footer nav --- */

.level-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.7);
}

.dots {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 0;
  transition: transform 0.12s;
}

.dots button:hover { transform: scale(1.3); }

.dots button.cur { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.dots button.done { background: var(--orange); border-color: var(--orange); }

.nav-btns { display: flex; gap: 8px; }

/* --- TechWebster ecosystem footer (game shell) --- */
.eco-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.92);
}

.eco-foot .eco-nav--shell {
  gap: 10px 16px;
}

.eco-foot .eco-label {
  font-size: 10px;
}

.eco-foot .eco-links a {
  font-size: 12.5px;
}

.eco-foot .eco-meta {
  font-size: 12.5px;
  opacity: 0.9;
}

/* --- toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 24px);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--orange);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  box-shadow: var(--shadow);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.toast .stars { color: var(--orange); letter-spacing: 2px; margin-left: 6px; }
.toast .stars i { font-style: normal; opacity: 0.3; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1020px) {
  .stage-area { grid-template-columns: 1fr; }
  .rail { order: 2; }
  .board-col { order: 1; }
  .top-progress { min-width: 0; }
  .tp-track { width: 90px; }
}

@media (max-width: 720px) {
  .hero { margin-top: 48px; }
  .hub-wrap { padding: 20px 18px 56px; }
  .stage-area { padding: 14px; gap: 14px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .top-progress { margin-left: 0; width: 100%; }
  .specimen { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-block, .live-dot { animation: none; }
  .game-card, .btn, .toast, .tp-track i, .gc-bar i, .board-frame { transition: none; }
}

/* ============================================================
   2026 refinement layer
   A single TechWebster orange accent, sharper hierarchy, and
   responsive layouts that preserve the game-first experience.
   ============================================================ */

:root {
  --bg-deep: #080a0e;
  --surface: #10151d;
  --surface-raised: #151c26;
  --line-soft: rgba(255, 255, 255, 0.075);
  --line-bright: rgba(255, 255, 255, 0.16);
  --text-strong: #f7f8fa;
  --text-soft: #a8b0bb;
  --orange-strong: #ff7f00;
  --orange-pale: #ffb15b;
}

body {
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    radial-gradient(circle at 82% 0%, rgba(255, 127, 0, 0.12), transparent 28rem),
    radial-gradient(circle at 10% 12%, rgba(39, 55, 75, 0.35), transparent 30rem);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.hub-wrap {
  max-width: 1180px;
  padding: 28px 32px 72px;
}

.hub-top {
  min-height: 52px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.hub-top .brand { display: inline-flex; align-items: center; }
.hub-top .brand::after {
  content: "Learning lab";
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--line-bright);
  color: var(--text-soft);
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-top .tag { color: var(--orange-pale); letter-spacing: 0.18em; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  column-gap: clamp(32px, 7vw, 96px);
  align-items: center;
  max-width: none;
  margin-top: clamp(58px, 9vw, 112px);
}

.hero .kicker, .hero h1, .hero .sub { grid-column: 1; }
.hero .kicker { color: var(--orange-pale); }
.hero h1 {
  max-width: 8ch;
  font-size: clamp(48px, 7.2vw, 84px);
  letter-spacing: -0.015em;
}
.hero .sub { max-width: 48ch; font-size: 16px; line-height: 1.7; }
.specimen {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin-top: 0;
  max-width: none;
  border-radius: 18px;
  background: rgba(16, 21, 29, 0.9);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.specimen-head { background: rgba(255,255,255,0.025); }
.specimen-code { white-space: nowrap; overflow-x: auto; }
.specimen-track { min-height: 106px; align-items: center; }
.specimen-track i { height: 42px; width: 58px; }

.games-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(72px, 10vw, 132px);
}

.game-card {
  min-height: 284px;
  padding: 24px;
  border-radius: 18px;
  background: rgba(16, 21, 29, 0.86);
  border-color: var(--line-soft);
}
.game-card:first-child { grid-column: span 2; min-height: 252px; }
.game-card:first-child > p { max-width: 66ch; }
.game-card:hover { transform: translateY(-5px); border-color: rgba(255, 127, 0, 0.62); }
.gc-icon { border-radius: 12px; background: rgba(255, 127, 0, 0.07); }
.game-card h2 { font-size: 28px; }
.gc-play { display: inline-flex; align-items: center; gap: 8px; }
.gc-play::after { content: ""; width: 22px; height: 1px; background: currentColor; transition: width .2s ease; }
.game-card:hover .gc-play::after { width: 34px; }
.gc-bar { height: 5px; background: rgba(255,255,255,0.06); }
.gc-bar i { background: var(--orange-strong); }

.hub-foot { border-top-color: var(--line-soft); padding-top: 24px; }
.eco-foot { border-top-color: var(--line-soft); background: rgba(8, 10, 14, 0.92); padding-inline: clamp(16px, 3vw, 40px); }

.topbar {
  min-height: 64px;
  padding: 12px clamp(16px, 3vw, 40px);
  background: rgba(8, 10, 14, 0.92);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line-soft);
}
.home-link { padding: 4px 0; }
.home-link img { height: 25px; }
.top-title { letter-spacing: 0.045em; }
.top-progress { min-width: 220px; }
.tp-track { width: 132px; height: 6px; }
.tp-track i { background: var(--orange-strong); }

.stage-area {
  grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 32px);
  padding: clamp(18px, 3vw, 36px);
}
.rail { gap: 12px; }
.card, .feedback, .board-frame {
  border-radius: 16px;
  background: rgba(16, 21, 29, 0.88);
  border-color: var(--line-soft);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.22);
}
.lv-tag { color: var(--orange-pale); }
.lv-name { font-size: 28px; }
.editor-card { background: rgba(10, 14, 20, 0.92); }
#editor { min-height: 220px; background: #0b1017; border-color: var(--line-soft); }
.btn { border-radius: 10px; }
.btn.primary { background: var(--orange-strong); box-shadow: 0 10px 24px rgba(255, 127, 0, 0.2); }
.btn.primary:hover { background: #ff9229; }
.btn.ghost:hover { border-color: rgba(255, 127, 0, 0.6); color: var(--orange-pale); }
.board-frame { padding: 10px; }
.board-caption { padding: 2px 6px 0; }
.level-nav { padding-inline: clamp(16px, 3vw, 40px); background: rgba(8, 10, 14, 0.82); border-top-color: var(--line-soft); }
.dots button.cur { box-shadow: 0 0 0 3px var(--orange-soft); }

@media (max-width: 760px) {
  .hub-wrap { padding: 20px 18px 56px; }
  .hub-top .brand::after { display: none; }
  .hero { grid-template-columns: 1fr; margin-top: 56px; }
  .hero .kicker, .hero h1, .hero .sub, .specimen { grid-column: 1; grid-row: auto; }
  .hero h1 { max-width: 9ch; font-size: clamp(48px, 14vw, 72px); }
  .specimen { margin-top: 30px; }
  .games-grid { grid-template-columns: 1fr; margin-top: 72px; }
  .game-card:first-child { grid-column: auto; }
  .game-card { min-height: 0; }
  .topbar { flex-wrap: wrap; gap: 8px 12px; }
  .top-progress { width: 100%; margin-left: 0; }
  .tp-track { flex: 1; width: auto; }
  .stage-area { grid-template-columns: 1fr; padding: 14px; }
  .board-col { order: 1; }
  .rail { order: 2; }
  .level-nav { align-items: flex-start; flex-direction: column; gap: 14px; }
  .nav-btns { width: 100%; }
  .nav-btns .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .game-card:hover { transform: none; }
  .gc-play::after { transition: none; }
}
