:root {
  color-scheme: light;
  --ink: #372d35;
  --muted: #746975;
  --paper: #fff8fb;
  --panel: #ffffff;
  --line: #ecdfe7;
  --pink: #ff8fb7;
  --peach: #ffc48f;
  --mint: #8fdcc4;
  --sky: #8bbff3;
  --lilac: #bfa4ff;
  --butter: #ffe28a;
  --shadow: 0 16px 40px rgba(82, 51, 73, 0.13);
  --result-width: 640px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-rounded, "Avenir Next", "Nunito", system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 196, 143, 0.45), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(143, 220, 196, 0.4), transparent 22rem),
    linear-gradient(135deg, #fff6fb 0%, #eef9ff 50%, #fffbea 100%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 3rem;
  border: 0;
  border-radius: 18px;
  padding: 0.8rem 1rem;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 -3px 0 rgba(55, 45, 53, 0.11), 0 8px 20px rgba(93, 72, 87, 0.12);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-2px);
  box-shadow: inset 0 -3px 0 rgba(55, 45, 53, 0.1), 0 12px 26px rgba(93, 72, 87, 0.18);
}

input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  color: var(--ink);
  background: #fff;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.sound-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  min-height: 2.4rem;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 900;
  backdrop-filter: blur(16px);
}

.sound-toggle[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, #ff79aa, #ffae70);
}

.round-counter {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 1.1rem 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-left: 0;
  border-radius: 0 24px 24px 0;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.round-counter span {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bf5981;
}

.round-counter strong {
  font-size: 2.6rem;
  line-height: 1;
}

.boot-screen,
.win-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 196, 143, 0.42), transparent 22rem),
    radial-gradient(circle at 82% 16%, rgba(143, 220, 196, 0.42), transparent 22rem),
    #fff8fb;
}

.boot-screen.hidden,
.win-screen.hidden {
  display: none;
}

.boot-video {
  width: min(960px, 100%);
  max-height: min(760px, calc(100vh - 5rem));
  border-radius: 34px;
  background: #fff;
  box-shadow: var(--shadow);
  object-fit: contain;
}

