/* ============================================================
   SUICIDE HOTLINE CHAT ROOM — happystoner5420 Games
   AAA dark glassmorphism chat UI. 100% offline. No fonts/CDN.
   ============================================================ */

:root {
  --bg-0: #04050a;
  --bg-1: #0a0d16;
  --bg-2: #10141f;
  --panel: rgba(16, 20, 32, 0.72);
  --panel-solid: #12161f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --txt: #e8eaf2;
  --txt-dim: #8b91a5;
  --txt-faint: #565d73;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #ff3b6b;
  --danger: #ff2244;
  --danger-glow: rgba(255, 34, 68, 0.45);
  --good: #2ee67f;
  --gold: #ffc933;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 70% -10%, #171233 0%, var(--bg-0) 55%) fixed, var(--bg-0);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.noise-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

#app { position: relative; z-index: 2; height: 100%; }

.screen { height: 100%; }
.hidden { display: none !important; }

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

/* ============================================================
   MAIN MENU
   ============================================================ */
#menu {
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.menu-inner { text-align: center; max-width: 720px; padding: 24px; animation: menuIn 1.1s cubic-bezier(.16,1,.3,1) both; }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(26px) scale(.97); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.menu-badge {
  display: inline-block; font-size: 11px; letter-spacing: 6px; color: var(--txt-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 18px;
  background: rgba(255,255,255,.03); margin-bottom: 26px; text-transform: uppercase;
}

.game-title {
  font-size: clamp(38px, 7vw, 78px);
  font-weight: 900; letter-spacing: 2px; line-height: 1.02;
  background: linear-gradient(180deg, #fff 0%, #cfc6ff 40%, #7c5cff 80%, #3a2a7a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(124,92,255,.35);
  position: relative;
  animation: titleFlicker 6s infinite;
}
@keyframes titleFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; } 93% { opacity: .55; } 94% { opacity: 1; }
  96% { opacity: .75; } 97% { opacity: 1; }
}
.game-title::after {
  content: attr(data-text); position: absolute; inset: 0;
  background: linear-gradient(180deg, #fff, #cfc6ff 40%, #7c5cff 80%, #3a2a7a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  clip-path: inset(0 0 0 0);
  animation: glitchSlice 4.2s infinite steps(1);
  opacity: 0;
}
@keyframes glitchSlice {
  0%, 7%, 9%, 100% { opacity: 0; }
  8% { opacity: .8; clip-path: inset(12% 0 62% 0); transform: translateX(-4px); }
}
.game-title::before {
  content: attr(data-text); position: absolute; inset: 0; color: transparent;
  background: linear-gradient(180deg, #ff3b6b, #ff3b6b);
  -webkit-background-clip: text; background-clip: text;
  clip-path: inset(0 0 0 0);
  animation: glitchSlice2 3.7s infinite steps(1);
  opacity: 0;
}
@keyframes glitchSlice2 {
  0%, 13%, 15%, 100% { opacity: 0; }
  14% { opacity: .7; clip-path: inset(58% 0 18% 0); transform: translateX(5px); }
}

.title-sub {
  margin-top: 14px; font-size: 15px; letter-spacing: 8px; text-transform: uppercase;
  color: var(--txt-dim);
}
.title-sub::before, .title-sub::after { content: " ☠ "; color: var(--danger); }

.menu-buttons { margin-top: 48px; display: flex; flex-direction: column; gap: 14px; align-items: center; }

.btn {
  font-family: var(--font); font-size: 14px; font-weight: 700; letter-spacing: 2px;
  color: var(--txt); background: rgba(255,255,255,.05);
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 14px 34px; cursor: pointer; min-width: 260px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  text-transform: uppercase;
}
.btn:hover {
  background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3);
  transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.btn:active { transform: translateY(0) scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-color: rgba(168,85,247,.6);
  box-shadow: 0 6px 26px rgba(124,92,255,.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #8f6fff, #b76aff); box-shadow: 0 10px 34px rgba(124,92,255,.55); }

.btn-danger {
  background: rgba(255,34,68,.12); border-color: rgba(255,34,68,.5); color: #ff8096;
}
.btn-danger:hover { background: rgba(255,34,68,.22); border-color: var(--danger); box-shadow: 0 8px 28px var(--danger-glow); }

.menu-disclaimer {
  margin-top: 44px; font-size: 12px; line-height: 1.7; color: var(--txt-faint);
  max-width: 560px; margin-left: auto; margin-right: auto;
}

/* ============================================================
   GAME LAYOUT
   ============================================================ */
#game { display: flex; background: rgba(5,6,12,.55); backdrop-filter: blur(10px); }

#sidebar {
  width: 292px; min-width: 292px; height: 100%;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14,17,28,.92), rgba(9,11,19,.92));
}
#sidebar-head { padding: 16px 14px 12px; border-bottom: 1px solid var(--line); }
.logo-mini { font-weight: 900; letter-spacing: 2px; font-size: 15px; color: var(--txt); }
.logo-mini b { color: var(--danger); }
#stats { display: flex; gap: 12px; margin-top: 8px; font-size: 10px; letter-spacing: 1.5px; color: var(--txt-faint); }
.stat b { font-size: 14px; color: var(--txt); }
#stat-saved { color: var(--good) !important; }
#stat-alive { color: var(--accent-2) !important; }

#npc-list { flex: 1; overflow-y: auto; padding: 8px 8px 20px; }

.npc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 4px;
  transition: background .15s, border-color .15s;
  position: relative;
}
.npc-item:hover { background: rgba(255,255,255,.05); border-color: var(--line); }
.npc-item.active { background: rgba(124,92,255,.14); border-color: rgba(124,92,255,.4); }
.npc-item.dead { opacity: .45; }
.npc-item.dead .npc-name { text-decoration: line-through; text-decoration-color: var(--danger); text-decoration-thickness: 2px; }

.avatar-wrap { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
.avatar-wrap img, .avatar-wrap canvas {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line-strong);
  background: linear-gradient(135deg, #1c2233, #0e1120);
}
.npc-item.typing .avatar-wrap img { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.npc-item.crisis .avatar-wrap img { border-color: var(--danger); animation: crisisPulse 1s infinite; box-shadow: 0 0 14px var(--danger-glow); }
@keyframes crisisPulse { 50% { box-shadow: 0 0 24px var(--danger-glow); } }

.red-x {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900; color: var(--danger);
  text-shadow: 0 0 10px var(--danger), 0 0 26px var(--danger);
  animation: xSlam .5s cubic-bezier(.2,2,.4,1) both;
}
@keyframes xSlam { from { transform: scale(3) rotate(-40deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }

.npc-info { flex: 1; min-width: 0; }
.npc-name { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.npc-name .illness-chip {
  font-size: 8.5px; font-weight: 800; letter-spacing: 1px; padding: 2px 6px; border-radius: 6px;
  background: rgba(124,92,255,.18); color: #b9a8ff; border: 1px solid rgba(124,92,255,.35);
  white-space: nowrap;
}
.npc-name .illness-chip.schizo { background: rgba(255,59,107,.14); color: #ff9db4; border-color: rgba(255,59,107,.4); }
.npc-name .illness-chip.bipolar { background: rgba(34,211,238,.12); color: #7fe3f7; border-color: rgba(34,211,238,.35); }
.npc-name .illness-chip.saved-chip { background: rgba(255,201,51,.14); color: var(--gold); border-color: rgba(255,201,51,.4); }

.hope-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); margin-top: 5px; overflow: hidden; }
.hope-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--danger), #ff8c42 55%, var(--good)); width: 50%; transition: width .6s cubic-bezier(.2,.8,.2,1); }

.npc-status { font-size: 9.5px; letter-spacing: 1px; color: var(--txt-faint); margin-top: 3px; text-transform: uppercase; }
.npc-status .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.dot.online { background: var(--good); box-shadow: 0 0 6px var(--good); }
.dot.typing { background: var(--accent-2); animation: blink 1s infinite; }
.dot.dead { background: var(--danger); }
.dot.crisis { background: var(--danger); animation: blink .5s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ============================================================
   CHAT AREA
   ============================================================ */
#chat-area { flex: 1; height: 100%; display: flex; flex-direction: column; min-width: 0; }

#chat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: rgba(14,17,28,.6);
}
#chat-header-title { font-size: 16px; font-weight: 800; letter-spacing: 1px; }
#chat-header-sub { font-size: 11.5px; color: var(--txt-dim); margin-top: 2px; }
#chat-header-avatars { display: flex; margin-left: auto; align-items: center; }
#chat-header-avatars img {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-1);
  margin-left: -8px; background: #1a2033;
}
#chat-header-avatars img:first-child { margin-left: 0; }

.chat-actions { display: flex; gap: 8px; }
.icon-btn {
  font-size: 15px; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--txt);
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.icon-btn.muted { opacity: .45; }

#channels-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); overflow-x: auto; background: rgba(8,10,17,.7);
  scrollbar-width: none;
}
#channels-bar::-webkit-scrollbar { display: none; }
.chan-chip {
  flex-shrink: 0; font-family: var(--font); font-size: 11.5px; font-weight: 700; letter-spacing: 1px;
  color: var(--txt-dim); background: rgba(255,255,255,.04);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer;
  transition: all .15s;
}
.chan-chip:hover { color: var(--txt); background: rgba(255,255,255,.09); }
.chan-chip.active { color: #0a0d16; background: linear-gradient(135deg, var(--accent), #a855f7); border-color: transparent; box-shadow: 0 3px 16px rgba(124,92,255,.4); }
.chan-chip.new { border-style: dashed; border-color: rgba(34,211,238,.5); color: var(--accent-2); }
.chan-chip.new:hover { background: rgba(34,211,238,.12); }
.chan-chip .x-close { margin-left: 8px; opacity: .6; font-weight: 900; }
.chan-chip .x-close:hover { opacity: 1; color: var(--danger); }

/* ---- messages ---- */
#chat-scroll {
  flex: 1; overflow-y: auto; padding: 18px 20px 10px;
  scroll-behavior: smooth;
}

.msg {
  display: flex; gap: 11px; margin-bottom: 14px;
  animation: msgIn .35s cubic-bezier(.2,.9,.3,1.2) both;
  max-width: 88%;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.msg .m-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: linear-gradient(135deg,#1c2233,#0e1120); border: 2px solid var(--line-strong); }

.msg-body { min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.m-name { font-size: 12.5px; font-weight: 800; letter-spacing: .4px; }
.m-time { font-size: 10px; color: var(--txt-faint); }
.m-illness { font-size: 8.5px; font-weight: 800; letter-spacing: 1px; padding: 1.5px 6px; border-radius: 5px; background: rgba(124,92,255,.15); color: #b9a8ff; border: 1px solid rgba(124,92,255,.3); }
.m-illness.schizo { background: rgba(255,59,107,.12); color: #ff9db4; border-color: rgba(255,59,107,.35); }
.m-illness.bipolar { background: rgba(34,211,238,.1); color: #7fe3f7; border-color: rgba(34,211,238,.3); }

.m-bubble {
  display: inline-block; padding: 9px 13px; border-radius: 4px 14px 14px 14px;
  background: rgba(255,255,255,.055); border: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; user-select: text;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.msg.self { margin-left: auto; flex-direction: row-reverse; }
.msg.self .m-bubble {
  background: linear-gradient(135deg, rgba(124,92,255,.28), rgba(168,85,247,.22));
  border-color: rgba(124,92,255,.45);
  border-radius: 14px 4px 14px 14px;
}
.msg.self .msg-meta { flex-direction: row-reverse; }
.msg.self .m-name { color: #c3b6ff; }

.msg.system { max-width: 100%; justify-content: center; margin: 6px 0 14px; }
.msg.system .m-bubble {
  background: rgba(0,0,0,.35); border-color: var(--line); color: var(--txt-dim);
  font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; text-align: center;
  border-radius: 999px; padding: 7px 18px; width: fit-content;
}
.msg.system .m-bubble.dark { color: #ff8096; border-color: rgba(255,34,68,.35); }

.msg.death-announce .m-bubble { border-color: var(--danger); box-shadow: 0 0 18px rgba(255,34,68,.18); animation: deathFlash 1s; }
@keyframes deathFlash { 0% { background: rgba(255,34,68,.28); } 100% { background: rgba(255,255,255,.055); } }

.msg .m-quote {
  font-size: 11.5px; color: var(--txt-dim); border-left: 2px solid var(--line-strong);
  padding-left: 8px; margin-bottom: 5px; font-style: italic;
}

/* typing indicator */
#typing-bar { min-height: 24px; padding: 0 22px 6px; font-size: 11.5px; color: var(--txt-faint); letter-spacing: .5px; }
.typing-dots { display: inline-block; }
.typing-dots span { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--txt-faint); animation: tbounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes tbounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* quick chips */
#quick-chips { display: flex; gap: 8px; padding: 8px 16px 4px; overflow-x: auto; scrollbar-width: none; }
#quick-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--txt-dim); background: rgba(46,230,127,.06);
  border: 1px solid rgba(46,230,127,.28); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--good); background: rgba(46,230,127,.14); transform: translateY(-1px); }

/* composer */
#composer {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 16px 16px; border-top: 1px solid var(--line);
  background: rgba(10,12,20,.85);
}
#composer-input {
  flex: 1; resize: none; font-family: var(--font); font-size: 14px; color: var(--txt);
  background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 14px; outline: none; max-height: 130px; line-height: 1.45;
  transition: border-color .2s, box-shadow .2s;
}
#composer-input:focus { border-color: rgba(124,92,255,.6); box-shadow: 0 0 0 3px rgba(124,92,255,.15); }
#composer-input::placeholder { color: var(--txt-faint); }
.btn-send {
  min-width: 96px; padding: 12px 18px; border-radius: 12px; font-size: 13px;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3,4,8,.78); backdrop-filter: blur(12px);
  animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: min(560px, 92vw); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(22,26,40,.97), rgba(13,16,26,.97));
  border: 1px solid var(--line-strong); border-radius: 20px;
  padding: 30px 34px; text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
  animation: cardIn .4s cubic-bezier(.2,1.1,.3,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.95); } to { opacity: 1; transform: none; } }

.modal-card h2 { font-size: 21px; letter-spacing: 3px; margin-bottom: 18px; font-weight: 900; }
.modal-card.small { width: min(440px, 92vw); }
.modal-sub { font-size: 12.5px; color: var(--txt-dim); margin-bottom: 14px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.modal-actions .btn { min-width: 170px; }

.howto-body { text-align: left; font-size: 13px; line-height: 1.65; color: var(--txt-dim); }
.howto-body p { margin-bottom: 13px; }
.howto-body b { color: var(--txt); }

/* credits */
.credits-logo { font-size: 56px; animation: floatSkull 3s ease-in-out infinite; }
@keyframes floatSkull { 50% { transform: translateY(-8px) rotate(-4deg); } }
.credits-title { font-size: 17px; font-weight: 900; letter-spacing: 3px; margin: 10px 0 8px; }
.credits-studio {
  display: inline-block; margin: 10px 0 6px; font-size: 26px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold), #ff8c42); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(255,201,51,.25);
}
.credits-body p { font-size: 12.5px; color: var(--txt-dim); line-height: 1.7; }
.credits-small { font-size: 11px !important; margin-top: 8px; }

/* death modal */
.death-card { border-color: rgba(255,34,68,.4); }
#death-skull svg { width: 96px; height: 96px; animation: floatSkull 3s ease-in-out infinite, skullFlicker 4s infinite; filter: drop-shadow(0 0 24px var(--danger-glow)); }
@keyframes skullFlicker { 0%,100%{opacity:1} 95%{opacity:.4} 96%{opacity:1} }
.death-avatar-wrap { position: relative; width: 108px; height: 108px; margin: 16px auto 10px; }
.death-avatar-wrap img { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; filter: grayscale(1) brightness(.65); border: 3px solid var(--danger); box-shadow: 0 0 30px var(--danger-glow); }
.red-x-big {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 74px; font-weight: 900; color: var(--danger); transform: rotate(-8deg);
  text-shadow: 0 0 14px var(--danger), 0 0 40px var(--danger);
  animation: xSlam .6s cubic-bezier(.2,2,.4,1) both .15s;
}
.death-tag { font-size: 10.5px; letter-spacing: 3px; color: var(--txt-faint); text-transform: uppercase; margin-top: 4px; }
.death-desc { font-size: 13.5px; line-height: 1.7; color: var(--txt-dim); margin: 16px 0 12px; text-align: left; }
.death-desc b { color: var(--txt); }
.death-quote {
  font-style: italic; font-size: 12.5px; color: #ff9db4; border-left: 3px solid var(--danger);
  padding: 8px 14px; text-align: left; background: rgba(255,34,68,.07); border-radius: 0 10px 10px 0; margin-bottom: 20px;
}

/* group modal */
#group-list { max-height: 260px; overflow-y: auto; text-align: left; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.group-pick {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: all .12s; font-size: 13px;
}
.group-pick:hover { background: rgba(255,255,255,.05); }
.group-pick.selected { background: rgba(124,92,255,.15); border-color: rgba(124,92,255,.45); }
.group-pick img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.group-pick .pick-box { margin-left: auto; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent; }
.group-pick.selected .pick-box { background: var(--accent); border-color: var(--accent); color: #fff; }
#group-name {
  width: 100%; font-family: var(--font); font-size: 13px; color: var(--txt);
  background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 12px; outline: none; margin-bottom: 4px;
}
#group-name:focus { border-color: rgba(124,92,255,.6); }

/* end screen */
.end-card { border-color: var(--line-strong); }
#end-skull svg { width: 84px; height: 84px; }
#end-title { font-size: 30px; letter-spacing: 4px; }
#end-sub { color: var(--txt-dim); font-size: 13.5px; margin-bottom: 18px; }
.end-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.end-stat {
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 20px; min-width: 110px;
}
.end-stat .v { font-size: 26px; font-weight: 900; }
.end-stat .k { font-size: 9.5px; letter-spacing: 2px; color: var(--txt-faint); margin-top: 3px; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(20,24,38,.95); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 22px; font-size: 13px; z-index: 90;
  box-shadow: 0 14px 40px rgba(0,0,0,.6); animation: toastIn .3s cubic-bezier(.2,1.2,.3,1) both;
  max-width: 80vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.warn { border-color: rgba(255,201,51,.5); }
.toast.bad { border-color: rgba(255,34,68,.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  #sidebar { width: 220px; min-width: 220px; }
  .npc-name { font-size: 12px; }
  .msg { max-width: 97%; }
}
@media (max-width: 640px) {
  #sidebar { display: none; }
}