:root {
  color-scheme: dark;
  --bg: #07070d;
  --bg-deep: #0e1020;
  --panel: rgba(15, 18, 31, 0.82);
  --panel-strong: rgba(20, 24, 40, 0.95);
  --panel-soft: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef0ff;
  --muted: rgba(238, 240, 255, 0.66);
  --faint: rgba(238, 240, 255, 0.38);
  --accent: #8b67ff;
  --accent-2: #31d6c5;
  --accent-3: #ffb65f;
  --accent-4: #ff7aa8;
  --shadow: rgba(0, 0, 0, 0.46);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-head: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(126, 82, 255, 0.2), transparent 30%),
    radial-gradient(circle at 20% 30%, rgba(49, 214, 197, 0.12), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(255, 182, 95, 0.11), transparent 20%),
    linear-gradient(180deg, #05060b 0%, #090b14 38%, #06070d 100%);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  width: 100%;
  padding: 28px 18px 36px;
  isolation: isolate;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(transparent 0 96%, rgba(255, 255, 255, 0.025) 96% 100%),
    linear-gradient(90deg, transparent 0 96%, rgba(255, 255, 255, 0.02) 96% 100%);
  background-size: 100% 34px, 34px 100%;
  opacity: 0.25;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: -2;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 36vw;
  height: 36vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
  z-index: -3;
  animation: drift 18s ease-in-out infinite;
}

.ambient-a {
  top: -8vw;
  left: -8vw;
  background: radial-gradient(circle, rgba(142, 91, 255, 0.9), rgba(142, 91, 255, 0));
}

.ambient-b {
  top: 10vh;
  right: -10vw;
  background: radial-gradient(circle, rgba(49, 214, 197, 0.8), rgba(49, 214, 197, 0));
  animation-duration: 24s;
  animation-direction: reverse;
}

.ambient-c {
  bottom: -10vw;
  left: 26vw;
  background: radial-gradient(circle, rgba(255, 182, 95, 0.72), rgba(255, 182, 95, 0));
  animation-duration: 28s;
}

.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -4;
  background-image:
    radial-gradient(circle at 8% 15%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
    radial-gradient(circle at 22% 72%, rgba(255, 255, 255, 0.45) 0 1px, transparent 2px),
    radial-gradient(circle at 46% 28%, rgba(255, 255, 255, 0.65) 0 1px, transparent 2px),
    radial-gradient(circle at 61% 16%, rgba(255, 255, 255, 0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 64%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 91% 26%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 12% 86%, rgba(255, 255, 255, 0.42) 0 1px, transparent 2px),
    radial-gradient(circle at 83% 88%, rgba(255, 255, 255, 0.52) 0 1px, transparent 2px);
  opacity: 0.7;
  animation: shimmer 10s steps(2) infinite;
}

.app {
  max-width: 1360px;
  margin: 0 auto;
  position: relative;
}

.frame {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(8, 10, 20, 0.9), rgba(12, 15, 28, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  border-radius: calc(var(--radius-xl) + 4px);
  overflow: hidden;
}

.game-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 28px);
  min-height: 0;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 32%);
  mix-blend-mode: screen;
  opacity: 0.85;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  padding: 22px;
}

.hero.single {
  grid-template-columns: 1fr;
}

.hero-copy {
  padding: 18px 18px 6px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent);
}

.title {
  margin: 12px 0 10px;
  font-family: var(--font-head);
  font-size: clamp(58px, 9vw, 96px);
  line-height: 0.88;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(119, 108, 255, 0.24);
}

.title .accent {
  background: linear-gradient(120deg, #fff, color-mix(in srgb, var(--accent-3) 65%, white), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.hero-badges {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pill.soft {
  color: var(--muted);
}

.pill .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}

.hero-card,
.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(11, 14, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-xl);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.hero-card {
  min-height: 390px;
  display: flex;
  align-items: stretch;
}

.game-screen .hero-card {
  min-height: 0;
}

.hero-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 16%, transparent), transparent 32%),
    radial-gradient(circle at bottom right, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 32%);
  opacity: 0.9;
  pointer-events: none;
}

.hero-card-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  gap: 14px;
  min-height: 0;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.roster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  padding: 15px;
  min-height: 264px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(16, 18, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
  overflow: hidden;
}

.roster-card:hover,
.roster-card:focus-visible,
.roster-card.is-preview {
  transform: translateY(-3px) scale(1.01);
  border-color: color-mix(in srgb, var(--accent) 54%, white 12%);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 44px color-mix(in srgb, var(--accent) 20%, transparent);
}

.roster-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 40%),
    radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 42%);
  opacity: 0.65;
  pointer-events: none;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.card-name {
  font-family: var(--font-head);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.03em;
}

.card-role {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: right;
}

.card-lore {
  position: relative;
  z-index: 1;
  color: rgba(240, 241, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
  min-height: 54px;
}

.mini-stage,
.main-stage {
  position: relative;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.1), transparent 48%),
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 35%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mini-stage {
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
}

.stage-glow {
  position: absolute;
  inset: auto 18% 10% 18%;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 24%, rgba(0, 0, 0, 0.52));
  filter: blur(24px);
  opacity: 0.58;
}

.mini-stage .creature-wrap {
  transform: translateY(6px) scale(0.72);
}

.main-stage {
  min-height: 580px;
  display: grid;
  place-items: end center;
  padding: 112px 16px 18px;
}

.game-screen .main-stage {
  min-height: clamp(260px, 44vh, 390px);
}

.main-stage .creature-wrap {
  width: min(100%, 430px);
  transform: translateY(34px);
}

.creature-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 24px 38px rgba(0, 0, 0, 0.5));
}

.creature-wrap::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 17%;
  right: 17%;
  bottom: 10%;
  height: 9%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(0, 0, 0, 0.72) 0 32%, rgba(0, 0, 0, 0.34) 58%, transparent 76%);
  filter: blur(8px);
  opacity: 0.78;
  pointer-events: none;
}

.creature-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.blob-stage {
  --idle-speed: 8.8s;
  --bob-distance: 2px;
  --tilt: 0.25deg;
  --pulse-speed: 8.5s;
  --glow-strength: 0.75;
  position: relative;
  width: 100%;
}

.blob-stage.thriving {
  --idle-speed: 7.6s;
  --bob-distance: 3px;
  --tilt: 0.4deg;
}

.blob-stage.content {
  --idle-speed: 8.4s;
}

.blob-stage.wary {
  --idle-speed: 9.2s;
  --bob-distance: 2px;
}

.blob-stage.weary,
.blob-stage.neglected,
.blob-stage.feral {
  --idle-speed: 7.5s;
  --bob-distance: 4px;
  --tilt: 0.8deg;
}

.blob-stage .creature-body {
  transform-box: fill-box;
  transform-origin: center;
  animation: floaty var(--idle-speed) ease-in-out infinite;
}

.blob-stage .eyes {
  animation: blink 6.8s steps(1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.blob-stage .pupil {
  animation: gaze 7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.blob-stage .mouth {
  animation: mouthPulse var(--pulse-speed) ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.blob-stage.is-reacting .creature-body {
  animation: react 0.62s cubic-bezier(0.2, 0.9, 0.25, 1.05) 1;
}

.blob-stage.is-reacting .mouth {
  animation-duration: 0.62s;
}

.blob-stage.neglect-sticky .creature-body,
.blob-stage.neglect-overdramatic .creature-body,
.blob-stage.neglect-suspicious .creature-body,
.blob-stage.neglect-gloomy .creature-body,
.blob-stage.neglect-withdrawn .creature-body,
.blob-stage.neglect-eerie .creature-body,
.blob-stage.neglect-desperate .creature-body {
  filter: saturate(0.92) contrast(1.02);
}

.speech-bubble {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  width: min(92%, 520px);
  padding: 14px 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05)),
    rgba(10, 11, 18, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 18px;
  height: 18px;
  transform: translateX(-50%) rotate(45deg);
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bubble-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--faint);
}

.bubble-text {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.45;
  color: #fff8f2;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-card {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(10, 12, 22, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--faint);
}

.meta-value {
  margin-top: 8px;
  font-family: var(--font-head);
  font-size: 22px;
  line-height: 1.1;
}

.meta-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 0;
}

.need-ticker {
  --ring-color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
  padding: 8px 11px 8px 8px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(7, 9, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.need-ticker.is-urgent {
  --ring-color: var(--accent-4);
  border-color: color-mix(in srgb, var(--accent-4) 36%, rgba(255, 255, 255, 0.08));
  box-shadow:
    0 0 28px color-mix(in srgb, var(--accent-4) 24%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ticker-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 999px;
  background:
    conic-gradient(var(--ring-color) calc(var(--tick) * 1turn), rgba(255, 255, 255, 0.11) 0),
    rgba(255, 255, 255, 0.04);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--ring-color) 28%, transparent));
}

.ticker-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: rgba(8, 10, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ticker-ring span {
  position: relative;
  z-index: 1;
  color: #fff8ef;
  font-size: 13px;
  font-weight: 950;
}

.ticker-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ticker-copy strong {
  color: #fff8ef;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticker-copy span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-mark h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: 0.18em;
  line-height: 0.9;
}

.brand-mark p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hud-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.compact-control {
  min-height: 34px;
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 12px;
  white-space: nowrap;
}

.hud .pill {
  min-height: 40px;
  font-size: 14px;
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 4px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.speed-control > span {
  padding: 0 5px 0 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.speed-button {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 11px;
  color: var(--muted);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 900;
}

.speed-button:hover,
.speed-button:focus-visible,
.speed-button.is-active {
  color: #071016;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  border-color: rgba(255, 255, 255, 0.18);
  outline: none;
}

.stage-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
  padding: 22px 22px 0;
}

.stage-header .stack {
  display: grid;
  gap: 8px;
}

.stage-header h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 34px;
  letter-spacing: 0.08em;
}

.stage-header .desc {
  color: var(--muted);
  line-height: 1.5;
  max-width: 62ch;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
  padding: 16px 22px 22px;
  align-items: stretch;
  min-height: 0;
  overflow: visible;
}

.side-stack {
  display: grid;
  gap: 16px;
  min-height: 0;
  max-height: 520px;
  overflow: visible;
}

.stats-panel,
.stats-grid {
  position: relative;
  overflow: visible;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats-panel {
  padding: 20px;
}

.stats-grid {
  display: grid;
  gap: 16px;
}

.stat-row {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.065);
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 248, 240, 0.92);
}

.stat-meter {
  position: relative;
  height: 24px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28);
}