.play-video {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: min(420px, calc(100% - 3rem));
  min-height: 104px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 34px;
  color: #fff;
  background: linear-gradient(135deg, #ff79aa, #ffae70);
  box-shadow: 0 18px 44px rgba(82, 51, 73, 0.28);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.play-video:hover,
.play-video:focus-visible {
  transform: translate(-50%, -50%);
  box-shadow: 0 22px 52px rgba(82, 51, 73, 0.32);
}

.play-video.hidden {
  display: none;
}

.skip-video {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  min-height: 2.4rem;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.85rem;
  font-weight: 900;
  backdrop-filter: blur(16px);
}

.app-shell {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 196, 143, 0.72), transparent 20rem),
    radial-gradient(circle at 80% 12%, rgba(143, 220, 196, 0.65), transparent 20rem),
    linear-gradient(135deg, #fff7fb 0%, #eefaff 48%, #fff9df 100%);
}

.intro-screen.hidden {
  display: none;
}

.intro-card {
  display: grid;
  grid-template-rows: 260px auto 180px 92px auto auto;
  justify-items: center;
  width: min(760px, 100%);
  height: min(720px, calc(100vh - 2rem));
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 34px;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.intro-visual {
  display: grid;
  place-items: center;
  width: min(260px, 60vw);
  aspect-ratio: 1;
  align-self: end;
  margin-bottom: 0.75rem;
  border-radius: 34px;
  overflow: hidden;
  background:
    linear-gradient(135deg, #ffe5ee, #e1fff2 56%, #fff2b7),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 10px, transparent 10px 20px);
}

.intro-cat-image {
  width: 118%;
  height: 118%;
  object-fit: cover;
  object-position: center 44%;
  filter: saturate(1.08) contrast(1.02);
}

.intro-card h1 {
  display: grid;
  place-items: center;
  width: min(620px, 100%);
  min-height: 180px;
  margin-bottom: 0;
  font-size: clamp(3.1rem, 8vw, 6rem);
  line-height: 0.92;
}

.intro-copy {
  max-width: 560px;
  min-height: 92px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.48;
}

.intro-progress {
  display: flex;
  align-self: end;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.intro-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #e9dce5;
}

.intro-dot.active {
  width: 34px;
  background: linear-gradient(90deg, #ff79aa, #ffc06f);
}

.intro-buttons {
  display: grid;
  grid-template-columns: 120px 180px;
  align-self: start;
  gap: 0.75rem;
}

.hero-panel,
.town-panel,
.choice-dock,
.log-panel,
.report-panel {
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: end;
  min-height: 260px;
  padding: clamp(1.2rem, 3vw, 2.5rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: #bf5981;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0.45rem;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.5;
}

.room-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 22px;
  background: #fff;
}

.intro-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #ff79aa, #ffae70);
}

.restart-button {
  width: min(640px, 100%);
  margin: 1.2rem auto 0;
  padding: 1.1rem 2rem;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.stage-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.app-shell[data-step="select"] .stage-grid,
.app-shell[data-step="profile"] .stage-grid,
.app-shell[data-step="action"] .stage-grid {
  grid-template-columns: 1fr;
}

.app-shell[data-step="select"] .town-panel,
.app-shell[data-step="select"] .choice-dock,
.app-shell[data-step="select"] .log-panel,
.app-shell[data-step="select"] .report-panel,
.app-shell[data-step="profile"] .town-panel,
.app-shell[data-step="profile"] .log-panel,
.app-shell[data-step="profile"] .report-panel,
.app-shell[data-step="action"] .hero-panel,
.app-shell[data-step="notes"] .hero-panel,
.app-shell[data-step="town"] .hero-panel,
.app-shell[data-step="action"] .stage-grid,
.app-shell[data-step="action"] .town-panel,
.app-shell[data-step="action"] .cat-board,
.app-shell[data-step="action"] .log-panel,
.app-shell[data-step="action"] .report-panel,
.app-shell[data-step="town"] .cat-board,
.app-shell[data-step="town"] .choice-dock,
.app-shell[data-step="town"] .log-panel,
.app-shell[data-step="town"] .report-panel,
.app-shell[data-step="notes"] .town-panel,
.app-shell[data-step="notes"] .choice-dock,
.app-shell[data-step="notes"] .report-panel,
.app-shell[data-step="report"] .hero-panel,
.app-shell[data-step="report"] .stage-grid,
.app-shell[data-step="report"] .choice-dock,
.app-shell[data-step="report"] .log-panel {
  display: none;
}

.app-shell[data-step="profile"] .hero-panel {
  display: none;
}

.app-shell[data-step="town"] .stage-grid,
.app-shell[data-step="notes"] .stage-grid {
  grid-template-columns: minmax(280px, var(--result-width));
  justify-content: center;
}

.app-shell[data-step="action"] .cat-board {
  grid-template-columns: minmax(280px, 520px);
  justify-content: center;
}

.app-shell[data-step="action"] .choice-dock {
  max-width: 1180px;
  margin-right: auto;
  margin-left: auto;
}

.app-shell[data-step="notes"] .log-panel,
.app-shell[data-step="notes"] .cat-board,
.app-shell[data-step="notes"] .cat-card {
  width: min(var(--result-width), 100%);
  max-width: var(--result-width);
  margin-right: auto;
  margin-left: auto;
}

.app-shell[data-step="notes"] .cat-board.locked {
  grid-template-columns: minmax(280px, var(--result-width));
}

.town-panel,
.choice-dock,
.log-panel {
  padding: 1rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.app-shell[data-step="your-choice"] > :not(.round-scene),
.app-shell[data-step="neighbors"] > :not(.round-scene),
.app-shell[data-step="combined"] > :not(.round-scene) {
  display: none;
}

.app-shell[data-step="town-check"] > :not(.town-check) {
  display: none;
}

.town-check {
  width: min(100%, 1080px);
  margin: 4vh auto 2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.town-check-hero {
  display: grid;
  grid-template-columns: minmax(240px, 400px) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
}

.town-check-hero img {
  width: 100%;
  border-radius: 24px;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}

.town-check-hero h2 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 0.98;
}

.town-check-copy {
  max-width: 520px;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.45;
}

.town-check-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.town-check-group {
  padding: 1rem;
  border-radius: 22px;
  background: #fff;
}

.town-check-group h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.town-check-group h3::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.town-check-group.great {
  background: #ecf9f1;
}

.town-check-group.great h3::before {
  background: #83cda1;
}

.town-check-group.steady {
  background: #fff8e8;
}

.town-check-group.steady h3::before {
  background: #ffd479;
}

.town-check-group.help {
  background: #fdeef0;
}

.town-check-group.help h3::before {
  background: #ef777d;
}

.town-check-meter {
  padding: 0.65rem 0;
  border-top: 1px dashed rgba(82, 51, 73, 0.15);
}

.town-check-meter:first-of-type {
  border-top: 0;
}

.town-check-meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.town-check-meter-top span {
  color: var(--muted);
  font-weight: 900;
}

.town-check-meter .impact-pips {
  margin: 0.4rem 0;
}

.town-check-meter p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.town-check-empty {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.town-check-meter small {
  color: var(--muted);
}

.scene-groups {
  margin-top: 1.2rem;
}

#town-check-go {
  width: 100%;
  margin-top: 1.4rem;
  padding: 1.1rem 2rem;
  font-size: 1.15rem;
}

@media (max-width: 900px) {
  .town-check-hero,
  .town-check-groups {
    grid-template-columns: 1fr;
  }
}

.round-scene {
  width: min(100%, 960px);
  margin: 1.5rem auto;
  padding: 1.5rem;
}

.round-scene[hidden] { display: none; }
.round-scene h2 { font-size: 1.6rem; }
.round-scene > .primary-button { width: 100%; margin-top: 1.25rem; }
.neighbor-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.neighbor-card { padding: 1rem; background: #fff; border: 1px solid #eedde7; border-radius: 8px; min-width: 0; }
.neighbor-card img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; }
.neighbor-card h3 { margin-bottom: 0; }
.neighbor-card p { font-size: 0.95rem; line-height: 1.55; }
.neighbor-effects { color: #655d65; }
.scene-meters { display: grid; gap: 1rem; margin: 1.5rem 0; }
.scene-meter { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.scene-meter .meter-track { grid-column: 1 / -1; }
.town-impact-list { background: #fff; padding: 0 1rem; }
.town-impact-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) minmax(180px, 1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #eedde7; align-items: center; }
.impact-name, .impact-result { display: grid; gap: 0.3rem; }
.impact-name span, .impact-result small { font-size: 0.85rem; color: #655d65; }
.impact-pips { display: flex; gap: 4px; }
.impact-pips span { width: 22px; height: 10px; background: #eee6eb; border-radius: 2px; }
.impact-pips .good { background: #83cda1; }
.impact-pips .warning { background: #ffd479; }
.impact-pips .danger { background: #ef777d; }
.impact-sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; text-align: center; }
.impact-sources span { display: grid; gap: 0.3rem; }
.impact-sources small { color: #655d65; font-size: 0.8rem; }
.impact-sources .steady { color: #655d65; }
@media (max-width: 640px) {
  .town-impact-row { grid-template-columns: minmax(0, 1fr) 120px; }
  .impact-sources { grid-column: 1 / -1; text-align: left; }
}
.scene-table-wrap { overflow-x: auto; }
.scene-table { width: 100%; border-collapse: collapse; background: #fff; }
.scene-table th, .scene-table td { padding: 0.8rem; text-align: left; border-bottom: 1px solid #eedde7; }
.scene-table th { font-size: 0.9rem; }
.round-scene em { font-style: normal; font-weight: bold; white-space: nowrap; }
.round-scene em.up { color: #237347; }
.round-scene em.down { color: #b32e42; }
@media (max-width: 640px) {
  .neighbor-cards { grid-template-columns: 1fr; }
  .neighbor-card img { max-height: 210px; }
  .round-scene { padding: 0.75rem; }
  .scene-table th, .scene-table td { padding: 0.5rem; }
}

.meter-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.meter {
  display: grid;
  gap: 0.3rem;
}

.meter.warning .meter-fill,
.tiny-stat.warning {
  background: linear-gradient(90deg, #ffe28a, #ffc777);
}

.meter.danger .meter-fill,
.tiny-stat.danger {
  background: #ef777d;
}

.meter.good .meter-fill,
.tiny-stat.good {
  background: #83cda1;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.meter-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3e8ef;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sky), var(--lilac));
}

.phase-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 20px;
  background: #fff7df;
}

.phase-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

.cat-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.cat-board.locked {
  grid-template-columns: minmax(280px, 520px);
  justify-content: center;
}

.cat-board.locked .cat-card {
  min-height: 520px;
}

.cat-board.locked .cat-avatar {
  min-height: 310px;
}

.cat-board.locked .cat-face {
  width: 132px;
  height: 112px;
  transform: translateY(-30px);
}

.cat-board.locked .cat-face::before,
.cat-board.locked .cat-face::after {
  top: -37px;
  width: 46px;
  height: 54px;
}

.cat-board.locked .cat-face::before {
  left: 10px;
}

.cat-board.locked .cat-face::after {
  right: 10px;
}

.cat-board.locked .cat-body {
  top: 135px;
  width: 120px;
  height: 112px;
  border-radius: 48% 48% 36% 36%;
}

.cat-board.locked .eyes {
  top: 43px;
  left: 29px;
  width: 74px;
}

.cat-board.locked .eyes span {
  width: 24px;
  height: 29px;
}

.cat-board.locked .nose {
  top: 69px;
  left: 59px;
  width: 16px;
  height: 12px;
}

.cat-board.locked .mouth {
  top: 87px;
  left: 57px;
  width: 20px;
  height: 17px;
}

.cat-board.locked .blush {
  top: 79px;
  width: 27px;
  height: 12px;
}

.cat-board.locked .blush.left {
  left: 18px;
}

.cat-board.locked .blush.right {
  right: 18px;
}

.cat-board.locked .whiskers {
  top: 73px;
  width: 36px;
}

.cat-board.locked .whiskers.left {
  left: -26px;
}

.cat-board.locked .whiskers.right {
  right: -26px;
}

.cat-board.locked .whiskers span {
  width: 34px;
}

.cat-board.locked .tail {
  top: 136px;
  right: calc(50% - 102px);
  width: 58px;
  height: 96px;
  border-radius: 999px 999px 999px 24px;
  transform: rotate(25deg);
}

.cat-board.locked .paw {
  top: 222px;
  width: 42px;
  height: 32px;
}

.cat-board.locked .paw.left {
  left: calc(50% - 68px);
}

.cat-board.locked .paw.right {
  right: calc(50% - 68px);
}

.cat-card {
  display: grid;
  gap: 0.7rem;
  min-height: 260px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  padding: 0.85rem;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(90, 68, 84, 0.1);
}

.cat-card.selected {
  outline: 4px solid rgba(255, 143, 183, 0.55);
}

.cat-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.cat-name {
  margin: 0;
  font-size: 1.18rem;
}

.cat-role {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.cat-avatar {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 170px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 42% 42%, rgba(255, 255, 255, 0.78), transparent 52px),
    linear-gradient(135deg, var(--cat-soft), #fff 62%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0 8px, transparent 8px 16px);
}

.cat-portrait {
  width: 112%;
  height: 172px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(76, 55, 70, 0.16));
}

.cat-card.mood-sad .cat-avatar,
.cat-card.mood-angry .cat-avatar {
  background: #fff;
}

.cat-card.mood-sad .cat-portrait,
.cat-card.mood-angry .cat-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

.cat-board.locked .cat-portrait {
  width: 96%;
  height: 310px;
}

.cat-board.locked .cat-card.mood-sad .cat-portrait,
.cat-board.locked .cat-card.mood-angry .cat-portrait {
  width: 100%;
  height: 100%;
}

.cat-body {
  position: absolute;
  top: 71px;
  width: 54px;
  height: 48px;
  border-radius: 45% 45% 38% 38%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.5), transparent 20px),
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 55%),
    var(--cat-fur);
  box-shadow: inset -7px -9px 0 rgba(55, 45, 53, 0.06);
}

.cat-face {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 78px;
  border: 4px solid rgba(55, 45, 53, 0.06);
  border-radius: 49% 49% 43% 43%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.58), transparent 25px),
    radial-gradient(circle at 67% 68%, rgba(55, 45, 53, 0.08), transparent 36px),
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent 52%),
    var(--cat-fur);
  box-shadow: inset -10px -12px 0 rgba(55, 45, 53, 0.06), inset 8px 8px 0 rgba(255, 255, 255, 0.2);
}

.cat-face::before,
.cat-face::after {
  content: "";
  position: absolute;
  top: -25px;
  width: 34px;
  height: 39px;
  clip-path: polygon(50% 0, 94% 100%, 6% 100%);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), transparent 58%),
    var(--cat-fur);
  box-shadow: inset -5px -5px 0 rgba(55, 45, 53, 0.05);
}

.cat-face::before,
.cat-face::after,
.cat-body,
.paw,
.tail {
  border: 2px solid rgba(55, 45, 53, 0.06);
}

.cat-face::before {
  left: 6px;
  transform: rotate(-18deg);
}

.cat-face::after {
  right: 6px;
  transform: rotate(18deg);
}

.eyes {
  position: absolute;
  top: 28px;
  left: 19px;
  width: 54px;
  display: flex;
  justify-content: space-between;
}

.eyes span {
  width: 17px;
  height: 20px;
  border-radius: 50%;
  background: #2f252b;
  box-shadow: inset 0 0 0 4px #2f252b, inset 5px 5px 0 rgba(255, 255, 255, 0.78);
}

.mouth {
  position: absolute;
  left: 39px;
  top: 53px;
  width: 14px;
  height: 12px;
  border-radius: 0 0 999px 999px;
  background: #ef7097;
}

.nose {
  position: absolute;
  top: 45px;
  left: 40px;
  width: 13px;
  height: 9px;
  border-radius: 55% 55% 70% 70%;
  background: #ff8aaa;
}

.blush {
  position: absolute;
  top: 51px;
  width: 18px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 144, 174, 0.45);
}

.blush.left {
  left: 12px;
}

.blush.right {
  right: 12px;
}

.whiskers {
  position: absolute;
  top: 48px;
  width: 24px;
  height: 18px;
}

.whiskers.left {
  left: -15px;
}

.whiskers.right {
  right: -15px;
  transform: scaleX(-1);
}

.whiskers span {
  position: absolute;
  left: 0;
  width: 23px;
  height: 2px;
  border-radius: 999px;
  background: rgba(55, 45, 53, 0.35);
}

.whiskers span:nth-child(1) {
  top: 0;
  transform: rotate(10deg);
}

.whiskers span:nth-child(2) {
  top: 8px;
}

.whiskers span:nth-child(3) {
  top: 16px;
  transform: rotate(-10deg);
}

.paw {
  position: absolute;
  z-index: 2;
  top: 99px;
  width: 24px;
  height: 20px;
  border-radius: 50% 50% 44% 44%;
  background: var(--cat-fur);
  box-shadow: inset -3px -4px 0 rgba(55, 45, 53, 0.05);
}

.paw.left {
  left: calc(50% - 37px);
}

.paw.right {
  right: calc(50% - 37px);
}

.tail {
  position: absolute;
  top: 73px;
  right: calc(50% - 66px);
  width: 37px;
  height: 49px;
  border-radius: 999px 999px 999px 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 58%),
    var(--cat-fur);
  transform: rotate(28deg);
  box-shadow: inset -5px -5px 0 rgba(55, 45, 53, 0.05);
}

.badge {
  align-self: start;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  color: #fff;
  background: var(--cat-accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.tiny-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.tiny-stat {
  position: relative;
  border-radius: 14px;
  padding: 0.45rem 0.25rem;
  text-align: center;
  background: #fbf2f7;
}

.tiny-stat strong {
  display: block;
  font-size: 0.78rem;
}

.tiny-stat span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.meter em,
.tiny-stat em {
  display: inline-grid;
  place-items: center;
  min-width: 1.8rem;
  min-height: 1.25rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  color: #fff;
  font-style: normal;
  font-weight: 900;
  background: #8bc7a8;
}

.tiny-stat em {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
}

.meter em.down,
.tiny-stat em.down {
  background: #c94d58;
}

.choice-dock {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.action-heading {
  display: none;
}

.choice-dock.waiting .action-grid,
.choice-dock.waiting .small-button,
.choice-dock.waiting .profile-button,
.choice-dock.waiting .stat-guide,
.choice-dock.waiting .action-heading,
.choice-dock.profile .action-grid,
.choice-dock.profile .action-heading,
.choice-dock.action .profile-button,
.choice-dock.action .stat-guide,
.choice-dock.action > div:nth-child(2) {
  display: none;
}

.choice-dock.action {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.choice-dock.action .action-heading {
  display: block;
}

.choice-dock.action .action-heading h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.choice-dock.profile {
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
}

.cat-bio {
  margin-top: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.profile-button {
  margin-top: 1rem;
}

.small-button {
  min-height: 2.35rem;
  margin-top: 0.8rem;
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.choice-dock p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.action-card {
  display: grid;
  gap: 0.4rem;
  min-height: 150px;
  padding: 1rem;
  text-align: left;
}

.action-card strong {
  font-size: 1.05rem;
}

.action-card.tint-0 {
  background: #ffeef5;
}

.action-card.tint-1 {
  background: #fff3e4;
}

.action-card.tint-2 {
  background: #e9f9f2;
}

.action-card.tint-3 {
  background: #e9f3fd;
}

.action-card.tint-4 {
  background: #f1ecfd;
}

.action-card.tint-5 {
  background: #fff9e0;
}

.action-card.tint-6 {
  background: #fdeef0;
}

.action-card.tint-7 {
  background: #ecf9f6;
}

.action-card span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.action-card b {
  color: var(--ink);
}

.stat-guide {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.stat-definition {
  min-height: 96px;
  border-radius: 18px;
  padding: 0.85rem;
  background: #fff7fb;
}

.stat-definition strong {
  display: block;
  margin-bottom: 0.35rem;
}

.stat-definition span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.log-panel {
  margin-top: 1rem;
}

.round-dialogue {
  margin: 1rem 0 0;
  border-radius: 20px;
  padding: 1rem 1.1rem;
  color: var(--ink);
  background: #fff7df;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
}

.round-dialogue.town-warning {
  background: #ff967c;
  color: #422027;
  border-left: 5px solid #bf394b;
}

.round-dialogue[hidden] {
  display: none;
}

.log-continue {
  width: 100%;
  margin-top: 1rem;
}

.report-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
}

#story-log {
  display: grid;
  gap: 0.6rem;
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding-left: 1.45rem;
}

#story-log li {
  padding: 0.8rem 1rem;
  border-radius: 18px;
  background: #fff;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .hero-panel,
  .stage-grid,
  .choice-dock {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 0.8rem, 1440px);
  }

  .round-counter {
    padding: 0.7rem 0.75rem;
    border-radius: 0 16px 16px 0;
  }

  .round-counter span {
    font-size: 0.6rem;
  }

  .round-counter strong {
    font-size: 1.6rem;
  }

  .cat-board,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .town-panel,
  .choice-dock,
  .log-panel {
    border-radius: 20px;
  }

  .panel-header {
    display: grid;
  }
}

/* Keep decision information visible without covering choices. */
.decision-status { margin: 1rem 0; font-size: 0.95rem; }
.decision-status h3 { margin: 0.7rem 0 0.4rem; }
.decision-meters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.decision-meter { padding: 0.45rem 0.65rem; border-radius: 10px; background: #fff; border: 2px solid var(--line); }
.decision-meter.danger { border-color: #c74556; }
.decision-meter.warning { border-color: #b38926; }
.decision-meter.good { border-color: #398469; }
.action-card:disabled { cursor: not-allowed; opacity: 0.65; transform: none; }
.action-unavailable { font-weight: 800; }
.cat-avatar:disabled { cursor: default; }


/* Only the longer final intro needs extra clearance above the dots. */
#intro-screen[data-slide="3"] .intro-copy {
  margin-top: 0;
  position: relative;
  top: -1.48em;
}
