:root {
  --pink: #ff4fc3;
  --hot: #ff1493;
  --dark: #030104;
  --blood: #d7192f;
  --ink: #fce7ff;
  --muted: #f8a8dc;
  --panel: rgba(14, 3, 16, 0.9);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

#appShell {
  position: relative;
  width: 100vw;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 79, 195, 0.12), transparent 24%),
    linear-gradient(rgba(0,0,0,.32), rgba(0,0,0,.48)),
    url("./assets/lisa-lab-background-real-fast.webp") center / cover no-repeat,
    linear-gradient(#050105, #000);
  isolation: isolate;
}

#scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  transform: translate(-50%, -50%);
  display: block;
  image-rendering: auto;
  touch-action: none;
}

button,
input,
select {
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
}

#mobileHint {
  position: absolute;
  z-index: 29;
  left: 50%;
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 78px));
  transform: translateX(-50%);
  display: none;
  pointer-events: none;
  padding: 7px 12px;
  border: 2px solid rgba(255, 214, 243, 0.72);
  background: rgba(0, 0, 0, 0.62);
  color: #ffd6f3;
  font: 900 12px "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000, 0 0 10px rgba(255,79,195,.85);
  box-shadow: 0 0 20px rgba(255,79,195,.32);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  pointer-events: none;
}

.screen.active {
  display: flex;
}

h1 {
  margin: 5vh 0 0;
  color: var(--pink);
  font-size: clamp(42px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: 0.06em;
  text-shadow:
    4px 0 #5b003c,
    -4px 0 #5b003c,
    0 4px #5b003c,
    0 0 32px rgba(255, 79, 195, 0.85);
}

#landing h1 {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: var(--pink);
}

