:root {
  color-scheme: dark;
  --bg: #09060c;
  --panel: rgba(18, 12, 24, 0.88);
  --panel-solid: #120c18;
  --panel-raised: #191020;
  --border: rgba(207, 164, 231, 0.16);
  --border-strong: rgba(219, 174, 245, 0.3);
  --text: #f4edf6;
  --muted: #a99bad;
  --muted-2: #756a79;
  --violet: #c785ee;
  --violet-light: #e1b0ff;
  --pink: #e76c9d;
  --pink-soft: #ff9bbe;
  --wine: #6b2649;
  --success: #8bd6ad;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 47% -15%, rgba(112, 46, 139, 0.22), transparent 38%),
    linear-gradient(180deg, #0e0912 0%, var(--bg) 42%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.075;
  pointer-events: none;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--violet-light);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: 18%;
  left: -17rem;
  background: #8a3d9d;
}

.ambient-two {
  right: -19rem;
  bottom: 4%;
  background: #7b1f52;
}

.topbar {
  display: flex;
  width: min(1500px, calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(210, 150, 241, 0.32);
  border-radius: 50%;
  background: rgba(98, 47, 120, 0.17);
  color: var(--violet-light);
  font-size: 23px;
  box-shadow: inset 0 0 20px rgba(191, 102, 230, 0.08);
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.23em;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar-actions,
.points-display,
.shop-trigger {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 12px;
}

.sound-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sound-trigger,
.sound-settings-trigger {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.sound-trigger {
  min-width: 105px;
  padding: 0 13px;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
}

.sound-trigger span:first-child {
  color: var(--violet-light);
  font-size: 17px;
}

.sound-trigger.active {
  border-color: rgba(139, 214, 173, 0.34);
  color: #c8edd7;
  background: rgba(63, 119, 84, 0.1);
}

.sound-settings-trigger {
  width: 34px;
  min-height: 45px;
  font-size: 19px;
}

.sound-trigger:hover,
.sound-settings-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(151, 82, 177, 0.08);
}

.sound-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 310px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(17, 10, 22, 0.98);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(22px);
}

.sound-panel[hidden] {
  display: none;
}

.sound-panel-heading,
.volume-control,
.sound-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sound-panel-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sound-panel-heading .eyebrow {
  display: block;
  margin-bottom: 3px;
}

.sound-panel-heading strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 400;
}

#audio-state-label {
  color: var(--success);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.volume-control {
  padding: 14px 0;
  gap: 14px;
  color: var(--muted);
  font-size: 9px;
}

.volume-control input {
  width: 132px;
  accent-color: var(--violet);
}

.sound-switch {
  padding: 10px 0;
  gap: 15px;
  border-top: 1px solid rgba(207, 164, 231, 0.08);
}

.sound-switch span,
.sound-switch b,
.sound-switch small {
  display: block;
}

.sound-switch b {
  font-size: 10px;
}

.sound-switch small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 400;
}

.sound-switch input {
  width: 32px;
  height: 18px;
  flex: 0 0 32px;
  accent-color: var(--violet);
}

.sound-panel > p {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.45;
}

.points-display {
  min-width: 126px;
  gap: 10px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}

.heart-icon {
  color: var(--pink);
  font-size: 19px;
  filter: drop-shadow(0 0 8px rgba(231, 108, 157, 0.45));
}

.points-display strong,
.points-display small {
  display: block;
}

.points-display strong {
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
}

.points-display small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.shop-trigger {
  min-height: 45px;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid rgba(209, 146, 239, 0.38);
  border-radius: 8px;
  background: #24132f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.shop-trigger:hover {
  border-color: var(--violet);
  background: #31183f;
  transform: translateY(-1px);
}

.shop-trigger span:first-child {
  color: var(--pink-soft);
}

.app-shell {
  display: grid;
  width: min(1500px, calc(100% - 48px));
  margin: 28px auto 40px;
  grid-template-columns: 290px minmax(420px, 1fr) 390px;
  gap: 22px;
  align-items: stretch;
}

.side-column,
.character-column {
  min-width: 0;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 10px 42px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(14px);
}

.intro-panel {
  padding: 23px 22px 21px;
  background:
    linear-gradient(150deg, rgba(80, 34, 91, 0.14), transparent 58%),
    var(--panel);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--violet);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.intro-panel h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(25px, 2vw, 34px);
  font-weight: 400;
  line-height: 1.04;
}

.intro-panel h1 em {
  color: #e9c7f6;
  font-weight: 400;
}

.muted-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.actions-panel {
  flex: 1;
  padding: 20px;
}

