:root {
  color-scheme: dark;
  --bg-0: #020814;
  --bg-1: #061022;
  --bg-2: #0c1a32;
  --panel: rgba(7, 12, 22, 0.84);
  --panel-strong: rgba(10, 17, 30, 0.96);
  --panel-soft: rgba(10, 18, 32, 0.72);
  --line: rgba(120, 185, 255, 0.28);
  --line-strong: rgba(140, 200, 255, 0.45);
  --text: #f4f8ff;
  --muted: #9fb0c8;
  --accent: #3b8cff;
  --accent-strong: #6bb6ff;
  --accent-cool: #a8d4ff;
  --accent-cool-soft: rgba(88, 180, 255, 0.28);
  --danger: #ff6b7a;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  /* One size for every sidebar icon “tile” (logo frame, buttons, tab icons, link rows) */
  --sidebar-tile: 2.75rem;
  --sidebar-rail-width: var(--sidebar-tile);
  --sidebar-rail: var(--sidebar-rail-width);
  /* Shared 3-col sidebar layout: rail | label/content | actions */
  --sidebar-row-template: var(--sidebar-rail-width) minmax(0, 1fr) minmax(0, max-content);
  /* Fixed sidebar track — no vw so the shell doesn’t jitter */
  --sidebar-width: 18.5rem;
  --sidebar-open-width: var(--sidebar-width);
  --sidebar-collapsed-width: 5.2rem;
  /* Centers the rail in the collapsed pill; same padding when expanded keeps icons on one vertical line */
  --sidebar-inline-pad: calc((var(--sidebar-collapsed-width) - var(--sidebar-rail-width) - 2px) / 2);
  --sidebar-ease: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-rest-ease: 260ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Consistent breathing room between UI blocks (≈5px) */
  --gutter: 5px;
  /* Shell / sidebar chrome */
  --shell-pad: calc(1.15rem + var(--gutter));
  /* Space around the sidebar pill (inset from shell padding + separation from main) */
  --sidebar-margin: calc(0.75rem + var(--gutter));
  --tab-list-max-height: min(42vh, 17.5rem);
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Sora", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

*::selection {
  color: #ffffff;
  background: rgba(88, 160, 255, 0.4);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 90% 70% at 12% -8%, rgba(59, 140, 255, 0.38), transparent 52%),
    radial-gradient(ellipse 70% 55% at 92% 8%, rgba(168, 212, 255, 0.22), transparent 45%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(45, 125, 255, 0.12), transparent 50%),
    linear-gradient(155deg, var(--bg-0), var(--bg-1) 38%, var(--bg-2));
  background-size: 100% 100%, 100% 100%, 100% 100%, 200% 200%;
  background-position: 0% 0%, 0% 0%, 0% 0%, 0% 50%;
  animation: none;
  overflow: hidden;
}

@keyframes bg-base-shift {
  0% {
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 40%;
  }
  100% {
    background-position: 4% 2%, -3% -2%, 2% -3%, 100% 55%;
  }
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  inset: auto;
  border-radius: 999px;
  filter: blur(28px);
  will-change: auto;
}

body::before {
  width: 26rem;
  height: 26rem;
  left: -8rem;
  bottom: -6rem;
  background: rgba(59, 140, 255, 0.36);
  opacity: 0.74;
  animation: none;
}

body::after {
  width: 22rem;
  height: 22rem;
  right: -6rem;
  top: 5rem;
  background: rgba(120, 200, 255, 0.3);
  opacity: 0.62;
  animation: none;
}

@keyframes bg-orb-a {
  0%,
  100% {
    opacity: 0.62;
    transform: translate3d(0, 0, 0) scale(1);
  }
  35% {
    opacity: 0.95;
    transform: translate3d(22px, -18px, 0) scale(1.08);
  }
  70% {
    opacity: 0.78;
    transform: translate3d(10px, 12px, 0) scale(1.03);
  }
}

