:root {
  --green: #58cc02;
  --green-d: #58a700;
  --blue: #1cb0f6;
  --blue-d: #1899d6;
  --blue-soft: #ddf4ff;
  --red: #ff4b4b;
  --red-d: #ea2b2b;
  --yellow: #ffc800;
  --orange: #ff9600;
  --ink: #3c3c3c;
  --muted: #777;
  --line: #e5e5e5;
  --soft: #f7f7f7;
  --panel-w: 390px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Nunito, ui-rounded, system-ui, sans-serif;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) min(38dvh, 340px);
}
body[data-screen="title"] #app { grid-template-rows: minmax(0, 1fr) 0; }
body[data-screen="title"] #panel { visibility: hidden; }
@media (min-width: 900px), (min-aspect-ratio: 4/3) and (min-width: 600px) {
  #app { grid-template-columns: minmax(0, 1fr) var(--panel-w); grid-template-rows: minmax(0, 1fr); }
  body[data-screen="title"] #app { grid-template-columns: minmax(0, 1fr) 0; grid-template-rows: minmax(0, 1fr); }
}

/* ---------- stage ---------- */
#stage { position: relative; overflow: hidden; min-height: 0; background: #a9defe; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; user-select: none; }
#scene .drift { animation: drift 60s ease-in-out infinite alternate; }
#scene .twinkle { animation: twinkle 3s ease-in-out infinite alternate; }
#scene .steam { animation: steam 2.4s ease-in-out infinite; }
#scene .wag { transform-box: fill-box; transform-origin: 0% 50%; animation: wag 0.32s ease-in-out infinite alternate; }
#scene .sway { transform-box: fill-box; transform-origin: 0% 100%; animation: sway 2.6s ease-in-out infinite alternate; }
#scene #doorPanel { cursor: pointer; }
#scene .pop-text { font-family: Nunito, sans-serif; font-weight: 900; }
@keyframes drift { from { transform: translateX(-70px); } to { transform: translateX(70px); } }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 1; } }
@keyframes wag { from { transform: rotate(-42deg); } to { transform: rotate(-12deg); } }
@keyframes sway { from { transform: rotate(-6deg); } to { transform: rotate(9deg); } }
@keyframes steam { 0%, 100% { opacity: 0.2; transform: translateY(2px); } 50% { opacity: 0.8; transform: translateY(-3px); } }

.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 0;
  pointer-events: none;
  z-index: 3;
}
.hud > * { pointer-events: auto; }
body[data-screen="title"] .hud { display: none; }
.hud-tags { display: flex; gap: 6px; flex: 1; min-width: 0; }
.hud-actions { display: flex; gap: 8px; flex: 1; justify-content: flex-end; }
.tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}
.tag:empty { display: none; }
.tag.level-easy { color: var(--green-d); }
.tag.level-normal { color: var(--blue-d); }
.tag.level-hard { color: #e07b00; }
.tag.level-brutal { color: var(--red-d); }

.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
  position: relative;
}
.meter-label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.meter-track { width: clamp(90px, 20vw, 200px); height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--red);
  position: relative;
  transition: width 0.6s cubic-bezier(.2, .9, .3, 1.2), background-color 0.4s;
}
.meter-fill::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.35); }
.meter-delta {
  position: absolute;
  right: -6px;
  top: 100%;
  font-size: 15px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  -webkit-text-stroke: 4px #fff;
  paint-order: stroke fill;
}
.meter-delta.show { animation: delta 1.2s ease-out forwards; }
.meter-delta.up { color: var(--green); }
.meter-delta.down { color: var(--red); }
@keyframes delta { 0% { opacity: 0; transform: translateY(-4px) scale(0.6); } 15% { opacity: 1; transform: translateY(2px) scale(1.15); } 70% { opacity: 1; transform: translateY(6px) scale(1); } 100% { opacity: 0; transform: translateY(12px); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); }
.icon-btn .ico-off { display: none; }
body.muted .mute-btn .ico-on, body.music-off .music-btn .ico-on { display: none; }
body.muted .mute-btn .ico-off, body.music-off .music-btn .ico-off { display: block; }
.pill-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  font-weight: 900;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}
.pill-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); }