.panel-heading,
.relationship-topline,
.relationship-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading h2,
.relationship-panel h2,
.chat-header h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
}

.panel-heading h2 {
  font-size: 20px;
}

.mini-badge {
  padding: 5px 7px;
  border: 1px solid rgba(231, 108, 157, 0.21);
  border-radius: 5px;
  color: var(--pink-soft);
  background: rgba(111, 39, 71, 0.12);
  font-size: 9px;
}

.action-list {
  display: flex;
  margin-top: 17px;
  flex-direction: column;
  gap: 9px;
}

.action-divider {
  display: flex;
  margin: 4px 0 1px;
  align-items: center;
  gap: 9px;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.action-divider::before,
.action-divider::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.action-card {
  display: grid;
  min-height: 68px;
  padding: 11px 11px 11px 10px;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(211, 177, 225, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.action-card:hover {
  border-color: rgba(207, 134, 239, 0.42);
  background: rgba(143, 75, 164, 0.09);
  transform: translateX(3px);
}

.action-card:active {
  transform: translateX(3px) scale(0.985);
}

.action-card.featured {
  border-color: rgba(225, 112, 155, 0.24);
  background: rgba(112, 41, 72, 0.08);
}

.action-card.intimate:not(.locked) {
  border-color: rgba(199, 133, 238, 0.22);
  background: rgba(114, 61, 137, 0.06);
}

.action-card.locked {
  border-style: dashed;
  cursor: pointer;
  opacity: 0.57;
}

.action-card.locked:hover {
  border-color: rgba(231, 108, 157, 0.36);
  background: rgba(112, 41, 72, 0.06);
  transform: none;
}

.action-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--violet-light);
  background: rgba(117, 62, 139, 0.14);
  font-family: var(--display);
  font-size: 20px;
}

.featured .action-symbol {
  color: var(--pink-soft);
}

.action-copy strong,
.action-copy small {
  display: block;
}

.action-copy strong {
  font-size: 11px;
  font-weight: 700;
}

.action-copy small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.3;
}

.reward {
  display: flex;
  min-width: 30px;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--pink-soft);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.reward small {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
}

.action-card:not(.locked) .reward small {
  color: var(--success);
}

.relationship-panel {
  padding: 18px 19px;
}

.relationship-topline {
  color: var(--muted-2);
  font-size: 9px;
}

.relationship-topline .eyebrow {
  margin: 0;
}

.relationship-name-row {
  margin-top: 8px;
}

.relationship-panel h2 {
  font-size: 22px;
}

#relationship-orb {
  color: var(--violet-light);
  font-size: 21px;
}

.progress-track {
  height: 4px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 8px;
  background: #2c2130;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--violet-light));
  box-shadow: 0 0 12px rgba(208, 124, 238, 0.45);
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.relationship-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.character-column {
  display: flex;
  min-height: 680px;
  flex-direction: column;
  gap: 14px;
}

.character-frame {
  position: relative;
  flex: 1;
  min-height: 614px;
  overflow: hidden;
  border: 1px solid rgba(218, 172, 239, 0.23);
  border-radius: 18px;
  background: #140f1c;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  isolation: isolate;
}

.character-frame > .raven-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  opacity: 1;
  transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1), filter 500ms ease, opacity 240ms ease;
}

.character-frame.reacting > .raven-image {
  transform: scale(1.012);
  filter: saturate(1.07) brightness(1.03);
}

.character-frame.portrait-switching > .raven-image {
  opacity: 0.16;
  transform: scale(1.018);
  filter: saturate(1.18) blur(2px);
}

.portrait-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 4, 10, 0.13) 0%, transparent 28%, transparent 57%, rgba(8, 4, 11, 0.94) 100%),
    linear-gradient(90deg, rgba(5, 2, 8, 0.18), transparent 25%, transparent 75%, rgba(5, 2, 8, 0.18));
  pointer-events: none;
}

.online-chip {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(11, 7, 14, 0.56);
  backdrop-filter: blur(12px);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.online-chip span,
.presence-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(139, 214, 173, 0.7);
}