@keyframes bg-orb-b {
  0%,
  100% {
    opacity: 0.55;
    transform: translate3d(0, 0, 0) scale(1);
  }
  40% {
    opacity: 0.92;
    transform: translate3d(-26px, 20px, 0) scale(1.12);
  }
  75% {
    opacity: 0.72;
    transform: translate3d(-8px, -14px, 0) scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    background-size: auto;
    background-position: initial;
  }

  body::before,
  body::after {
    animation: none;
    will-change: auto;
    opacity: 0.8;
    transform: none;
  }
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Filled artwork (e.g. games controller) — overrides stroke icons above */
svg.ui-icon--filled {
  fill: currentColor;
  stroke: none;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: calc(1.25rem + var(--gutter));
  min-height: 100dvh;
  padding: var(--shell-pad);
  box-sizing: border-box;
  transition: gap var(--sidebar-ease);
}

.shell--sidebar-collapsed {
  gap: calc(0.9rem + var(--gutter));
}

.shell-sidebar,
.shell-main {
  min-height: 0;
}

/* Pill shell: sidebar only — outer margin insets the card from the shell padding */
.shell-sidebar {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: surface-in 360ms ease-out both;
  flex: 0 0 var(--sidebar-width);
  flex-shrink: 0;
  width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  transition:
    flex-basis var(--sidebar-ease),
    width var(--sidebar-ease),
    max-width var(--sidebar-ease);
  display: flex;
  flex-direction: column;
  gap: calc(1rem + var(--gutter));
  padding: calc(1.1rem + var(--gutter)) var(--sidebar-inline-pad);
  border-radius: var(--radius-xl);
  align-items: stretch;
  align-self: stretch;
  justify-content: flex-start;
  min-height: 0;
  min-width: 0;
  margin: var(--sidebar-margin);
}

.shell--sidebar-collapsed .shell-sidebar {
  flex-basis: var(--sidebar-collapsed-width);
  width: var(--sidebar-collapsed-width);
  max-width: var(--sidebar-collapsed-width);
  margin: var(--sidebar-margin);
}

/*
 * Sidebar rows: one grid for everything — [icon rail] [label / content] [actions]
 * Rail width never changes; only the shell width + text fade when collapsed.
 */
.shell-sidebar__row {
  display: grid;
  grid-template-columns: var(--sidebar-row-template);
  align-items: center;
  column-gap: calc(0.45rem + var(--gutter));
  min-width: 0;
  width: 100%;
}

.sidebar-block__header.shell-sidebar__row {
  min-height: var(--sidebar-tile);
}

.shell-sidebar__rail {
  width: var(--sidebar-rail-width);
  min-width: var(--sidebar-rail-width);
  max-width: var(--sidebar-rail-width);
  justify-self: start;
  display: flex;
  justify-content: center;
  align-items: center;
}

.shell-sidebar__rail--spacer {
  pointer-events: none;
}

.shell-sidebar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: calc(0.35rem + var(--gutter));
  min-width: 0;
}

.shell-sidebar__actions:empty {
  display: none;
}

/* Text / secondary column */
.shell-sidebar__rest {
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear 0s;
}

.shell--sidebar-collapsed .shell-sidebar__rest {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  width: 0;
  min-width: 0;
  max-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear var(--sidebar-rest-ease);
}

/* Collapsed keeps the same three-column rail layout; only labels/actions fade. */

@media (prefers-reduced-motion: reduce) {
  .shell {
    transition: none;
  }

  .shell-sidebar {
    transition: none;
  }

  .shell-sidebar__rest,
  .tab-card__body,
  .tab-card__close,
  .route-link__label {
    transition:
      opacity 0.01ms,
      visibility 0.01ms;
  }

  .tab-card__close {
    transition:
      opacity 0.01ms,
      visibility 0.01ms,
      width 0.01ms;
  }
}

.shell-sidebar__brand {
  padding: 0.35rem 0 0.55rem;
  min-width: 0;
  overflow: hidden;
}

