:root{
  --bg: #0b0c10;
  --panel: #121424;
  --panel2:#0f1120;
  --ink: #0b0c10;
  --text: #1b1116;
  --muted:#5e4d56;
  --line: rgba(27,17,22,0.12);
  --accent:#ff4fa3;
  --accent2:#ff7ac0;
  --love:#ff7ac0;
  --good:#2ee59d;

  /* UI accent (used for buttons, focus rings, user message highlight, etc.).
     We keep the day UI surfaces pink/white; only these accents change when the cat mutates. */
  --uiAccentGlow: rgba(255,79,163,0.22);
  --uiAccentBorderSoft: rgba(255,79,163,0.30);
  --uiAccentBorder: rgba(255,79,163,0.38);
  --uiAccentBorderStrong: rgba(255,79,163,0.55);
  --uiAccentRingSoft: rgba(255,79,163,0.08);
  --uiAccentRing: rgba(255,79,163,0.10);
  --uiAccentShadow: rgba(255,79,163,0.10);
  --uiAccentShadowStrong: rgba(255,79,163,0.20);
  --uiAccentText: rgba(255,79,163,0.88);

  /* Day UI palette (surfaces stay pink/white; accents can change when the cat mutates). */
  --uiTint: rgba(0,0,0,0.0);
  --uiBgGlow1: rgba(255,79,163,0.22);
  --uiBgGlow2: rgba(255,122,192,0.20);
  --uiBgGlow3: rgba(255,210,232,0.85);
  --uiBgTint: rgba(0,0,0,0.0);
  --uiBgBase1: #fff3fa;
  --uiBgBase2: #fde6f2;
  --uiBgBase3: #fff6fb;

  --uiPanelGlow: rgba(255,79,163,0.18);
  --uiPanelTint: rgba(0,0,0,0.0);
  --uiPanelA: rgba(245,245,248,0.92);
  --uiPanelB: rgba(236,236,242,0.86);

  --uiTopGlow: rgba(255,79,163,0.22);
  --uiTopTint: rgba(0,0,0,0.0);
  --uiTopA: rgba(255,255,255,0.55);
  --uiTopB: rgba(255,255,255,0.0);

  --uiBottomGlow: rgba(255,79,163,0.14);
  --uiBottomTint: rgba(0,0,0,0.0);
  --uiBottomA: rgba(255,255,255,0.42);
  --uiBottomB: rgba(236,236,242,0.62);

  --uiComposerGlow: rgba(255,79,163,0.14);
  --uiComposerTint: rgba(0,0,0,0.0);
  --uiComposerA: rgba(255,255,255,0.62);
  --uiComposerB: rgba(236,236,242,0.78);

  --uiRightTopGlow: rgba(255,122,192,0.14);
  --uiRightTopTint: rgba(0,0,0,0.0);

  --uiActiveGlow: var(--uiAccentGlow);
  --uiActiveTint: var(--uiAccentRingSoft);

  /* Tinted "white" surfaces for Day theme (overridden per cat color). */
  --uiSurfaceBtn: rgba(255,255,255,0.70);
  --uiSurfaceChat: rgba(255,255,255,0.66);
  --uiSurfaceMsg: rgba(255,255,255,0.72);
  --uiSurfaceMsgUserA: rgba(255,255,255,0.82);
  --uiSurfaceMsgUserB: rgba(255,255,255,0.68);
  --uiSurfaceInput: rgba(255,255,255,0.82);
  --uiModalA: rgba(255,255,255,0.92);
  --uiModalB: rgba(236,236,242,0.86);

  --roomWall:#ffd3e8;
  --roomWall2:#f6b8d7;
  --floor:#f0a9c7;
  --floor2:#e28ab4;
  --roomGlow1: rgba(255,122,192,0.10);
  --roomGlow2: rgba(255,79,163,0.12);
  --windowGlow: rgba(255,122,192,0.32);

  --cat1:#e38b3b;
  --cat2:#c9732b;
  --cat3:#ffb1c9;
  --collar:#ff4fa3;
  --collar2:#ff1f86;
  --tag:#ffffff;

  --radius: 16px;
  --shadow: 0 18px 40px rgba(0,0,0,0.45);
  --shadow2: 0 10px 24px rgba(0,0,0,0.35);

  /* Disco timing defaults (JS can override on .app for beat-sync). */
  --disco-beat: 0.5s; /* 120 BPM */
  --disco-bar: 2s;    /* 4 beats */
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background:
    radial-gradient(1200px 700px at 10% 0%, var(--uiBgGlow1), transparent 58%),
    radial-gradient(1100px 800px at 90% 10%, var(--uiBgGlow2), transparent 60%),
    radial-gradient(900px 700px at 55% 40%, var(--uiBgTint), transparent 62%),
    radial-gradient(1400px 1000px at 50% 105%, var(--uiBgGlow3), rgba(255,240,248,0.0) 60%),
    linear-gradient(180deg, var(--uiBgBase1), var(--uiBgBase2) 55%, var(--uiBgBase3));
  overflow: hidden;
}

.app{
  height: 100%;
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 380px;
  gap: 16px;
  padding: 16px;
}

.sidebar, .right{
  background:
    radial-gradient(900px 260px at 20% 0%, var(--uiPanelGlow), transparent 60%),
    radial-gradient(900px 260px at 85% 100%, var(--uiPanelTint), transparent 60%),
    linear-gradient(180deg, var(--uiPanelA), var(--uiPanelB));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

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

.right{
  display:flex;
  flex-direction:column;
  min-height: 0;
}

.side-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(800px 120px at 0% 0%, var(--uiTopGlow), transparent 55%),
    radial-gradient(800px 120px at 100% 0%, var(--uiTopTint), transparent 55%),
    linear-gradient(180deg, var(--uiTopA), var(--uiTopB));
}

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

.brand{
  display:flex;
  gap:10px;
  align-items:center;
  min-width: 0;
}
.brand-mark{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.45), transparent 40%),
    linear-gradient(135deg, var(--accent), var(--accent2));
  position: relative;
  box-shadow: 0 10px 24px var(--uiAccentShadowStrong);
}
.brand-mark::before,
.brand-mark::after{
  content:"";
  position:absolute;
  top: 7px;
  width: 6px;
  height: 8px;
  background: rgba(10,10,16,0.8);
  border-radius: 3px;
}
.brand-mark::before{ left: 7px; }
.brand-mark::after{ right: 7px; }
.brand-text{ min-width:0; }
.brand-name{
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.1;
  display:flex;
  align-items:center;
  gap: 8px;
  white-space: nowrap;
}
.brand-sub{
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  opacity: 0.9;
}