#landing h1::before {
  content: "LISA THE AI";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  color: transparent;
  background:
    radial-gradient(ellipse at 7% 53%, rgba(67, 0, 9, .88) 0 11px, transparent 17px),
    radial-gradient(ellipse at 17% 48%, rgba(92, 0, 15, .86) 0 14px, transparent 21px),
    radial-gradient(ellipse at 27% 53%, rgba(79, 0, 12, .84) 0 12px, transparent 19px),
    radial-gradient(ellipse at 45% 47%, rgba(72, 0, 10, .87) 0 15px, transparent 22px),
    radial-gradient(ellipse at 56% 55%, rgba(102, 0, 18, .82) 0 13px, transparent 20px),
    radial-gradient(ellipse at 68% 48%, rgba(68, 0, 11, .86) 0 11px, transparent 18px),
    radial-gradient(ellipse at 85% 50%, rgba(98, 0, 17, .84) 0 14px, transparent 21px),
    radial-gradient(ellipse at 96% 54%, rgba(69, 0, 10, .88) 0 10px, transparent 16px),
    radial-gradient(ellipse at 5% 52%, rgba(111, 0, 13, .92) 0 6px, transparent 9px),
    radial-gradient(ellipse at 14% 49%, rgba(181, 0, 27, .82) 0 7px, transparent 11px),
    radial-gradient(ellipse at 23% 45%, rgba(130, 0, 16, .78) 0 8px, transparent 12px),
    radial-gradient(ellipse at 32% 56%, rgba(218, 18, 43, .74) 0 6px, transparent 10px),
    radial-gradient(ellipse at 45% 44%, rgba(102, 0, 12, .84) 0 7px, transparent 11px),
    radial-gradient(ellipse at 55% 51%, rgba(190, 0, 31, .78) 0 8px, transparent 12px),
    radial-gradient(ellipse at 66% 43%, rgba(119, 0, 16, .82) 0 6px, transparent 10px),
    radial-gradient(ellipse at 84% 48%, rgba(226, 19, 45, .74) 0 7px, transparent 11px),
    radial-gradient(ellipse at 96% 53%, rgba(115, 0, 14, .86) 0 5px, transparent 9px),
    radial-gradient(circle at 10% 35%, #f02243 0 1.2px, transparent 2px),
    radial-gradient(circle at 16% 58%, #6f000d 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 26% 36%, #e01634 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 38% 49%, #75000d 0 1.3px, transparent 2.1px),
    radial-gradient(circle at 49% 62%, #d7192f 0 1.2px, transparent 2px),
    radial-gradient(circle at 58% 35%, #78000e 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 69% 56%, #ed2340 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 80% 37%, #79000d 0 1.3px, transparent 2.1px),
    radial-gradient(circle at 91% 59%, #d7192f 0 1.2px, transparent 2px),
    linear-gradient(180deg, rgba(168, 0, 25, .96), rgba(70, 0, 8, .96)) 4% 39% / 2px 31px no-repeat,
    linear-gradient(180deg, rgba(226, 18, 45, .9), rgba(73, 0, 9, .95)) 22% 40% / 2px 27px no-repeat,
    linear-gradient(180deg, rgba(150, 0, 21, .92), rgba(58, 0, 8, .96)) 43% 37% / 2px 33px no-repeat,
    linear-gradient(180deg, rgba(214, 18, 42, .9), rgba(68, 0, 9, .96)) 63% 42% / 2px 29px no-repeat,
    linear-gradient(180deg, rgba(172, 0, 27, .95), rgba(65, 0, 8, .96)) 84% 38% / 2px 30px no-repeat,
    linear-gradient(180deg, rgba(227, 19, 45, .88), rgba(70, 0, 8, .96)) 97% 40% / 2px 28px no-repeat;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 0 rgba(30, 0, 8, .55));
}

#landing h1::after {
  content: "LISA THE AI";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  color: transparent;
  background:
    radial-gradient(circle, rgba(92, 0, 12, .86) 0 .7px, transparent 1.25px) 3px 4px / 27px 19px repeat,
    radial-gradient(circle, rgba(224, 20, 45, .72) 0 .62px, transparent 1.18px) 14px 9px / 39px 26px repeat,
    radial-gradient(circle, rgba(132, 0, 17, .78) 0 .75px, transparent 1.3px) 9px 17px / 51px 31px repeat,
    radial-gradient(circle at 3% 47%, #7c0010 0 .9px, transparent 1.6px),
    radial-gradient(circle at 5% 55%, #da1530 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 6% 34%, #9a0015 0 .8px, transparent 1.5px),
    radial-gradient(circle at 8% 61%, #b80020 0 1px, transparent 1.7px),
    radial-gradient(circle at 12% 42%, #8f0012 0 .9px, transparent 1.6px),
    radial-gradient(circle at 13% 51%, #e01a36 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 14% 59%, #7f0010 0 .8px, transparent 1.5px),
    radial-gradient(circle at 18% 35%, #b0001d 0 1px, transparent 1.7px),
    radial-gradient(circle at 20% 43%, #ec203f 0 .9px, transparent 1.6px),
    radial-gradient(circle at 22% 53%, #850010 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 24% 61%, #d50f2d 0 .8px, transparent 1.5px),
    radial-gradient(circle at 27% 37%, #a00018 0 1px, transparent 1.7px),
    radial-gradient(circle at 29% 50%, #e01634 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 32% 61%, #79000d 0 .9px, transparent 1.6px),
    radial-gradient(circle at 35% 43%, #c60025 0 1px, transparent 1.7px),
    radial-gradient(circle at 39% 35%, #920012 0 .8px, transparent 1.5px),
    radial-gradient(circle at 43% 45%, #d7192f 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 45% 54%, #84000f 0 .9px, transparent 1.6px),
    radial-gradient(circle at 48% 34%, #b3001e 0 1px, transparent 1.7px),
    radial-gradient(circle at 51% 59%, #e01a36 0 .8px, transparent 1.5px),
    radial-gradient(circle at 54% 41%, #7c0010 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 56% 52%, #dc1732 0 .9px, transparent 1.6px),
    radial-gradient(circle at 59% 61%, #970014 0 1px, transparent 1.7px),
    radial-gradient(circle at 62% 35%, #bf0022 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 65% 49%, #84000f 0 .8px, transparent 1.5px),
    radial-gradient(circle at 68% 57%, #df1935 0 1px, transparent 1.7px),
    radial-gradient(circle at 71% 39%, #940013 0 .9px, transparent 1.6px),
    radial-gradient(circle at 73% 48%, #d3122e 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 76% 59%, #80000e 0 .8px, transparent 1.5px),
    radial-gradient(circle at 82% 36%, #b5001f 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 84% 48%, #eb1f3d 0 .9px, transparent 1.6px),
    radial-gradient(circle at 86% 60%, #870011 0 1px, transparent 1.7px),
    radial-gradient(circle at 89% 43%, #d7192f 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 92% 54%, #960014 0 .8px, transparent 1.5px),
    radial-gradient(circle at 95% 38%, #c80024 0 1px, transparent 1.7px),
    radial-gradient(circle at 97% 55%, #7a000d 0 .9px, transparent 1.6px),
    linear-gradient(180deg, #b0001d, #5a000a) 5% 41% / 1px 20px no-repeat,
    linear-gradient(180deg, #de1734, #5e000b) 13% 45% / 1px 25px no-repeat,
    linear-gradient(180deg, #ad0019, #550008) 23% 39% / 1px 19px no-repeat,
    linear-gradient(180deg, #d7192f, #5a000a) 31% 43% / 1px 24px no-repeat,
    linear-gradient(180deg, #9e0015, #4c0007) 45% 43% / 1px 22px no-repeat,
    linear-gradient(180deg, #d7192f, #5c000a) 56% 40% / 1px 28px no-repeat,
    linear-gradient(180deg, #b0001d, #510008) 67% 44% / 1px 20px no-repeat,
    linear-gradient(180deg, #e01835, #5c000a) 74% 41% / 1px 23px no-repeat,
    linear-gradient(180deg, #ad0019, #580009) 86% 42% / 1px 25px no-repeat,
    linear-gradient(180deg, #d7192f, #5c000a) 96% 42% / 1px 21px no-repeat;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 0 rgba(30, 0, 8, .65));
}

.tagline {
  margin: 10px 0 42vh;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pixelButton,
.modeButton,
.smallButton,
#chatForm button {
  pointer-events: auto;
  border: 3px solid #ffd6f3;
  border-radius: 0;
  color: #180010;
  background: linear-gradient(180deg, #ffb7ea, var(--pink));
  box-shadow: 0 6px 0 #70004b, 0 0 28px rgba(255, 79, 195, 0.45);
  font: 900 18px "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  padding: 14px 24px;
  cursor: pointer;
  text-transform: uppercase;
}

.iconButton {
  position: absolute;
  z-index: 30;
  left: max(116px, calc(env(safe-area-inset-left) + 116px));
  top: max(14px, calc(env(safe-area-inset-top) + 14px));
  width: 54px;
  height: 46px;
  min-width: 54px;
  padding: 0;
  display: grid;
  place-items: center;
}

.fullscreenButton {
  left: auto;
  right: max(14px, calc(env(safe-area-inset-right) + 14px));
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.55), transparent 38%),
    linear-gradient(180deg, #ffb7ea, var(--pink));
  box-shadow:
    0 6px 0 #70004b,
    0 0 28px rgba(255, 79, 195, 0.82),
    0 0 46px rgba(255, 20, 147, 0.42);
  animation: fullscreenGlow 1.35s ease-in-out infinite alternate;
}

.fullscreenIcon {
  position: relative;
  display: block;
  width: 31px;
  height: 27px;
}

.fsCorner {
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: #160010;
  border-style: solid;
  filter: drop-shadow(0 0 4px rgba(255,255,255,.86));
}

.fsTopLeft {
  left: 1px;
  top: 1px;
  border-width: 4px 0 0 4px;
}

.fsTopRight {
  right: 1px;
  top: 1px;
  border-width: 4px 4px 0 0;
}

.fsBottomLeft {
  left: 1px;
  bottom: 1px;
  border-width: 0 0 4px 4px;
}

.fsBottomRight {
  right: 1px;
  bottom: 1px;
  border-width: 0 4px 4px 0;
}

.fullscreenButton[aria-pressed="true"] {
  filter: saturate(1.25) brightness(1.08);
  box-shadow:
    0 4px 0 #70004b,
    0 0 34px rgba(255, 255, 255, 0.78),
    0 0 52px rgba(255, 79, 195, 0.92);
}

@keyframes fullscreenGlow {
  from {
    transform: translateY(0) scale(1);
    box-shadow: 0 6px 0 #70004b, 0 0 22px rgba(255,79,195,.64), 0 0 34px rgba(255,20,147,.24);
  }
  to {
    transform: translateY(-1px) scale(1.035);
    box-shadow: 0 7px 0 #70004b, 0 0 34px rgba(255,255,255,.64), 0 0 54px rgba(255,79,195,.82);
  }
}

.iconButton[aria-pressed="true"] {
  filter: grayscale(0.8) brightness(0.8);
  box-shadow: 0 4px 0 #3a0027, 0 0 14px rgba(255, 79, 195, 0.24);
}

.fullscreenButton[aria-pressed="true"] {
  filter: saturate(1.25) brightness(1.08);
  box-shadow:
    0 4px 0 #70004b,
    0 0 34px rgba(255, 255, 255, 0.78),
    0 0 52px rgba(255, 79, 195, 0.92);
}

.smallButton.active {
  filter: saturate(1.45) brightness(1.08);
  box-shadow: 0 6px 0 #70004b, 0 0 30px rgba(255, 79, 195, 0.82);
}

.speakerIcon {
  position: relative;
  width: 31px;
  height: 27px;
  display: block;
}

.speakerBox {
  position: absolute;
  left: 1px;
  top: 9px;
  width: 9px;
  height: 10px;
  background: #160010;
  border: 2px solid #160010;
  box-shadow: inset 0 0 0 2px #fff3fb;
}

.speakerCone {
  position: absolute;
  left: 8px;
  top: 5px;
  width: 14px;
  height: 18px;
  background: #160010;
  clip-path: polygon(0 34%, 100% 0, 100% 100%, 0 66%);
  box-shadow: inset 0 0 0 2px #fff3fb;
}

.soundWave {
  position: absolute;
  border: 3px solid #160010;
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 24px 24px 0;
}

.waveOne {
  left: 21px;
  top: 7px;
  width: 8px;
  height: 13px;
}

.waveTwo {
  left: 24px;
  top: 3px;
  width: 13px;
  height: 21px;
}

.muteSlash {
  position: absolute;
  left: 2px;
  top: 12px;
  width: 35px;
  height: 5px;
  background: #8c003b;
  border: 1px solid #fff3fb;
  transform: rotate(-42deg) scaleX(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

.iconButton[aria-pressed="true"] .soundWave {
  opacity: 0.12;
}

.iconButton[aria-pressed="true"] .muteSlash {
  transform: rotate(-42deg) scaleX(1);
}

.pixelButton:active,
.modeButton:active,
.smallButton:active,
#chatForm button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #70004b, 0 0 18px rgba(255, 79, 195, 0.36);
}

.playIcon {
  display: inline-block;
  margin-right: 8px;
}

#enterButton {
  position: relative;
  animation: enterGlow 1.35s ease-in-out infinite alternate;
}

#enterButton::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 79, 195, 0.58), rgba(255, 79, 195, 0.18) 42%, transparent 72%);
  filter: blur(5px);
  animation: enterHalo 1.35s ease-in-out infinite alternate;
}

@keyframes enterGlow {
  from {
    box-shadow: 0 6px 0 #70004b, 0 0 28px rgba(255, 79, 195, 0.5), 0 0 0 rgba(255, 255, 255, 0);
    transform: translateY(0) scale(1);
  }
  to {
    box-shadow: 0 6px 0 #70004b, 0 0 38px rgba(255, 79, 195, 0.95), 0 0 22px rgba(255, 255, 255, 0.5);
    transform: translateY(-1px) scale(1.03);
  }
}

@keyframes enterHalo {
  from { opacity: 0.55; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.1); }
}

.panel {
  pointer-events: auto;
  width: min(92vw, 620px);
  padding: 28px;
  border: 3px solid var(--pink);
  background: var(--panel);
  box-shadow: 0 0 0 5px #210016, 0 0 60px rgba(255, 79, 195, 0.5);
}

.panel h2 {
  margin: 0 0 14px;
  color: var(--pink);
  font-size: clamp(28px, 6vw, 56px);
}

.authPanel {
  width: min(92vw, 560px);
  display: grid;
  gap: 16px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,79,195,.08)),
    rgba(5, 0, 8, .84);
  backdrop-filter: blur(8px);
}

.authTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 214, 243, .42);
  background: rgba(0, 0, 0, .38);
}

.authTab,
.miniTextButton {
  border: 0;
  color: #ffd6f3;
  background: transparent;
  font: 900 13px "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

.authTab {
  padding: 10px 12px;
  border-radius: 10px;
}

.authTab.active {
  color: #170010;
  background: linear-gradient(180deg, #ffb7ea, var(--pink));
  box-shadow: 0 4px 0 #70004b, 0 0 18px rgba(255,79,195,.48);
}

.authPanel p {
  margin: 0;
  color: #ffe3f7;
  font: 800 16px/1.45 "Trebuchet MS", "Segoe UI", sans-serif;
}

.authActions {
  display: grid;
  gap: 12px;
}

.oauthButton {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 16px;
  border: 2px solid rgba(255, 214, 243, .92);
  border-radius: 16px;
  color: #12000d;
  background: linear-gradient(90deg, #fff, #ffc5ef 52%, #ff4fc3);
  box-shadow: 0 5px 0 #70004b, 0 0 24px rgba(255,79,195,.35);
  font: 1000 17px "Trebuchet MS", "Segoe UI", sans-serif;
  text-decoration: none;
  letter-spacing: .02em;
}

.oauthButton:hover {
  transform: translateY(-1px);
  filter: saturate(1.1);
}

.oauthButton.disabled {
  pointer-events: none;
  opacity: .48;
  filter: grayscale(.45);
}

.oauthMark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  background: #151515;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.82);
}

.discordAuth .oauthMark { background: #5865f2; }
.googleAuth .oauthMark { background: #111; }

.authStatus {
  min-height: 22px;
  color: #ffb9ea !important;
  font-size: 13px !important;
}

.ghostButton {
  justify-self: center;
  font-size: 14px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(255,183,234,.9), rgba(255,79,195,.78));
}

.hubUserBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 214, 243, .46);
  border-radius: 999px;
  color: #ffe3f7;
  background: rgba(0,0,0,.34);
  font: 900 13px "Trebuchet MS", "Segoe UI", sans-serif;
}

.miniTextButton {
  padding: 5px 8px;
  border-radius: 999px;
  color: #180010;
  background: #ff8ed9;
}

.hub {
  display: grid;
  gap: 18px;
  width: min(92vw, 670px);
  padding: clamp(22px, 4vw, 34px);
  border-radius: 22px;
  border: 2px solid rgba(255, 214, 243, 0.9);
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,79,195,.05)),
    rgba(6, 0, 8, 0.76);
  box-shadow:
    0 0 0 1px rgba(255,79,195,.48),
    0 24px 86px rgba(0,0,0,.72),
    inset 0 0 38px rgba(255,79,195,.12);
  backdrop-filter: blur(8px);
}

.modeButton {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 74px;
  border-radius: 18px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(22px, 4vw, 38px);
  letter-spacing: 0.06em;
  background:
    linear-gradient(90deg, rgba(255,255,255,.7), rgba(255,79,195,.95)),
    radial-gradient(circle at 12% 50%, rgba(255,255,255,.55), transparent 18%);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.modeLabel {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 0 18px;
  border-radius: 999px;
  text-shadow: 0 2px 0 rgba(255,255,255,.5), 0 4px 18px rgba(0,0,0,.34);
}

.modeIcon {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.modeCanvas {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
  height: 68px;
  image-rendering: auto;
  filter: drop-shadow(0 3px 0 #050005) drop-shadow(0 0 13px rgba(255, 79, 195, 0.58));
}

.chatModeCanvas,
.fightModeCanvas,
.aboutModeCanvas {
  left: 18px;
  width: 166px;
}

.chatModeCanvas {
  width: 76px;
}

.chatIcon {
  left: 30px;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #ff4fc3;
  border: 5px solid #050005;
  box-shadow: 0 0 0 2px #ffd6f3, 0 0 18px rgba(255,79,195,.85);
}

.chatIcon::before,
.chatIcon::after {
  content: "";
  position: absolute;
  background: radial-gradient(circle at 54% 52%, #050005 0 3px, #fff 4px);
  border: 2px solid #050005;
  border-radius: 50%;
  width: 11px;
  height: 11px;
  top: 14px;
}

.chatIcon::before { left: 9px; }
.chatIcon::after { right: 9px; }

.chatIcon {
  background: #ff4fc3;
}

.aboutIcon {
  left: 22px;
  top: 50%;
  width: 104px;
  height: 58px;
  transform: translateY(-50%);
}

.aboutLisaFace {
  position: absolute;
  left: 0;
  top: 6px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 44%, #fff 0 6px, #050005 7px 9px, transparent 10px),
    radial-gradient(circle at 66% 44%, #fff 0 6px, #050005 7px 9px, transparent 10px),
    #ff4fc3;
  border: 5px solid #050005;
  box-shadow: 0 0 0 2px #ffd6f3, 0 0 18px rgba(255,79,195,.85);
}

.aboutLisaFace::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -10px;
  width: 24px;
  height: 12px;
  background: #f21b2d;
  border: 4px solid #050005;
  border-radius: 4px;
  box-shadow: -13px 0 0 -2px #f21b2d, 13px 0 0 -2px #f21b2d;
}

.aboutRifle {
  position: absolute;
  left: 42px;
  top: 22px;
  width: 60px;
  height: 9px;
  border-radius: 8px;
  background: linear-gradient(90deg, #05070a, #2c3540 56%, #090b10);
  border: 3px solid #050005;
  transform: rotate(-18deg);
  box-shadow: 0 0 0 1px rgba(255,255,255,.28), 0 0 12px rgba(255,79,195,.35);
}

.aboutRifle::before,
.aboutRifle::after {
  content: "";
  position: absolute;
  background: #050005;
}

.aboutRifle::before {
  left: 8px;
  top: 7px;
  width: 16px;
  height: 18px;
  border-radius: 4px;
  transform: rotate(14deg);
}

.aboutRifle::after {
  right: -17px;
  top: 1px;
  width: 19px;
  height: 5px;
  border-radius: 5px;
}

.fightIcon {
  bottom: 9px;
  width: 58px;
  height: 50px;
}

.fightIcon.left { left: 22px; }
.fightIcon.right { right: 22px; }

.fightIcon::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 44%, #050005 0 3px, transparent 4px),
    radial-gradient(circle at 66% 44%, #050005 0 3px, transparent 4px),
    var(--fighter, #fff);
  border: 5px solid #050005;
  box-shadow: 0 0 0 2px rgba(255,255,255,.62);
}

.fightIcon::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 29px;
  width: 10px;
  height: 26px;
  border-radius: 10px;
  background: var(--fighter, #fff);
  border: 4px solid #050005;
  transform: rotate(var(--lean, -10deg));
}

.fightIcon.right {
  --fighter: #ff4fc3;
  --lean: 12deg;
}

.fightIcon.right::before {
  box-shadow: 0 0 0 2px #ffd6f3, 0 -13px 0 -6px #f21b2d;
}

.modeButton:hover,
.modeButton:focus-visible {
  transform: translateY(-3px) scale(1.015);
  filter: saturate(1.22) brightness(1.08);
  box-shadow: 0 10px 0 #70004b, 0 0 46px rgba(255, 79, 195, 0.74);
}

.aboutPanel {
  position: relative;
  width: min(94vw, 920px);
  min-height: min(84dvh, 720px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.aboutPanel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent),
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.08), transparent 18%);
  opacity: 0;
}

.aboutBack {
  width: max-content;
  justify-self: start;
  z-index: 1;
}

.aboutPanel h2,
.aboutPanel p,
.aboutLisaStage {
  position: relative;
  z-index: 1;
}

.aboutPanel h2 {
  font-size: clamp(38px, 6vw, 76px);
  line-height: .9;
  text-align: center;
  text-shadow: 0 5px 0 #260014, 0 0 32px rgba(255,79,195,.86);
}

.aboutPanel p {
  margin: 0 auto;
  max-width: 760px;
  color: #ffe8f8;
  font: 900 clamp(18px, 2.2vw, 28px) "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.2;
  text-align: center;
}

.aboutLisaStage {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#aboutLisaCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.modeOverlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.modeOverlay.hidden {
  display: none;
}

.topBar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(82px, calc(env(safe-area-inset-right) + 82px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 23;
}

.smallButton {
  padding: 9px 12px;
  font-size: 12px;
}

#connectionStatus,
#miniModeTitle {
  color: #ffd6f3;
  background: rgba(0, 0, 0, 0.58);
  border: 2px solid rgba(255, 79, 195, 0.55);
  padding: 8px 12px;
  font-weight: 900;
  text-shadow: 0 0 10px var(--hot);
}

#chatLog {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  top: 72px;
  width: min(34vw, 420px);
  max-height: calc(100dvh - 172px);
  overflow: auto;
  display: grid;
  gap: 10px;
  pointer-events: auto;
  padding-right: 4px;
}

#chatLog[hidden] {
  display: none;
}

#captionBar {
  position: absolute;
  left: 50%;
  right: auto;
  top: max(72px, calc(env(safe-area-inset-top) + 72px));
  width: min(76vw, 980px);
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 28px;
  border: 2px solid rgba(255, 79, 195, 0.62);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 0 26px rgba(255, 79, 195, 0.36);
  backdrop-filter: blur(2px);
  transition: opacity 120ms ease, transform 120ms ease;
}

#captionBar.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#captionSpeaker {
  color: #ffffff;
  font: 900 clamp(13px, 2vw, 18px) "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 2px 0 #000, 0 0 14px rgba(255, 79, 195, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
}

#captionSpeaker::before {
  content: "";
  width: 30px;
  height: 30px;
  border: 3px solid #050005;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 46%, #050005 0 2px, #fff 3px 6px, transparent 7px),
    radial-gradient(circle at 66% 46%, #050005 0 2px, #fff 3px 6px, transparent 7px),
    linear-gradient(#ff7bd6, #ff4fc3);
  box-shadow: 0 0 0 2px #ff9ee4, 0 0 18px rgba(255, 79, 195, 0.78);
}

#captionSpeaker::after,
#fightDialogueSpeaker::after {
  content: "";
  position: absolute;
  left: -1px;
  top: -9px;
  width: 31px;
  height: 17px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 34'%3E%3Cpath d='M31 17 5 4 8 30zM33 17 59 4 56 30z' fill='%23050005'/%3E%3Cpath d='M31 17 10 8 12 26zM33 17 54 8 52 26z' fill='%23f21b2d'/%3E%3Crect x='25' y='9' width='14' height='16' rx='3' fill='%23050005'/%3E%3Crect x='28' y='12' width='8' height='10' rx='2' fill='%23ff2a36'/%3E%3Cpath d='M13 10h8M43 10h8' stroke='%23ffd6f3' stroke-width='3' stroke-linecap='round' opacity='.72'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 0 #050005) drop-shadow(0 0 7px rgba(255,42,54,.75));
  pointer-events: none;
}

#captionBar[data-speaker="ai"] {
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.2);
}

#captionBar[data-speaker="ai"] #captionSpeaker::before {
  background:
    radial-gradient(circle at 34% 46%, #050005 0 2px, #fff 3px 6px, transparent 7px),
    radial-gradient(circle at 66% 46%, #050005 0 2px, #fff 3px 6px, transparent 7px),
    linear-gradient(#f7fbff, #cfe6ff);
  box-shadow: 0 0 0 2px rgba(255,255,255,.72), 0 0 18px rgba(255,255,255,.38);
}

#captionBar[data-speaker="ai"] #captionSpeaker::after {
  content: none;
}

#captionText {
  color: var(--pink);
  padding-left: clamp(8px, 2vw, 24px);
  font: 900 clamp(26px, 4.8vw, 48px) "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.05;
  text-shadow: 0 3px 0 #000, 0 0 20px rgba(255, 79, 195, 0.82), 0 0 4px #fff;
}

#captionBar[data-speaker="ai"] #captionText {
  color: #f4fbff;
  font-size: clamp(21px, 3.8vw, 38px);
  text-shadow: 0 3px 0 #000, 0 0 16px rgba(255,255,255,.44);
}

#fightDialogueBar {
  position: absolute;
  left: 50%;
  top: max(104px, calc(env(safe-area-inset-top) + 104px));
  width: min(78vw, 980px);
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  pointer-events: none;
  z-index: 18;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 22px;
  border: 2px solid rgba(255, 79, 195, 0.68);
  background: linear-gradient(90deg, rgba(5, 0, 8, 0.78), rgba(48, 0, 34, 0.5));
  box-shadow: 0 0 28px rgba(255, 79, 195, 0.28), inset 0 0 22px rgba(255, 79, 195, 0.1);
  backdrop-filter: blur(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

#fightDialogueBar.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.chatWeapons {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  top: max(88px, calc(env(safe-area-inset-top) + 88px));
  z-index: 24;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: auto;
}

#chatWeaponToggle {
  min-width: 156px;
  min-height: 58px;
  font-size: 18px;
  box-shadow: 0 7px 0 #70004b, 0 0 34px rgba(255, 79, 195, 0.72);
}

#addAiButton {
  min-width: 156px;
  min-height: 50px;
  font-size: 15px;
  background: linear-gradient(180deg, #ffe6f8, #ff87d8);
}

.chatTrashCan {
  width: 156px;
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 10px 9px;
  border: 3px solid rgba(255, 214, 243, 0.86);
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,.55), transparent 36%),
    linear-gradient(180deg, #ffe6f8, #ff87d8 46%, #ff4fc3);
  box-shadow: 0 7px 0 #70004b, 0 0 30px rgba(255,79,195,.62);
  pointer-events: none;
  opacity: .94;
}

.chatTrashCan.trashHot {
  border-color: #ffffff;
  background:
    radial-gradient(circle at 50% 12%, rgba(255,255,255,.78), transparent 38%),
    linear-gradient(180deg, #fff3fb, #ff9ee1 42%, #ff1493);
  box-shadow: 0 7px 0 #70004b, 0 0 40px rgba(255,255,255,.78), 0 0 30px rgba(255,79,195,.95);
  transform: translateY(-2px);
}

.trashLid {
  width: 64px;
  height: 10px;
  border: 3px solid #050005;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #f1f6ff, #9aa8b8);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.8);
}

.trashBody {
  width: 52px;
  height: 48px;
  border: 4px solid #050005;
  border-radius: 7px 7px 12px 12px;
  background:
    repeating-linear-gradient(90deg, rgba(5,0,5,.18) 0 4px, transparent 4px 10px),
    linear-gradient(180deg, #e3e9f2, #7f8b9b);
  box-shadow: inset 0 4px 0 rgba(255,255,255,.62), 0 0 12px rgba(255,255,255,.18);
}

.trashText {
  color: #ffd6f3;
  font: 900 11px "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: .12em;
  text-shadow: 0 2px 0 #050005, 0 0 10px rgba(255,79,195,.85);
}

.chatWeaponPanel {
  order: -1;
  width: min(290px, 52vw);
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: 218px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 2px solid var(--pink);
  background: rgba(10, 0, 8, 0.86);
  box-shadow: 0 0 26px rgba(255, 79, 195, 0.32);
  scrollbar-color: var(--pink) rgba(0,0,0,.4);
  scrollbar-width: thin;
}

.addAiPanel {
  width: min(250px, 50vw);
}

.chatWeaponChoice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  border: 2px solid #ffd6f3;
  color: #14000d;
  background: linear-gradient(180deg, #ffd8f1, #ff4fc3);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 0 #70004b;
}

.aiChoice {
  grid-template-columns: 28px 1fr;
  align-items: center;
  column-gap: 9px;
}

.aiChoice .weaponHint {
  grid-column: 2;
}

.aiSwatch {
  grid-row: 1 / span 2;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 4px solid #050005;
  background: var(--swatch, #ff4fc3);
  box-shadow: 0 0 0 2px rgba(255,255,255,.62);
}

.grokSwatch { --swatch: #111111; }
.gptSwatch { --swatch: #35e675; }
.geminiSwatch { --swatch: #67c9ff; }
.claudeSwatch { --swatch: #e98c46; }

.chatWeaponChoice.active {
  filter: saturate(1.35) brightness(1.08);
  box-shadow: 0 4px 0 #70004b, 0 0 24px rgba(255, 79, 195, 0.82);
}

.weaponName {
  font: 900 17px "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
}

.weaponHint {
  font: 800 11px "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
}

.mobileBlockButton {
  position: absolute;
  z-index: 24;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px));
  min-width: 120px;
  min-height: 54px;
  display: none;
  pointer-events: auto;
}

.postFightChat {
  position: absolute;
  z-index: 28;
  left: 50%;
  top: 50%;
  width: min(92vw, 720px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 3px solid #ff4fc3;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,79,195,.08)),
    rgba(6, 0, 8, 0.92);
  box-shadow:
    0 0 0 4px #210016,
    0 22px 80px rgba(0,0,0,.72),
    0 0 42px rgba(255,79,195,.46);
  pointer-events: auto;
}

.postFightHeader {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  color: #ffd6f3;
  text-align: left;
}

.postFightHeader strong {
  display: block;
  color: #ff4fc3;
  font: 900 clamp(24px, 4vw, 36px) "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: .08em;
  text-shadow: 0 3px 0 #050005, 0 0 20px rgba(255,79,195,.85);
}

#postFightSummary {
  display: block;
  margin-top: 4px;
  color: #ffe9f8;
  font-weight: 900;
}

.postFightLisaIcon,
.postFightLisaMiniIcon {
  display: inline-block;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 0;
  background: url("./assets/lisa-postfight-icon-clean.png") center / contain no-repeat;
  filter: drop-shadow(0 0 2px #ffd6f3) drop-shadow(0 0 18px rgba(255,79,195,.78));
  position: relative;
}

.postFightLisaIcon::before,
.postFightLisaMiniIcon::before {
  content: none;
}

.postFightLisaMiniIcon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 1px #ffd6f3) drop-shadow(0 0 10px rgba(255,79,195,.72));
}

.postFightMessages {
  min-height: 126px;
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid rgba(255,79,195,.5);
  background: rgba(0,0,0,.48);
  text-align: left;
}

.postFightBubble {
  width: fit-content;
  max-width: min(92%, 560px);
  padding: 10px 12px;
  border: 2px solid rgba(255,214,243,.6);
  border-radius: 14px;
  background: rgba(255,79,195,.12);
  color: #ffd6f3;
  font: 900 17px "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.22;
}

.postFightBubble.lisa {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.postFightBubble.user {
  justify-self: end;
  color: #ffffff;
  border-color: rgba(255,255,255,.68);
  background: rgba(255,255,255,.08);
}

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

.postFightForm input {
  min-height: 54px;
  border: 3px solid #ff4fc3;
  background: rgba(0,0,0,.74);
  color: #fff;
  padding: 0 14px;
  font: 900 17px "Trebuchet MS", "Segoe UI", sans-serif;
}

.postFightForm button,
.postFightReturn {
  min-height: 54px;
}

.postFightReturn {
  justify-self: end;
}

#fightDialogueSpeaker {
  color: #ffffff;
  font: 900 clamp(13px, 1.8vw, 17px) "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 0 #000, 0 0 14px rgba(255, 79, 195, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
}

#fightDialogueSpeaker::before {
  content: "";
  width: 26px;
  height: 26px;
  border: 3px solid #050005;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 46%, #050005 0 2px, #fff 3px 6px, transparent 7px),
    radial-gradient(circle at 66% 46%, #050005 0 2px, #fff 3px 6px, transparent 7px),
    linear-gradient(#ff83dc, #ff4fc3);
  box-shadow: 0 0 0 2px #ff9ee4, 0 0 18px rgba(255, 79, 195, 0.78);
}

#fightDialogueText {
  color: #ffd6f3;
  font: 900 clamp(18px, 2.8vw, 32px) "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.05;
  text-shadow: 0 2px 0 #000, 0 0 14px rgba(255, 79, 195, 0.82);
}

.message {
  padding: 10px 12px;
  border: 2px solid rgba(255, 79, 195, 0.5);
  background: rgba(0, 0, 0, 0.64);
  box-shadow: 0 0 18px rgba(255, 79, 195, 0.16);
  font-weight: 800;
  line-height: 1.25;
}

.message.user {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

.message.lisa {
  color: #ffd6f3;
}

.message.ai {
  border-color: rgba(180, 230, 255, 0.62);
  color: #eefaff;
}

#chatForm {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  pointer-events: auto;
}

.micButton {
  position: relative;
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: 30px auto;
  place-items: center;
  align-content: center;
  row-gap: 1px;
  min-width: 72px;
  min-height: 58px;
  border: 3px solid var(--pink);
  color: #14000d;
  background: linear-gradient(180deg, #ffd8f1, #ff4fc3);
  box-shadow: 0 5px 0 #70004b, 0 0 24px rgba(255, 79, 195, 0.46);
  cursor: pointer;
  font: 900 11px "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  padding: 4px 8px 6px;
}

.micButton[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(180deg, #ff1f6d, #9a002f);
  box-shadow: 0 5px 0 #370014, 0 0 28px rgba(255, 31, 109, 0.88);
}

.micButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.55);
}

.micGlyph {
  position: relative;
  width: 31px;
  height: 30px;
  margin-top: -4px;
  border: 0;
  border-radius: 0;
  background: url("./assets/mic-icon-nano.png") center / contain no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 1px 0 #050005) drop-shadow(0 0 5px rgba(255,255,255,.72));
}

.micGlyph::before {
  content: none;
}

.micGlyph::after {
  content: none;
}

.micLabel {
  display: block;
  line-height: 1;
  font-size: 11px;
}

.micButton[aria-pressed="true"] .micGlyph {
  animation: micPulse 760ms ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { transform: translateY(-1px) scale(1); filter: drop-shadow(0 1px 0 #050005) drop-shadow(0 0 5px rgba(255,255,255,.72)); }
  50% { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 1px 0 #050005) drop-shadow(0 0 12px rgba(255,255,255,.95)); }
}

#chatInput {
  min-height: 52px;
  border: 3px solid var(--pink);
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  padding: 0 14px;
  outline: none;
  font: 900 16px "Trebuchet MS", "Segoe UI", sans-serif;
  min-width: 0;
}

#chatInput:focus {
  box-shadow: 0 0 0 4px rgba(255, 79, 195, 0.28);
}

.miniPanel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr);
  gap: 18px;
  align-items: end;
  justify-items: stretch;
  pointer-events: auto;
  width: min(88vw, 620px);
  transform: translate(-50%, -50%);
  padding: clamp(18px, 3vw, 28px);
  border: 3px solid var(--pink);
  background: rgba(0, 0, 0, 0.82);
  box-shadow: 0 0 0 5px #210016, 0 0 60px rgba(255, 79, 195, 0.5);
}

.stagePreviewGrid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  gap: 10px;
}

.stageCard {
  min-height: 96px;
  border: 1px solid rgba(255, 214, 243, 0.38);
  border-radius: 16px;
  color: #fff;
  background: radial-gradient(circle at 50% 15%, rgba(255,255,255,.10), transparent 26%), #050005;
  padding: 6px;
  pointer-events: auto;
  cursor: pointer;
  display: grid;
  align-content: end;
  gap: 5px;
  position: relative;
  overflow: hidden;
  font: 900 10px "Trebuchet MS", "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.stageCard::before {
  content: "";
  position: absolute;
  inset: 6px 6px 24px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 72% 18%, rgba(255,255,255,.32), transparent 11%),
    linear-gradient(var(--stage-sky, #120012), #050005 60%, var(--stage-floor, #1a0a17) 61%),
    linear-gradient(110deg, transparent 0 40%, rgba(255,255,255,.12) 42%, transparent 44%);
  box-shadow: inset 0 -5px 16px rgba(0,0,0,.45), inset 0 -3px 0 var(--stage-accent, var(--pink));
}

.stageCard::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 35px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--stage-accent, var(--pink)), #fff, var(--stage-accent, var(--pink)));
  box-shadow: 28px -24px 16px -2px var(--stage-accent, var(--pink)), 56px 8px 14px -1px var(--stage-accent, var(--pink));
}

.stageCard span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 0 #000;
}

.stageCard.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 79, 195, 0.42), 0 0 22px rgba(255, 79, 195, 0.55);
}

.miniPanel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 900;
  text-transform: uppercase;
}

.miniPanel select {
  min-height: 58px;
  color: #fff;
  background: #180010;
  border: 3px solid var(--pink);
  padding: 0 12px;
  font: 900 clamp(16px, 2.4vw, 24px) "Trebuchet MS", "Segoe UI", sans-serif;
}

#startMiniButton {
  grid-column: 1 / -1;
  min-height: 64px;
  font-size: clamp(22px, 3.2vw, 34px);
}

#miniInstructions {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  margin: 0;
  color: #ffd6f3;
  text-align: center;
  font-weight: 900;
  text-shadow: 0 2px 0 #000;
  pointer-events: none;
}

@media (max-width: 780px) {
  .iconButton {
    width: 48px;
    height: 42px;
    min-width: 48px;
    top: max(9px, calc(env(safe-area-inset-top) + 9px));
  }

  #musicToggleButton {
    left: max(82px, calc(env(safe-area-inset-left) + 82px));
  }

  .fullscreenButton {
    right: max(9px, calc(env(safe-area-inset-right) + 9px));
  }

  h1 {
    font-size: clamp(42px, 13vw, 72px);
    margin-top: 7vh;
  }

  .tagline {
    margin-bottom: 48vh;
    font-size: 12px;
    max-width: min(88vw, 520px);
  }

  .panel,
  .hub {
    width: min(94vw, 560px);
    max-height: calc(var(--app-height, 100dvh) - 24px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .hub {
    gap: 12px;
  }

  .modeButton {
    min-height: 68px;
  }

  .topBar {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(66px, calc(env(safe-area-inset-right) + 66px));
    gap: 8px;
  }

  .topBar .smallButton,
  #resetLisaButton {
    padding: 7px 8px;
    font-size: 10px;
    min-height: 38px;
  }

  #connectionStatus,
  #miniModeTitle {
    min-width: 0;
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 7px 8px;
    font-size: 11px;
  }

  #chatLog {
    left: 14px;
    right: 14px;
    width: auto;
    top: 64px;
    max-height: 34dvh;
  }

  .miniPanel {
    grid-template-columns: 1fr;
    width: min(92vw, 440px);
  }

  .modeCanvas {
    height: 54px;
    opacity: 0.78;
  }

  .chatModeCanvas,
  .fightModeCanvas,
  .aboutModeCanvas {
    left: 10px;
    width: 126px;
  }

  .postFightChat {
    left: 12px;
    right: 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: auto;
    padding: 12px;
    gap: 10px;
  }

  .postFightHeader {
    grid-template-columns: 42px 1fr;
    gap: 10px;
  }

  .postFightLisaIcon {
    width: 42px;
    height: 42px;
  }

  .postFightMessages {
    min-height: 88px;
    max-height: 30dvh;
    font-size: 15px;
  }

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

  .postFightForm input,
  .postFightForm button,
  .postFightReturn {
    min-height: 48px;
  }

  .aboutPanel {
    width: min(94vw, 560px);
    min-height: auto;
    max-height: calc(100dvh - 26px);
    overflow: auto;
    padding: 18px;
    border-radius: 18px;
  }

  .aboutPanel h2 {
    font-size: clamp(30px, 10vw, 52px);
  }

  .aboutPanel p {
    font-size: clamp(15px, 4.5vw, 21px);
  }

  .stagePreviewGrid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  #captionBar {
    left: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    transform: translateY(-10px);
    grid-template-columns: 1fr;
    gap: 5px;
    top: max(62px, calc(env(safe-area-inset-top) + 62px));
    padding: 9px 12px;
  }

  #captionBar.active {
    transform: translateY(0);
  }

  #captionText {
    padding-left: 0;
    font-size: clamp(21px, 6vw, 34px);
  }

  #chatForm {
    left: 10px;
    right: 10px;
    gap: 7px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .micButton {
    min-width: 56px;
    padding: 0 5px;
  }

  .micLabel {
    font-size: 9px;
  }

  #fightDialogueBar {
    left: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    transform: translateY(-10px);
    grid-template-columns: 1fr;
    gap: 5px;
    top: max(86px, calc(env(safe-area-inset-top) + 86px));
    padding: 9px 12px;
  }

  #fightDialogueBar.active {
    transform: translateY(0);
  }

  #fightDialogueText {
    font-size: clamp(18px, 5.4vw, 28px);
  }

  .chatWeapons {
    right: 12px;
    top: max(82px, calc(env(safe-area-inset-top) + 82px));
  }

  .chatWeaponPanel {
    width: min(250px, 64vw);
    max-height: 196px;
  }

  .addAiPanel {
    width: min(230px, 62vw);
  }

  #chatWeaponToggle {
    min-width: 132px;
    min-height: 52px;
    font-size: 15px;
  }

  #addAiButton {
    min-width: 132px;
    min-height: 46px;
    font-size: 13px;
  }

  .chatTrashCan {
    width: 132px;
    min-height: 78px;
    padding: 5px 8px 7px;
  }

  .trashBody {
    width: 42px;
    height: 38px;
  }

  .mobileBlockButton {
    display: block;
    right: 12px;
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px));
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  .topBar {
    right: auto;
    width: min(calc(100vw - 74px), 318px);
    gap: 6px;
  }

  #connectionStatus {
    display: none;
  }

  #miniModeTitle {
    max-width: 34vw;
    padding: 6px 7px;
    font-size: 10px;
  }

  #resetLisaButton {
    max-width: 118px;
    white-space: normal;
    line-height: 1;
    padding: 6px 7px;
    font-size: 9px;
  }

  #mobileHint {
    display: block;
  }

  #hubScreen.screen {
    align-items: flex-start;
    padding-left: 12px;
  }

  h1 {
    margin-top: 4vh;
    font-size: clamp(38px, 14vw, 62px);
  }

  .tagline {
    margin: 8px 18px 46vh;
    font-size: 10px;
    line-height: 1.25;
  }

  #enterButton {
    padding: 12px 18px;
    font-size: 16px;
  }

  .hub {
    width: min(calc(100vw - 42px), 348px);
    padding: 14px 10px;
    gap: 10px;
  }

  .hub h2 {
    font-size: clamp(28px, 10vw, 42px);
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .modeButton {
    min-height: 58px;
    padding: 8px 8px 8px 72px;
    font-size: clamp(18px, 6.4vw, 26px);
    letter-spacing: 0.035em;
  }

  .modeLabel {
    padding: 0 4px;
    line-height: 1;
    white-space: normal;
  }

  .modeCanvas {
    left: 4px;
    width: 62px !important;
    height: 48px;
    opacity: .62;
  }

  #captionBar {
    top: max(58px, calc(env(safe-area-inset-top) + 58px));
    left: 8px;
    right: auto;
    width: min(calc(100vw - 16px), 374px);
    max-width: none;
    padding: 7px 9px;
  }

  #captionSpeaker {
    font-size: 11px;
  }

  #captionSpeaker::before {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }

  #captionText {
    font-size: clamp(16px, 5.1vw, 24px);
    line-height: 1.12;
  }

  .chatWeapons {
    left: min(calc(100vw - 110px), 280px);
    right: auto;
    top: max(74px, calc(env(safe-area-inset-top) + 74px));
    gap: 6px;
    transform: scale(.86);
    transform-origin: top right;
  }

  #chatWeaponToggle,
  #addAiButton,
  .chatTrashCan {
    min-width: 104px;
    width: 104px;
  }

  #chatWeaponToggle {
    min-height: 45px;
    font-size: 12px;
  }

  #addAiButton {
    min-height: 40px;
    font-size: 11px;
  }

  .chatTrashCan {
    min-height: 64px;
  }

  .trashLid {
    width: 48px;
    height: 8px;
  }

  .trashBody {
    width: 34px;
    height: 30px;
    border-width: 3px;
  }

  .trashText {
    font-size: 9px;
  }

  .chatWeaponPanel {
    width: min(218px, 66vw);
    max-height: min(174px, 35vh);
    padding: 8px;
  }

  .chatWeaponChoice {
    padding: 8px 9px;
  }

  #chatForm {
    left: 7px;
    right: auto;
    width: min(calc(100vw - 14px), 376px);
    grid-template-columns: 48px minmax(0, 1fr) 56px;
    gap: 5px;
  }

  .micButton {
    min-width: 48px;
    min-height: 48px;
    padding: 3px 4px 5px;
  }

  #chatInput {
    min-height: 48px;
    padding: 0 7px;
  }

  #chatForm button[type="submit"] {
    padding: 7px 6px;
    font-size: 10px;
  }

  .miniPanel {
    top: 52%;
    width: min(94vw, 390px);
    max-height: calc(var(--app-height, 100dvh) - 112px);
    overflow: auto;
    padding: 14px;
  }

  .stagePreviewGrid {
    grid-template-columns: repeat(2, minmax(96px, 1fr));
    gap: 8px;
  }

  .stageCard {
    min-height: 74px;
  }

  #miniInstructions {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .iconButton {
    top: max(8px, calc(env(safe-area-inset-top) + 8px));
  }

  h1 {
    margin-top: 0;
    font-size: clamp(42px, 8vw, 78px);
  }

  .tagline {
    margin-bottom: 36vh;
    font-size: 11px;
  }

  .panel,
  .hub {
    max-height: calc(var(--app-height, 100dvh) - 18px);
    overflow: auto;
    padding: 16px;
  }

  .hub {
    width: min(70vw, 620px);
    gap: 10px;
  }

  .hub h2 {
    font-size: clamp(34px, 7vw, 56px);
  }

  .modeButton {
    min-height: 56px;
    font-size: clamp(22px, 4vw, 34px);
  }

  .modeCanvas {
    height: 50px;
  }

  .topBar {
    top: max(7px, env(safe-area-inset-top));
  }

  #captionBar {
    top: max(54px, calc(env(safe-area-inset-top) + 54px));
    width: min(64vw, 760px);
    padding: 8px 12px;
  }

  #captionText {
    font-size: clamp(18px, 3.4vw, 30px);
  }

  .chatWeapons {
    top: max(66px, calc(env(safe-area-inset-top) + 66px));
    gap: 7px;
  }

  #chatWeaponToggle,
  #addAiButton,
  .chatTrashCan {
    min-width: 118px;
    width: 118px;
  }

  #chatWeaponToggle {
    min-height: 42px;
    font-size: 12px;
  }

  #addAiButton {
    min-height: 38px;
    font-size: 11px;
  }

  .chatTrashCan {
    min-height: 56px;
    grid-template-columns: auto 1fr;
    gap: 5px;
    padding: 4px 7px;
  }

  .trashLid {
    display: none;
  }

  .trashBody {
    width: 30px;
    height: 30px;
    border-width: 3px;
  }

  .trashText {
    font-size: 9px;
  }

  .chatWeaponPanel {
    width: min(240px, 40vw);
    max-height: min(180px, 48vh);
  }

  #chatForm {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: 56px minmax(0, 1fr) 72px;
  }

  #chatInput,
  .micButton,
  #chatForm button {
    min-height: 46px;
  }

  .miniPanel {
    top: 52%;
    width: min(72vw, 620px);
    max-height: calc(var(--app-height, 100dvh) - 84px);
    overflow: auto;
    padding: 14px;
    gap: 10px;
  }

  .stagePreviewGrid {
    grid-template-columns: repeat(5, minmax(62px, 1fr));
    gap: 7px;
  }

  .stageCard {
    min-height: 68px;
  }

  .mobileBlockButton {
    bottom: max(66px, calc(env(safe-area-inset-bottom) + 66px));
  }

  #miniInstructions {
    display: none;
  }
}

@media (min-width: 1200px) {
  .panel.hub {
    width: min(72vw, 760px);
  }

  .chatWeaponPanel {
    width: 304px;
  }
}
