:root {
  --bg: #05070b;
  --ink: #e7f7fb;
  --muted: #8aa3b0;
  --cyan: #00e8ff;
  --cyan-2: #6af6ff;
  --line: rgba(0, 232, 255, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Manrope", "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  background: #000;
  overflow: hidden;
}
html.is-locked .app,
html.is-locked .ghost,
html.is-locked .bg { visibility: hidden; pointer-events: none; }

.gate,
.hello {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  display: block;
  padding: 0;
}
.gate[hidden],
.hello[hidden] { display: none; }
.still {
  position: relative;
  overflow: hidden;
  background: #000;
}
.still-full {
  position: absolute;
  inset: 0;
}
.still-full::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 28%, transparent 22%, rgba(0, 0, 0, 0.2) 55%, #000 86%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 18%, transparent 42%, #000 86%);
}
.still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  display: block;
}
.still-side img {
  object-position: 48% 42%;
}
.fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  overflow: hidden;
}
.fx i {
  position: absolute;
  display: block;
}
.fx-aurora {
  inset: -18% -8%;
  background:
    radial-gradient(ellipse 70% 38% at 78% 8%, rgba(90, 230, 255, 0.22), transparent 58%),
    radial-gradient(ellipse 55% 42% at 18% 18%, rgba(70, 140, 220, 0.14), transparent 62%),
    linear-gradient(118deg, transparent 30%, rgba(80, 210, 255, 0.08) 48%, transparent 66%);
  filter: blur(22px);
  animation: aurora 16s ease-in-out infinite alternate;
}
.fx-veil {
  inset: 0;
  background: radial-gradient(ellipse at 50% 72%, rgba(0, 170, 210, 0.14), transparent 58%);
  animation: veil 12s ease-in-out infinite;
}
.fx-halo {
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(110, 235, 255, 0.28) 0%, rgba(0, 180, 255, 0.08) 42%, transparent 72%);
  animation: wanderA 11s ease-in-out infinite;
}
.fx-halo-2 {
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(180, 255, 255, 0.16) 0%, transparent 65%);
  animation: wanderB 14s ease-in-out infinite;
}
.fx-source {
  right: 10%;
  top: -10%;
  width: 30%;
  height: 26%;
  background: radial-gradient(ellipse at 70% 22%, rgba(230, 255, 255, 0.42) 0%, rgba(80, 210, 255, 0.16) 38%, transparent 70%);
  filter: blur(12px);
  animation: sourceGlow 9s ease-in-out infinite;
}
.fx-shaft {
  top: -28%;
  height: 118%;
  border-radius: 0;
  transform-origin: 50% 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(70, 200, 255, 0.0) 32%,
    rgba(120, 230, 255, 0.16) 46%,
    rgba(210, 255, 255, 0.34) 50%,
    rgba(120, 230, 255, 0.16) 54%,
    rgba(70, 200, 255, 0.0) 68%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 18%, rgba(0, 0, 0, 0.5) 58%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 18%, rgba(0, 0, 0, 0.5) 58%, transparent 100%);
  filter: blur(1.35px);
  animation: shaftBreathe 11s ease-in-out infinite;
}
.fx-sheen {
  left: -24%;
  top: -28%;
  width: 36%;
  height: 160%;
  background: linear-gradient(105deg, transparent 30%, rgba(180, 255, 255, 0.16) 48%, transparent 62%);
  filter: blur(10px);
  animation: sheen 11s ease-in-out infinite;
}
.fx-scan {
  left: 0;
  width: 100%;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(90, 230, 255, 0.1), transparent);
  animation: scanDown 18s linear infinite;
}