.chat-list{
  padding: 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
  flex: 1;
  overflow: auto;
}
.chat-item{
  appearance:none;
  border: 1px solid rgba(27,17,22,0.12);
  background: var(--uiSurfaceChat);
  color: var(--text);
  text-align:left;
  padding: 10px 10px;
  border-radius: 14px;
  cursor:pointer;
  position: relative;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.chat-item:hover{
  transform: translateY(-1px);
  border-color: rgba(27,17,22,0.20);
  box-shadow: 0 12px 26px rgba(0,0,0,0.10);
}
.chat-item:focus-visible{
  outline: none;
  border-color: var(--uiAccentBorder);
  box-shadow:
    0 0 0 6px var(--uiAccentRingSoft),
    0 12px 26px rgba(0,0,0,0.10);
}
.chat-item.is-active{
  background:
    radial-gradient(160px 80px at 14% 20%, var(--uiActiveTint), transparent 60%),
    linear-gradient(180deg, var(--uiActiveGlow), var(--uiSurfaceBtn));
  border-color: var(--uiAccentBorderStrong);
  box-shadow: 0 14px 30px rgba(0,0,0,0.10);
}
.chat-title{ font-weight: 700; font-size: 13px; }
.chat-snippet{ color: var(--muted); font-size: 12px; margin-top: 4px; opacity: 0.95; }

.btn{
  appearance:none;
  border: 1px solid rgba(27,17,22,0.16);
  background: var(--uiSurfaceBtn);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  position: relative;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
  transform: translateY(0);
  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    filter 160ms ease,
    background 220ms ease;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(27,17,22,0.26);
  box-shadow: 0 12px 26px rgba(0,0,0,0.12);
}
.btn:active{
  transform: translateY(0px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.10);
  filter: saturate(1.05);
}
.btn:focus-visible{
  outline: none;
  border-color: var(--uiAccentBorderStrong);
  box-shadow:
    0 0 0 6px var(--uiAccentRing),
    0 12px 26px rgba(0,0,0,0.12);
}
.btn-ghost{ padding: 8px 10px; font-size: 12px; }
.icon-btn{
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}
.icon{
  display: grid;
  place-items: center;
}
.ico{
  width: 18px;
  height: 18px;
  display: block;
}

.chats-toggle{ display:none; color: var(--muted); }
.sidebar.is-chats-open .chats-toggle{ color: var(--accent); }
.icon-chevron .ico{ transition: transform 160ms ease; }
.sidebar.is-chats-open .icon-chevron .ico{ transform: rotate(180deg); }

/* Theme toggle button: text label (no icons). */
.theme-toggle{ color: #ff4fa3; }
body[data-theme="night"] .theme-toggle{ color: rgba(255,255,255,0.92); }

.music-toggle{ color: #ff4fa3; }
body[data-theme="night"] .music-toggle{ color: rgba(255,255,255,0.92); }
/* Music toggle button: text label (no icons). */
.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: var(--uiAccentBorderStrong);
  color: #121012;
  background-size: 160% 160%;
  background-position: 0% 50%;
}
.btn-primary:hover{
  background-position: 85% 50%;
  filter: brightness(1.02) saturate(1.05);
}

.btn-pay{
  padding: 12px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: var(--uiAccentBorderStrong);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.12),
    0 0 0 0 rgba(255,79,163,0.0);
  text-align: center;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 2px;
  animation: payPulse 2.6s ease-in-out infinite;
}
.btn-pay:hover{
  background-position: 85% 50%;
  filter: brightness(1.03) saturate(1.08);
  box-shadow:
    0 16px 32px rgba(0,0,0,0.14),
    0 0 0 6px var(--uiAccentRingSoft);
}
.btn-pay:active{
  animation: none;
}
.btn-pay__label{
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: 13px;
  line-height: 1.15;
}
.btn-pay__sub{
  font-weight: 800;
  font-size: 11px;
  color: rgba(12,10,16,0.72);
  line-height: 1.15;
  opacity: 0.95;
}
@keyframes payPulse{
  0%, 100%{
    box-shadow:
      0 14px 28px rgba(0,0,0,0.12),
      0 0 0 0 rgba(255,79,163,0.0);
  }
  55%{
    box-shadow:
      0 16px 32px rgba(0,0,0,0.14),
      0 0 0 6px var(--uiAccentRingSoft);
  }
}
@media (prefers-reduced-motion: reduce){
  .btn-pay{ animation: none; }
}

.side-bottom{
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(900px 160px at 0% 0%, var(--uiBottomGlow), transparent 60%),
    radial-gradient(900px 160px at 100% 0%, var(--uiBottomTint), transparent 60%),
    linear-gradient(180deg, var(--uiBottomA), var(--uiBottomB));
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "theme music"
    "hint hint";
  align-items:center;
  justify-content:center;
  column-gap: 10px;
  row-gap: 10px;
  margin-top: auto;
}
.theme-toggle{ grid-area: theme; }
.music-toggle{ grid-area: music; }
.audio-hint{ grid-area: hint; }
.side-bottom .btn{
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 13px;
}
.audio-hint{
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.78;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 14px;
}
.audio-hint:empty{ display:none; }
.audio-hint--sidebar{
  padding: 8px 14px 10px;
  min-height: 0;
}

.audio-unlock{
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 80;
  width: min(360px, calc(100% - 24px));
  text-align: center;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow2);
}

.stage{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 0;
}
.room{
  width: min(760px, 100%);
  height: min(560px, calc(100vh - 32px));
  border-radius: calc(var(--radius) + 10px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 15% 0%, var(--roomGlow1), transparent 55%),
    radial-gradient(900px 520px at 85% 0%, var(--roomGlow2), transparent 55%),
    linear-gradient(180deg, var(--roomWall), var(--roomWall2) 65%, transparent 65%);
}
.room::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 5px);
  opacity: 0.22;
  pointer-events:none;
}

.wall-art{
  position:absolute;
  inset: 64px 24px auto 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 16px;
}
.poster{
  width: 150px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(255,255,255,0.06));
  transform: rotate(-1.5deg);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}
.poster-title{
  font-weight: 900;
  letter-spacing: 1px;
  color: rgba(255,79,163,0.95);
}
.poster-sub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.window{
  width: 190px;
  height: 140px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: radial-gradient(220px 140px at 40% 20%, var(--windowGlow), rgba(0,0,0,0.35));
  box-shadow: inset 0 0 0 6px rgba(0,0,0,0.18), 0 10px 24px rgba(0,0,0,0.26);
  position: relative;
  overflow:hidden;
}
.window::after{
  content:"";
  position:absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255,255,255,0.14) 48%, rgba(255,255,255,0.14) 52%, transparent 53%),
    linear-gradient(0deg, transparent 47%, rgba(255,255,255,0.14) 48%, rgba(255,255,255,0.14) 52%, transparent 53%);
  opacity: 0.7;
  pointer-events:none;
}
.stars{
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 20%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 55% 55%, rgba(255,255,255,0.60) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 65%, rgba(255,255,255,0.65) 0 1px, transparent 2px);
  opacity: 0.65;
  animation: starsDrift 10s linear infinite;
}
@keyframes starsDrift{
  0%{ transform: translateX(0px); }
  100%{ transform: translateX(12px); }
}
.moon{
  position:absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  right: 22px;
  top: 22px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.85), rgba(255,255,255,0.55));
  box-shadow: 0 0 22px rgba(255,255,255,0.18);
}

.clock{
  width: 96px;
  height: 96px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.55), rgba(255,255,255,0.18)),
    linear-gradient(180deg, rgba(0,0,0,0.14), rgba(0,0,0,0.24));
  box-shadow: inset 0 0 0 6px rgba(0,0,0,0.10), 0 10px 22px rgba(0,0,0,0.20);
  position: relative;
}
.clock-face{
  position:absolute;
  inset: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.22), transparent 55%),
    repeating-conic-gradient(
      from 0deg,
      rgba(255,255,255,0.0) 0deg,
      rgba(255,255,255,0.0) 26deg,
      rgba(255,255,255,0.22) 27deg,
      rgba(255,255,255,0.0) 28deg
    );
  opacity: 0.85;
}
.clock .hand{
  position:absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  transform-origin: 50% calc(100% - 2px);
  transform: translate(-50%, -100%) rotate(0deg);
  animation: handSpin 8s linear infinite;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}
.clock .hand.hour{ height: 22px; width: 3px; opacity: 0.85; animation-duration: 1200s; }
.clock .hand.minute{ height: 30px; width: 2px; opacity: 0.9; animation-duration: 240s; }
.clock .hand.second{ height: 34px; width: 1px; background: rgba(255,79,163,0.9); animation-duration: 60s; }
.clock .pin{
  position:absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.14);
}
@keyframes handSpin{
  to { transform: translate(-50%, -100%) rotate(360deg); }
}

.floor{
  position:absolute;
  left:0; right:0; bottom:0;
  height: 36%;
  background:
    radial-gradient(900px 240px at 50% 0%, rgba(255,255,255,0.26), transparent 60%),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.06) 0px,
      rgba(255,255,255,0.06) 28px,
      rgba(0,0,0,0.05) 28px,
      rgba(0,0,0,0.05) 30px
    ),
    linear-gradient(180deg, var(--floor), var(--floor2));
  border-top: 1px solid rgba(255,255,255,0.08);
}

.lights{
  position:absolute;
  top: 18px;
  left: 22px;
  right: 22px;
  height: 38px;
  pointer-events:none;
}
.wire{
  position:absolute;
  left: 0; right:0; top: 12px;
  height: 2px;
  background: linear-gradient(90deg, rgba(27,17,22,0.22), rgba(27,17,22,0.10));
  transform: skewX(-12deg);
  border-radius: 999px;
  opacity: 0.7;
}
.bulb{
  position:absolute;
  top: 6px;
  width: 14px;
  height: 18px;
  border-radius: 8px 8px 10px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 0 0 rgba(255,79,163,0);
  animation: twinkle 2.2s ease-in-out infinite;
}
.bulb::after{
  content:"";
  position:absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -6px;
  width: 2px;
  height: 8px;
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
}
.bulb:nth-child(2){ left: 4%;  --c: rgba(255,79,163,0.90); animation-delay: 0.05s; }
.bulb:nth-child(3){ left: 14%; --c: rgba(46,229,157,0.85); animation-delay: 0.55s; }
.bulb:nth-child(4){ left: 26%; --c: rgba(255,255,255,0.82); animation-delay: 0.12s; }
.bulb:nth-child(5){ left: 38%; --c: rgba(255,79,163,0.95); animation-delay: 0.78s; }
.bulb:nth-child(6){ left: 50%; --c: rgba(46,229,157,0.82); animation-delay: 0.26s; }
.bulb:nth-child(7){ left: 62%; --c: rgba(255,255,255,0.80); animation-delay: 0.92s; }
.bulb:nth-child(8){ left: 74%; --c: rgba(255,122,192,0.90); animation-delay: 0.34s; }
.bulb:nth-child(9){ left: 86%; --c: rgba(46,229,157,0.82); animation-delay: 1.05s; }
.bulb:nth-child(10){ left: 92%; --c: rgba(255,255,255,0.82); animation-delay: 0.62s; }
.bulb:nth-child(11){ left: 98%; --c: rgba(255,79,163,0.92); animation-delay: 0.18s; }