.bubble {
  position: absolute;
  z-index: 2;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
  transform-origin: left center;
  animation: bubble-in 0.22s cubic-bezier(.2, .9, .3, 1.3);
  overflow-y: auto;
}
.bubble::before, .bubble::after { content: ""; position: absolute; width: 0; height: 0; border-style: solid; }
.bubble[data-side="right"]::before { left: -13px; top: 18px; border-width: 9px 13px 9px 0; border-color: transparent var(--line) transparent transparent; }
.bubble[data-side="right"]::after { left: -9px; top: 20px; border-width: 7px 10px 7px 0; border-color: transparent #fff transparent transparent; }
.bubble[data-side="top"] { transform-origin: center bottom; }
.bubble[data-side="top"]::before { left: var(--tail, 50%); bottom: -13px; margin-left: -9px; border-width: 13px 9px 0 9px; border-color: var(--line) transparent transparent transparent; }
.bubble[data-side="top"]::after { left: var(--tail, 50%); bottom: -9px; margin-left: -7px; border-width: 10px 7px 0 7px; border-color: #fff transparent transparent transparent; }
.bubble[data-side="top"] { overflow: visible; left: 12px; right: 12px; width: fit-content; margin-inline: auto; }
@keyframes bubble-in { from { opacity: 0; scale: 0.8; } to { opacity: 1; scale: 1; } }
.dots { display: inline-flex; gap: 5px; padding: 4px 2px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #c8c8c8; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }

.knock-hint {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 10px 18px;
  border-radius: 999px;
  border: 0;
  background: #fff;
  color: var(--blue-d);
  font-weight: 900;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  animation: hint 1.4s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }

/* ---------- conversation panel ---------- */
#panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border-top: 2px solid var(--line);
}
@media (min-width: 900px), (min-aspect-ratio: 4/3) and (min-width: 600px) { #panel { border-top: 0; border-left: 2px solid var(--line); } }
@media (max-width: 1100px) and (min-aspect-ratio: 4/3) { :root { --panel-w: 330px; } }
.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}
.msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 15.5px;
  line-height: 1.38;
  animation: msg-in 0.2s ease-out;
  overflow-wrap: anywhere;
}
.msg.home { align-self: flex-start; background: var(--soft); border: 2px solid var(--line); border-bottom-left-radius: 6px; }
.msg.rep { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.event { align-self: center; max-width: none; padding: 2px 8px; font-size: 13px; color: var(--muted); font-weight: 800; }
.msg .thought { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 700; font-style: italic; color: #8a7bd6; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.composer { padding: 10px 12px calc(12px + var(--safe-b)); border-top: 2px solid var(--line); }
.say-row { display: flex; align-items: center; gap: 8px; }
.say-row input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--soft);
  font-size: 16px;
  font-weight: 700;
  outline: none;
}
.say-row input:focus { border-color: var(--blue); background: #fff; }
.say-row input:disabled { opacity: 0.6; }
.send-btn { width: 50px; height: 50px; background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-d); }
.send-btn:disabled { background: var(--line); box-shadow: 0 4px 0 #d0d0d0; color: #fff; }
.mic-btn {
  position: relative;
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 0 var(--green-d);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mic-btn svg { width: 26px; height: 26px; position: relative; }
.mic-btn:disabled { background: var(--line); box-shadow: 0 4px 0 #d0d0d0; }
.mic-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-d); }
.mic-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--red); opacity: 0; transition: transform 0.08s; }
body.recording .mic-btn { background: var(--red); box-shadow: 0 4px 0 var(--red-d); }
body.recording .mic-ring { opacity: 0.35; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 16px;
  border: 0;
  font-weight: 900;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: transform 0.05s;
}
.btn:active { transform: translateY(4px); box-shadow: none !important; }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-d); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.btn-plain { background: #fff; color: var(--blue); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn-big { width: 100%; min-height: 54px; font-size: 17px; }
.knock-btn { width: 100%; min-height: 56px; font-size: 18px; animation: knock-pulse 1.4s ease-in-out infinite; }
@keyframes knock-pulse { 0%, 100% { filter: none; } 50% { filter: brightness(1.08); } }

/* ---------- overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}
#results, .sheet { background: rgba(20, 24, 40, 0.45); animation: fade 0.2s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.card {
  width: min(100%, 440px);
  background: #fff;
  border-radius: 24px;
  border: 2px solid var(--line);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  padding: 22px;
  animation: card-in 0.3s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

/* title screen: the street scrolls behind a wordmark and a small card */
.title-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(18px + var(--safe-b));
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(10, 50, 110, 0.14), rgba(10, 50, 110, 0) 34%, rgba(10, 50, 110, 0) 62%, rgba(10, 50, 110, 0.2));
}
.title-screen > * { pointer-events: auto; }
.title-actions { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; display: flex; gap: 8px; }
.title-top { text-align: center; margin-top: clamp(30px, 7vh, 72px); }
.wordmark {
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: clamp(54px, 11.5vw, 120px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
  user-select: none;
}
.wordmark .ch {
  display: inline-block;
  text-shadow:
    0.035em 0 0 #2f8a12, -0.035em 0 0 #2f8a12, 0 0.035em 0 #2f8a12, 0 -0.035em 0 #2f8a12,
    0.025em 0.025em 0 #2f8a12, -0.025em 0.025em 0 #2f8a12, 0.025em -0.025em 0 #2f8a12, -0.025em -0.025em 0 #2f8a12,
    0 0.07em 0 #2f8a12, 0.025em 0.08em 0 #2f8a12, -0.025em 0.08em 0 #2f8a12, 0 0.1em 0 #2f8a12,
    0 0.18em 0.12em rgba(0, 30, 60, 0.22);
  animation: drop 0.7s cubic-bezier(.2, .9, .3, 1.35) backwards, letter-bob 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms + 150ms), calc(1.5s + var(--i) * 150ms);
}
.wordmark .door {
  width: 0.78em;
  height: 0.98em;
  margin-right: 0.08em;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 0.06em 0 #2f8a12) drop-shadow(0 0.1em 0.08em rgba(0, 30, 60, 0.2));
  animation: drop 0.7s cubic-bezier(.2, .9, .3, 1.35) backwards, knock-wiggle 5s ease-in-out 2.2s infinite;
}
@keyframes drop { from { transform: translateY(-140%) scale(0.6); opacity: 0; } 60% { transform: translateY(6%) scale(1.04); opacity: 1; } to { transform: none; } }
@keyframes letter-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6%); } }
@keyframes knock-wiggle { 0%, 82%, 100% { transform: none; } 85% { transform: rotate(-7deg); } 88% { transform: rotate(6deg); } 91% { transform: rotate(-4deg); } 94% { transform: rotate(2deg); } }
.tagline {
  margin: 14px 0 0;
  color: #fff;
  font-size: clamp(17px, 2.4vw, 23px);
  font-weight: 800;
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(16, 64, 128, 0.34);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 0 rgba(0, 40, 90, 0.3);
  animation: fade 0.6s 0.8s backwards;
}
.title-stats { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; animation: fade 0.6s 1s backwards; }
.title-stats:empty { display: none; }
.title-stats span {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}
.title-stats b { font-weight: 900; color: var(--green-d); }
.title-bottom {
  width: min(100%, 440px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  background: #fff;
  border: 2px solid var(--line);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  animation: card-in 0.5s 0.6s cubic-bezier(.2, .9, .3, 1.2) backwards;
}
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 9px 30px 9px 13px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #fff;
  box-shadow: 0 3px 0 var(--line);
  text-align: left;
}
.setup-pill::after { content: ""; position: absolute; right: 13px; top: 50%; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: translateY(-70%) rotate(45deg); }
.setup-pill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.setup-pill span { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.setup-pill b { max-width: 100%; font-size: 17px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-pill b.level-easy { color: var(--green-d); }
.setup-pill b.level-normal { color: var(--blue-d); }
.setup-pill b.level-hard { color: #e07b00; }
.setup-pill b.level-brutal { color: var(--red-d); }
.start-btn { min-height: 58px; font-size: 19px; }
.sheet-card.setup-card { text-align: left; width: min(100%, 460px); }
.setup-card .btn { margin-top: 4px; }

#wipe {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: radial-gradient(circle at 50% 40%, #ffffff, #d4efff);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#wipe.on { opacity: 1; pointer-events: auto; }

.field { margin-bottom: 16px; }
.field-label { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 13px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 3px 0 var(--line);
}
.chip[aria-pressed="true"] { border-color: #84d8ff; background: var(--blue-soft); color: var(--blue-d); box-shadow: 0 3px 0 #84d8ff; }
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.text-input {
  width: 100%;
  margin-top: 10px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--soft);
  font-size: 16px;
  font-weight: 700;
  outline: none;
}
.text-input:focus { border-color: var(--blue); background: #fff; }

.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--line);
}
.level[aria-pressed="true"] { border-color: #84d8ff; background: var(--blue-soft); color: var(--blue-d); box-shadow: 0 3px 0 #84d8ff; }
.level:active { transform: translateY(2px); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.bars i { width: 6px; border-radius: 3px; background: var(--line); }
.bars i:nth-child(1) { height: 8px; }
.bars i:nth-child(2) { height: 13px; }
.bars i:nth-child(3) { height: 18px; }
.bars i:nth-child(4) { height: 22px; }
.level[data-level="easy"] .bars i:nth-child(-n+1) { background: var(--green); }
.level[data-level="normal"] .bars i:nth-child(-n+2) { background: var(--blue); }
.level[data-level="hard"] .bars i:nth-child(-n+3) { background: var(--orange); }
.level[data-level="brutal"] .bars i:nth-child(-n+4) { background: var(--red); }

.toggle { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; font-size: 16px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.2s; flex: none; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); transition: transform 0.2s; }
.toggle input:checked + .toggle-track { background: var(--green); }
.toggle input:checked + .toggle-track .toggle-knob { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid #84d8ff; outline-offset: 2px; }

/* results */
.results-card { width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px 22px; }
.result-head { text-align: center; }
.result-head h2 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: -0.01em; }
.result-head.win h2 { color: var(--green); }
.result-head.loss h2 { color: var(--red); }
.result-head.neutral h2 { color: var(--blue-d); }
.stars { display: flex; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.stars svg { width: 46px; height: 46px; animation: star-pop 0.4s cubic-bezier(.2, .9, .3, 1.5) backwards; }
.stars svg:nth-child(2) { animation-delay: 0.15s; width: 56px; height: 56px; margin-top: -8px; }
.stars svg:nth-child(3) { animation-delay: 0.3s; }
@keyframes star-pop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.score-line { color: var(--muted); font-size: 15px; }
.numbers { display: flex; gap: 8px; margin: 16px 0; }
.stat { flex: 1; padding: 8px 6px; border-radius: 14px; border: 2px solid var(--line); text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 900; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.numbers .stat b { font-size: 18px; }
.section { margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--line); }
.section h3 { margin: 0 0 8px; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.section p { margin: 0 0 8px; line-height: 1.4; }
.headline { font-size: 17px; }
.list { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 6px; }
.list li { position: relative; padding-left: 26px; line-height: 1.4; }
.list li::before { position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; }
.list.good li::before { content: "✓"; background: var(--green); }
.list.work li::before { content: "!"; background: var(--orange); }
.try { padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); color: #145f86; line-height: 1.4; }
.label-sm { font-size: 13px; color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 0 6px; }
.who { display: grid; gap: 4px; line-height: 1.4; }
.who b { font-size: 18px; }
.muted { color: var(--muted); }
details.convo summary { cursor: pointer; font-weight: 900; color: var(--blue-d); list-style: none; }
details.convo summary::-webkit-details-marker { display: none; }
details.convo .log { padding: 10px 0 0; overflow: visible; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; position: sticky; bottom: -24px; background: #fff; padding: 12px 0 4px; }
.loading-line { display: flex; align-items: center; gap: 10px; color: var(--muted); }

/* sheet */
.sheet { place-items: end center; }
@media (min-width: 700px) { .sheet { place-items: center; } }
.sheet-card { width: min(100%, 400px); text-align: center; margin-bottom: var(--safe-b); }
.sheet-card h2 { margin: 4px 0 18px; font-size: 22px; font-weight: 900; }
.sheet-actions { display: grid; gap: 10px; }

.toast {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  animation: card-in 0.2s ease-out;
}

@media (max-width: 899px) {
  .hud-tags { display: none; }
  .meter { margin-right: auto; }
  .bubble { font-size: 15.5px; padding: 10px 13px; }
}
@media (max-width: 380px) {
  .meter-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #scene .drift, #scene .twinkle, #scene .wag, #scene .sway, .knock-hint, .knock-btn, .wordmark .ch, .wordmark .door { animation: none; }
}