@keyframes aurora {
  from { transform: translate(-2%, 1%) scale(1); opacity: 0.4; }
  to { transform: translate(3%, -3%) scale(1.06); opacity: 0.85; }
}
@keyframes veil {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.08); }
}
@keyframes wanderA {
  0% { opacity: 0.28; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 0.7; transform: translate(-50%, -50%) translate(3%, -2%) scale(1.06); }
  100% { opacity: 0.28; transform: translate(-50%, -50%) scale(0.96); }
}
@keyframes wanderB {
  0% { opacity: 0.18; transform: translate(-50%, -50%) translate(2%, 3%) scale(1.04); }
  50% { opacity: 0.5; transform: translate(-50%, -50%) translate(-4%, -2%) scale(0.94); }
  100% { opacity: 0.18; transform: translate(-50%, -50%) translate(2%, 3%) scale(1.04); }
}
@keyframes sourceGlow {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}
@keyframes shaftBreathe {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.88; }
}
@keyframes sheen {
  0% { transform: translateX(-90%) rotate(16deg); opacity: 0; }
  10% { opacity: 0.4; }
  26% { opacity: 0; }
  100% { transform: translateX(170%) rotate(16deg); opacity: 0; }
}
@keyframes scanDown {
  0% { top: -24%; opacity: 0; }
  8% { opacity: 0.65; }
  90% { opacity: 0.4; }
  100% { top: 108%; opacity: 0; }
}
.still-front .fx-halo { left: 50%; top: 58%; width: 38%; height: 58%; }
.still-front .fx-halo-2 { left: 50%; top: 36%; width: 28%; height: 34%; }
.still-front .fx-shaft.s1 { left: 58%; width: 72px; transform: rotate(-32deg); animation-duration: 13s; }
.still-front .fx-shaft.s2 { left: 63%; width: 96px; transform: rotate(-27deg); animation-duration: 10.5s; animation-delay: -2s; }
.still-front .fx-shaft.s3 { left: 68%; width: 118px; transform: rotate(-22deg); animation-duration: 9s; animation-delay: -4s; }
.still-front .fx-shaft.s4 { left: 73%; width: 88px; transform: rotate(-18deg); animation-duration: 12s; animation-delay: -1s; }
.still-front .fx-shaft.s5 { left: 77%; width: 58px; transform: rotate(-14deg); animation-duration: 14s; animation-delay: -6s; }
.still-side .fx-halo { left: 46%; top: 54%; width: 36%; height: 54%; }
.still-side .fx-halo-2 { left: 42%; top: 32%; width: 26%; height: 32%; }
.still-side .fx-shaft.s1 { left: 57%; width: 70px; transform: rotate(-30deg); animation-duration: 13s; }
.still-side .fx-shaft.s2 { left: 63%; width: 94px; transform: rotate(-25deg); animation-duration: 10.5s; animation-delay: -2s; }
.still-side .fx-shaft.s3 { left: 69%; width: 116px; transform: rotate(-21deg); animation-duration: 9s; animation-delay: -4s; }
.still-side .fx-shaft.s4 { left: 74%; width: 86px; transform: rotate(-17deg); animation-duration: 12s; animation-delay: -1s; }
.still-side .fx-shaft.s5 { left: 78%; width: 56px; transform: rotate(-13deg); animation-duration: 14s; animation-delay: -6s; }
.gate .still,
.gate .gate-brand,
.gate .gate-panel {
  opacity: 0;
}
.gate .still { animation: fadeStill 2s ease 0.12s both; }
.gate .gate-brand { animation: fadeUp 1.35s ease 0.75s both; }
.gate .gate-panel { animation: fadeUp 1.2s ease 1.2s both; }
.gate.is-out,
.hello.is-out {
  animation: boot-out 0.95s ease forwards;
  pointer-events: none;
}
.hello .still,
.hello .hello-copy { opacity: 0; }
.hello.is-in .still { animation: fadeStill 1.7s ease both; }
.hello.is-in .hello-copy { animation: fadeUp 1.25s ease 0.45s both; }
@keyframes fadeStill {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.gate-brand {
  position: absolute;
  left: 50%;
  top: 4.2%;
  transform: translateX(-50%);
  z-index: 4;
  text-align: center;
  pointer-events: none;
  width: max-content;
  max-width: 96vw;
  padding: 0 16px;
}
.gate-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  mix-blend-mode: screen;
  display: block;
  margin: 0 auto 12px;
}
.gate-beta {
  display: inline-block;
  position: relative;
  font-family: Orbitron, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.46em;
  padding: 7px 18px 7px 22px;
  color: #9ff6ff;
  text-transform: uppercase;
  margin-bottom: 12px;
  background: rgba(0, 12, 22, 0.2);
}
.gate-beta::before,
.gate-beta::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: rgba(0, 232, 255, 0.7);
}
.gate-beta::before {
  top: 0;
  left: 0;
  border-top: 1px solid;
  border-left: 1px solid;
}
.gate-beta::after {
  right: 0;
  bottom: 0;
  border-right: 1px solid;
  border-bottom: 1px solid;
}
.gate-title {
  font-family: Syne, Manrope, sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 7.6vw, 88px);
  letter-spacing: 0.06em;
  line-height: 0.95;
  margin: 0;
  white-space: nowrap;
}
.gate-title .akira {
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(105deg, #f4feff 0%, #ffffff 22%, #8aefff 42%, #ffffff 58%, #c9fbff 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: inkShift 7.5s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(80, 220, 255, 0.4)) drop-shadow(0 8px 28px rgba(0, 0, 0, 0.45));
}
.gate-title .ai {
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  margin-left: 0.06em;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #f3ffff 0%, #5af0ff 48%, #00c8e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(0, 232, 255, 0.85)) drop-shadow(0 0 42px rgba(0, 180, 255, 0.4));
  animation: aiGlow 3.8s ease-in-out infinite;
}
.gate-title::after {
  content: "";
  display: block;
  width: 84px;
  height: 1px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, rgba(0, 232, 255, 0.85), transparent);
  animation: linePulse 4.8s ease-in-out infinite;
}
@keyframes inkShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes aiGlow {
  0%, 100% { opacity: 0.86; filter: drop-shadow(0 0 14px rgba(0, 232, 255, 0.7)); }
  50% { opacity: 1; filter: drop-shadow(0 0 26px rgba(90, 245, 255, 1)); }
}
@keyframes linePulse {
  0%, 100% { opacity: 0.35; width: 64px; }
  50% { opacity: 0.95; width: 110px; }
}
.gate-panel {
  position: absolute;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  padding: 0;
}
.gate-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #666;
  text-transform: lowercase;
}
.gate-panel input {
  width: min(460px, 88vw);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #2a2a2a;
  color: #fff;
  font-family: Orbitron, sans-serif;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 10px 0 12px;
  outline: none;
  text-transform: uppercase;
}
.gate-panel input:focus { border-bottom-color: #00e8ff; }
.gate-panel input[readonly] { opacity: 0.7; }
.gate-panel input.is-bad {
  border-bottom-color: #ff8aa0;
  animation: gateShake 0.38s ease;
}
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}
.gate-err {
  font-size: 12px;
  color: #ff8aa0;
  min-height: 16px;
}
@media (max-width: 640px) {
  .gate-brand { top: 4.5%; width: max-content; max-width: 100%; }
  .gate-title { font-size: clamp(34px, 11vw, 48px); }
  .gate-beta { font-size: 9px; letter-spacing: 0.36em; }
}
.hello { z-index: 70; }
.hello-copy {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  z-index: 4;
  width: min(90vw, 640px);
  text-align: center;
  padding: 0;
}
.hello-jp {
  font-family: "Noto Sans JP", sans-serif;
  letter-spacing: 0.4em;
  font-size: 11px;
  color: var(--cyan);
  margin-bottom: 10px;
}
.hello-copy h2 {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.guest {
  display: block;
  font-size: 11px;
  color: var(--cyan-2);
  margin-top: 2px;
}
@media (max-width: 800px) {
  .gate-panel { bottom: 5%; }
  .hello-copy { bottom: 8%; }
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #05070b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.boot-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.boot-logo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  mix-blend-mode: screen;
  opacity: 0;
  animation: boot-in 0.6s ease 0.15s forwards;
}
.boot-mark {
  margin-top: 14px;
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: rgba(0, 232, 255, 0.85);
  opacity: 0;
  animation: boot-in 0.5s ease 0.35s forwards;
}
.boot-bar {
  width: 88px;
  height: 1px;
  margin-top: 18px;
  background: rgba(0, 232, 255, 0.12);
  overflow: hidden;
  opacity: 0;
  animation: boot-in 0.4s ease 0.45s forwards;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #00e8ff;
  animation: boot-load 1.6s linear 0.55s forwards;
}
@keyframes boot-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes boot-load {
  from { width: 0; }
  to { width: 100%; }
}
.boot.is-out {
  animation: boot-out 0.45s ease forwards;
  pointer-events: none;
}
@keyframes boot-out {
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .boot { display: none; }
}

.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-photo {
  position: absolute; inset: 0;
  background: url("../img/attic.jpg") center/cover no-repeat;
  opacity: 0.32;
  filter: saturate(1.15) contrast(1.08) brightness(0.7);
  transform: scale(1.04);
}
.grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0, 232, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 232, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 20%, #000 18%, transparent 72%);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.4;
}
.orb-a { width: 420px; height: 420px; left: -80px; top: -40px; background: #053a48; }
.orb-b { width: 380px; height: 380px; right: -60px; bottom: -80px; background: #3a1230; }
.scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.015) 0 1px, transparent 1px 4px);
  opacity: 0.3; mix-blend-mode: overlay;
}
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.62) 100%);
}