.reaction-bubble {
  position: absolute;
  top: 22px;
  right: 20px;
  z-index: 3;
  width: min(260px, 45%);
  padding: 13px 15px 13px 35px;
  border: 1px solid rgba(225, 189, 238, 0.2);
  border-radius: 11px 11px 2px 11px;
  background: rgba(12, 7, 16, 0.76);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(15px);
  transform-origin: bottom right;
  transition: opacity 200ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reaction-bubble.hidden {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}

.reaction-bubble p {
  margin: 0;
  color: #f1e4f4;
  font-family: var(--display);
  font-size: 13px;
  font-style: italic;
  line-height: 1.45;
}

.quote-mark {
  position: absolute;
  top: 8px;
  left: 13px;
  color: var(--pink);
  font-family: var(--display);
  font-size: 26px;
}

.pendant-hotspot {
  position: absolute;
  top: 49%;
  left: 50%;
  z-index: 4;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(231, 207, 245, 0.22);
  border-radius: 50%;
  background: rgba(20, 10, 29, 0.25);
  cursor: pointer;
  opacity: 0.18;
  transform: translate(-50%, -50%);
  transition: opacity 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.pendant-hotspot:hover {
  background: rgba(131, 71, 153, 0.45);
  box-shadow: 0 0 25px rgba(209, 139, 240, 0.5);
  opacity: 1;
}

.pendant-hotspot span {
  color: #f1d2ff;
  font-size: 15px;
}

.character-caption {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.character-caption .eyebrow {
  margin-bottom: 3px;
  color: rgba(238, 213, 247, 0.65);
}

.character-caption h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(35px, 4vw, 54px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.92;
  text-shadow: 0 4px 20px #000;
}

.mood-label {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  text-align: right;
}

.mood-label span,
.mood-label strong {
  display: block;
}

.mood-label span {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.mood-label strong {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
}

.now-playing {
  display: flex;
  min-height: 60px;
  padding: 10px 15px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.vinyl {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #1b1420 0 3px, #2b2130 4px 5px);
  animation: spin 7s linear infinite;
}

.vinyl::after,
.vinyl i {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.vinyl::after {
  width: 12px;
  height: 12px;
  background: var(--wine);
}

.vinyl i {
  z-index: 1;
  width: 3px;
  height: 3px;
  background: #e4c8eb;
}

.now-playing-copy {
  min-width: 0;
  margin-left: 11px;
}

.now-playing-copy small,
.now-playing-copy strong {
  display: block;
}

.now-playing-copy small {
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.now-playing-copy strong {
  margin-top: 3px;
  overflow: hidden;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equalizer {
  display: flex;
  height: 21px;
  margin-left: auto;
  align-items: end;
  gap: 3px;
}

.equalizer i {
  width: 2px;
  height: 35%;
  background: var(--violet);
  animation: equalize 1.1s ease-in-out infinite alternate;
}

.equalizer i:nth-child(2) { animation-delay: -0.3s; }
.equalizer i:nth-child(3) { animation-delay: -0.8s; }
.equalizer i:nth-child(4) { animation-delay: -0.5s; }

.chat-column {
  min-height: 680px;
}

.chat-panel {
  display: flex;
  height: 100%;
  min-height: 680px;
  overflow: hidden;
  flex-direction: column;
}

.chat-header {
  display: flex;
  padding: 17px 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.5);
}

.chat-header h2 {
  font-size: 18px;
}

.chat-header p {
  display: flex;
  margin: 4px 0 0;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 9px;
}

.presence-dot {
  display: inline-block;
}

.icon-button,
.close-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 16px;
}

.icon-button:hover,
.close-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(189, 118, 219, 0.08);
}

.messages {
  display: flex;
  min-height: 260px;
  padding: 19px 17px 10px;
  overflow-y: auto;
  flex: 1;
  flex-direction: column;
  gap: 15px;
  scrollbar-color: #42294c transparent;
  scrollbar-width: thin;
}

.message {
  display: flex;
  max-width: 88%;
  flex-direction: column;
  animation: message-in 350ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message.raven {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message-bubble {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 3px 12px 12px 12px;
  background: #1a1220;
  color: #e9dfec;
  font-size: 11px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.message.user .message-bubble {
  border-color: rgba(204, 137, 235, 0.23);
  border-radius: 12px 3px 12px 12px;
  background: #2c1735;
  color: #f7eff9;
}

.message-meta {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.typing-bubble {
  display: flex;
  width: 55px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.typing-bubble i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet-light);
  animation: typing 1s ease-in-out infinite;
}

.typing-bubble i:nth-child(2) { animation-delay: 120ms; }
.typing-bubble i:nth-child(3) { animation-delay: 240ms; }

.suggestions {
  display: flex;
  padding: 8px 15px 10px;
  overflow-x: auto;
  gap: 6px;
  scrollbar-width: none;
}

.suggestions::-webkit-scrollbar {
  display: none;
}

.suggestions button {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.suggestions button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chat-form {
  display: flex;
  margin: 0 14px;
  padding: 7px 7px 7px 12px;
  align-items: end;
  gap: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: rgba(7, 4, 10, 0.44);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.chat-form:focus-within {
  border-color: rgba(209, 140, 239, 0.64);
  box-shadow: 0 0 0 3px rgba(186, 108, 219, 0.07);
}

.chat-form textarea {
  width: 100%;
  max-height: 100px;
  min-height: 34px;
  padding: 8px 0 4px;
  resize: none;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 11px;
  line-height: 1.4;
}

.chat-form textarea::placeholder {
  color: #6f6373;
}

.chat-form button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(225, 170, 245, 0.25);
  border-radius: 8px;
  background: #5a2c6c;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.chat-form button:hover {
  background: #75408a;
  transform: translateY(-1px);
}

.chat-form button:disabled {
  cursor: wait;
  opacity: 0.5;
  transform: none;
}

.chat-note {
  margin: 9px 14px 13px;
  color: #665b69;
  font-size: 8px;
  text-align: center;
}

.mobile-nav {
  display: none;
}

.shop-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  color: var(--text);
  background: var(--panel-solid);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.72);
}

.activity-dialog {
  width: min(650px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(219, 174, 245, 0.34);
  border-radius: 18px;
  color: var(--text);
  background: #110b16;
  box-shadow: 0 34px 130px rgba(0, 0, 0, 0.78);
}

.activity-dialog::backdrop {
  background: rgba(4, 2, 6, 0.84);
  backdrop-filter: blur(14px);
}

.activity-surface {
  padding: 26px;
  background:
    radial-gradient(circle at 50% 20%, rgba(125, 59, 148, 0.15), transparent 42%),
    #110b16;
}

.activity-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.activity-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(29px, 5vw, 43px);
  font-weight: 400;
}

.activity-progress {
  display: grid;
  margin: 19px 0 22px;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.activity-progress span {
  height: 3px;
  border-radius: 4px;
  background: #2a1d2e;
  transition: background 300ms ease, box-shadow 300ms ease;
}

.activity-dialog[data-stage="choice"] .activity-progress span:first-child,
.activity-dialog[data-stage="result"] .activity-progress span {
  background: var(--violet);
  box-shadow: 0 0 10px rgba(199, 133, 238, 0.34);
}

.activity-glyph {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 17px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--violet-light);
  background: rgba(123, 61, 145, 0.13);
  font-family: var(--display);
  font-size: 28px;
  box-shadow: 0 0 32px rgba(179, 92, 214, 0.09);
}

.activity-scene > p {
  max-width: 510px;
  min-height: 58px;
  margin: 0 auto 21px;
  color: #e9deec;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.62;
  text-align: center;
}

.activity-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.activity-choices button {
  min-height: 54px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-size: 10px;
  line-height: 1.35;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.activity-choices button:hover {
  border-color: var(--violet);
  background: rgba(138, 71, 162, 0.12);
  transform: translateY(-1px);
}

.activity-dialog[data-stage="result"] .activity-choices {
  grid-template-columns: 1fr;
}

.activity-dialog[data-stage="result"] .activity-choices button {
  border-color: rgba(139, 214, 173, 0.25);
  color: #c8edd7;
  background: rgba(63, 119, 84, 0.09);
}

.activity-footer {
  display: flex;
  margin-top: 19px;
  padding-top: 13px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.05em;
}

#activity-stakes {
  color: var(--pink-soft);
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.shop-dialog::backdrop {
  background: rgba(4, 2, 6, 0.78);
  backdrop-filter: blur(10px);
}

.shop-surface {
  max-height: calc(100dvh - 48px);
  padding: 27px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 100% 0%, rgba(123, 59, 145, 0.19), transparent 36%),
    var(--panel-solid);
}

.shop-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.shop-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 400;
}

.shop-header p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.close-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 24px;
  font-weight: 200;
}

.shop-balance {
  display: flex;
  margin: 23px 0 17px;
  padding: 13px 15px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.shop-balance strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
}

.shop-balance strong span:first-child {
  color: var(--pink);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.shop-card {
  display: flex;
  min-height: 260px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 180ms ease, transform 180ms ease;
}

.shop-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.shop-card-visual {
  display: grid;
  min-height: 88px;
  place-items: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at center, rgba(187, 98, 218, 0.18), transparent 55%),
    #130c19;
  color: var(--violet-light);
  font-family: var(--display);
  font-size: 33px;
}

.shop-card-content {
  display: flex;
  padding: 14px;
  flex: 1;
  flex-direction: column;
}

.shop-card-content small {
  color: var(--pink-soft);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.shop-card h3 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
}

.shop-card p {
  margin: 7px 0 15px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.shop-card button {
  width: 100%;
  min-height: 36px;
  margin-top: auto;
  border: 1px solid rgba(206, 139, 237, 0.3);
  border-radius: 7px;
  background: #291533;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shop-card button:hover:not(:disabled) {
  border-color: var(--violet);
  background: #3a1c48;
}

.shop-card button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.shop-card.owned {
  border-color: rgba(139, 214, 173, 0.25);
}

.shop-card.owned button {
  border-color: rgba(139, 214, 173, 0.28);
  color: #b2e9c9;
  background: rgba(54, 111, 78, 0.16);
}

.shop-footnote {
  margin: 17px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 320px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text);
  background: rgba(24, 13, 31, 0.95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 250ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.particle {
  position: absolute;
  z-index: 8;
  color: var(--pink-soft);
  font-size: 15px;
  pointer-events: none;
  animation: float-heart 1.2s ease-out forwards;
}

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

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes equalize { from { height: 25%; } to { height: 95%; } }
@keyframes typing { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float-heart { 0% { opacity: 0; transform: translate(0, 0) scale(0.7) rotate(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--drift), -95px) scale(1.15) rotate(var(--rotate)); } }

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 250px minmax(350px, 1fr) 340px;
    gap: 15px;
  }

  .intro-panel {
    padding: 20px 18px;
  }

  .actions-panel {
    padding: 16px;
  }

  .action-card {
    grid-template-columns: 34px 1fr auto;
    gap: 8px;
  }

  .action-symbol {
    width: 34px;
    height: 34px;
  }

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

@media (max-width: 940px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .topbar {
    width: calc(100% - 28px);
    min-height: 68px;
  }

  .brand-subtitle,
  .shop-trigger,
  .points-display small {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .sound-trigger {
    width: 38px;
    min-width: 38px;
    min-height: 40px;
    padding: 0;
  }

  .sound-trigger span:last-child {
    display: none;
  }

  .sound-settings-trigger {
    width: 30px;
    min-height: 40px;
  }

  .sound-panel {
    position: fixed;
    top: 62px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 15px;
  }

  .points-display {
    min-width: auto;
    padding: 8px 11px;
    border-radius: 8px;
  }

  .points-display strong {
    font-size: 17px;
  }

  .app-shell {
    display: block;
    width: calc(100% - 28px);
    margin: 15px auto 22px;
  }

  [data-mobile-view] {
    display: none;
  }

  body[data-mobile-tab="interactions"] [data-mobile-view="interactions"],
  body[data-mobile-tab="raven"] [data-mobile-view="raven"],
  body[data-mobile-tab="chat"] [data-mobile-view="chat"] {
    display: flex;
  }

  .interactions-column {
    gap: 12px;
  }

  .intro-panel h1 {
    font-size: 31px;
  }

  .actions-panel {
    min-height: auto;
  }

  .action-card {
    min-height: 72px;
  }

  .character-column,
  .chat-column,
  .chat-panel {
    min-height: calc(100dvh - 176px);
  }

  .character-frame {
    min-height: calc(100dvh - 250px);
    max-height: 760px;
  }

  .character-frame > .raven-image {
    object-position: center 21%;
  }

  .chat-panel {
    width: 100%;
  }

  .messages {
    min-height: 380px;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 10;
    display: grid;
    min-height: 59px;
    padding: 5px;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: rgba(17, 10, 22, 0.93);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
  }

  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 9px;
    color: var(--muted-2);
    background: transparent;
    cursor: pointer;
    font-size: 8px;
  }

  .mobile-nav button span {
    font-family: var(--display);
    font-size: 17px;
  }

  .mobile-nav button.active {
    color: var(--violet-light);
    background: rgba(137, 70, 160, 0.15);
  }

  .toast {
    right: 16px;
    bottom: calc(83px + env(safe-area-inset-bottom));
    left: 16px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .character-frame {
    min-height: calc(100dvh - 245px);
  }

  .reaction-bubble {
    top: 66px;
    right: 14px;
    width: min(260px, calc(100% - 28px));
  }

  .character-caption {
    right: 17px;
    bottom: 16px;
    left: 17px;
  }

  .character-caption h2 {
    font-size: 41px;
  }

  .shop-dialog {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
  }

  .shop-surface {
    max-height: calc(100dvh - 18px);
    padding: 20px 15px;
  }

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

  .activity-surface {
    padding: 20px 15px;
  }

  .activity-choices {
    grid-template-columns: 1fr;
  }

  .activity-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .shop-card {
    min-height: 0;
  }

  .shop-card-visual {
    min-height: 68px;
  }
}

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