.stat-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--value) * 1%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--from), var(--to));
  box-shadow: 0 0 24px color-mix(in srgb, var(--to) 50%, transparent);
}

.stat-fill::after {
  content: "";
  position: absolute;
  inset: 2px 7px auto;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.06));
}

.stat-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% - 4px);
  z-index: 999;
  display: grid;
  gap: 5px;
  min-width: 190px;
  padding: 10px 11px;
  border-radius: 15px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 22%, transparent), transparent 48%),
    rgba(7, 9, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.stat-row:hover,
.stat-row:focus-within,
.stat-row:focus {
  z-index: 50;
}

.stat-row:hover .stat-tooltip,
.stat-row:focus-within .stat-tooltip,
.stat-row:focus .stat-tooltip {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.subvalue-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.subvalue-row span {
  color: var(--muted);
}

.subvalue-row strong {
  color: #fff8ef;
}

.stat-note {
  color: var(--faint);
  font-size: 13px;
  line-height: 1.45;
}

.actions-panel {
  padding: 18px;
}

.actions-dock {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 30;
  overflow: visible;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.action-button,
.ghost-button,
.select-button,
.share-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(17, 19, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.action-button:hover,
.ghost-button:hover,
.select-button:hover,
.share-button:hover,
.action-button:focus-visible,
.ghost-button:focus-visible,
.select-button:focus-visible,
.share-button:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 60%, white 8%);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 36px color-mix(in srgb, var(--accent) 18%, transparent);
}

.action-button:disabled,
.select-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.action-tile {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  z-index: 1;
  padding: 4px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    color-mix(in srgb, var(--action-b) 10%, rgba(5, 7, 13, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.action-tile.is-open {
  z-index: 80;
  border-color: color-mix(in srgb, var(--action-a) 44%, rgba(255, 255, 255, 0.08));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--action-a) 18%, transparent), 0 18px 48px rgba(0, 0, 0, 0.26);
}

.action-tile.is-wanted {
  border-color: color-mix(in srgb, var(--action-a) 62%, rgba(255, 255, 255, 0.16));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--action-a) 30%, transparent),
    0 0 26px color-mix(in srgb, var(--action-a) 30%, transparent);
}

.action-tile.is-wanted .action-button {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 18px 38px color-mix(in srgb, var(--action-b) 34%, transparent),
    0 0 30px color-mix(in srgb, var(--action-a) 34%, transparent);
}

.action-tile.is-wanted .sub-toggle {
  color: #071016;
  background: linear-gradient(135deg, var(--action-a), var(--action-b));
}

.actions-dock .action-button {
  min-height: 96px;
  width: 100%;
  flex-direction: column;
  gap: 9px;
  padding: 12px 10px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 10%, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--action-a) 78%, #ffffff 6%), color-mix(in srgb, var(--action-b) 78%, #090b14 12%));
  border-color: color-mix(in srgb, var(--action-a) 72%, white 10%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 12px 28px color-mix(in srgb, var(--action-b) 28%, transparent);
}

.sub-toggle {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 27px;
  padding: 3px 5px 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03)),
    rgba(5, 7, 13, 0.58);
  border: 1px solid color-mix(in srgb, var(--action-a) 24%, rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sub-toggle b {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  color: #071016;
  background: linear-gradient(135deg, var(--action-a), var(--action-b));
  font-size: 13px;
  line-height: 1;
}

.sub-toggle:hover,
.sub-toggle:focus-visible {
  color: #071016;
  background: linear-gradient(135deg, var(--action-a), var(--action-b));
  outline: none;
}

.sub-action-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 100;
  display: grid;
  gap: 7px;
  width: min(250px, 76vw);
  padding: 10px;
  border-radius: 20px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--action-a) 34%, transparent), transparent 48%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--action-b) 22%, transparent), transparent 42%),
    rgba(7, 9, 18, 0.96);
  border: 1px solid color-mix(in srgb, var(--action-a) 28%, rgba(255, 255, 255, 0.11));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.sub-action-menu::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(7, 9, 18, 0.96);
  border-right: 1px solid color-mix(in srgb, var(--action-a) 24%, rgba(255,255,255,.08));
  border-bottom: 1px solid color-mix(in srgb, var(--action-a) 24%, rgba(255,255,255,.08));
}

.sub-action-button {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-areas:
    "icon title"
    "icon note";
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  padding: 10px;
  border-radius: 15px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032)),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.sub-action-button:hover,
.sub-action-button:focus-visible {
  background: linear-gradient(135deg, color-mix(in srgb, var(--action-a) 28%, rgba(255,255,255,.07)), color-mix(in srgb, var(--action-b) 22%, rgba(255,255,255,.05)));
  border-color: color-mix(in srgb, var(--action-a) 45%, rgba(255, 255, 255, 0.14));
  transform: translateY(-1px);
  outline: none;
}

.sub-action-button span {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  font-size: 18px;
  background: color-mix(in srgb, var(--action-a) 20%, rgba(255, 255, 255, 0.06));
}

.sub-action-button strong {
  grid-area: title;
  color: #fff8ef;
  font-size: 13px;
}

.sub-action-button small {
  grid-area: note;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.actions-dock .action-button::before {
  content: "";
  position: absolute;
  inset: -45% -25% auto;
  height: 82%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24), transparent 58%);
  opacity: 0.75;
  transform: rotate(-12deg);
  pointer-events: none;
}

.actions-dock .action-button:hover,
.actions-dock .action-button:focus-visible {
  transform: translateY(-4px) scale(1.025);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.3),
    0 0 34px color-mix(in srgb, var(--action-a) 38%, transparent);
}

.actions-dock .action-icon {
  width: 42px;
  height: 42px;
  font-size: 24px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.16) 42%, rgba(0, 0, 0, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 18px rgba(0, 0, 0, 0.2);
}

.actions-dock .action-copy {
  text-align: center;
  gap: 1px;
}

.actions-dock .action-copy strong {
  font-size: 13px;
  color: white;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.34);
}

.actions-dock .action-copy span {
  max-width: 15ch;
  margin-inline: auto;
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  line-height: 1.2;
}

.action-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: white;
  font-weight: 700;
}

.action-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.action-copy strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.action-copy span {
  color: var(--muted);
  font-size: 12px;
}

.personality-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.personality-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff7ef;
}

.personality-badge .swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent);
}

.insight {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.memory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.memory-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.memory-chip strong {
  color: var(--text);
  font-weight: 700;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 18px;
  min-height: 0;
  overflow: hidden;
}

.hero-chat {
  min-height: 210px;
  max-height: 260px;
}

.hero-chat .chat-log {
  max-height: 126px;
}

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

.chat-head strong {
  display: block;
  margin-top: 3px;
  color: #fff8f0;
  font-size: 15px;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, transparent) rgba(255, 255, 255, 0.06);
}

.chat-message {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-message span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-message p {
  margin: 0;
  color: rgba(255, 248, 242, 0.9);
  font-size: 14px;
  line-height: 1.42;
}

.chat-message.from-you {
  margin-left: 22px;
  background: color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.05));
}

.chat-message.from-blob {
  margin-right: 22px;
  border-color: color-mix(in srgb, var(--accent-2) 26%, rgba(255, 255, 255, 0.08));
}