@keyframes twinkle{
  0%, 100% { background: rgba(255,255,255,0.07); box-shadow: 0 0 0 rgba(255,79,163,0); transform: translateY(0); }
  35% { background: var(--c, rgba(255,79,163,0.75)); box-shadow: 0 0 18px var(--c, rgba(255,79,163,0.65)); transform: translateY(1px); }
  70% { background: rgba(255,255,255,0.09); box-shadow: 0 0 10px rgba(255,255,255,0.10); transform: translateY(0); }
}

.props{
  position:absolute;
  left:0; right:0;
  bottom: 10%;
  height: 40%;
  pointer-events:none;
}
.cat-tree{
  position:absolute;
  left: 12%;
  bottom: 5%;
  width: 150px;
  height: 190px;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,0.22));
}
.ct-base{
  position:absolute;
  left: 18px;
  bottom: 0;
  width: 114px;
  height: 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.70), rgba(220,220,230,0.85));
  border: 1px solid rgba(27,17,22,0.16);
  box-shadow: inset 0 -8px 16px rgba(0,0,0,0.10);
}
.ct-post{
  position:absolute;
  left: 70px;
  bottom: 18px;
  width: 14px;
  height: 120px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(27,17,22,0.20) 0px,
      rgba(27,17,22,0.20) 4px,
      rgba(255,255,255,0.18) 4px,
      rgba(255,255,255,0.18) 8px
    ),
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(0,0,0,0.10));
  border: 1px solid rgba(27,17,22,0.14);
}
.ct-perch{
  position:absolute;
  left: 34px;
  bottom: 132px;
  width: 90px;
  height: 26px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,79,163,0.32), rgba(255,255,255,0.70));
  border: 1px solid rgba(27,17,22,0.14);
  box-shadow: 0 10px 18px rgba(0,0,0,0.14);
}
.ct-perch::after{
  content:"";
  position:absolute;
  left: 12px;
  right: 12px;
  top: 7px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
}
.ct-toy{
  position:absolute;
  left: 102px;
  bottom: 120px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(46,229,157,0.85);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
  animation: toySwing 1.3s ease-in-out infinite;
  transform-origin: top center;
}
.ct-toy::before{
  content:"";
  position:absolute;
  left: 50%;
  top: -28px;
  width: 2px;
  height: 28px;
  background: rgba(27,17,22,0.18);
  transform: translateX(-50%);
  border-radius: 999px;
}
@keyframes toySwing{
  0%,100%{ transform: translateX(0) rotate(-12deg); }
  50%{ transform: translateX(-6px) rotate(12deg); }
}
.plant{
  position:absolute;
  right: 12%;
  bottom: 6%;
  width: 120px;
  height: 160px;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,0.35));
}
.pot{
  position:absolute;
  bottom:0;
  left: 18px;
  width: 84px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,122,192,0.55), rgba(255,79,163,0.30));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 -10px 18px rgba(0,0,0,0.20);
}
.leaf{
  position:absolute;
  width: 46px;
  height: 78px;
  border-radius: 60px 60px 18px 18px;
  background: linear-gradient(180deg, rgba(46,229,157,0.88), rgba(46,229,157,0.22));
  border: 1px solid rgba(255,255,255,0.14);
  transform-origin: bottom center;
  animation: leafSway 2.8s ease-in-out infinite;
}
.leaf.l1{ left: 8px; bottom: 44px; transform: rotate(-10deg); animation-delay: 0.1s; }
.leaf.l2{ left: 36px; bottom: 48px; transform: rotate(4deg); animation-delay: 0.5s; }
.leaf.l3{ left: 64px; bottom: 44px; transform: rotate(12deg); animation-delay: 0.2s; }
@keyframes leafSway{
  0%,100%{ transform: rotate(var(--r, 0deg)); }
  50%{ transform: rotate(calc(var(--r, 0deg) + 6deg)); }
}
.leaf.l1{ --r: -10deg; }
.leaf.l2{ --r: 4deg; }
.leaf.l3{ --r: 12deg; }

.cat-wrap{
  position:absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  display:flex;
  align-items:center;
  justify-content:center;
  animation: catBob 1.9s ease-in-out infinite;
}
.cat-wrap.is-petted{
  animation-duration: 0.95s;
}
.cat-wrap.is-petted .cat-tail{
  animation-duration: 0.35s;
}
.cat-wrap.is-petted .shadow{
  animation-duration: 0.95s;
}
.cat-wrap.is-petted{
  filter: drop-shadow(0 22px 28px rgba(255,79,163,0.18));
}

/* Angry reaction on send */
.app.is-angry .cat-wrap{
  animation: angryShake 0.52s steps(2, end) 1;
  filter: saturate(1.25) contrast(1.05);
}
@keyframes angryShake{
  0%{ transform: translateX(-50%) translateY(0px); }
  20%{ transform: translateX(calc(-50% - 6px)) translateY(-2px); }
  40%{ transform: translateX(calc(-50% + 6px)) translateY(0px); }
  60%{ transform: translateX(calc(-50% - 4px)) translateY(-1px); }
  80%{ transform: translateX(calc(-50% + 4px)) translateY(0px); }
  100%{ transform: translateX(-50%) translateY(0px); }
}

/* Dance on request: type "dance" */
.app.is-dancing .cat{
  animation: danceWiggle 0.32s steps(2, end) infinite;
  transform-origin: 50% 68%;
}
.app.is-dancing .cat-tail{
  animation-duration: 0.32s;
}
.app.is-dancing .shadow{
  animation-duration: 0.9s;
}
.app.is-dancing .bulb{
  animation-duration: 0.75s;
}
@keyframes danceWiggle{
  0%{ transform: translateY(0) rotate(-6deg); }
  50%{ transform: translateY(-2px) rotate(6deg); }
  100%{ transform: translateY(0) rotate(-6deg); }
}

/* Paid disco party (x402) */
.party{
  position:absolute;
  inset: 0;
  opacity: 0;
  pointer-events:none;
  transition: opacity 320ms ease;
  z-index: 6;
}
.app.is-disco .party{ opacity: 1; }
/* Ensure mutation flash can appear even if disco is fading out. */
.app.is-mutating .party{ opacity: 1; }

/* Mutation flash overlay (used when the cat changes color after payment). */
.party::after{
  content:"";
  position:absolute;
  inset: 0;
  pointer-events:none;
  opacity: 0;
  background:
    radial-gradient(320px 220px at 50% 62%, rgba(255,255,255,0.62), transparent 68%),
    radial-gradient(720px 520px at 50% 55%, rgba(255,79,163,0.18), transparent 70%),
    radial-gradient(520px 380px at 50% 55%, rgba(46,229,157,0.12), transparent 72%);
  mix-blend-mode: screen;
}
.app.is-mutating .party::after{
  animation: mutateFlash 1.25s ease-out 1;
}
@keyframes mutateFlash{
  0%{ opacity: 0; filter: blur(0px) saturate(1.0); }
  18%{ opacity: 1; filter: blur(0.2px) saturate(1.2); }
  55%{ opacity: 0.35; filter: blur(0px) saturate(1.1); }
  100%{ opacity: 0; filter: blur(0px) saturate(1.0); }
}

.party-dimmer{
  position:absolute;
  inset: 0;
  background: rgba(7,5,12,0.26);
  opacity: 0;
  transition: opacity 420ms ease;
}
.app.is-disco .party-dimmer{ opacity: 1; }

.party-bg{
  position:absolute;
  inset: -18%;
  background:
    radial-gradient(520px 320px at 18% 10%, rgba(255,79,163,0.22), transparent 60%),
    radial-gradient(620px 380px at 84% 18%, rgba(180,90,255,0.20), transparent 62%),
    radial-gradient(700px 420px at 50% 86%, rgba(46,229,157,0.14), transparent 66%),
    linear-gradient(180deg, rgba(255,210,232,0.12), rgba(180,90,255,0.10));
  opacity: 0;
  mix-blend-mode: screen;
  transform: translate3d(0,0,0);
}
.app.is-disco .party-bg{
  opacity: 0.68;
  animation: discoBgShift 6s ease-in-out infinite, discoPulse var(--disco-beat) ease-in-out infinite;
}
@keyframes discoBgShift{
  0%{ transform: translate(-2%, -1%) scale(1.05); filter: hue-rotate(0deg) saturate(1.05); }
  50%{ transform: translate(2%, 1%) scale(1.08); filter: hue-rotate(24deg) saturate(1.20); }
  100%{ transform: translate(-2%, -1%) scale(1.05); filter: hue-rotate(0deg) saturate(1.05); }
}
@keyframes discoPulse{
  0%,100%{ opacity: 0.52; }
  50%{ opacity: 0.80; }
}