.shell-sidebar__logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sidebar-tile);
  height: var(--sidebar-tile);
  border-radius: calc(var(--sidebar-tile) * 0.32);
  background:
    linear-gradient(135deg, rgba(45, 125, 255, 0.3), rgba(142, 189, 255, 0.16)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 14px 34px rgba(45, 125, 255, 0.22);
}

.shell-sidebar__logo-image {
  width: calc(var(--sidebar-tile) * 0.68);
  height: calc(var(--sidebar-tile) * 0.68);
  object-fit: cover;
  border-radius: calc(var(--sidebar-tile) * 0.22);
  display: block;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.16);
}

.shell-sidebar__eyebrow,
.content-card__eyebrow,
.section-hero__eyebrow,
.hero-panel__eyebrow,
.stage-overlay__eyebrow {
  margin: 0 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cool);
}

.shell-sidebar__title {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sidebar-toggle-row {
  width: 100%;
  min-width: 0;
  padding: 0 0 calc(0.45rem + var(--gutter));
}

.sidebar-toggle-btn {
  width: 100%;
  min-height: var(--sidebar-tile);
  height: var(--sidebar-tile);
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px rgba(45, 125, 255, 0.18);
}

.sidebar-toggle-btn:focus-visible {
  outline: 2px solid rgba(88, 160, 255, 0.55);
  outline-offset: 2px;
}

.sidebar-toggle-btn__rail {
  min-width: 0;
}

.sidebar-toggle-btn__label {
  display: flex;
  align-items: center;
  gap: calc(0.35rem + var(--gutter));
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-toggle-btn__lt {
  font-family: var(--mono);
  font-weight: 600;
  opacity: 0.85;
}

/* Collapsed: chevron points right (expand). Expanded: points left (retract). */
.shell:not(.shell--sidebar-collapsed) .sidebar-toggle-btn__rail .ui-icon {
  transform: rotate(180deg);
}

.sidebar-block {
  display: flex;
  flex-direction: column;
  gap: calc(0.8rem + var(--gutter));
  min-height: 0;
  /* Left inset 0: icon rail lines up with brand row (same x as shell padding edge). */
  padding: calc(1rem + var(--gutter)) calc(1rem + var(--gutter)) calc(1rem + var(--gutter)) 0;
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-block--tabs {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tab-list {
  flex: 1 1 0;
  min-height: 0;
  max-height: var(--tab-list-max-height);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.35rem 0.3rem 0.45rem 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.2);
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 160, 255, 0.45) rgba(255, 255, 255, 0.06);
}

.tab-list::-webkit-scrollbar {
  width: 6px;
}

.tab-list::-webkit-scrollbar-thumb {
  background: rgba(88, 160, 255, 0.4);
  border-radius: 999px;
}

.tab-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.sidebar-block--links {
  margin-top: auto;
}

.shell--sidebar-collapsed .sidebar-block {
  background: transparent;
  border-color: transparent;
}

.sidebar-block__header {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-block__heading {
  display: block;
  line-height: 1.2;
}

.sidebar-block__action,
.toolbar-button,
.address-bar__submit,
.hero-action,
.prompt-chip {
  border: 0;
  border-radius: 999px;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.sidebar-block__action,
.toolbar-button,
.address-bar__submit,
.hero-action {
  padding: calc(0.68rem + var(--gutter)) calc(1rem + var(--gutter));
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-block__action--icon {
  width: var(--sidebar-tile);
  height: var(--sidebar-tile);
  min-width: var(--sidebar-tile);
  min-height: var(--sidebar-tile);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-button--icon {
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  transition: transform 220ms ease;
}

.sidebar-block__action:hover,
.toolbar-button:hover,
.address-bar__submit:hover,
.hero-action:hover,
.tab-card:hover,
.route-link:hover,
.shortcut-card:hover,
.mini-game-card:hover,
.game-card:hover,
.prompt-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(45, 125, 255, 0.22);
}

.toolbar-button--accent,
.address-bar__submit,
.hero-action {
  background: linear-gradient(135deg, rgba(45, 125, 255, 0.34), rgba(88, 160, 255, 0.2));
  border-color: rgba(88, 160, 255, 0.42);
}

.hero-action--muted {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.tab-list,
.route-list {
  display: flex;
  flex-direction: column;
  gap: calc(0.7rem + var(--gutter));
}

.route-link,
.shortcut-card,
.mini-game-card,
.game-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(0.8rem + var(--gutter));
  width: 100%;
  text-align: left;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.tab-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-row-template);
  align-items: center;
  justify-content: start;
  column-gap: calc(0.45rem + var(--gutter));
  width: 100%;
  text-align: left;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 calc(0.45rem + var(--gutter)) 0 0;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
  overflow: hidden;
}

.tab-list .tab-card {
  min-height: var(--sidebar-tile);
  padding-top: 0;
  padding-bottom: 0;
}

.tab-list .tab-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  transform: none;
  box-shadow: none;
}

/* Active tab: no extra frame — only the icon reads as “selected” (lighter blue). */
.tab-card--active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.tab-list .tab-card--active:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.tab-card__icon {
  display: grid;
  place-items: center;
  justify-self: start;
  align-self: center;
  width: var(--sidebar-tile);
  height: var(--sidebar-tile);
  min-width: var(--sidebar-tile);
  min-height: var(--sidebar-tile);
  margin: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(159, 176, 200, 0.75);
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: color 160ms ease, opacity 160ms ease;
}

.tab-card--active .tab-card__icon {
  color: #c8e4ff;
}

.tab-card__favicon {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
  display: block;
  opacity: 0.55;
  transition: opacity 160ms ease, filter 160ms ease;
}

.tab-card--active .tab-card__favicon {
  opacity: 1;
  filter: brightness(1.12) saturate(1.15);
}

.tab-card__fallback-icon,
.tab-card__close-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.tab-card__body {
  min-width: 0;
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear 0s;
}

.shell--sidebar-collapsed .tab-card__body {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  width: 0;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear var(--sidebar-rest-ease);
}

.tab-card__title,
.route-link__label,
.shortcut-card__title,
.content-card__title,
.section-hero__title,
.hero-panel__title,
.stage-overlay__title {
  margin: 0;
  font-weight: 700;
}

.tab-card__title {
  font-size: 0.96rem;
}

.status-card__label,
.hero-panel__text,
.section-hero__text,
.content-card__header p,
.stage-overlay__text {
  color: var(--muted);
}

.tab-card__close {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 2rem;
  height: 2rem;
  min-width: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear 0s,
    width var(--sidebar-rest-ease),
    padding var(--sidebar-rest-ease);
}

.shell--sidebar-collapsed .tab-card__close {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  width: 0;
  min-width: 0;
  padding: 0;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear var(--sidebar-rest-ease),
    width var(--sidebar-rest-ease),
    padding var(--sidebar-rest-ease);
}

.tab-card__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.shortcut-card {
  min-height: 3rem;
  padding: calc(0.7rem + var(--gutter)) calc(0.9rem + var(--gutter));
  align-items: center;
}

.route-link {
  display: grid;
  gap: 0;
  row-gap: 0;
  grid-template-columns: var(--sidebar-row-template);
  align-items: center;
  justify-content: start;
  column-gap: calc(0.45rem + var(--gutter));
  min-height: var(--sidebar-tile);
  padding: calc(0.35rem + var(--gutter)) calc(0.65rem + var(--gutter)) calc(0.35rem + var(--gutter)) 0;
  overflow: hidden;
}

.route-link__rail {
  display: grid;
  place-items: center;
  justify-self: start;
  align-self: center;
  width: var(--sidebar-rail-width);
  min-width: var(--sidebar-rail-width);
  height: var(--sidebar-tile);
  min-height: var(--sidebar-tile);
  flex-shrink: 0;
}

.route-link__icon {
  width: 1rem;
  height: 1rem;
  color: var(--accent-cool);
}

.route-link__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear 0s;
}

.shell--sidebar-collapsed .route-link__label {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  width: 0;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  transition:
    opacity var(--sidebar-rest-ease),
    visibility 0s linear var(--sidebar-rest-ease);
}

.route-link__label,
.shortcut-card__title {
  font-size: 0.95rem;
  line-height: 1.25;
}

.status-card {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-card + .status-card {
  margin-top: 0.7rem;
}

.status-card__label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-card__value {
  display: block;
  font-size: 0.98rem;
}

.shell-main {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(1rem + var(--gutter));
  padding: calc(1rem + var(--gutter));
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.shell-toolbar {
  display: flex;
  align-items: center;
  gap: calc(0.75rem + var(--gutter));
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.shell-toolbar .address-bar {
  flex: 1 1 auto;
  min-width: 0;
}

.shell-toolbar__clock {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.shell-toolbar__controls {
  display: flex;
  align-items: center;
  gap: calc(0.25rem + var(--gutter));
  flex-shrink: 0;
}

/* Toolbar icon buttons: no chip/pill fill — avoids a “bar” behind icons + URL */
.shell-toolbar .toolbar-button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.shell-toolbar .toolbar-button:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  transform: none;
}

.shell-toolbar .toolbar-button:focus-visible {
  outline: 2px solid rgba(88, 160, 255, 0.55);
  outline-offset: 2px;
}

.address-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: calc(0.5rem + var(--gutter));
  width: 100%;
  min-width: 0;
  padding: var(--gutter) 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.address-bar:focus-within {
  box-shadow: none;
}

.address-bar__input,
.search-field__input,
.ai-chat__input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.address-bar__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.2rem 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.35;
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 140ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.address-bar:focus-within .address-bar__input {
  border-bottom-color: rgba(88, 160, 255, 0.55);
}

#toolbar-address-undo {
  margin-inline-start: auto;
}

.address-bar__history:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.address-bar__submit {
  flex: 0 0 auto;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
}

.address-bar__input::placeholder,
.search-field__input::placeholder,
.ai-chat__input::placeholder {
  color: #7f8d9b;
}

.shell-stage,
.pane-stack {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
}

.shell-stage {
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.shell-stage--full-bleed {
  border: 0;
  border-radius: 0;
  background: #000000;
  box-shadow: none;
}

.shell-pane {
  position: absolute;
  inset: 0;
  display: none;
}

.shell-pane--active {
  display: block;
}

.shell-pane--internal {
  overflow: auto;
  padding: calc(1.2rem + var(--gutter));
}

.shell-pane--frame {
  background: linear-gradient(180deg, rgba(12, 24, 37, 0.95), rgba(8, 15, 23, 0.98));
}

.shell-stage--full-bleed .shell-pane--frame {
  background: #000000;
}

.shell-pane__frame-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.shell-pane__frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0b131b;
}

.shell-stage--full-bleed .shell-pane__frame {
  background: #000000;
}

.shell-pane__repo-link {
  display: inline-flex;
  align-items: center;
  gap: calc(0.35rem + var(--gutter));
  padding: calc(0.38rem + var(--gutter)) calc(0.55rem + var(--gutter));
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  background: rgba(4, 10, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.shell-pane__repo-link:hover {
  background: rgba(12, 24, 40, 0.88);
  border-color: rgba(88, 160, 255, 0.35);
  color: var(--accent-cool);
}

.shell-pane__repo-link:focus-visible {
  outline: 2px solid rgba(88, 160, 255, 0.55);
  outline-offset: 2px;
}

.shell-pane__repo-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  fill: currentColor;
  stroke: none;
}

.shell-pane__repo-text {
  line-height: 1;
}

/* Home: Google-inspired centered search + shortcuts (dark “Material” vibe) */
.shell-pane--home {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  padding-top: calc(2.5rem + var(--gutter));
}

.shell-pane--active.shell-pane--home {
  display: flex;
}

.shell-pane--home .home-repo-link {
  position: absolute;
  right: calc(1rem + var(--gutter));
  bottom: calc(1rem + var(--gutter));
  z-index: 2;
}

.home-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1.5rem, 5vh, 3.5rem) calc(1rem + var(--gutter)) calc(1.25rem + var(--gutter));
  flex: 0 0 auto;
}

.home-wordmark {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.75rem, 9vw, 4.25rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  background: linear-gradient(
    105deg,
    var(--accent-cool) 0%,
    var(--accent-strong) 42%,
    var(--accent) 78%,
    var(--accent-cool) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 24px var(--accent-cool-soft));
}

.home-tagline {
  margin: calc(0.65rem + var(--gutter)) 0 0;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.home-search-bar {
  width: 100%;
  max-width: 36.5rem;
  margin: calc(1.75rem + var(--gutter)) auto 0;
}

.home-search-bar__field {
  display: flex;
  align-items: center;
  gap: calc(0.65rem + var(--gutter));
  padding: calc(0.45rem + var(--gutter)) calc(0.45rem + var(--gutter)) calc(0.45rem + var(--gutter))
    calc(1.05rem + var(--gutter));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 8px 28px rgba(0, 0, 0, 0.28);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.home-search-bar__field:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(88, 160, 255, 0.45);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 10px 36px rgba(0, 0, 0, 0.32),
    0 0 0 4px var(--accent-cool-soft);
}

.home-search-bar__icon {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  opacity: 0.65;
  color: var(--muted);
}

.home-search-bar__field:focus-within .home-search-bar__icon {
  opacity: 0.9;
  color: var(--accent-cool);
}

.home-search-bar__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.02rem;
  outline: none;
}

.home-search-bar__input::placeholder {
  color: rgba(159, 176, 200, 0.65);
}

.home-search-bar__submit {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: calc(2.5rem + var(--gutter));
  height: calc(2.5rem + var(--gutter));
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
  cursor: pointer;
  box-shadow: 0 2px 12px var(--accent-cool-soft);
  transition:
    transform 140ms ease,
    filter 140ms ease,
    box-shadow 140ms ease;
}

.home-search-bar__submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 18px var(--accent-cool-soft);
}

.home-search-bar__submit:active {
  transform: scale(0.96);
}

.home-search-bar__submit:focus-visible {
  outline: 2px solid var(--accent-cool);
  outline-offset: 2px;
}

.home-search-bar__submit-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: #ffffff;
  opacity: 0.95;
}

.home-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: calc(0.5rem + var(--gutter));
  margin-top: calc(1.65rem + var(--gutter));
  max-width: 40rem;
}