.ghost {
  position: fixed;
  right: 3%;
  bottom: 10%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  filter: saturate(1.05);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(0, 232, 255, 0.7);
  animation: ping 1.8s infinite;
}
@keyframes ping {
  70% { box-shadow: 0 0 0 10px rgba(0, 232, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 232, 255, 0); }
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 920px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(6, 10, 16, 0.55), rgba(4, 7, 12, 0.78));
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(0, 232, 255, 0.08);
  border-right: 1px solid rgba(0, 232, 255, 0.08);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  flex: none;
  border-bottom: 1px solid rgba(0,232,255,0.1);
  background: rgba(4, 8, 12, 0.35);
}
.ghost-btn {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  transition: 0.2s ease;
}
.ghost-btn:hover { background: rgba(0, 232, 255, 0.08); }
.who { display: flex; align-items: center; gap: 10px; }
.who strong { display: block; font-size: 14px; }
.who span { font-size: 11px; color: var(--muted); }
.mini-av {
  width: 38px; height: 38px; border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--cyan);
  box-shadow: 0 0 16px rgba(0,232,255,0.35);
  background: #081018;
}
.mini-av img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;
}
.hud { display: flex; align-items: center; gap: 8px; }
.hud span {
  font-family: Orbitron, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--cyan);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
}