.party-beams{
  position:absolute;
  inset: -30%;
  opacity: 0;
  pointer-events:none;
  mix-blend-mode: screen;
}
.app.is-disco .party-beams{ opacity: 1; }
.party-beams::before,
.party-beams::after{
  content:"";
  position:absolute;
  inset: 0;
  opacity: 0;
}
.party-beams::before{
  background:
    linear-gradient(90deg,
      transparent 0%,
      rgba(255,255,255,0.0) 26%,
      rgba(255,255,255,0.22) 31%,
      rgba(255,255,255,0.0) 36%,
      transparent 100%);
}
.party-beams::after{
  background:
    linear-gradient(90deg,
      transparent 0%,
      rgba(46,229,157,0.0) 24%,
      rgba(46,229,157,0.22) 29%,
      rgba(46,229,157,0.0) 34%,
      transparent 100%);
}
.app.is-disco .party-beams::before{ animation: beamSweepA var(--disco-bar) linear infinite; }
.app.is-disco .party-beams::after{ animation: beamSweepB var(--disco-bar) linear infinite; animation-delay: calc(var(--disco-beat) * 2); }
@keyframes beamSweepA{
  0%{ transform: translateX(-45%) rotate(12deg); opacity: 0; }
  10%{ opacity: 0.95; }
  55%{ opacity: 0.70; }
  100%{ transform: translateX(45%) rotate(12deg); opacity: 0; }
}
@keyframes beamSweepB{
  0%{ transform: translateX(-55%) rotate(-10deg); opacity: 0; }
  12%{ opacity: 0.90; }
  58%{ opacity: 0.65; }
  100%{ transform: translateX(55%) rotate(-10deg); opacity: 0; }
}

.party-reflections{
  position:absolute;
  inset: 0;
  opacity: 0;
  pointer-events:none;
  background:
    repeating-linear-gradient(
      125deg,
      rgba(255,255,255,0.0) 0 22px,
      rgba(255,255,255,0.10) 22px 26px,
      rgba(255,255,255,0.0) 26px 46px
    );
  mix-blend-mode: overlay;
}
.app.is-disco .party-reflections{
  opacity: 1;
  animation: reflectionsSlide var(--disco-bar) linear infinite;
}
@keyframes reflectionsSlide{
  0%{ background-position: 0 0; }
  100%{ background-position: 220px 0; }
}

.party-glow{
  position:absolute;
  inset: 0;
  background:
    radial-gradient(240px 160px at 20% 20%, rgba(46,229,157,0.18), transparent 70%),
    radial-gradient(260px 190px at 80% 25%, rgba(255,79,163,0.22), transparent 72%),
    radial-gradient(320px 220px at 50% 75%, rgba(255,255,255,0.12), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0;
}
.app.is-disco .party-glow{ animation: partyGlow var(--disco-beat) steps(2, end) infinite; }
@keyframes partyGlow{
  0%{ opacity: 0.45; filter: hue-rotate(0deg) saturate(1.05); }
  50%{ opacity: 0.70; filter: hue-rotate(25deg) saturate(1.25); }
  100%{ opacity: 0.45; filter: hue-rotate(0deg) saturate(1.05); }
}

.disco{
  position:absolute;
  left: 50%;
  top: 5.5%;
  transform: translateX(-50%);
  transform-origin: 50% 0;
  opacity: 0;
}
.app.is-disco .disco{ opacity: 1; animation: discoSwing calc(var(--disco-bar) * 1) ease-in-out infinite; }
@keyframes discoSwing{
  0%{ transform: translateX(-50%) rotate(-3deg); }
  50%{ transform: translateX(-50%) rotate(3deg); }
  100%{ transform: translateX(-50%) rotate(-3deg); }
}

.disco-chain{
  width: 10px;
  height: 48px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    180deg,
    rgba(240,240,245,0.65) 0 6px,
    rgba(170,170,184,0.65) 6px 10px
  );
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(18,12,18,0.12);
}

.disco-ball{
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 6px;
  image-rendering: pixelated;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.18) 0 6px, transparent 6px 12px) 0 0/12px 12px,
    linear-gradient(0deg, rgba(255,255,255,0.14) 0 6px, transparent 6px 12px) 0 0/12px 12px,
    radial-gradient(circle at 26% 22%, rgba(255,255,255,0.95), rgba(255,255,255,0.0) 44%),
    radial-gradient(circle at 55% 65%, rgba(46,229,157,0.26), rgba(255,79,163,0.28)),
    linear-gradient(#cfd3da, #8a93a3);
  box-shadow:
    0 0 0 3px rgba(18,12,18,0.14),
    0 18px 30px rgba(0,0,0,0.34);
}
.app.is-disco .disco-ball{
  animation:
    discoRotate calc(var(--disco-bar) * 2) linear infinite,
    discoShimmer var(--disco-beat) steps(2, end) infinite;
}
@keyframes discoRotate{
  0%{ transform: rotate(0deg); }
  100%{ transform: rotate(360deg); }
}
@keyframes discoShimmer{
  0%{ filter: hue-rotate(0deg) brightness(1.05); }
  50%{ filter: hue-rotate(16deg) brightness(1.22); }
  100%{ filter: hue-rotate(0deg) brightness(1.05); }
}

.party-fx{
  position:absolute;
  inset: 0;
  opacity: 0;
  pointer-events:none;
  z-index: 4;
}
.app.is-disco .party-fx{ opacity: 1; }
.fx-heart,
.fx-star{
  position:absolute;
  opacity: 0;
  transform: translate(0,0) scale(0.9);
  filter: drop-shadow(0 10px 16px rgba(0,0,0,0.20));
  --dx: 0px;
  --dy: -54px;
}
.app.is-disco .fx-heart,
.app.is-disco .fx-star{
  opacity: 1;
  animation: fxFloat calc(var(--disco-bar) * 1.25) ease-in-out infinite;
}
@keyframes fxFloat{
  0%{ transform: translate(0, 0) scale(0.85); opacity: 0; }
  18%{ opacity: 1; }
  100%{ transform: translate(var(--dx), var(--dy)) scale(1.12); opacity: 0; }
}
.fx-heart{
  width: 6px;
  height: 6px;
  background: rgba(255,205,228,0.95);
  border-radius: 1px;
  box-shadow:
    -6px 0 0 0 rgba(255,205,228,0.95),
    6px 0 0 0 rgba(255,205,228,0.95),
    -6px 6px 0 0 rgba(255,170,205,0.95),
    6px 6px 0 0 rgba(255,170,205,0.95),
    0px 6px 0 0 rgba(255,230,242,0.95),
    0px 12px 0 0 rgba(255,205,228,0.95),
    0px 0px 0 2px rgba(27,17,22,0.12);
}
.fx-star{
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.92);
  border-radius: 1px;
  box-shadow:
    -4px 0 0 0 rgba(46,229,157,0.82),
    4px 0 0 0 rgba(255,79,163,0.86),
    0 -4px 0 0 rgba(255,255,255,0.90),
    0 4px 0 0 rgba(255,255,255,0.86),
    0 0 18px rgba(255,79,163,0.22);
}

.fx-heart.h1{ left: 40%; top: 66%; animation-delay: 0.00s; --dx: -10px; --dy: -58px; }
.fx-heart.h2{ left: 58%; top: 62%; animation-delay: 0.18s; --dx: 14px;  --dy: -52px; }
.fx-heart.h3{ left: 46%; top: 54%; animation-delay: 0.28s; --dx: -4px;  --dy: -62px; }
.fx-heart.h4{ left: 66%; top: 54%; animation-delay: 0.08s; --dx: 10px;  --dy: -66px; }
.fx-star.s1{ left: 34%; top: 46%; animation-delay: 0.06s; --dx: -12px; --dy: -46px; }
.fx-star.s2{ left: 72%; top: 42%; animation-delay: 0.16s; --dx: 10px;  --dy: -50px; }
.fx-star.s3{ left: 30%; top: 58%; animation-delay: 0.24s; --dx: -8px;  --dy: -44px; }
.fx-star.s4{ left: 78%; top: 56%; animation-delay: 0.32s; --dx: 12px;  --dy: -42px; }
.fx-star.s5{ left: 52%; top: 40%; animation-delay: 0.12s; --dx: 4px;   --dy: -58px; }
.fx-star.s6{ left: 56%; top: 72%; animation-delay: 0.22s; --dx: -6px;  --dy: -36px; }

.party-notes{
  position:absolute;
  left: 50%;
  bottom: 26%;
  width: 420px;
  height: 260px;
  transform: translateX(-50%);
  opacity: 0;
}
.app.is-disco .party-notes{ opacity: 1; }
.note{
  position:absolute;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 24px;
  letter-spacing: 0;
  color: rgba(255,255,255,0.95);
  text-shadow:
    0 0 0 rgba(0,0,0,0.0),
    0 2px 0 rgba(18,12,18,0.22),
    0 0 18px rgba(255,79,163,0.32),
    0 0 22px rgba(46,229,157,0.22);
  opacity: 0;
}
.app.is-disco .note{ animation: noteFloat 1.3s ease-in-out infinite; opacity: 1; }
.note.n1{ left: 8%; top: 38%; animation-delay: 0.00s; }
.note.n2{ left: 18%; top: 12%; animation-delay: 0.15s; }
.note.n3{ left: 74%; top: 18%; animation-delay: 0.22s; }
.note.n4{ left: 86%; top: 44%; animation-delay: 0.08s; }
.note.n5{ left: 52%; top: 4%;  animation-delay: 0.30s; }
@keyframes noteFloat{
  0%{ transform: translateY(0px) rotate(-6deg); }
  50%{ transform: translateY(-12px) rotate(6deg); }
  100%{ transform: translateY(0px) rotate(-6deg); }
}

