/* NachtBlau Launcher v36 — compact single-screen launcher */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root,
[data-theme="nacht"] {
  --bg: #04060c;
  --bg-elevated: #0a0e16;
  --bg-surface: #0e121c;
  --bg-glass: rgba(12, 16, 26, 0.72);
  --ink: #eef2f8;
  --muted: #6e8299;
  --line: rgba(120, 155, 195, 0.1);
  --line-strong: rgba(120, 155, 195, 0.18);
  --accent: #3ecfe8;
  --accent-2: #9ee4f4;
  --accent-dim: rgba(62, 207, 232, 0.12);
  --gold: #c4a24a;
  --gold-dim: rgba(196, 162, 74, 0.12);
  --glow: rgba(62, 207, 232, 0.14);
  --panel: rgba(10, 14, 22, 0.85);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.36);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-base: 180ms;
  --font-display: "Syne", sans-serif;
  --font-body: "Outfit", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --game-accent: var(--accent);
  --game-accent-2: var(--accent-2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --header-h: 52px;
  --footer-h: 24px;
  --dock-h: 0px;
  --hero-h: clamp(200px, 38vh, 400px);
  --hero-max: min(42vh, 420px);
  --card-w: 192px;
}

[data-theme="ember"] {
  --bg: #070504;
  --bg-elevated: #110a08;
  --bg-surface: #18100c;
  --bg-glass: rgba(20, 12, 10, 0.72);
  --ink: #fff0e6;
  --muted: #9a8070;
  --line: rgba(255, 140, 90, 0.1);
  --line-strong: rgba(255, 140, 90, 0.18);
  --accent: #ff7840;
  --accent-2: #ffb888;
  --accent-dim: rgba(255, 120, 64, 0.12);
  --gold: #d4a050;
  --gold-dim: rgba(212, 160, 80, 0.12);
  --glow: rgba(255, 120, 64, 0.14);
  --panel: rgba(18, 10, 8, 0.85);
}

[data-theme="verdant"] {
  --bg: #030806;
  --bg-elevated: #071210;
  --bg-surface: #0b1814;
  --bg-glass: rgba(10, 20, 16, 0.72);
  --ink: #e8f9ef;
  --muted: #689880;
  --line: rgba(90, 190, 130, 0.1);
  --line-strong: rgba(90, 190, 130, 0.18);
  --accent: #42d878;
  --accent-2: #a0f0bc;
  --accent-dim: rgba(66, 216, 120, 0.12);
  --gold: #b8a050;
  --gold-dim: rgba(184, 160, 80, 0.12);
  --glow: rgba(66, 216, 120, 0.14);
  --panel: rgba(8, 18, 14, 0.85);
}

[data-theme="frost"] {
  --bg: #040810;
  --bg-elevated: #090e18;
  --bg-surface: #0d1420;
  --bg-glass: rgba(10, 16, 28, 0.72);
  --ink: #ecf4ff;
  --muted: #7088a8;
  --line: rgba(150, 190, 240, 0.1);
  --line-strong: rgba(150, 190, 240, 0.18);
  --accent: #9ed0ff;
  --accent-2: #e0f0ff;
  --accent-dim: rgba(158, 208, 255, 0.12);
  --gold: #beb070;
  --gold-dim: rgba(190, 176, 112, 0.12);
  --glow: rgba(158, 208, 255, 0.14);
  --panel: rgba(10, 16, 28, 0.85);
}

[data-theme="slate"] {
  --bg: #070708;
  --bg-elevated: #0e0e10;
  --bg-surface: #141418;
  --bg-glass: rgba(16, 16, 20, 0.72);
  --ink: #f2ece0;
  --muted: #888078;
  --line: rgba(180, 168, 130, 0.1);
  --line-strong: rgba(180, 168, 130, 0.18);
  --accent: #c4ae78;
  --accent-2: #ece0b0;
  --accent-dim: rgba(196, 174, 120, 0.12);
  --gold: #d0b858;
  --gold-dim: rgba(208, 184, 88, 0.12);
  --glow: rgba(196, 174, 120, 0.14);
  --panel: rgba(14, 14, 16, 0.88);
}

html, body {
  height: 100dvh;
  max-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

body {
  overflow-x: hidden;
  overflow-y: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(62, 207, 232, 0.035), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(62, 207, 232, 0.015), transparent),
    var(--bg);
}

.hidden { display: none !important; }