.chat-message.mood-happy { box-shadow: inset 3px 0 0 #ff8fd8; }
.chat-message.mood-sad { box-shadow: inset 3px 0 0 #74a7ff; }
.chat-message.mood-hungry { box-shadow: inset 3px 0 0 #ffb75f; }
.chat-message.mood-gross { box-shadow: inset 3px 0 0 #7cf0ff; }
.chat-message.mood-sleepy { box-shadow: inset 3px 0 0 #a78bff; }
.chat-message.mood-stressed { box-shadow: inset 3px 0 0 #ff6f7d; }
.chat-message.mood-curious { box-shadow: inset 3px 0 0 #b0ff87; }

.chat-empty {
  padding: 12px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
  background: rgba(255, 255, 255, 0.045);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chat-form input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  background: rgba(6, 7, 13, 0.72);
  outline: none;
}

.chat-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, white 8%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.chat-form button {
  border-radius: 14px;
  padding: 10px 13px;
  color: #0a0b12;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
}

.footer-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px 22px;
}

.footer-row .ghost-button {
  min-width: 160px;
}

.select-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 22px;
  max-height: calc(100vh - 56px);
  min-height: 0;
  overflow: hidden;
}

.picker-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}

.picker-preview {
  min-height: 392px;
  min-width: 0;
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto minmax(118px, 0.78fr) auto auto;
  gap: 14px;
  overflow: hidden;
}

.picker-preview .mini-stage {
  min-height: 132px;
}

.picker-preview .lore {
  color: var(--muted);
  line-height: 1.6;
  max-width: 58ch;
}

.picker-detail {
  display: grid;
  gap: 12px;
}

.picker-detail .mini-meta {
  display: grid;
  gap: 8px;
}

.picker-detail .mini-meta .meta-value {
  font-size: 18px;
}

.roster-copy {
  display: grid;
  gap: 10px;
}

.roster-copy h1,
.roster-copy h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.08em;
}

.roster-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.profile-copy {
  align-content: start;
}

.profile-copy h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.profile-textblock {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-textblock p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.36;
}

.profile-label {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.evolution-preview {
  display: grid;
  gap: 7px;
}

.evolution-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.evolution-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  color: rgba(255, 248, 242, 0.9);
  font-size: 11px;
  background: rgba(8, 10, 18, 0.42);
  border: 1px solid color-mix(in srgb, var(--accent-2) 24%, rgba(255, 255, 255, 0.08));
}

.evolution-index {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  color: #0b0d14;
  font-size: 10px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

.profile-traits {
  position: relative;
  z-index: 3;
  margin-bottom: -4px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.profile-traits .trait-pill {
  justify-content: center;
  min-height: 18px;
  width: 100%;
  padding: 2px 4px;
  font-size: 9px;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.trait-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff7ea;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 44%, transparent), color-mix(in srgb, var(--accent-2) 32%, transparent)),
    rgba(255, 255, 255, 0.06);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, rgba(255, 255, 255, 0.12));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 15%, transparent);
}

.character-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.character-facts.profile {
  position: relative;
  z-index: 3;
}

.character-fact {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.085);
}

.character-fact span {
  display: block;
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-fact strong {
  display: block;
  margin-top: 3px;
  color: #fff8ef;
  font-size: 11px;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.character-facts.compact {
  grid-template-columns: 1fr;
  gap: 5px;
}

.character-facts.compact .character-fact {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
}

.character-facts.compact .character-fact strong {
  margin-top: 0;
  text-align: right;
}

.roster-grid-wrap {
  padding: 16px;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.roster-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 8px 2px 2px;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--accent) 58%, transparent) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.roster-scroll::-webkit-scrollbar {
  width: 10px;
}

.roster-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.roster-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.footer-note {
  color: var(--faint);
  font-size: 13px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 1320px;
  margin: 8px auto 0;
  padding: 7px 14px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: rgba(5, 7, 14, 0.58);
  backdrop-filter: blur(14px);
}

.footer-brand {
  color: inherit;
  text-decoration: none;
}

.footer-brand:hover,
.footer-brand:focus-visible {
  color: var(--text);
  outline: none;
}

.footer-links {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #071016;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  outline: none;
}

.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(14px);
}

.info-panel {
  position: relative;
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 24%, transparent), transparent 36%),
    linear-gradient(180deg, rgba(20, 24, 42, 0.98), rgba(8, 10, 19, 0.98));
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.62);
}

.info-panel h2 {
  margin: 10px 44px 16px 0;
  font-family: var(--font-head);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.98;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info-block,
.imprint-copy {
  padding: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.info-block h3 {
  margin: 0 0 7px;
  font-size: 14px;
  color: color-mix(in srgb, var(--accent-2) 72%, white);
}

.info-block p,
.imprint-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.imprint-copy p + p {
  margin-top: 10px;
}

.imprint-copy a {
  color: color-mix(in srgb, var(--accent-2) 78%, white);
  overflow-wrap: anywhere;
}

.muted-small {
  color: var(--faint) !important;
  font-size: 12px !important;
}

.static-fallback {
  width: min(720px, 100%);
  margin: 10vh auto 0;
  padding: 34px;
}

.static-fallback h1 {
  margin: 10px 0;
  font-family: var(--font-head);
  font-size: clamp(46px, 8vw, 82px);
  line-height: 0.95;
}

.static-fallback p {
  max-width: 580px;
  color: var(--muted);
  line-height: 1.6;
}

.static-fallback nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.static-fallback a,
.legal-back,
.legal-footer a {
  color: var(--text);
  text-decoration: none;
}

.static-fallback a,
.legal-back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
}

.static-fallback a:hover,
.static-fallback a:focus-visible,
.legal-back:hover,
.legal-back:focus-visible,
.legal-footer a:hover,
.legal-footer a:focus-visible {
  color: #071016;
  background: var(--accent-2);
  outline: none;
}

.legal-shell {
  width: min(920px, 100%);
  margin: 0 auto;
}

.legal-header {
  padding: 18px 0 22px;
}

.legal-header h1 {
  max-width: 780px;
  margin: 22px 0 12px;
  font-family: var(--font-head);
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1;
}

.legal-lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.legal-content {
  padding: 28px;
}

.legal-content section + section {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.legal-content h2 {
  margin: 0 0 12px;
  font-family: var(--font-head);
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.1;
}

.legal-content h3 {
  margin: 22px 0 8px;
  font-size: 17px;
}

.legal-content p,
.legal-content li,
.legal-facts dd,
.legal-facts dt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.legal-content a {
  color: color-mix(in srgb, var(--accent-2) 78%, white);
  overflow-wrap: anywhere;
}

.legal-content ul,
.legal-content ol {
  padding-left: 22px;
}

.legal-content li + li {
  margin-top: 7px;
}

.legal-facts {
  display: grid;
  grid-template-columns: minmax(145px, 0.35fr) 1fr;
  gap: 8px 18px;
  margin: 0;
}

.legal-facts dt {
  color: var(--faint);
  font-weight: 800;
}

.legal-facts dd {
  margin: 0;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 4px 0;
  color: var(--faint);
  font-size: 13px;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-footer a {
  padding: 4px 6px;
  border-radius: 6px;
}

.info-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 24px;
  line-height: 1;
}

.info-close:hover,
.info-close:focus-visible {
  color: #071016;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  outline: none;
}

.hidden {
  display: none !important;
}

svg .body-fill {
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--glow) 32%, transparent));
}