.home-shortcut-pill {
  padding: calc(0.38rem + var(--gutter)) calc(0.95rem + var(--gutter));
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cool);
  background: var(--accent-cool-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.home-shortcut-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.hero-panel,
.content-card,
.section-hero,
.stage-overlay__content {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(8, 17, 25, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 38px rgba(2, 5, 10, 0.5);
}

.shell-pane--internal::-webkit-scrollbar,
.ai-chat__messages::-webkit-scrollbar {
  width: 10px;
}

.shell-pane--internal::-webkit-scrollbar-track,
.ai-chat__messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}

.shell-pane--internal::-webkit-scrollbar-thumb,
.ai-chat__messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(88, 160, 255, 0.55), rgba(45, 125, 255, 0.5));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel {
  padding: calc(1.5rem + var(--gutter));
  overflow: hidden;
}

.hero-panel__title,
.section-hero__title,
.stage-overlay__title {
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.04;
}

.hero-panel__text,
.section-hero__text,
.stage-overlay__text {
  max-width: 46rem;
  line-height: 1.7;
  font-size: 0.98rem;
}

.hero-panel__actions,
.shortcut-grid,
.ai-layout,
.prompt-list,
.mini-game-grid,
.game-grid {
  display: grid;
  gap: calc(1rem + var(--gutter));
}