#particles { display: none; }

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1280px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 0 clamp(12px, 2.5vw, 28px) calc(6px + var(--dock-h));
  min-height: 0;
  overflow: hidden;
}

/* ── Header ── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex: 0 0 auto;
  min-height: var(--header-h);
  max-height: var(--header-h);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-2);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: opacity var(--t-fast) var(--ease);
}

.mark:hover { opacity: 0.88; }

.mark img {
  width: 32px;
  height: 32px;
}

.mark-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.theme-picker {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.theme-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: var(--swatch);
  cursor: pointer;
  padding: 0;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.theme-swatch:hover { transform: scale(1.12); }

.theme-swatch.is-active {
  box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 2.5px var(--swatch);
}

.ghost-link,
.icon-btn,
.pill,
.cta,
.filters button,
.tile,
.recent-chip,
.search-clear,
.preset,
.account-chip {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition:
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease),
    opacity var(--t-fast) var(--ease);
}

.ghost-link {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}

.ghost-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Hero ── */

.feature {
  position: relative;
  flex: 0 0 auto;
  height: var(--hero-h);
  max-height: var(--hero-max);
  min-height: 0;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.feature-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.feature-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(48px) saturate(0.65) brightness(0.18);
  transform: scale(1.25);
  opacity: 0.5;
}

.feature-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr min(36%, 300px);
  gap: clamp(12px, 2vw, 24px);
  height: 100%;
  padding: clamp(14px, 2vw, 20px);
  align-items: center;
  min-height: 0;
}

.feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  gap: 0;
  overflow: hidden;
}

.feature-poster-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  padding: var(--space-1);
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.feature-poster {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: calc(var(--radius-sm) - 2px);
}

.hero-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-1);
  font-weight: 600;
}

.hero-kicker.is-featured {
  color: var(--gold);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 2.8vw, 1.9rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-1);
  overflow-wrap: anywhere;
}

.hero-sub {
  display: block;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.46em;
  font-weight: 400;
  margin-top: var(--space-1);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.hero-desc {
  max-width: 48ch;
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: var(--space-2);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
  max-height: 2.6em;
  overflow: hidden;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--game-accent) 28%, var(--line));
  background: color-mix(in srgb, var(--game-accent) 8%, rgba(0, 0, 0, 0.32));
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.chip-quiet {
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 0;
  background: linear-gradient(145deg, var(--game-accent), color-mix(in srgb, var(--game-accent-2) 85%, var(--game-accent)));
  color: #030810;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cta:hover {
  filter: brightness(1.05);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 4px 12px rgba(0, 0, 0, 0.24);
}

.cta:active { transform: scale(0.98); }
.cta:disabled { opacity: 0.42; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

.cta-soft,
.cta-ghost {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  color: var(--ink);
  min-height: 34px;
  padding: 0 12px;
  font-weight: 500;
  font-size: 0.78rem;
  box-shadow: none;
  filter: none;
}

.cta-soft:hover,
.cta-ghost:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  filter: none;
  box-shadow: none;
}

.cta-ghost { color: var(--muted); }
.cta-ghost.is-active {
  color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 35%, var(--line));
  background: var(--gold-dim);
}

#btn-play {
  min-height: 38px;
  padding: 0 20px;
  font-size: 0.86rem;
}

.hero-note {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-note-accent {
  color: color-mix(in srgb, var(--game-accent) 55%, var(--muted));
}

/* ── Catalog ── */

.catalog {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
  position: relative;
}

.catalog-head {
  flex: 0 0 auto;
  margin-bottom: var(--space-1);
}

.catalog-title {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.catalog-bar {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex: 0 0 auto;
  margin-bottom: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-height: 0;
}

.search-field { position: relative; flex: 1; min-width: 0; }

.search-field input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-surface);
  color: var(--ink);
  outline: none;
  font-size: 0.88rem;
  font-weight: 400;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.search-field input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.search-field input:hover {
  background: color-mix(in srgb, var(--bg-surface) 90%, var(--ink) 10%);
}

.search-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 3px var(--glow);
  background: var(--bg-surface);
}

.search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border-color: transparent;
  background: transparent;
  font-size: 1.05rem;
  color: var(--muted);
}

.search-clear:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.catalog-tools { display: flex; gap: var(--space-1); flex-shrink: 0; }

.pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.pill.is-active,
.pill:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-dim);
}