.blob-stage .rune,
.blob-stage .spark,
.blob-stage .orbit,
.blob-stage .sprout,
.blob-stage .glisten {
  animation: floaty 7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.blob-stage .spark {
  animation-duration: 4.8s;
}

.blob-stage .orbit {
  animation-duration: 7.8s;
}

.blob-stage .sprout {
  animation-duration: 5.8s;
}

.blob-stage .glisten {
  animation-duration: 6.6s;
}

/* Compact density pass: keep the visual identity, reduce scroll and empty space. */
:root {
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

.app-shell {
  padding: 14px 12px 18px;
}

.app {
  max-width: 1260px;
}

.frame {
  border-radius: 24px;
}

.hero,
.select-screen {
  gap: 10px;
  padding: 12px;
}

.picker-hero {
  grid-template-columns: minmax(280px, 0.55fr) minmax(620px, 1.45fr);
  gap: 10px;
}

.content-grid {
  gap: 10px;
  padding: 10px 12px 12px;
}

.side-stack {
  max-height: 560px;
}

.toolbar,
.stage-header {
  gap: 10px;
  padding: 12px 12px 0;
}

.need-ticker {
  min-width: 150px;
  padding: 6px 9px 6px 6px;
}

.ticker-ring {
  width: 36px;
  height: 36px;
}

.ticker-copy strong {
  font-size: 11px;
}

.ticker-copy span {
  font-size: 10px;
}

.footer-row {
  gap: 8px;
  padding: 0 12px 12px;
}

.hero-card {
  min-height: 280px;
}

.hero-card-content,
.picker-preview,
.stats-panel,
.actions-panel,
.personality-panel,
.chat-panel {
  padding: 12px;
}

.hero-card-content,
.picker-preview,
.personality-panel,
.chat-panel,
.side-stack,
.stats-grid,
.roster-copy,
.trait-list {
  gap: 8px;
}

.picker-preview {
  min-height: 300px;
  grid-template-rows: auto auto minmax(86px, 0.62fr) auto auto;
}

.picker-preview .mini-stage {
  min-height: 88px;
}

.roster-grid {
  gap: 8px;
}

.roster-grid-wrap {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.roster-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 8px 2px 2px;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--accent) 58%, transparent) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.roster-scroll::-webkit-scrollbar {
  width: 10px;
}

.roster-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.roster-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.roster-grid-wrap {
  padding: 10px;
}

.roster-card {
  gap: 8px;
  min-height: 206px;
  padding: 10px;
}

.card-name {
  font-size: 19px;
}

.card-role {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.card-lore {
  min-height: 44px;
  font-size: 11px;
  line-height: 1.35;
}

.mini-stage {
  min-height: 88px;
}

.mini-stage .creature-wrap {
  transform: translateY(5px) scale(0.6);
}

.main-stage {
  min-height: 390px;
  padding: 88px 10px 12px;
  place-items: end center;
}

.main-stage .creature-wrap {
  width: min(100%, 280px);
  transform: translateY(30px);
}

.speech-bubble {
  top: 10px;
  width: min(92%, 420px);
  padding: 9px 12px;
  border-radius: 16px;
}

.speech-bubble::after {
  bottom: -7px;
  width: 13px;
  height: 13px;
}

.bubble-label,
.meta-title {
  font-size: 9px;
  letter-spacing: 0.14em;
}

.bubble-text {
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.32;
}

.brand-mark h1 {
  font-size: 34px;
  letter-spacing: 0.12em;
}

.brand-mark p,
.footer-note {
  font-size: 10px;
}

.eyebrow {
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.eyebrow::before {
  width: 9px;
  height: 9px;
}

.stage-header .stack,
.stat-row {
  gap: 5px;
}

.stage-header h2 {
  font-size: 24px;
  letter-spacing: 0.04em;
}

.stage-header .desc,
.roster-copy p,
.insight,
.meta-sub {
  font-size: 12px;
  line-height: 1.35;
}

.stage-header .desc,
.roster-copy p,
.card-lore,
.meta-sub,
.insight {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.stage-header .desc,
.roster-copy p,
.insight {
  -webkit-line-clamp: 2;
}

.card-lore,
.meta-sub {
  -webkit-line-clamp: 2;
}

.roster-copy h1,
.roster-copy h2 {
  font-size: 24px;
  letter-spacing: 0.04em;
}

.hero-meta,
.status-strip,
.hud,
.hud-actions,
.memory-list,
.actions-grid,
.actions-dock {
  gap: 6px;
}

.compact-control {
  min-height: 28px;
  padding: 6px 9px;
  font-size: 11px;
}

.stats-panel .eyebrow,
.actions-panel .eyebrow {
  margin-bottom: 8px !important;
}

.pill,
.hud .pill {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.speed-control {
  min-height: 30px;
  gap: 3px;
  padding: 3px;
}

.speed-control > span {
  font-size: 9px;
  padding: 0 4px;
}

.speed-button {
  min-height: 22px;
  padding: 3px 6px;
  border-radius: 9px;
  font-size: 9px;
}

.meta-card {
  padding: 10px 12px;
}

.meta-value {
  margin-top: 5px;
  font-size: 17px;
}

.meta-sub {
  margin-top: 4px;
}

.stat-head {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.stat-meter {
  height: 16px;
}

.stat-note {
  font-size: 11px;
  line-height: 1.25;
}

.action-button,
.ghost-button,
.select-button,
.share-button {
  gap: 8px;
  border-radius: 12px;
  padding: 9px 10px;
}

.action-icon {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.action-copy strong {
  font-size: 12px;
}

.action-copy span {
  font-size: 10px;
}

.actions-dock .action-button {
  min-height: 74px;
  padding: 8px 6px;
  border-radius: 15px;
}

.actions-dock .action-icon {
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.actions-dock .action-copy strong {
  font-size: 11px;
}

.actions-dock .action-copy span {
  display: none;
}

.personality-badge {
  gap: 8px;
  padding: 8px 10px;
}

.memory-chip {
  gap: 5px;
  padding: 6px 8px;
  font-size: 10px;
}

.creature-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-box: fill-box;
  transform-origin: 50% 58%;
  animation: creatureDrift var(--idle-speed, 8.8s) ease-in-out infinite;
  will-change: transform;
}

.creature-asset {
  position: relative;
  z-index: 3;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  image-rendering: auto;
  filter:
    saturate(0.82)
    contrast(1.12)
    brightness(0.93)
    drop-shadow(0 20px 24px rgba(0, 0, 0, 0.48));
  transition: filter 360ms ease, opacity 360ms ease;
}

.blob-stage.neglected .creature-asset,
.blob-stage.feral .creature-asset,
.blob-stage.weary .creature-asset {
  filter:
    saturate(0.66)
    contrast(1.12)
    brightness(0.82)
    drop-shadow(0 22px 26px rgba(0, 0, 0, 0.55));
}

.creature-asset.mood-thriving,
.creature-asset.mood-content {
  filter:
    saturate(0.92)
    contrast(1.1)
    brightness(0.98)
    drop-shadow(0 20px 24px rgba(0, 0, 0, 0.46));
}

.creature-asset.mood-weary,
.creature-asset.mood-neglected,
.creature-asset.mood-feral {
  opacity: 0.92;
}

.state-aura,
.state-scene,
.state-face {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.state-aura {
  z-index: 0;
  border-radius: 42%;
  background:
    radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--glow) 28%, transparent), transparent 42%),
    radial-gradient(circle at 50% 80%, rgba(0, 0, 0, 0.24), transparent 34%);
  filter: blur(8px);
  opacity: 0.8;
  animation: auraPulse 4.6s ease-in-out infinite;
}

.state-aura.mood-weary,
.state-aura.mood-neglected,
.state-aura.mood-feral {
  background:
    radial-gradient(circle at 50% 52%, rgba(90, 86, 120, 0.34), transparent 42%),
    radial-gradient(circle at 50% 80%, rgba(45, 28, 20, 0.32), transparent 34%);
  opacity: 0.62;
}

.state-scene {
  z-index: 4;
  overflow: visible;
}

.state-scene::before {
  content: "";
  position: absolute;
  inset: 2% 4% 2%;
  border-radius: 30% 30% 24% 24%;
  opacity: 0.62;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.34), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 46%);
}

.state-scene.room-kitchen::before {
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.34), transparent 46%),
    linear-gradient(180deg, rgba(255, 184, 92, 0.12), rgba(45, 23, 12, 0.04));
}

.state-scene.room-bedroom::before {
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.38), transparent 46%),
    linear-gradient(180deg, rgba(103, 122, 255, 0.16), rgba(20, 15, 45, 0.06));
}

.state-scene.room-bath::before {
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.3), transparent 46%),
    linear-gradient(180deg, rgba(110, 240, 255, 0.15), rgba(8, 40, 47, 0.05));
}

.state-scene.room-work::before {
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.36), transparent 46%),
    linear-gradient(180deg, rgba(255, 209, 108, 0.12), rgba(22, 20, 28, 0.06));
}

.state-scene.room-living::before {
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.32), transparent 46%),
    linear-gradient(180deg, rgba(181, 111, 255, 0.13), rgba(17, 10, 31, 0.06));
}

.dirt,
.crumb,
.tear-drop,
.rain,
.empty-bowl,
.poop,
.trash,
.fly,
.sleep-z,
.heart,
.sparkle-state,
.coin-pop,
.play-burst {
  position: absolute;
  display: block;
  pointer-events: none;
}

.room-floor,
.room-window,
.room-counter,
.room-fridge,
.room-pot,
.room-shelf,
.room-plate,
.room-bed,
.room-pillow,
.room-lamp,
.room-moon,
.room-tiles,
.room-tub,
.room-mirror,
.room-bubbles,
.room-desk,
.room-monitor,
.room-keyboard,
.room-paper,
.room-chart,
.room-rug,
.room-sofa,
.room-plant,
.room-frame,
.room-candle {
  position: absolute;
  display: block;
  pointer-events: none;
}

.room-floor {
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 23%;
  border-radius: 50% 50% 20% 20%;
  opacity: 0.68;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 56%, transparent 72%);
  transform: perspective(120px) rotateX(16deg);
}

.kitchen-floor { background: radial-gradient(ellipse at center, rgba(255, 183, 95, 0.2), rgba(255, 255, 255, 0.03) 54%, transparent 72%); }
.bedroom-floor { background: radial-gradient(ellipse at center, rgba(116, 126, 255, 0.2), rgba(255, 255, 255, 0.03) 54%, transparent 72%); }
.bath-floor { background: radial-gradient(ellipse at center, rgba(124, 240, 255, 0.22), rgba(255, 255, 255, 0.04) 54%, transparent 72%); }
.work-floor { background: radial-gradient(ellipse at center, rgba(255, 207, 109, 0.19), rgba(255, 255, 255, 0.03) 54%, transparent 72%); }
.living-floor { background: radial-gradient(ellipse at center, rgba(196, 150, 255, 0.2), rgba(255, 255, 255, 0.03) 54%, transparent 72%); }

.room-window {
  right: 8%;
  top: 12%;
  width: 78px;
  height: 54px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.15) 49% 51%, transparent 52%),
    linear-gradient(180deg, transparent 48%, rgba(255, 255, 255, 0.15) 49% 51%, transparent 52%),
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.85), transparent 7px),
    linear-gradient(135deg, rgba(70, 80, 160, 0.75), rgba(20, 25, 60, 0.25));
  box-shadow: 0 0 28px rgba(120, 160, 255, 0.16);
}

.moon-window {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 242, 178, 0.9), transparent 9px),
    linear-gradient(135deg, rgba(36, 45, 112, 0.78), rgba(12, 15, 44, 0.3));
}

.room-counter {
  left: 8%;
  bottom: 13%;
  width: 104px;
  height: 42px;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, rgba(255, 208, 119, 0.28), rgba(68, 38, 22, 0.42));
  border: 1px solid rgba(255, 224, 160, 0.18);
}

.room-fridge {
  left: 8%;
  bottom: 29%;
  width: 48px;
  height: 88px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(160, 242, 255, 0.22), rgba(50, 84, 100, 0.26));
  border: 1px solid rgba(195, 246, 255, 0.18);
}

.room-pot {
  left: 28%;
  bottom: 24%;
  color: #ffcf6d;
  font-size: 25px;
  text-shadow: 0 0 14px rgba(255, 207, 109, 0.55);
  animation: steamCurl 3s ease-in-out infinite;
}

.room-shelf {
  right: 9%;
  top: 31%;
  width: 92px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 220, 150, 0.24);
  box-shadow: 0 -13px 0 -3px rgba(255, 160, 95, 0.12), 0 13px 0 -3px rgba(255, 160, 95, 0.1);
}