/* Cat dances harder in disco mode */
.app.is-disco .cat-wrap{
  animation: discoGroove calc(var(--disco-beat) * 2) steps(2, end) infinite;
  filter: saturate(1.1) contrast(1.02);
}
.app.is-disco .cat{
  filter:
    drop-shadow(0 20px 26px rgba(0,0,0,0.35))
    drop-shadow(0 0 18px rgba(255,79,163,0.24))
    drop-shadow(0 0 22px rgba(46,229,157,0.16));
}
.app.is-disco .cat-tail{
  animation: tailDisco var(--disco-beat) ease-in-out infinite;
}
.app.is-disco .sparkles{
  opacity: 1;
}
.app.is-disco .sparkles::before{
  animation: sparkleDisco calc(var(--disco-bar) * 1) steps(6, end) infinite;
}
.app.is-disco .sparkles::after{
  animation: sparkleDisco calc(var(--disco-bar) * 1) steps(6, end) infinite;
  animation-delay: calc(var(--disco-beat) * 1);
}
@keyframes sparkleDisco{
  0%{ opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  12%{ opacity: 1; }
  62%{ opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  100%{ opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
}
@keyframes discoGroove{
  0%{ transform: translateX(calc(-50% - 12px)) translateY(0px); }
  25%{ transform: translateX(-50%) translateY(-10px); }
  50%{ transform: translateX(calc(-50% + 12px)) translateY(0px); }
  75%{ transform: translateX(-50%) translateY(-10px); }
  100%{ transform: translateX(calc(-50% - 12px)) translateY(0px); }
}
@keyframes tailDisco{
  0%,100% { transform: rotate(-4deg); }
  50% { transform: rotate(18deg); }
}
.app.is-disco .cat{ 
  animation: danceWiggle 0.26s steps(2, end) infinite;
  transform-origin: 50% 68%;
}
.app.is-disco .shadow{
  animation-duration: calc(var(--disco-beat) * 2);
}
.app.is-disco .bulb{
  animation-duration: var(--disco-beat);
  filter: saturate(1.2);
}
/* Lovey: keywords cute/kiss/hug/pretty */
.cat-wrap::before{
  content:"";
  position:absolute;
  left: calc(50% + 18px);
  top: 122px;
  width: 6px;
  height: 6px;
  opacity: 0;
  pointer-events:none;
  background: rgba(255,205,228,0.95);
  border-radius: 1px;
  box-shadow:
    -6px 0 0 0 rgba(255,205,228,0.95),
    6px 0 0 0 rgba(255,205,228,0.95),
    -6px 6px 0 0 rgba(255,170,205,0.95),
    6px 6px 0 0 rgba(255,170,205,0.95),
    0px 6px 0 0 rgba(255,230,242,0.95),
    0px 12px 0 0 rgba(255,205,228,0.95),
    0px 0px 0 2px rgba(27,17,22,0.12);
  transform: translateY(0) scale(1);
  z-index: 4;
}
.app.is-lovey .cat-wrap::before{
  animation: kissPop 0.9s ease-out 1;
}
.app.is-lovey .cat{
  animation: loveyApproach 0.9s steps(3, end) 1;
  transform-origin: 50% 70%;
}
.app.is-lovey .shadow{
  animation: loveyShadow 0.9s ease-out 1;
}
@keyframes loveyApproach{
  0%{ transform: translateY(0) scale(1); }
  40%{ transform: translateY(-4px) scale(1.10); }
  100%{ transform: translateY(-2px) scale(1.22); }
}
@keyframes loveyShadow{
  0%{ transform: translateY(18px) scaleX(1); opacity: 0.6; }
  100%{ transform: translateY(18px) scaleX(0.74); opacity: 0.42; }
}
@keyframes kissPop{
  0%{ opacity: 0; transform: translateY(4px) scale(0.8); }
  30%{ opacity: 1; transform: translateY(0px) scale(1.0); }
  100%{ opacity: 0; transform: translateY(-18px) scale(1.1); }
}
@keyframes catBob{
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50% { transform: translateX(-50%) translateY(-10px); }
}
.cat{
  width: 270px;
  height: 270px;
  image-rendering: pixelated;
  filter: drop-shadow(0 20px 26px rgba(0,0,0,0.35));
}
.shadow{
  position:absolute;
  width: 150px;
  height: 20px;
  border-radius: 999px;
  bottom: 26px;
  background: radial-gradient(60px 12px at 50% 50%, rgba(0,0,0,0.45), transparent 70%);
  opacity: 0.65;
  transform: translateY(18px);
  animation: shadowPulse 1.9s ease-in-out infinite;
}
@keyframes shadowPulse{
  0%, 100% { transform: translateY(18px) scaleX(1); opacity: 0.6; }
  50% { transform: translateY(18px) scaleX(0.84); opacity: 0.45; }
}
.cat-tail{
  transform-origin: 46px 40px;
  animation: tailWag 2.6s ease-in-out infinite;
}
@keyframes tailWag{
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}
.cat-mouth{ opacity: 1; }
.cat-mouth-open{ opacity: 0; }
.cat-eyes-sleep{ opacity: 0; }
.cat-eyes-sleepy{ opacity: 0; }
.cat-eyes-sparkle{ opacity: 0; }
.cat-eyes-love{ opacity: 0; }
.cat-eyebrows-angry{ opacity: 0; }
.cat-blush{ opacity: 0; }
.cat-smile{ opacity: 0; }
.cat-frown{ opacity: 0; }
.cat-paw-right{
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.sparkles{
  position:absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -52%);
  pointer-events:none;
  opacity: 0;
  z-index: 5;
}
.sparkles::before,
.sparkles::after{
  content:"";
  position:absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  background: rgba(255,255,255,0.90);
  box-shadow:
    -80px -40px 0 0 rgba(46,229,157,0.85),
    -60px 30px 0 0 rgba(255,79,163,0.90),
    -22px -62px 0 0 rgba(255,255,255,0.85),
    14px -58px 0 0 rgba(46,229,157,0.85),
    58px -30px 0 0 rgba(255,122,192,0.95),
    72px 26px 0 0 rgba(255,255,255,0.82),
    28px 58px 0 0 rgba(46,229,157,0.80),
    -28px 62px 0 0 rgba(255,79,163,0.88);
}
.sparkles::after{
  width: 4px;
  height: 4px;
  opacity: 0;
  background: rgba(255,255,255,0.75);
  box-shadow:
    -72px -6px 0 0 rgba(255,255,255,0.75),
    -44px -74px 0 0 rgba(255,79,163,0.78),
    0px -84px 0 0 rgba(255,255,255,0.78),
    44px -74px 0 0 rgba(46,229,157,0.78),
    72px -6px 0 0 rgba(255,255,255,0.75),
    52px 66px 0 0 rgba(255,122,192,0.85),
    -52px 66px 0 0 rgba(46,229,157,0.78);
}
.app.is-sparkle .sparkles{
  opacity: 1;
}
.app.is-sparkle .sparkles::before{
  animation: sparkleBurst 1.1s steps(6, end) 1;
}
.app.is-sparkle .sparkles::after{
  animation: sparkleBurst2 1.1s steps(6, end) 1;
}
@keyframes sparkleBurst{
  0%{ opacity: 0; transform: translate(-50%, -50%) scale(0.7); filter: blur(0); }
  10%{ opacity: 1; }
  65%{ opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  100%{ opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
}
@keyframes sparkleBurst2{
  0%{ opacity: 0; transform: translate(-50%, -50%) scale(0.65); filter: blur(0); }
  18%{ opacity: 1; }
  70%{ opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
  100%{ opacity: 0; transform: translate(-50%, -50%) scale(1.34); }
}

.tears{
  position:absolute;
  left: 50%;
  top: 94px;
  width: 220px;
  height: 140px;
  transform: translateX(-50%);
  pointer-events:none;
  opacity: 0;
  z-index: 3;
}
.tears::before,
.tears::after{
  content:"";
  position:absolute;
  top: 48px;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 0 0 2px rgba(72,217,255,0.18);
  border-radius: 1px;
  opacity: 0;
}
.tears::before{ left: 88px; }
.tears::after{ left: 126px; }

@keyframes talkClose{
  0%, 79% { opacity: 1; }
  80%, 100% { opacity: 0; }
}
@keyframes talkOpen{
  0%, 79% { opacity: 0; }
  80%, 100% { opacity: 1; }
}

.right-top{
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  background:
    radial-gradient(800px 120px at 100% 0%, var(--uiRightTopGlow), transparent 55%),
    radial-gradient(800px 120px at 0% 0%, var(--uiRightTopTint), transparent 55%);
  position: relative;
}
.right-title{
  text-align: center;
}
.rt-name{ font-weight: 900; letter-spacing: 0.4px; }
.rt-sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }
.status{
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(27,17,22,0.14);
  background: var(--uiSurfaceBtn);
  font-size: 12px;
  color: var(--muted);
  user-select:none;
  position: absolute;
  right: 14px;
  top: 14px;
}
.status.is-busy{
  border-color: var(--uiAccentBorderSoft);
  color: var(--uiAccentText);
  box-shadow: 0 0 0 6px var(--uiAccentRingSoft);
}

.output{
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow:auto;
}
.thinking{
  padding: 8px 14px 0;
  min-height: 24px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.thinking.is-visible{
  opacity: 1;
  transform: translateY(0);
}
.msg{
  border: 1px solid rgba(27,17,22,0.12);
  background: var(--uiSurfaceMsg);
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: 0 12px 20px rgba(27,17,22,0.10);
}
.msg-user{
  margin-left: 28px;
  background: linear-gradient(180deg, var(--uiSurfaceMsgUserA), var(--uiSurfaceMsgUserB));
  border-color: var(--uiAccentBorderSoft);
  box-shadow: 0 12px 20px var(--uiAccentShadow);
}
.msg-user .msg-role{
  color: var(--uiAccentText);
  font-weight: 800;
  letter-spacing: 0.3px;
}
.msg-assistant{
  margin-right: 28px;
}
.msg-role{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.msg-text{
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
}
.caret{
  display:inline-block;
  width: 10px;
  height: 18px;
  margin-left: 2px;
  background: rgba(27,17,22,0.55);
  transform: translateY(3px);
  animation: caretBlink 1s step-end infinite;
  border-radius: 2px;
}
@keyframes caretBlink{
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.composer{
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  display:flex;
  gap: 10px;
  align-items:flex-end;
  background:
    radial-gradient(900px 180px at 20% 0%, var(--uiComposerGlow), transparent 55%),
    radial-gradient(900px 180px at 100% 0%, var(--uiComposerTint), transparent 55%),
    linear-gradient(180deg, var(--uiComposerA), var(--uiComposerB));
}
.credit{
  padding: 0 14px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.75;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wallet{
  padding: 12px 14px 14px;
  border-top: 1px dashed rgba(27,17,22,0.16);
  margin-top: 2px;
}
.catalog-btn{
  width: 100%;
  text-align: center;
  opacity: 0.92;
}
.wallet .btn{
  width: 100%;
}
.wallet .btn + .btn{
  margin-top: 10px;
}
.wallet-status{
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.85;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 16px;
  margin-top: 10px;
}
.prompt{
  flex:1;
  resize:none;
  border-radius: 14px;
  border: 1px solid rgba(27,17,22,0.14);
  background: var(--uiSurfaceInput);
  color: var(--text);
  padding: 10px 10px;
  outline: none;
  line-height: 1.35;
}
.prompt:focus{
  border-color: var(--uiAccentBorder);
  box-shadow: 0 0 0 6px var(--uiAccentRingSoft);
}

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

/* Persistent face variations based on paid mutation color.
   JS sets `data-cat-face` on `.app` (in-memory only). */
.app[data-cat-face="grey"]:not(.is-sleeping):not(.is-crying) .cat-eyes-open{ opacity: 0; }
.app[data-cat-face="grey"]:not(.is-sleeping):not(.is-crying) .cat-eyes-sleepy{ opacity: 1; }

.app[data-cat-face="beige"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-mouth{ opacity: 0; }
.app[data-cat-face="beige"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-smile{ opacity: 1; }

.app[data-cat-face="blue"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-mouth{ opacity: 0; }
.app[data-cat-face="blue"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-smile{ opacity: 1; }
.app[data-cat-face="blue"]:not(.is-sleeping):not(.is-crying) .cat-eyes-sparkle{ opacity: 1; }
.app[data-cat-face="blue"]:not(.is-sleeping):not(.is-crying) .cat-blush{ opacity: 1; }

.app[data-cat-face="red"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-mouth{ opacity: 0; }
.app[data-cat-face="red"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-frown{ opacity: 1; }
.app[data-cat-face="red"]:not(.is-sleeping):not(.is-crying) .cat-eyebrows-angry{ opacity: 1; }

.app[data-cat-face="green"]:not(.is-sleeping):not(.is-crying) .cat-eyes-open{ opacity: 0; }
.app[data-cat-face="green"]:not(.is-sleeping):not(.is-crying) .cat-eyes-love{ opacity: 1; }
.app[data-cat-face="green"]:not(.is-sleeping):not(.is-crying) .cat-blush{ opacity: 1; }
.app[data-cat-face="green"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-mouth{ opacity: 0; }
.app[data-cat-face="green"]:not(.is-responding):not(.is-greeting):not(.is-crying):not(.is-sleeping) .cat-smile{ opacity: 1; }

/* Responding state: more bounce + mouth open */
.app.is-responding .cat-wrap{ animation-duration: 0.72s; }
.app.is-responding .shadow{ animation-duration: 0.72s; }
.app.is-responding .cat-tail{ animation-duration: 0.55s; }
.app.is-responding .cat-mouth{ animation: talkClose 0.26s steps(1, end) infinite; }
.app.is-responding .cat-mouth-open{ animation: talkOpen 0.26s steps(1, end) infinite; }
.app.is-responding .wire{ opacity: 0.95; }
.app.is-responding .bulb{ animation-duration: 1.2s; }

/* Greeting: keyword "hi" */
.app.is-greeting .cat-mouth{ opacity: 0; animation: none !important; }
.app.is-greeting .cat-mouth-open{ opacity: 0; animation: none !important; }
.app.is-greeting .cat-smile{ opacity: 1; }
.app.is-greeting .cat-paw-right{
  animation: pawWave 0.34s steps(2, end) infinite;
}
@keyframes pawWave{
  0%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-3px) rotate(-18deg); }
  100%{ transform: translateY(0) rotate(0deg); }
}

/* Crying: keywords ugly/lame/bad (and moche/nul) */
.app.is-crying .tears{
  opacity: 1;
}
.app.is-crying .tears::before,
.app.is-crying .tears::after{
  animation: tearDrop 0.7s steps(2, end) infinite;
  opacity: 1;
}
.app.is-crying .tears::after{
  animation-delay: 0.18s;
}
.app.is-crying .cat-mouth{ opacity: 0; animation: none !important; }
.app.is-crying .cat-mouth-open{ opacity: 0; animation: none !important; }
.app.is-crying .cat-smile{ opacity: 0; }
.app.is-crying .cat-frown{ opacity: 1; }
.app.is-crying .cat-wrap{
  animation-duration: 2.8s;
  filter: saturate(0.9) contrast(0.98);
}
@keyframes tearDrop{
  0%{ transform: translateY(0); opacity: 0; }
  20%{ opacity: 1; }
  100%{ transform: translateY(18px); opacity: 0; }
}

/* Sleeping */
.app.is-sleeping .cat-wrap{
  animation-duration: 4.2s;
  filter: saturate(0.88);
}
.app.is-sleeping .shadow{
  animation-duration: 4.2s;
  opacity: 0.5;
}
.app.is-sleeping .cat-eyes-open{ opacity: 0; }
.app.is-sleeping .cat-eyes-sleep{ opacity: 1; }
.app.is-sleeping .cat-mouth{ opacity: 1 !important; animation: none !important; }
.app.is-sleeping .cat-mouth-open{ opacity: 0 !important; animation: none !important; }
.app.is-sleeping .cat-wrap::after{
  content: "zzz";
  position:absolute;
  right: 10px;
  top: 22px;
  font-weight: 900;
  font-size: 14px;
  color: rgba(255,79,163,0.75);
  text-shadow: 0 10px 18px rgba(0,0,0,0.18);
  transform: rotate(-10deg);
}

/* Night theme (black/pink) */
body[data-theme="night"]{
  --text: #f7eff4;
  --muted: #cbb7c3;
  --line: rgba(255,255,255,0.12);
  --roomWall: #1a0a13;
  --roomWall2: #12060d;
  --floor: #12070e;
  --floor2: #090308;
  --roomGlow1: rgba(255,79,163,0.12);
  --roomGlow2: rgba(255,31,134,0.10);
  --windowGlow: rgba(255,79,163,0.20);
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(255,79,163,0.20), transparent 58%),
    radial-gradient(1100px 800px at 90% 10%, rgba(255,31,134,0.18), transparent 60%),
    radial-gradient(1400px 1000px at 50% 105%, rgba(255,79,163,0.10), transparent 60%),
    linear-gradient(180deg, #050007, #0a0011 55%, #050008);
}

/* Room palettes that harmonize with the mutated cat (Day theme only). */
body[data-theme="day"] .app[data-cat-face="grey"]{
  --roomWall:#f6f3ea;
  --roomWall2:#d8d2c4;
  --floor:#c28b5a;
  --floor2:#9a6336;
  --roomGlow1: rgba(46,229,157,0.14);   /* green */
  --roomGlow2: rgba(255,255,255,0.10);  /* white */
  --windowGlow: rgba(46,229,157,0.22);
}
body[data-theme="day"] .app[data-cat-face="beige"]{
  --roomWall:#ffe8d4;
  --roomWall2:#f2cda8;
  --floor:#e0aa7a;
  --floor2:#c58555;
  --roomGlow1: rgba(255,255,255,0.12);
  --roomGlow2: rgba(255,79,163,0.10);
  --windowGlow: rgba(255,255,255,0.18);
}
body[data-theme="day"] .app[data-cat-face="blue"]{
  --roomWall:#deefff;
  --roomWall2:#b8d4ff;
  --floor:#9fb8d6;
  --floor2:#718eae;
  --roomGlow1: rgba(90,163,255,0.16);
  --roomGlow2: rgba(255,255,255,0.08);
  --windowGlow: rgba(90,163,255,0.24);
}
body[data-theme="day"] .app[data-cat-face="red"]{
  --roomWall:#ffe1e4;
  --roomWall2:#f3a7ac;
  --floor:#d98b91;
  --floor2:#b76066;
  --roomGlow1: rgba(232,92,99,0.14);
  --roomGlow2: rgba(255,255,255,0.08);
  --windowGlow: rgba(232,92,99,0.22);
}
body[data-theme="day"] .app[data-cat-face="green"]{
  --roomWall:#e5ffed;
  --roomWall2:#bfead0;
  --floor:#a7d9bb;
  --floor2:#77b693;
  --roomGlow1: rgba(46,229,157,0.16);
  --roomGlow2: rgba(255,255,255,0.08);
  --windowGlow: rgba(46,229,157,0.22); /* mint */
}

/* Day accent swap: keep the background surfaces pink/white, only recolor the pink highlights. */
body[data-theme="day"][data-cat-face="grey"]{
  --accent: #b8bcc6;
  --accent2: #e0e3ee;
  --uiAccentGlow: rgba(184,188,198,0.24);
  --uiAccentBorderSoft: rgba(184,188,198,0.28);
  --uiAccentBorder: rgba(184,188,198,0.42);
  --uiAccentBorderStrong: rgba(184,188,198,0.70);
  --uiAccentRingSoft: rgba(184,188,198,0.08);
  --uiAccentRing: rgba(184,188,198,0.12);
  --uiAccentShadow: rgba(184,188,198,0.14);
  --uiAccentShadowStrong: rgba(184,188,198,0.22);
  --uiAccentText: rgba(86,92,110,0.92);
}
body[data-theme="day"][data-cat-face="beige"]{
  --accent: #e6a86f;
  --accent2: #f6c59c;
  --uiAccentGlow: rgba(230,168,111,0.24);
  --uiAccentBorderSoft: rgba(230,168,111,0.28);
  --uiAccentBorder: rgba(230,168,111,0.42);
  --uiAccentBorderStrong: rgba(230,168,111,0.70);
  --uiAccentRingSoft: rgba(230,168,111,0.08);
  --uiAccentRing: rgba(230,168,111,0.12);
  --uiAccentShadow: rgba(230,168,111,0.14);
  --uiAccentShadowStrong: rgba(230,168,111,0.22);
  --uiAccentText: rgba(165,103,52,0.92);
}
body[data-theme="day"][data-cat-face="blue"]{
  --accent: #5aa3ff;
  --accent2: #8bc1ff;
  --uiAccentGlow: rgba(90,163,255,0.24);
  --uiAccentBorderSoft: rgba(90,163,255,0.28);
  --uiAccentBorder: rgba(90,163,255,0.42);
  --uiAccentBorderStrong: rgba(90,163,255,0.72);
  --uiAccentRingSoft: rgba(90,163,255,0.08);
  --uiAccentRing: rgba(90,163,255,0.12);
  --uiAccentShadow: rgba(90,163,255,0.14);
  --uiAccentShadowStrong: rgba(90,163,255,0.22);
  --uiAccentText: rgba(30,98,185,0.94);
}
body[data-theme="day"][data-cat-face="red"]{
  --accent: #e85c63;
  --accent2: #ff8aa0;
  --uiAccentGlow: rgba(232,92,99,0.24);
  --uiAccentBorderSoft: rgba(232,92,99,0.28);
  --uiAccentBorder: rgba(232,92,99,0.42);
  --uiAccentBorderStrong: rgba(232,92,99,0.72);
  --uiAccentRingSoft: rgba(232,92,99,0.08);
  --uiAccentRing: rgba(232,92,99,0.12);
  --uiAccentShadow: rgba(232,92,99,0.14);
  --uiAccentShadowStrong: rgba(232,92,99,0.22);
  --uiAccentText: rgba(170,44,52,0.94);
}
body[data-theme="day"][data-cat-face="green"]{
  --accent: #39c97c;
  --accent2: #86f0bd;
  --uiAccentGlow: rgba(57,201,124,0.24);
  --uiAccentBorderSoft: rgba(57,201,124,0.28);
  --uiAccentBorder: rgba(57,201,124,0.42);
  --uiAccentBorderStrong: rgba(57,201,124,0.72);
  --uiAccentRingSoft: rgba(57,201,124,0.08);
  --uiAccentRing: rgba(57,201,124,0.12);
  --uiAccentShadow: rgba(57,201,124,0.14);
  --uiAccentShadowStrong: rgba(57,201,124,0.22);
  --uiAccentText: rgba(25,120,70,0.94);
}
body[data-theme="night"] .sidebar,
body[data-theme="night"] .right{
  background:
    radial-gradient(900px 260px at 20% 0%, rgba(255,79,163,0.14), transparent 60%),
    linear-gradient(180deg, rgba(18,6,14,0.78), rgba(8,2,6,0.68));
  box-shadow: 0 18px 44px rgba(0,0,0,0.40);
}
body[data-theme="night"] .chat-item{
  background: rgba(0,0,0,0.22);
  border-color: rgba(255,255,255,0.12);
  color: var(--text);
}
body[data-theme="night"] .msg{
  background: rgba(0,0,0,0.22);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 12px 20px rgba(0,0,0,0.26);
}
body[data-theme="night"] .msg-user{
  background: rgba(0,0,0,0.22);
  border-color: rgba(255,79,163,0.35);
  box-shadow: 0 12px 20px rgba(0,0,0,0.26);
}
body[data-theme="night"] .prompt{
  background: rgba(0,0,0,0.20);
  border-color: rgba(255,255,255,0.14);
  color: var(--text);
}
body[data-theme="night"] .composer{
  background:
    radial-gradient(900px 180px at 20% 0%, rgba(255,79,163,0.12), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.28));
}
body[data-theme="night"] .btn{
  background: rgba(0,0,0,0.18);
  border-color: rgba(255,255,255,0.14);
  color: var(--text);
}
/* Ensure theme icon stays highly visible in both modes. */
body[data-theme="night"] .btn.theme-toggle{ color: rgba(255,255,255,0.96); }
body[data-theme="day"] .btn.theme-toggle{ color: #ff4fa3; }
body[data-theme="night"] .btn.music-toggle{ color: rgba(255,255,255,0.96); }
body[data-theme="day"] .btn.music-toggle{ color: #ff4fa3; }

/* Keep primary/premium buttons vibrant in Night theme and make subtext readable. */
body[data-theme="night"] .btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: var(--uiAccentBorderStrong);
  color: rgba(255,255,255,0.96);
}
body[data-theme="night"] .btn-pay{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: var(--uiAccentBorderStrong);
  color: rgba(255,255,255,0.98);
}
body[data-theme="night"] .btn-pay__label,
body[data-theme="night"] .btn-pay__sub{
  color: rgba(255,255,255,0.94);
  text-shadow: 0 2px 0 rgba(0,0,0,0.22);
}
body[data-theme="night"] .status{
  background: rgba(0,0,0,0.18);
  border-color: rgba(255,255,255,0.14);
}
body[data-theme="night"] .side-top,
body[data-theme="night"] .side-bottom{
  background:
    radial-gradient(900px 180px at 20% 0%, rgba(255,79,163,0.14), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.28));
}
body[data-theme="night"] .wire{
  background: linear-gradient(90deg, rgba(255,255,255,0.20), rgba(255,255,255,0.08));
}
body[data-theme="night"] .wallet{
  border-top: 1px dashed rgba(255,255,255,0.16);
}
body[data-theme="night"] .catalog-btn{
  opacity: 1;
}

/* Catalog modal */
.modal{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 50;
}
.modal.is-open{
  opacity: 1;
  pointer-events: auto;
}
.modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(12,10,16,0.35);
  backdrop-filter: blur(2px);
}
.modal-card{
  position: relative;
  width: min(560px, calc(100% - 24px));
  border-radius: 18px;
  border: 1px solid rgba(27,17,22,0.14);
  background:
    radial-gradient(700px 220px at 20% 0%, rgba(255,79,163,0.10), transparent 55%),
    linear-gradient(180deg, var(--uiModalA), var(--uiModalB));
  box-shadow: 0 22px 56px rgba(0,0,0,0.22);
  overflow: hidden;
}
.modal-card--small{
  width: min(420px, calc(100% - 24px));
}
.modal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-title{
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: rgba(27,17,22,0.78);
}
.modal-close{ padding: 8px 10px; font-size: 12px; }
.modal-body{
  padding: 12px 14px 14px;
}
.catalog-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.catalog-item{
  appearance:none;
  text-align:left;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(27,17,22,0.12);
  background: var(--uiSurfaceMsg);
  color: inherit;
}
.catalog-item--selectable{
  cursor: pointer;
  transition: transform 120ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.catalog-item--selectable:hover{
  transform: translateY(-1px);
  border-color: var(--uiAccentBorderSoft);
  box-shadow: 0 12px 26px rgba(0,0,0,0.10);
}
.catalog-item--selectable:active{
  transform: translateY(0px);
}
.catalog-item--selectable:focus-visible{
  outline: none;
  border-color: var(--uiAccentBorderStrong);
  box-shadow: 0 0 0 6px var(--uiAccentRing);
}
.catalog-item[disabled]{
  opacity: 0.60;
  cursor: not-allowed;
}
.catalog-head{
  width: 22px;
  height: 18px;
  border-radius: 3px;
  box-shadow: 0 10px 18px rgba(0,0,0,0.10);
}
.catalog-name{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.catalog-rate{
  margin-left: auto;
  font-size: 12px;
  font-weight: 900;
  color: rgba(27,17,22,0.70);
}
.modal-note{
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.85;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.confirm-text{
  text-align: center;
  font-size: 12px;
  color: rgba(27,17,22,0.70);
  margin-top: 2px;
}
.confirm-actions{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}
.confirm-actions .btn{
  flex: 1;
}

body[data-theme="night"] .modal-card{
  border-color: rgba(255,255,255,0.14);
  background:
    radial-gradient(700px 220px at 20% 0%, rgba(255,79,163,0.12), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.22), rgba(0,0,0,0.34));
  box-shadow: 0 22px 56px rgba(0,0,0,0.45);
}
body[data-theme="night"] .modal-title{ color: rgba(247,239,244,0.86); }
body[data-theme="night"] .catalog-item{
  border-color: rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
}
body[data-theme="night"] .catalog-rate{ color: rgba(247,239,244,0.74); }
body[data-theme="night"] .confirm-text{ color: rgba(247,239,244,0.78); }

@media (max-width: 1100px){
  body{ overflow:auto; }
  .app{
    grid-template-columns: 260px minmax(360px, 1fr) 340px;
    height: auto;
    min-height: 100%;
  }
  .room{ height: 520px; }
}

@media (max-width: 980px){
  body{ overflow:auto; }
  .app{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 100%;
  }
  /* Mobile reading flow: chats first, then the cat room, then the request/payment panel. */
  .sidebar{ order: 1; }
  .stage{ order: 2; }
  .right{ order: 3; }

  /* Keep the chat window fixed-height; scroll messages inside. */
  .right{
    height: calc(72vh - 32px);
    max-height: calc(72vh - 32px);
    height: calc(72dvh - 32px);
    max-height: calc(72dvh - 32px);
  }
  .right .right-top{ order: 1; }
  .right .output{
    order: 2;
    height: auto;
    flex: 1 1 auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .right .thinking{ order: 3; }
  .right .composer{ order: 4; }
  .right .wallet{
    order: 5;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  /* Saved chats are hidden by default on small screens (use the arrow to show them). */
  .chats-toggle{ display: grid; }
  #chatList{ display: none; }
  .sidebar.is-chats-open #chatList{
    display:flex;
    max-height: 280px;
    overflow:auto;
  }

  /* Make the top bar more compact on mobile/tablet widths. */
  .side-top{ padding: 12px 12px 10px; }
  .side-actions{ gap: 6px; }
  .room{ height: 480px; }
  .output{ height: auto; }
}

/* Phone layout: prevent room props from overlapping too much. */
@media (max-width: 520px){
  .app{ padding: 10px; gap: 10px; }

  .room{ height: 372px; }

  .right{
    height: calc(72vh - 20px);
    max-height: calc(72vh - 20px);
    height: calc(72dvh - 20px);
    max-height: calc(72dvh - 20px);
  }

  /* Hide the "MEOW / room tour" poster on phones to reduce clutter. */
  .poster{ display:none; }

  .wall-art{
    inset: 50px 12px auto 12px;
    gap: 12px;
  }
  .window{
    width: 150px;
    height: 110px;
    border-radius: 16px;
  }
  .clock{
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }
  .clock-face{ inset: 8px; border-radius: 14px; }
  .clock .hand.hour{ height: 16px; }
  .clock .hand.minute{ height: 22px; }
  .clock .hand.second{ height: 26px; }

  .lights{
    left: 12px;
    right: 12px;
    top: 12px;
    height: 32px;
  }
  .bulb{
    width: 11px;
    height: 15px;
    top: 8px;
  }

  .props{
    bottom: 8%;
    height: 40%;
  }
  .cat-tree{
    left: 3%;
    bottom: 3%;
    width: 150px;
    height: 190px;
    transform: scale(0.74);
    transform-origin: left bottom;
    filter: drop-shadow(0 12px 14px rgba(0,0,0,0.20));
  }
  .plant{
    right: 3%;
    bottom: 3%;
    width: 120px;
    height: 160px;
    transform: scale(0.74);
    transform-origin: right bottom;
    filter: drop-shadow(0 12px 14px rgba(0,0,0,0.30));
  }

  .cat-wrap{
    width: 204px;
    height: 204px;
    bottom: 12%;
  }

  /* Party overlays: keep them inside the smaller room. */
  .party-notes{ width: 280px; height: 200px; bottom: 30%; }
  .disco-chain{ height: 38px; }
  .disco-ball{ width: 56px; height: 56px; }

  /* Tighten UI spacing on small screens. */
  .side-top{ padding: 6px 10px 6px; }
  .brand{ gap: 8px; }
  .brand-mark{ width: 28px; height: 28px; border-radius: 9px; }
  .brand-mark::before{ left: 5px; }
  .brand-mark::after{ right: 5px; }
  .brand-name{ font-size: 13px; }
  .brand-sub{ display:none; }
  .side-actions{ gap: 4px; }
  #newChatBtn{ height: 32px; padding: 0 8px; font-size: 11px; }
  .icon-btn{ width: 32px; height: 32px; }
  .ico{ width: 17px; height: 17px; }
  /* Bottom settings buttons are text now: keep them compact. */
  .side-bottom .btn{ font-size: 12px; padding: 9px 10px; border-radius: 13px; }
  .audio-hint--sidebar{ padding: 6px 10px 8px; font-size: 10px; }
  .chat-list{ padding: 10px; }
  .chat-item{ padding: 9px 10px; }
  .chat-title{ font-size: 12px; }
  .chat-snippet{ font-size: 11px; }

  .right-top{ padding: 12px 12px 10px; }
  .status{ right: 12px; top: 12px; padding: 6px 9px; font-size: 11px; }
  .output{ padding: 12px; height: auto; }
  .msg{ padding: 10px 10px; }
  .msg-user{ margin-left: 16px; }
  .msg-assistant{ margin-right: 16px; }
  .msg-text{ font-size: 13px; }

  .composer{ padding: 10px 12px 12px; gap: 8px; }
  .prompt{ border-radius: 12px; padding: 9px 9px; }

  .wallet{ padding: 10px 12px 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .wallet .btn + .btn{ margin-top: 8px; }

  .btn{ padding: 9px 10px; font-size: 12px; border-radius: 11px; }
  .btn-ghost{ padding: 8px 10px; font-size: 12px; }
  .btn-pay{ padding: 11px 10px; border-radius: 13px; }
  .btn-pay__label{ font-size: 12px; }
  .btn-pay__sub{ font-size: 10px; }
}
.pixel-head{
  width: 18px;
  height: 14px;
  image-rendering: pixelated;
  background: var(--h1, var(--cat1));
  border-radius: 2px;
  position: relative;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.pixel-head::before{
  content:"";
  position:absolute;
  left: 2px;
  top: -3px;
  width: 5px;
  height: 4px;
  background: var(--h1, var(--cat1));
  box-shadow:
    9px 0 0 0 var(--h1, var(--cat1)),
    0px 3px 0 0 var(--h2, var(--cat2)),
    9px 3px 0 0 var(--h2, var(--cat2));
}
.pixel-head::after{
  content:"";
  position:absolute;
  left: 4px;
  top: 5px;
  width: 2px;
  height: 2px;
  background: rgba(10,10,16,0.75);
  box-shadow:
    8px 0 0 0 rgba(10,10,16,0.75),
    4px 3px 0 0 rgba(10,10,16,0.75);
  border-radius: 1px;
}