.pill.is-active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.recent-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  margin-bottom: var(--space-1);
  overflow: hidden;
  min-height: 0;
}

.recent-label {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
  font-weight: 600;
}

.recent-list {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.76rem;
  color: var(--muted);
}

.recent-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.recent-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.filters {
  display: flex;
  gap: var(--space-1);
  flex-wrap: nowrap;
  flex: 0 0 auto;
  margin-bottom: var(--space-1);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.filters-sub {
  margin-top: 0;
  margin-bottom: var(--space-1);
}

.filters button {
  min-height: 28px;
  padding: 0 11px;
  flex-shrink: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  background: transparent;
  border-color: transparent;
}

.filters button:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.filters button.is-selected {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-dim);
}

.tab-count {
  margin-left: 4px;
  opacity: 0.55;
  font-size: 0.72em;
  font-weight: 400;
}

/* ── Game carousel ── */

.grid {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-height: 0;
  gap: var(--space-2);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  align-items: stretch;
  padding: 2px 2px 4px;
  margin: 0 -2px;
  mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.grid > li {
  flex: 0 0 var(--card-w);
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  min-height: 0;
}

.grid > li > .tile {
  width: 100%;
  min-height: 0;
}

.library-empty {
  flex: 1 1 auto;
  width: 100%;
  padding: var(--space-3) var(--space-1);
  color: var(--muted);
  font-size: 0.84rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: var(--radius-md);
  min-height: 0;
  height: 100%;
}

.tile:hover { opacity: 0.94; }
.tile:active { transform: scale(0.985); }

.tile-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.tile:hover .tile-media {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.tile.is-selected .tile-media {
  border-color: color-mix(in srgb, var(--game-accent) 50%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--game-accent) 20%, transparent),
    var(--shadow-md);
}

.tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-base) var(--ease);
}

.tile:hover .tile-media img { transform: scale(1.02); }

.tile-badge {
  position: absolute;
  left: var(--space-2);
  bottom: var(--space-2);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}

.tile-fav {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #b8c8d8;
  font-size: 0.8rem;
}

.tile-fav.is-active { color: var(--gold); }

.tile-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  flex-shrink: 0;
}

.tile-sub {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* ── Reader ── */

.reader {
  position: fixed;
  inset: 0;
  z-index: 25;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
}

.reader.hidden { display: none !important; }

.reader-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex: 0 0 auto;
  padding: 14px var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.reader-kicker {
  color: var(--accent);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.reader-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-top: var(--space-1);
}

.reader-author { color: var(--muted); margin-top: 3px; font-size: 0.86rem; }

.reader-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: var(--space-4);
  line-height: 1.65;
  font-size: 0.92rem;
}

.reader-chapter { margin-top: 1.3rem; }

.reader-chapter-title {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
  color: var(--accent-2);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.gallery-frame {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Tip sheet ── */

.tip-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 45;
  width: min(400px, calc(100vw - 24px));
  max-height: min(70dvh, 480px);
  overflow: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
}

.tip-sheet:not([open]) {
  pointer-events: none;
}

.tip-sheet[open] {
  padding: var(--space-3) 14px;
  border: 1px solid var(--line);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.tip-sheet:not([open]) > summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tip-sheet summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
  margin-bottom: var(--space-2);
}

.tip-sheet label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: var(--space-1);
}

.tip-sheet input[type="number"] {
  width: 100%;
  height: 40px;
  margin-bottom: var(--space-2);
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink);
}

.tip-presets {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.preset {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

.preset:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

/* ── Footer ── */

.foot {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(var(--space-2), 2vw, var(--space-4));
  flex: 0 0 auto;
  min-height: var(--footer-h);
  max-height: 28px;
  padding: var(--space-1) 0 2px;
  color: color-mix(in srgb, var(--muted) 85%, transparent);
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  border-top: 1px solid var(--line);
  margin-top: var(--space-1);
  overflow: hidden;
  white-space: nowrap;
}

.foot > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

#studio-tagline {
  margin-left: auto;
  opacity: 0.7;
}

.dock { display: none; }

/* ── Toast ── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  transform: translate(-50%, 10px);
  max-width: min(90vw, 400px);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.86rem;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

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

.toast.is-error {
  border-color: rgba(255, 110, 120, 0.35);
  color: #ffd4d8;
}

/* ── Account ── */

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(42vw, 200px);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
}