.room-plate {
  right: 20%;
  bottom: 16%;
  width: 42px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 207, 109, 0.42);
  background: rgba(255, 255, 255, 0.06);
}

.room-bed {
  left: 7%;
  bottom: 11%;
  width: 122px;
  height: 52px;
  border-radius: 22px 22px 10px 10px;
  background: linear-gradient(180deg, rgba(120, 127, 255, 0.28), rgba(35, 28, 80, 0.42));
  border: 1px solid rgba(190, 200, 255, 0.15);
}

.room-pillow {
  left: 11%;
  bottom: 25%;
  width: 43px;
  height: 22px;
  border-radius: 16px;
  background: rgba(238, 244, 255, 0.18);
}

.room-lamp {
  right: 12%;
  bottom: 24%;
  width: 32px;
  height: 58px;
  background:
    linear-gradient(90deg, transparent 42%, rgba(255, 220, 150, 0.35) 43% 57%, transparent 58%),
    radial-gradient(ellipse at top, rgba(255, 207, 109, 0.3), rgba(255, 207, 109, 0.05) 45%, transparent 46%);
  filter: drop-shadow(0 0 18px rgba(255, 207, 109, 0.24));
}

.room-moon {
  right: 19%;
  top: 15%;
  color: rgba(255, 236, 170, 0.74);
  font-size: 16px;
  text-shadow: 0 0 14px rgba(255, 236, 170, 0.48);
}

.room-tiles {
  inset: 10% 7% 36%;
  opacity: 0.16;
  background:
    linear-gradient(transparent 0 80%, rgba(255, 255, 255, 0.5) 81% 84%, transparent 85%),
    linear-gradient(90deg, transparent 0 80%, rgba(255, 255, 255, 0.45) 81% 84%, transparent 85%);
  background-size: 36px 28px;
}

.room-tub {
  left: 7%;
  bottom: 10%;
  width: 126px;
  height: 46px;
  border-radius: 0 0 42px 42px;
  border: 3px solid rgba(166, 245, 255, 0.32);
  border-top: 0;
  background: linear-gradient(180deg, rgba(110, 240, 255, 0.12), rgba(45, 93, 102, 0.22));
}

.room-mirror {
  right: 12%;
  top: 20%;
  width: 54px;
  height: 70px;
  border-radius: 22px;
  border: 2px solid rgba(195, 250, 255, 0.22);
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.22), rgba(125, 240, 255, 0.06));
}

.room-bubbles {
  color: rgba(190, 250, 255, 0.72);
  text-shadow: 0 0 12px rgba(125, 240, 255, 0.55);
  animation: bubbleRise 3.4s ease-in-out infinite;
}

.b-a { left: 19%; bottom: 30%; font-size: 16px; }
.b-b { left: 28%; bottom: 37%; font-size: 11px; animation-delay: .8s; }
.b-c { right: 19%; bottom: 43%; font-size: 13px; animation-delay: 1.3s; }

.room-desk {
  left: 8%;
  bottom: 12%;
  width: 138px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 207, 109, 0.22), rgba(50, 38, 28, 0.42));
  border: 1px solid rgba(255, 207, 109, 0.14);
}

.room-monitor {
  left: 16%;
  bottom: 27%;
  width: 70px;
  height: 44px;
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(127, 240, 255, 0.18), rgba(24, 32, 62, 0.66)),
    linear-gradient(90deg, transparent 0 45%, rgba(127, 240, 255, 0.18) 45% 55%, transparent 55%);
  border: 2px solid rgba(127, 240, 255, 0.18);
  box-shadow: 0 0 22px rgba(127, 240, 255, 0.16);
}

.room-keyboard {
  left: 17%;
  bottom: 20%;
  width: 80px;
  height: 11px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 4px, rgba(255,255,255,.04) 4px 8px);
}

.room-paper {
  right: 14%;
  bottom: 24%;
  color: rgba(255, 240, 190, 0.8);
  font-size: 24px;
  transform: rotate(-12deg);
  animation: paperWiggle 4s ease-in-out infinite;
}

.paper-b { right: 23%; bottom: 17%; animation-delay: .7s; transform: rotate(10deg); }

.room-chart {
  right: 8%;
  top: 18%;
  width: 72px;
  height: 50px;
  border-radius: 10px;
  border: 1px solid rgba(255, 207, 109, 0.16);
  background:
    linear-gradient(135deg, transparent 0 54%, rgba(255, 207, 109, 0.5) 55% 59%, transparent 60%),
    rgba(255, 255, 255, 0.035);
}

.room-rug {
  left: 31%;
  bottom: 5%;
  width: 138px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 122, 168, 0.2), rgba(139, 103, 255, 0.08) 65%, transparent 70%);
}

.room-sofa {
  left: 7%;
  bottom: 14%;
  width: 112px;
  height: 48px;
  border-radius: 28px 28px 12px 12px;
  background: linear-gradient(180deg, rgba(139, 103, 255, 0.24), rgba(49, 28, 89, 0.38));
  border: 1px solid rgba(207, 190, 255, 0.13);
}

.room-plant {
  right: 10%;
  bottom: 13%;
  width: 48px;
  height: 76px;
  background:
    radial-gradient(ellipse at 40% 18%, rgba(118, 255, 180, 0.46), transparent 17px),
    radial-gradient(ellipse at 68% 31%, rgba(80, 220, 155, 0.38), transparent 15px),
    linear-gradient(90deg, transparent 42%, rgba(116, 255, 178, 0.28) 43% 57%, transparent 58%);
}

.room-frame {
  right: 23%;
  top: 15%;
  width: 54px;
  height: 42px;
  border-radius: 9px;
  border: 2px solid rgba(255, 207, 109, 0.18);
  background: radial-gradient(circle at 52% 44%, rgba(255, 122, 168, 0.2), transparent 16px);
}

.room-candle {
  left: 22%;
  top: 31%;
  width: 11px;
  height: 29px;
  border-radius: 8px;
  background: rgba(255, 240, 190, 0.18);
  box-shadow: 0 -11px 16px rgba(255, 207, 109, 0.34);
  animation: candleFlicker 2.2s ease-in-out infinite;
}

.dirt {
  width: 18px;
  height: 13px;
  border-radius: 60% 40% 52% 48%;
  background: rgba(62, 35, 18, 0.78);
  box-shadow: 0 0 12px rgba(43, 21, 9, 0.34);
  animation: dirtWobble 4s ease-in-out infinite;
}

.d1 { left: 25%; top: 60%; }
.d2 { right: 24%; top: 50%; animation-delay: 0.8s; }
.d3 { left: 48%; top: 72%; width: 13px; height: 10px; animation-delay: 1.2s; }