.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  min-height: 0;
}
.transcript::-webkit-scrollbar { width: 8px; }
.transcript::-webkit-scrollbar-thumb { background: rgba(0,232,255,0.25); border-radius: 8px; }

.empty {
  margin: auto;
  text-align: center;
  max-width: 460px;
  padding: 12px 8px 24px;
}
.empty-av {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(0,232,255,0.45);
  box-shadow: 0 0 0 6px rgba(0,232,255,0.06), 0 0 36px rgba(0,232,255,0.2);
  background: #081018;
}
.empty-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.empty-jp {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--cyan);
  letter-spacing: 0.4em;
  font-size: 11px;
  margin-bottom: 8px;
}
.empty h2 { font-size: 32px; letter-spacing: -0.04em; }
.empty p { color: var(--muted); margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chips button {
  border: 1px solid var(--line);
  background: rgba(0,232,255,0.05);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: 0.2s ease;
}
.chips button:hover { border-color: var(--cyan); color: var(--cyan-2); }

.row { display: flex; gap: 10px; max-width: 100%; width: 100%; animation: in 0.35s ease; }
.row.user { margin-left: auto; flex-direction: row-reverse; }
@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.av {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  overflow: hidden; background: #081018;
  border: 1px solid rgba(0,232,255,0.5);
}
.av img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;
}
.bubble {
  padding: 12px 16px;
  border-radius: 18px 18px 18px 6px;
  background: linear-gradient(180deg, rgba(12, 28, 36, 0.9), rgba(8, 16, 22, 0.9));
  border: 1px solid rgba(0,232,255,0.16);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 15px;
}
.body.is-typing::after {
  content: "▍";
  margin-left: 1px;
  color: var(--cyan);
  animation: caret 0.85s steps(1) infinite;
}
@keyframes caret {
  50% { opacity: 0; }
}
.row.user .bubble {
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(180deg, rgba(0, 70, 82, 0.55), rgba(0, 40, 50, 0.7));
  border-color: rgba(0,232,255,0.35);
}
.attach-in {
  display: block;
  max-width: 220px;
  border-radius: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}