.account-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.account-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.account-chip.is-guest .account-chip-label {
  color: var(--accent-2);
}

/* ── Auth modal ── */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-modal.hidden { display: none; }

.auth-card {
  position: relative;
  width: min(100%, 400px);
  padding: 26px 22px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(14, 18, 30, 0.96), rgba(6, 10, 18, 0.98));
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: var(--space-4);
}

.auth-brand img { width: 40px; height: 40px; }

.auth-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.auth-brand-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
}

.auth-lead {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: var(--space-4);
}

.auth-form { display: grid; gap: 11px; }

.auth-form label {
  display: grid;
  gap: var(--space-1);
  font-size: 0.76rem;
  color: var(--muted);
}

.auth-form input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.auth-form input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 3px var(--glow);
}

.auth-error {
  min-height: 1.2em;
  color: #ffb4bc;
  font-size: 0.8rem;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 3px;
}

.auth-actions .cta {
  flex: 1 1 auto;
  justify-content: center;
}

.auth-switch {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-switch button {
  border: 0;
  background: none;
  color: var(--accent-2);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* ── Focus / gamepad ── */

.tile:focus-visible,
.cta:focus-visible,
.filters button:focus-visible,
.pill:focus-visible,
.recent-chip:focus-visible,
.icon-btn:focus-visible,
.ghost-link:focus-visible,
.account-chip:focus-visible,
.theme-swatch:focus-visible,
.search-field input:focus-visible,
.preset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  :root {
    --card-w: 172px;
    --hero-h: clamp(190px, 36vh, 340px);
    --hero-max: min(38vh, 360px);
  }

  .feature-inner {
    grid-template-columns: 1fr min(40%, 240px);
  }
}

@media (max-width: 900px) {
  :root {
    --dock-h: 58px;
    --card-w: 160px;
    --hero-h: clamp(170px, 32vh, 280px);
    --hero-max: min(36vh, 300px);
  }

  .feature-inner {
    grid-template-columns: 1fr min(34%, 130px);
    padding: 10px 12px;
    gap: 10px;
  }

  .feature-poster-wrap {
    order: 0;
    padding: var(--space-1);
  }

  .feature-copy {
    justify-content: center;
  }

  .hero-title {
    font-size: clamp(1.05rem, 4.2vw, 1.5rem);
  }

  .ghost-link { display: none; }

  .dock {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: var(--space-2) 12px calc(var(--space-2) + var(--safe-b));
    background: linear-gradient(180deg, transparent, rgba(4, 6, 12, 0.94) 32%);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .dock-cta { width: 100%; min-height: 44px; }
  .hero-actions #btn-play { display: none; }

  .toast {
    bottom: calc(72px + var(--safe-b));
  }

  .grid {
    mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
  }
}

@media (max-width: 720px) {
  :root {
    --card-w: 150px;
  }

  .account-chip-label { max-width: 72px; }

  .catalog-bar {
    flex-wrap: nowrap;
    padding: var(--space-1);
    gap: var(--space-1);
  }

  .search-field { flex: 1 1 auto; min-width: 0; }

  .catalog-tools { flex-shrink: 0; }

  .topbar-end { gap: var(--space-1); }
  .theme-picker { display: none; }
}

@media (max-width: 520px) {
  :root {
    --card-w: 142px;
    --hero-h: clamp(150px, 30vh, 240px);
    --hero-max: min(34vh, 260px);
  }

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

  .feature-inner {
    grid-template-columns: 1fr min(38%, 108px);
    gap: var(--space-2);
    padding: var(--space-2) 10px;
  }

  .hero-actions .cta-soft,
  .hero-actions .cta-ghost {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.74rem;
  }

  .foot {
    font-size: 0.6rem;
    gap: var(--space-1);
  }

  #studio-tagline { display: none; }
}

@media (max-height: 700px) {
  :root {
    --hero-h: clamp(140px, 34vh, 220px);
    --hero-max: min(36vh, 240px);
    --header-h: 48px;
  }

  .hero-kicker { margin-bottom: 2px; }
  .hero-title { margin-bottom: 2px; font-size: clamp(1rem, 2.5vw, 1.4rem); }
  .hero-desc { margin-bottom: var(--space-1); font-size: 0.78rem; }
  .hero-meta { margin-bottom: var(--space-1); }
  .topbar { min-height: 48px; max-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .tile:hover .tile-media img { transform: none; }
  .tile:active { transform: none; }
}