.poop {
  left: 18%;
  bottom: 15%;
  width: 34px;
  height: 24px;
  border-radius: 55% 55% 45% 45%;
  color: transparent;
  background:
    radial-gradient(circle at 50% 0%, #7a451c 0 7px, transparent 8px),
    radial-gradient(circle at 34% 42%, #8b5123 0 10px, transparent 11px),
    radial-gradient(circle at 62% 46%, #5f3216 0 11px, transparent 12px);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.32));
  animation: stink 2.4s ease-in-out infinite;
}

.trash {
  color: #c4bea5;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 236, 172, 0.28);
  animation: trashFloat 3.6s ease-in-out infinite;
}

.trash-a { right: 18%; bottom: 17%; transform: rotate(18deg); }
.trash-b { right: 27%; bottom: 10%; color: #8ed8c8; animation-delay: 0.7s; }
.trash-c { left: 18%; bottom: 30%; color: #ffcf6d; animation-delay: 0.35s; }

.fly {
  color: #1b1510;
  font-size: 18px;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
  animation: flyLoop 2.8s ease-in-out infinite;
}

.fly-a { left: 16%; top: 34%; }
.fly-b { right: 15%; top: 42%; animation-delay: 0.8s; }
.fly-c { left: 50%; top: 18%; animation-delay: 1.1s; }

.empty-bowl {
  left: 37%;
  bottom: 7%;
  width: 74px;
  height: 24px;
  border-radius: 0 0 45px 45px;
  border: 3px solid rgba(255, 199, 102, 0.75);
  border-top: 0;
  background: linear-gradient(180deg, rgba(60, 35, 20, 0), rgba(90, 48, 22, 0.72));
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.24);
  animation: bowlAsk 2.2s ease-in-out infinite;
}

.crumb {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffcf6d;
  bottom: 12%;
  animation: crumbRoll 3s ease-in-out infinite;
}

.crumb-a { left: 34%; }
.crumb-b { right: 34%; animation-delay: 1s; }
.crumb-c { left: 52%; bottom: 19%; animation-delay: 1.4s; }

.event-bowl {
  left: 50%;
  bottom: 5%;
  transform: scale(0.7);
  opacity: 0.8;
}

.sleep-z {
  color: rgba(225, 238, 255, 0.9);
  font-family: var(--font-head);
  font-weight: 900;
  text-shadow: 0 0 14px rgba(116, 225, 245, 0.62);
  animation: zFloat 2.8s ease-in-out infinite;
}

.z1 { right: 24%; top: 22%; font-size: 33px; }
.z2 { right: 18%; top: 12%; font-size: 24px; animation-delay: .45s; }
.z3 { right: 12%; top: 5%; font-size: 18px; animation-delay: .9s; }
.z4 { left: 18%; top: 12%; font-size: 22px; animation-delay: .65s; }

.tear-drop,
.rain {
  width: 8px;
  height: 17px;
  border-radius: 999px 999px 999px 0;
  background: #7fe7ff;
  transform: rotate(-28deg);
  box-shadow: 0 0 10px rgba(127, 231, 255, 0.62);
  animation: tearFall 1.9s ease-in-out infinite;
}

.t1 { left: 35%; top: 49%; }
.t2 { right: 35%; top: 50%; animation-delay: 0.35s; }
.r1 { left: 22%; top: 25%; opacity: .45; animation-delay: .7s; }
.r2 { right: 21%; top: 30%; opacity: .42; animation-delay: 1s; }
.r3 { left: 58%; top: 22%; opacity: .4; animation-delay: 1.25s; }

.heart,
.sparkle-state,
.coin-pop,
.play-burst {
  font-weight: 900;
  text-shadow: 0 0 13px currentColor;
  animation: happyFloat 2.4s ease-in-out infinite;
}

.heart { color: #ff7aa8; font-size: 22px; }
.h1 { left: 20%; top: 21%; }
.h2 { right: 21%; top: 26%; animation-delay: .5s; }
.sparkle-state { color: #fff0a8; font-size: 24px; }
.s1 { left: 29%; top: 13%; animation-delay: .3s; }
.s2 { right: 29%; top: 14%; animation-delay: .8s; }
.s3 { left: 46%; top: 7%; animation-delay: 1.1s; }
.coin-pop { color: #ffcf6d; font-size: 24px; }
.c1 { right: 24%; top: 27%; }
.c2 { right: 32%; top: 18%; animation-delay: .35s; }
.play-burst { color: #79f0ff; font-size: 28px; }
.p1 { left: 22%; top: 26%; }
.p2 { right: 22%; top: 18%; animation-delay: .4s; }
.p3 { left: 58%; top: 31%; animation-delay: .9s; }

.state-face {
  z-index: 5;
  inset: 25% 29% 28%;
  transform-origin: center;
  animation: faceBob 3.4s ease-in-out infinite;
  opacity: 0.92;
}

.face-eye,
.face-brow,
.face-mouth {
  position: absolute;
  display: block;
}

.face-eye {
  top: 32%;
  width: 16%;
  height: 21%;
  border-radius: 50%;
  background: rgba(6, 8, 18, 0.84);
  box-shadow: inset 4px -3px 0 rgba(255, 255, 255, 0.24), 0 0 8px rgba(255, 255, 255, 0.1);
  animation: stateBlink 6.2s steps(1) infinite;
}

.face-eye.left { left: 23%; }
.face-eye.right { right: 23%; }

.face-brow {
  top: 23%;
  width: 18%;
  height: 5px;
  border-radius: 999px;
  background: rgba(5, 5, 10, 0.72);
}

.face-brow.left { left: 21%; transform: rotate(-10deg); }
.face-brow.right { right: 21%; transform: rotate(10deg); }

.face-mouth {
  left: 34%;
  bottom: 23%;
  width: 32%;
  height: 18%;
  border: 5px solid rgba(8, 7, 13, 0.78);
  border-top: 0;
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 0 0 999px 999px;
}

.expression-happy .face-mouth {
  bottom: 21%;
  height: 23%;
  border-width: 6px;
}

.expression-sad .face-mouth,
.expression-hungry .face-mouth,
.expression-gross .face-mouth {
  bottom: 14%;
  transform: rotate(180deg);
}

.expression-sad .face-brow.left,
.expression-hungry .face-brow.left,
.expression-gross .face-brow.left { transform: rotate(16deg); }

.expression-sad .face-brow.right,
.expression-hungry .face-brow.right,
.expression-gross .face-brow.right { transform: rotate(-16deg); }

.expression-sleepy .face-eye {
  height: 5px;
  top: 39%;
  border-radius: 999px;
  animation: none;
}

.expression-sleepy .face-mouth {
  width: 18%;
  left: 41%;
  height: 18%;
  border: 5px solid rgba(8, 7, 13, 0.72);
  border-radius: 50%;
}

.expression-stressed .face-eye.left { transform: scaleX(0.8) rotate(-8deg); }
.expression-stressed .face-eye.right { transform: scaleX(0.8) rotate(8deg); }
.expression-stressed .face-mouth {
  border-radius: 999px;
  height: 6px;
  border: 0;
  background: rgba(8, 7, 13, 0.78);
}

.expression-gross .face-eye {
  background:
    linear-gradient(45deg, transparent 42%, rgba(6,8,18,.9) 43% 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, rgba(6,8,18,.9) 43% 57%, transparent 58%);
  box-shadow: none;
}

.state-face.vain {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.16));
}

.mini-stage > .creature-svg {
  flex: 0 0 auto;
  width: min(92%, 154px);
  height: 154px;
}

.blob-stage > .creature-svg {
  width: 100%;
  height: 100%;
}

.creature-svg .creature-body {
  transform-box: fill-box;
  transform-origin: center;
  animation: creatureBreath 4.2s ease-in-out infinite;
}

.creature-svg .eyes,
.creature-svg .single-eye,
.creature-svg .pixel-face {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 6.8s steps(1) infinite;
}

.creature-svg .pupil,
.creature-svg .pixel-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: gaze 7s ease-in-out infinite;
}

.creature-svg .mouth,
.creature-svg .pixel-mouth,
.creature-svg .tongue {
  transform-box: fill-box;
  transform-origin: center;
  animation: mouthPulse var(--pulse-speed, 8.5s) ease-in-out infinite;
}

.creature-svg .spark,
.creature-svg .orbit,
.creature-svg .sprout,
.creature-svg .glisten,
.creature-svg .antenna,
.creature-svg .ghost-pixel {
  transform-box: fill-box;
  transform-origin: center;
  animation: shimmer 3.8s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(0, calc(var(--bob-distance) * -1), 0) rotate(calc(var(--tilt) * -1));
  }
}

@keyframes creatureDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-0.12deg);
  }
  34% {
    transform: translate3d(0.4px, -1.5px, 0) rotate(0.16deg);
  }
  68% {
    transform: translate3d(-0.4px, 0.8px, 0) rotate(-0.18deg);
  }
}

@keyframes creatureBreath {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.025, 0.975);
  }
}

@keyframes auraPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.68;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.9;
  }
}

@keyframes dirtWobble {
  0%,
  100% { transform: rotate(-5deg) scale(1); }
  50% { transform: rotate(7deg) scale(1.08); }
}

@keyframes stink {
  0%,
  100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.05); }
}

@keyframes trashFloat {
  0%,
  100% { transform: translateY(0) rotate(14deg); }
  50% { transform: translateY(-6px) rotate(-10deg); }
}

@keyframes steamCurl {
  0%, 100% { transform: translateY(0) rotate(-4deg); opacity: 0.55; }
  50% { transform: translateY(-8px) rotate(8deg); opacity: 0.95; }
}

@keyframes bubbleRise {
  0%, 100% { transform: translateY(0) scale(0.9); opacity: 0.35; }
  50% { transform: translateY(-13px) scale(1.12); opacity: 0.9; }
}

@keyframes paperWiggle {
  0%, 100% { translate: 0 0; }
  50% { translate: 2px -4px; }
}

@keyframes candleFlicker {
  0%, 100% { filter: brightness(0.9); transform: scaleY(1); }
  50% { filter: brightness(1.35); transform: scaleY(1.08); }
}

@keyframes flyLoop {
  0%,
  100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(18px, -9px) rotate(18deg); }
  66% { transform: translate(-10px, 7px) rotate(-16deg); }
}

@keyframes bowlAsk {
  0%,
  100% { transform: translateY(0) scaleX(1); }
  50% { transform: translateY(-3px) scaleX(1.04); }
}

@keyframes crumbRoll {
  0%,
  100% { transform: translate(0, 0); opacity: 0.65; }
  50% { transform: translate(10px, -3px); opacity: 1; }
}

@keyframes zFloat {
  0% {
    transform: translateY(8px) scale(0.8);
    opacity: 0;
  }
  35%,
  75% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-22px) scale(1.1);
    opacity: 0;
  }
}

@keyframes tearFall {
  0% {
    transform: translateY(-4px) rotate(-28deg);
    opacity: 0;
  }
  25%,
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(28px) rotate(-28deg);
    opacity: 0;
  }
}

@keyframes happyFloat {
  0%,
  100% {
    transform: translateY(0) scale(0.92);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-12px) scale(1.12);
    opacity: 1;
  }
}

@keyframes faceBob {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes stateBlink {
  0%,
  6%,
  100% { transform: scaleY(1); }
  3% { transform: scaleY(0.12); }
}

@keyframes react {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  38% {
    transform: translate3d(0, -12px, 0) scale(1.045, 0.95);
  }
  68% {
    transform: translate3d(0, 3px, 0) scale(0.98, 1.03);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes blink {
  0%,
  8%,
  100% {
    transform: scaleY(1);
  }
  4% {
    transform: scaleY(0.12);
  }
}

@keyframes gaze {
  0%,
  100% {
    transform: translate3d(-1px, 0, 0);
  }
  50% {
    transform: translate3d(1px, -1px, 0);
  }
}

@keyframes mouthPulse {
  0%,
  100% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(1.05);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2vw, 2vh, 0) scale(1.08);
  }
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.55;
    filter: blur(0.2px);
  }
  50% {
    opacity: 0.85;
    filter: blur(0.75px);
  }
}