.net {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 232, 255, 0.2);
  background: rgba(0, 40, 50, 0.35);
}
.net-orb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.net.is-live .net-orb { animation: ping 1.2s infinite; }
.net.is-done .net-orb { background: #7cffc4; box-shadow: 0 0 10px #7cffc4; animation: none; }
.net b {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--cyan-2);
}
.net span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frame {
  --ratio: 1 / 1;
  margin-top: 12px;
  width: min(420px, 86%);
  max-width: 100%;
  aspect-ratio: var(--ratio);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #04080c;
  border: 1px solid rgba(0, 232, 255, 0.32);
  box-shadow: 0 0 0 1px rgba(0, 232, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.42);
}
.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  filter: blur(14px) saturate(0.25) brightness(0.7);
  transition: opacity 0.75s ease, filter 0.95s ease, transform 0.95s ease;
  z-index: 1;
}
.frame.is-ready img {
  opacity: 1;
  transform: none;
  filter: none;
}
.tank {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(0, 90, 110, 0.32), transparent 58%),
    linear-gradient(180deg, #08141c, #03060a);
  transition: opacity 0.55s ease;
}
.frame.is-ready .tank,
.frame.is-ready .frame-cap {
  opacity: 0;
  pointer-events: none;
  display: none;
}
.grain {
  position: absolute;
  inset: -20%;
  opacity: 0.22;
  background-image: radial-gradient(rgba(180, 255, 255, 0.35) 0.6px, transparent 0.8px);
  background-size: 3px 3px;
  animation: grain 0.35s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 34%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(0, 232, 255, 0.07),
    rgba(180, 255, 255, 0.28),
    rgba(0, 232, 255, 0.07),
    transparent
  );
  mix-blend-mode: screen;
  animation: wipe 2.4s ease-in-out infinite;
}
@keyframes wipe {
  0% { top: -40%; }
  100% { top: 110%; }
}
.chem {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -6%;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(0, 210, 230, 0.16) 55%, rgba(0, 120, 140, 0.22));
  filter: blur(8px);
  animation: tide 3.2s ease-in-out infinite;
}
@keyframes tide {
  0%, 100% { transform: translateY(18%) scaleX(1.02); opacity: 0.55; }
  50% { transform: translateY(0); opacity: 1; }
}
.c {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 232, 255, 0.75);
  z-index: 3;
  pointer-events: none;
}
.c-tl { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.c-tr { top: 9px; right: 9px; border-left: 0; border-bottom: 0; }
.c-bl { bottom: 9px; left: 9px; border-right: 0; border-top: 0; }
.c-br { bottom: 9px; right: 9px; border-left: 0; border-top: 0; }
.frame-cap {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 4;
  font-family: Orbitron, sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 12px rgba(0, 232, 255, 0.45);
  transition: opacity 0.45s ease;
}
.frame-cap span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: ping 1.5s infinite;
  flex: none;
}
.frame.is-fail .tank {
  background: linear-gradient(180deg, #18080c, #080305);
}
.frame.is-fail .frame-cap { color: #ff8aa0; }
.frame.is-fail .frame-cap span { background: #ff8aa0; box-shadow: 0 0 10px #ff8aa0; }
.frame.is-ready { cursor: zoom-in; }

.viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 5, 8, 0.92);
  flex-direction: column;
}
.viewer.is-open { display: flex; }
.viewer-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: grab;
}
.viewer-stage.is-drag { cursor: grabbing; }
.viewer-stage img {
  max-width: min(92vw, 1100px);
  max-height: calc(100vh - 88px);
  object-fit: contain;
  border-radius: 8px;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-bar {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 18px;
}
.viewer-bar button,
.viewer-bar a {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(8, 16, 22, 0.9);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.viewer-bar button:hover,
.viewer-bar a:hover {
  border-color: var(--cyan);
  color: var(--cyan-2);
}

.typing {
  display: flex; gap: 5px; align-items: center; height: 18px;
}
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  animation: bounce 1s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}


.composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0,232,255,0.1);
  flex: none;
  background: rgba(4, 8, 12, 0.4);
}
.field {
  flex: 1;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 12px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: 0.2s ease;
}
.field:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0,232,255,0.08), 0 0 28px rgba(0,232,255,0.12);
}
textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  max-height: 160px;
  line-height: 1.45;
}
.icon-btn, .send {
  width: 48px; height: 48px; flex: none;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.3);
  color: var(--cyan);
  cursor: pointer;
  display: grid; place-items: center;
  transition: 0.2s ease;
}
.send {
  background: linear-gradient(180deg, #00e8ff, #00a8c4);
  color: #041016;
  border: 0;
  box-shadow: 0 8px 24px rgba(0,232,255,0.28);
}
.icon-btn:hover, .send:hover { transform: translateY(-1px); }
.send:disabled { opacity: 0.45; transform: none; cursor: wait; }
.preview {
  position: relative; width: 72px;
}
.preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.preview button {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: #111; color: #fff; cursor: pointer;
}

@media (max-width: 920px) {
  .app {
    max-width: none;
    border: 0;
    height: 100dvh;
  }
  .ghost { display: none; }
  .frame { width: min(100%, 86vw); }
}