.hero-panel__actions {
  grid-template-columns: repeat(auto-fit, minmax(10rem, max-content));
  margin-top: calc(1.25rem + var(--gutter));
}

.content-card {
  padding: calc(1.15rem + var(--gutter));
}

.content-card__header,
.section-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: calc(1rem + var(--gutter));
}

.content-card__header {
  margin-bottom: calc(1rem + var(--gutter));
}

.section-hero {
  padding: calc(1.25rem + var(--gutter)) calc(1.35rem + var(--gutter));
  margin-bottom: calc(1rem + var(--gutter));
}

.section-hero__status {
  padding: calc(0.75rem + var(--gutter)) calc(0.95rem + var(--gutter));
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cool);
  background: var(--accent-cool-soft);
  border: 1px solid rgba(88, 160, 255, 0.24);
}

.search-field {
  display: block;
  margin-bottom: calc(1rem + var(--gutter));
}

.search-field__input,
.ai-chat__input {
  padding: calc(0.95rem + var(--gutter)) calc(1rem + var(--gutter));
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.search-field__input:focus,
.ai-chat__input:focus {
  border-color: rgba(88, 160, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(88, 160, 255, 0.14);
}

/* auto-fill + capped track width so a single search result stays card-sized, not full-bleed */
.mini-game-grid,
.game-grid {
  grid-template-columns: repeat(auto-fill, minmax(12rem, 14rem));
  justify-content: start;
}

.mini-game-card,
.game-card {
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 14rem;
  justify-self: start;
}

.mini-game-card__thumb,
.game-card__thumb,
.featured-launch__thumb {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(140deg, rgba(45, 125, 255, 0.24), rgba(142, 189, 255, 0.16)),
    rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.mini-game-card__thumb img,
.game-card__thumb img,
.featured-launch__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-game-card__body,
.game-card__body,
.featured-launch__body {
  padding: calc(0.95rem + var(--gutter)) calc(1rem + var(--gutter)) calc(1rem + var(--gutter));
}

/* Stacked layout only — avoids text overlapping the artwork in narrow or flex contexts */
.featured-launch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: calc(1rem + var(--gutter));
  width: 100%;
  min-width: 0;
}

.featured-launch__thumb {
  flex: 0 0 auto;
  align-self: center;
  width: 100%;
  max-width: min(22rem, 100%);
  aspect-ratio: 16 / 10;
  min-height: 7.5rem;
  max-height: min(36vh, 14rem);
  border-radius: var(--radius-lg);
}

.featured-launch__body {
  display: flex;
  flex-direction: column;
  gap: calc(0.8rem + var(--gutter));
  flex: 0 1 auto;
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 1;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
}

.featured-launch__title {
  margin: 0;
  font-size: 1.55rem;
}

.featured-launch__meta {
  margin: 0;
  color: var(--muted);
}

.featured-launch__meta-sep {
  white-space: nowrap;
}

.featured-launch__cta {
  align-self: flex-start;
  margin-top: auto;
}

.game-card__title,
.mini-game-card__title {
  margin: 0;
  font-size: 1rem;
}

.game-card__meta,
.mini-game-card__meta {
  margin-top: 0.28rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.game-card__meta-sep {
  white-space: nowrap;
}

.empty-state {
  padding: calc(1.2rem + var(--gutter));
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.ai-layout {
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
}

.ai-prompts {
  align-self: start;
}

.prompt-chip {
  width: 100%;
  padding: calc(0.95rem + var(--gutter)) calc(1rem + var(--gutter));
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-chat {
  display: flex;
  flex-direction: column;
  min-height: min(44rem, calc(100vh - 12rem));
}

.ai-chat__messages {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: calc(0.85rem + var(--gutter));
  overflow: auto;
  padding-right: calc(0.2rem + var(--gutter));
}

.ai-message {
  padding: calc(0.95rem + var(--gutter)) calc(1rem + var(--gutter));
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.ai-message--assistant {
  background:
    linear-gradient(135deg, rgba(88, 160, 255, 0.14), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.ai-message--user {
  background:
    linear-gradient(135deg, rgba(45, 125, 255, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.ai-message__label {
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cool);
}

.ai-message__body {
  line-height: 1.72;
  color: var(--text);
}

.ai-message__body p {
  margin: 0.45rem 0;
}

.ai-message__body ul {
  margin: 0.45rem 0;
  padding-left: 1.15rem;
}

.ai-message__body pre {
  margin: calc(0.7rem + var(--gutter)) 0;
  padding: calc(0.9rem + var(--gutter));
  overflow: auto;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-message__body code {
  font-family: var(--mono);
}

.ai-chat__form {
  display: flex;
  flex-direction: column;
  gap: calc(0.8rem + var(--gutter));
  margin-top: calc(1rem + var(--gutter));
}

.ai-chat__input {
  min-height: 7rem;
  resize: vertical;
}

.ai-chat__actions {
  display: flex;
  justify-content: flex-end;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(1.5rem + var(--gutter));
  background: rgba(4, 10, 16, 0.82);
  backdrop-filter: blur(12px);
}

.stage-overlay[hidden] {
  display: none;
}

.stage-overlay__content {
  max-width: 34rem;
  padding: calc(1.5rem + var(--gutter));
}

@media (max-width: 1100px) {
  .shell {
    flex-direction: column;
  }

  .shell-sidebar {
    max-height: none;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin-inline: var(--sidebar-margin);
    margin-block: calc(var(--sidebar-margin) * 0.75);
  }

  .shell--sidebar-collapsed {
    flex-direction: row;
    align-items: stretch;
    gap: calc(1rem + var(--gutter));
  }

  .shell--sidebar-collapsed .shell-sidebar {
    display: flex;
    flex: 0 0 4.6rem;
    width: 4.6rem;
    max-width: 4.6rem;
    margin: var(--sidebar-margin);
    /* Narrow strip: keep rail centered in this width */
    --sidebar-inline-pad: calc((4.6rem - var(--sidebar-rail-width) - 2px) / 2);
  }

  .shell--sidebar-collapsed .shell-main {
    flex: 1 1 0%;
    min-width: 0;
  }

  .ai-layout {
    grid-template-columns: 1fr;
  }

  .featured-launch__thumb {
    max-height: min(40vh, 14rem);
  }

  .ai-chat {
    min-height: 32rem;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .shell {
    min-height: 100dvh;
    --shell-pad: calc(0.8rem + var(--gutter));
    padding: var(--shell-pad);
  }

  .shell-main {
    padding: calc(0.85rem + var(--gutter));
  }

  .shell-sidebar {
    margin: var(--sidebar-margin);
  }

  .shell-toolbar .address-bar {
    flex-wrap: wrap;
    gap: calc(0.5rem + var(--gutter));
  }

  .shell-toolbar .address-bar__input {
    order: 1;
    flex: 1 1 100%;
    min-width: 100%;
  }

  .shell-toolbar__controls {
    order: 2;
  }

  #toolbar-address-undo {
    order: 3;
    margin-inline-start: 0;
  }

  #toolbar-address-redo {
    order: 4;
  }

  .shell-toolbar .address-bar__submit {
    order: 5;
    margin-left: 0;
  }

  .hero-panel__actions,
  .shortcut-grid,
  .mini-game-grid,
  .game-grid {
    grid-template-columns: 1fr;
    justify-content: center;
  }

  .game-grid .game-card,
  .mini-game-grid .mini-game-card {
    justify-self: center;
  }

  .shell-stage {
    min-height: 70vh;
  }
}

/* New tab control sizing in the tabs header row */
.sidebar-block__header--tabs .sidebar-block__action--icon {
  width: var(--sidebar-tile);
  height: var(--sidebar-tile);
  min-width: var(--sidebar-tile);
  min-height: var(--sidebar-tile);
}