@media (max-width: 1180px) {
  .hero,
  .content-grid,
  .picker-hero {
    grid-template-columns: 1fr;
  }

  .actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .roster-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: unset;
  }

  .side-stack {
    max-height: none;
    overflow: visible;
  }

  .chat-panel,
  .hero-chat {
    min-height: 260px;
    max-height: 300px;
  }

  .chat-log {
    max-height: 180px;
  }

  .main-stage {
    min-height: 420px;
  }
}

@media (max-width: 1180px) and (min-width: 900px) {
  .game-screen .content-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(270px, 0.75fr);
  }

  .game-screen .side-stack {
    max-height: 560px;
    overflow: visible;
  }

  .game-screen .main-stage {
    min-height: 320px;
  }
}

@media (max-height: 820px) and (min-width: 900px) {
  .app-shell {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .select-screen {
    max-height: calc(100vh - 24px);
  }

  .picker-preview {
    min-height: 250px;
  }

  .picker-preview .mini-stage {
    min-height: 76px;
  }

  .profile-textblock {
    padding: 8px 10px;
  }

  .roster-card {
    min-height: 176px;
  }

  .roster-card .mini-stage {
    min-height: 74px;
  }

  .card-lore {
    min-height: 32px;
  }

  .game-screen {
    max-height: calc(100vh - 16px);
  }

  .game-screen .content-grid {
    overflow: visible;
  }

  .game-screen .main-stage {
    min-height: 285px;
  }

  .game-screen .hero-chat {
    min-height: 140px;
    max-height: 155px;
  }

  .game-screen .hero-chat .chat-log {
    max-height: 66px;
  }
}

@media (max-height: 820px) and (min-width: 1181px) {
  .app-shell {
    padding: 8px 10px;
  }

  .frame {
    max-height: calc(100vh - 16px);
    overflow: hidden;
  }

  .toolbar {
    padding: 8px 10px 0;
  }

  .brand-mark h1 {
    font-size: 28px;
  }

  .brand-mark p {
    display: none;
  }

  .hud .pill,
  .pill {
    min-height: 26px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .game-screen .hud-actions {
    display: inline-flex;
  }

  .game-screen .compact-control {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 10px;
    border-radius: 10px;
  }

  .game-screen .speed-control {
    order: 9;
    width: 100%;
    justify-content: flex-end;
  }

  .stage-header {
    padding: 6px 10px 0;
    align-items: center;
  }

  .stage-header h2 {
    font-size: 21px;
  }

  .stage-header .desc {
    -webkit-line-clamp: 1;
    font-size: 11px;
    line-height: 1.25;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
    gap: 8px;
    padding: 8px 10px 8px;
  }

  .hero-card-content {
    gap: 6px;
    padding: 9px;
  }

  .main-stage {
    min-height: 300px;
    padding: 66px 8px 6px;
  }

  .main-stage .creature-wrap {
    width: min(100%, 240px);
    transform: translateY(22px);
  }

  .speech-bubble {
    top: 7px;
    width: min(92%, 390px);
    padding: 7px 10px;
  }

  .bubble-label {
    display: none;
  }

  .bubble-text {
    margin-top: 0;
    font-size: 13px;
    line-height: 1.22;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meta-card {
    padding: 7px 9px;
  }

  .meta-title,
  .meta-sub {
    display: none;
  }

  .meta-value {
    margin-top: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .actions-dock {
    gap: 5px;
  }

  .actions-dock .action-button {
    min-height: 58px;
    padding: 6px 5px;
    border-radius: 12px;
  }

  .actions-dock .action-icon {
    width: 28px;
    height: 28px;
    font-size: 17px;
  }

  .actions-dock .action-copy strong {
    font-size: 10px;
  }

  .hero-chat {
    min-height: 150px;
    max-height: 165px;
    padding: 8px;
    gap: 6px;
  }

  .chat-head {
    align-items: center;
  }

  .chat-head .eyebrow,
  .chat-head .pill {
    display: none;
  }

  .chat-head strong {
    margin: 0;
    font-size: 12px;
  }

  .hero-chat .chat-log {
    max-height: 76px;
    gap: 5px;
  }

  .chat-message {
    padding: 6px 8px;
    border-radius: 12px;
  }

  .chat-message span {
    font-size: 8px;
  }

  .chat-message p,
  .chat-empty {
    font-size: 10px;
    line-height: 1.2;
  }

  .chat-form {
    gap: 5px;
  }

  .chat-form input {
    padding: 7px 9px;
    border-radius: 11px;
    font-size: 12px;
  }

  .chat-form button {
    padding: 7px 9px;
    border-radius: 11px;
    font-size: 11px;
  }

  .side-stack {
    max-height: 520px;
    gap: 8px;
  }

  .personality-panel,
  .stats-panel {
    padding: 9px;
  }

  .personality-badge {
    padding: 7px 9px;
  }

  .personality-badge strong,
  .insight {
    font-size: 11px;
  }

  .insight {
    -webkit-line-clamp: 2;
  }

  .memory-list {
    display: none;
  }

  .stats-grid {
    gap: 7px;
  }

  .stat-row {
    gap: 4px;
  }

  .stat-head {
    font-size: 9px;
  }

  .stat-note {
    display: none;
  }

  .stat-meter {
    height: 8px;
  }

  .footer-row {
    padding: 0 10px 8px;
  }

  .footer-row .status-strip:first-child {
    display: none;
  }
}

@media (max-height: 820px) and (min-width: 900px) {
  .game-screen {
    grid-template-rows: auto auto minmax(0, 1fr);
    max-height: calc(100vh - 12px) !important;
  }

  .game-screen .footer-row {
    display: none;
  }

  .game-screen .toolbar {
    padding: 7px 9px 0;
  }

  .game-screen .need-ticker {
    min-width: 122px;
    padding: 4px 7px 4px 4px;
    gap: 6px;
  }

  .game-screen .ticker-ring {
    width: 30px;
    height: 30px;
  }

  .game-screen .ticker-ring span,
  .game-screen .ticker-copy span {
    font-size: 9px;
  }

  .game-screen .ticker-copy strong {
    font-size: 10px;
  }

  .game-screen .stage-header {
    padding: 5px 9px 0;
  }

  .game-screen .stage-header .desc,
  .game-screen .brand-mark p,
  .game-screen .hero-meta {
    display: none;
  }

  .game-screen .content-grid {
    grid-template-columns: minmax(0, 1.42fr) minmax(260px, 0.58fr) !important;
    gap: 7px;
    padding: 7px 9px 9px;
    min-height: 0;
    overflow: visible;
  }

  .game-screen .hero-card,
  .game-screen .hero-card-content {
    min-height: 0;
    overflow: hidden;
  }

  .game-screen .hero-card-content {
    display: grid;
    grid-template-rows: minmax(310px, 1fr) auto auto;
    gap: 6px;
    padding: 8px;
  }

  .game-screen .main-stage {
    min-height: 310px !important;
    padding: 64px 8px 6px;
    overflow: hidden;
  }

  .game-screen .main-stage .creature-wrap {
    width: min(100%, 285px) !important;
    transform: translateY(20px) !important;
  }

  .game-screen .speech-bubble {
    top: 6px;
    width: min(94%, 360px);
    padding: 6px 9px;
    z-index: 30;
  }

  .game-screen .bubble-label {
    display: none;
  }

  .game-screen .bubble-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.18;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .game-screen .actions-dock {
    gap: 5px;
  }

  .game-screen .actions-dock .action-button {
    min-height: 60px;
    padding: 6px 5px;
    border-radius: 12px;
  }

  .game-screen .sub-toggle {
    min-height: 21px;
    padding: 2px 4px 2px 8px;
    font-size: 8px;
  }

  .game-screen .sub-toggle b {
    width: 15px;
    height: 15px;
    font-size: 10px;
  }

  .game-screen .sub-action-menu {
    width: 205px;
    padding: 7px;
    gap: 4px;
  }

  .game-screen .sub-action-button {
    grid-template-columns: 26px 1fr;
    padding: 6px 7px;
  }

  .game-screen .sub-action-button span {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }

  .game-screen .sub-action-button strong {
    font-size: 10px;
  }

  .game-screen .sub-action-button small {
    font-size: 9px;
  }

  .game-screen .actions-dock .action-icon {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .game-screen .actions-dock .action-copy strong {
    font-size: 10px;
  }

  .game-screen .hero-chat {
    min-height: 130px !important;
    max-height: 145px !important;
    padding: 7px;
    gap: 5px;
  }

  .game-screen .hero-chat .chat-head .eyebrow,
  .game-screen .hero-chat .chat-head .pill {
    display: none;
  }

  .game-screen .hero-chat .chat-head strong {
    margin: 0;
    font-size: 11px;
  }

  .game-screen .hero-chat .chat-log {
    max-height: 58px !important;
    gap: 4px;
  }

  .game-screen .chat-message {
    padding: 5px 7px;
  }

  .game-screen .chat-message p,
  .game-screen .chat-empty {
    font-size: 10px;
    line-height: 1.15;
  }

  .game-screen .chat-message span {
    display: none;
  }

  .game-screen .chat-form input,
  .game-screen .chat-form button {
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 11px;
  }

  .game-screen .side-stack {
    max-height: 100% !important;
    gap: 7px;
    overflow: visible;
  }

  .game-screen .personality-panel,
  .game-screen .stats-panel {
    padding: 8px;
  }

  .game-screen .memory-list,
  .game-screen .stat-note,
  .game-screen .personality-badge + .insight,
  .game-screen .personality-badge small {
    display: none;
  }

  .game-screen .stats-grid {
    gap: 7px;
  }

  .game-screen .stat-row {
    gap: 5px;
    padding: 7px 8px;
  }

  .game-screen .stat-head {
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .game-screen .stat-meter {
    height: 14px;
  }
}

@media (max-height: 820px) and (min-width: 761px) and (max-width: 899px) {
  .game-screen {
    max-height: none;
    overflow: visible;
  }

  .game-screen .stage-header .desc,
  .game-screen .hero-meta,
  .game-screen .side-stack,
  .game-screen .footer-row .status-strip:first-child {
    display: none;
  }

  .game-screen .content-grid {
    grid-template-columns: 1fr !important;
    padding: 8px;
  }

  .game-screen .main-stage {
    min-height: 330px !important;
    padding-top: 64px;
  }

  .game-screen .main-stage .creature-wrap {
    width: min(100%, 300px) !important;
    transform: translateY(20px) !important;
  }

  .game-screen .hero-chat {
    min-height: 130px;
    max-height: 145px;
  }

  .game-screen .hero-chat .chat-log {
    max-height: 58px;
  }
}

@media (max-width: 700px) {
  .site-footer {
    align-items: stretch;
    border-radius: 18px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .static-fallback,
  .legal-content {
    padding: 20px;
  }

  .legal-facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .legal-facts dd + dt {
    margin-top: 10px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px 10px 20px;
  }

  .frame {
    border-radius: 24px;
  }

  .toolbar,
  .stage-header,
  .footer-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .need-ticker {
    width: 100%;
    justify-content: center;
  }

  .hero,
  .select-screen,
  .content-grid,
  .roster-grid-wrap {
    padding: 14px;
  }

  .hero-card-content,
  .picker-preview,
  .personality-panel,
  .stats-panel,
  .actions-panel,
  .chat-panel {
    padding: 14px;
  }

  .chat-panel,
  .hero-chat {
    min-height: 240px;
    max-height: 280px;
  }

  .chat-log {
    max-height: 155px;
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }

  .actions-dock {
    grid-template-columns: repeat(5, minmax(52px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .title {
    font-size: clamp(42px, 14vw, 70px);
  }

  .bubble-text {
    font-size: 16px;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .card-name {
    font-size: 22px;
  }
}

/* Selected Blob clarity pass: reduce competing panels and make the play loop scannable. */
.focus-screen {
  grid-template-rows: auto minmax(0, 1fr);
  max-height: none;
  overflow: visible;
}

.focus-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) auto minmax(360px, 1.25fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px 0;
}

.focus-title {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.focus-title h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(28px, 3.5vw, 46px);
  line-height: 0.96;
  letter-spacing: 0.06em;
}

.focus-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-hud {
  justify-content: flex-end;
  align-items: center;
}

.focus-hud .pill,
.focus-hud .speed-control {
  min-height: 32px;
}

.focus-need {
  border-color: color-mix(in srgb, var(--accent-3) 36%, rgba(255, 255, 255, 0.1));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-3) 20%, transparent), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.04);
}

.focus-grid {
  grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.72fr);
  gap: 12px;
  padding: 12px 16px 16px;
  align-items: start;
}

.focus-stage-card,
.focus-side > .panel,
.focus-chat-wrap .chat-panel {
  border-radius: 18px;
}

.focus-stage-card::before {
  opacity: 0.42;
}

.focus-stage-card .hero-card-content {
  gap: 10px;
  padding: 14px;
}

.focus-stage-summary,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.focus-stage-summary strong,
.panel-heading strong {
  display: block;
  color: #fff8ef;
  font-size: 15px;
}

.focus-stage-summary > div > span,
.panel-heading > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.focus-stage-summary .status-strip {
  justify-content: flex-end;
}

.focus-stage-card .main-stage {
  min-height: clamp(360px, 49vh, 540px);
  padding: 86px 12px 10px;
  border-radius: 16px;
}

.focus-stage-card .main-stage .creature-wrap {
  width: min(100%, 360px);
  transform: translateY(24px);
}

.focus-stage-card .speech-bubble {
  top: 12px;
  width: min(94%, 520px);
  border-radius: 16px;
}

.focus-stage-card .bubble-text {
  font-size: 16px;
  line-height: 1.34;
}

.focus-actions {
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  gap: 8px;
}

.focus-actions .action-tile {
  border-radius: 16px;
  padding: 3px;
}

.focus-actions .action-button {
  min-height: 72px;
  border-radius: 13px;
  gap: 6px;
  padding: 8px 6px;
}

.focus-actions .action-icon {
  width: 32px;
  height: 32px;
  font-size: 20px;
}

.focus-actions .action-copy strong {
  font-size: 11px;
}

.focus-actions .action-copy span {
  display: none;
}

.focus-actions .sub-toggle {
  min-height: 23px;
  padding: 2px 5px 2px 8px;
  font-size: 8px;
}

.focus-actions .sub-toggle b {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.focus-side {
  gap: 10px;
  max-height: none;
}

.focus-stats {
  padding: 14px;
}

.focus-stats .stats-grid {
  gap: 9px;
  margin-top: 12px;
}

.focus-stats .stat-row {
  gap: 7px;
  padding: 9px 10px;
  border-radius: 13px;
}

.focus-stats .stat-head {
  font-size: 11px;
  letter-spacing: 0.07em;
}

.focus-stats .stat-meter {
  height: 15px;
}

.focus-stats .stat-note {
  display: none;
}

.focus-personality {
  padding: 12px;
}

.focus-personality .memory-list {
  display: none;
}

.focus-personality {
  gap: 8px;
}

.focus-personality .personality-badge {
  align-items: flex-start;
  border-radius: 14px;
  width: 100%;
}

.focus-personality .insight {
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.focus-chat-wrap {
  grid-column: 1 / -1;
}

.focus-chat-wrap .chat-panel {
  min-height: 190px;
  max-height: 250px;
}

.focus-chat-wrap .chat-log {
  max-height: 130px;
}

.focus-chat-wrap .chat-head .pill {
  min-height: 28px;
}

.focus-screen .chat-message p,
.focus-screen .chat-empty {
  font-size: 14px;
  line-height: 1.42;
}

.focus-screen .chat-message span {
  font-size: 10px;
}

.focus-screen .chat-form input {
  font-size: 14px;
}

.focus-screen .chat-form button {
  font-size: 13px;
}

.focus-screen .footer-row,
.focus-screen .stage-header,
.focus-screen .hero-meta {
  display: none;
}

@media (max-width: 1180px) {
  .focus-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .focus-hud {
    justify-content: flex-start;
  }

  .focus-grid {
    grid-template-columns: 1fr;
  }

  .focus-chat-wrap {
    grid-column: auto;
  }

  .focus-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .focus-side .focus-stats {
    grid-row: span 2;
  }
}

@media (max-width: 760px) {
  .focus-toolbar,
  .focus-grid {
    padding-inline: 10px;
  }

  .focus-title h1 {
    font-size: 30px;
  }

  .focus-title p {
    white-space: normal;
  }

  .focus-side {
    grid-template-columns: 1fr;
  }

  .focus-actions {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .focus-actions .action-button {
    min-height: 64px;
  }

  .focus-stage-card .main-stage {
    min-height: 340px;
    padding-top: 76px;
  }

  .focus-stage-card .main-stage .creature-wrap {
    width: min(100%, 300px);
    transform: translateY(20px);
  }
}

@media (max-height: 820px) and (min-width: 900px) {
  .focus-screen {
    max-height: none !important;
    overflow: visible !important;
  }

  .focus-screen .focus-grid {
    grid-template-columns: minmax(0, 1.42fr) minmax(310px, 0.58fr) !important;
    gap: 10px;
    padding: 10px 12px 12px;
  }

  .focus-screen .hero-card,
  .focus-screen .hero-card-content {
    overflow: visible !important;
  }

  .focus-screen .hero-card-content {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
  }

  .focus-screen .main-stage {
    min-height: 330px !important;
    padding: 72px 8px 8px;
  }

  .focus-screen .main-stage .creature-wrap {
    width: min(100%, 300px) !important;
    transform: translateY(20px) !important;
  }

  .focus-screen .hero-chat {
    min-height: 165px !important;
    max-height: 220px !important;
  }

  .focus-screen .hero-chat .chat-log {
    max-height: 118px !important;
  }

  .focus-screen .side-stack {
    max-height: none !important;
  }
}

/* --- Tagesziele --- */

.daily-panel {
  padding: 14px;
}

.daily-panel .goal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.goal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: start;
  padding: 9px 11px;
  border-radius: 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.goal-row.is-done {
  border-color: rgba(83, 215, 172, 0.4);
  background: rgba(83, 215, 172, 0.08);
}

.goal-copy strong {
  display: block;
  color: #fff8ef;
  font-size: 12px;
  line-height: 1.3;
}

.goal-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.goal-row.is-done .goal-copy span {
  color: rgba(176, 255, 190, 0.75);
}

.goal-reward {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-align: right;
}

.goal-progress {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-meter {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  width: calc(var(--goal, 0) * 1%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

.goal-row.is-done .goal-fill {
  background: linear-gradient(90deg, #53d7ac, #b0ff87);
}

.goal-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Reduzierte Bewegung --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ambient,
  .starfield {
    display: none;
  }
}
