:root,
:root[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #07080d;
  --bg-2: #0b0d18;
  --bg-rgb: 7, 8, 13;
  --sidebar: rgba(8, 9, 16, .92);
  --surface: #11131d;
  --surface-2: #171a27;
  --surface-soft: rgba(255, 255, 255, .035);
  --surface-hover: rgba(255, 255, 255, .065);
  --text: #ececf5;
  --text-soft: #c6c8d8;
  --muted: #85899f;
  --faint: #5d6176;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(142, 108, 255, .34);
  --accent: #8b5cf6;
  --accent-2: #4f7cff;
  --accent-3: #ce58ff;
  --accent-rgb: 139, 92, 246;
  --success: #52d99a;
  --danger: #ff6d88;
  --glow: rgba(108, 78, 255, .28);
  --glow-2: rgba(70, 130, 255, .17);
  --shadow: rgba(0, 0, 0, .52);
  --grid: rgba(147, 132, 235, .055);
}

/* DeformAI 3.7 — постоянные статусы и интерактивные миссии */
.participant-copy {
  min-width: 0;
}

.participant-rank {
  align-items: center;
  align-self: flex-start;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(151, 124, 255, 0.22);
  border-radius: 999px;
  color: var(--text-primary, #f7f7ff);
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  gap: 3px;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-top: 5px;
  max-width: 150px;
  overflow: hidden;
  padding: 5px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-rank i,
.top-rank i {
  font-style: normal;
}

.participant-rank[data-rank="vip"],
.top-rank[data-rank="vip"] {
  background: linear-gradient(135deg, rgba(255, 190, 65, 0.2), rgba(255, 120, 36, 0.08));
  border-color: rgba(255, 194, 75, 0.42);
  color: #ffd57b;
}

.participant-rank[data-rank="boss"],
.top-rank[data-rank="boss"] {
  background: linear-gradient(135deg, rgba(255, 70, 96, 0.18), rgba(112, 47, 255, 0.12));
  border-color: rgba(255, 99, 125, 0.4);
  color: #ff9bac;
}

.participant-rank.secret,
.top-rank.secret {
  border-style: dashed;
  box-shadow: 0 0 22px rgba(121, 86, 255, 0.14);
}

.top-rank {
  align-items: center;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(151, 124, 255, 0.2);
  border-radius: 999px;
  color: var(--text-primary, #f7f7ff);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  max-width: 190px;
  overflow: hidden;
  padding: 7px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-layer {
  align-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(103, 63, 255, 0.22), transparent 36%),
    rgba(3, 4, 10, 0.82);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 20px;
  position: fixed;
  transition: opacity 0.22s ease;
  z-index: 1200;
}

.mission-layer[hidden] {
  display: none;
}

.mission-layer.show {
  opacity: 1;
}

.mission-card {
  background:
    linear-gradient(145deg, rgba(22, 24, 37, 0.98), rgba(9, 10, 18, 0.99)),
    #0b0c14;
  border: 1px solid rgba(174, 151, 255, 0.28);
  border-radius: 28px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62), 0 0 50px rgba(111, 72, 255, 0.14);
  color: #f7f7ff;
  max-width: 520px;
  overflow: hidden;
  padding: 34px;
  position: relative;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.26s cubic-bezier(.2, .9, .3, 1);
  width: 100%;
}

.mission-layer.show .mission-card {
  transform: translateY(0) scale(1);
}

.mission-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  color: #bfc1d3;
  cursor: pointer;
  display: flex;
  font-size: 20px;
  height: 36px;
  justify-content: center;
  position: absolute;
  right: 18px;
  top: 18px;
  width: 36px;
}

.mission-kicker {
  color: #ff7891;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin: 0 48px 9px 0;
}

.mission-kicker.terminal {
  color: #68efad;
}

.mission-kicker.observer {
  color: #77b7ff;
}

.mission-card h2 {
  font-size: clamp(25px, 5vw, 38px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 12px;
}

.mission-copy {
  color: #aeb0c2;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.boss-arena {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 60, 91, 0.2), transparent 38%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  margin-bottom: 16px;
  padding: 24px;
}

.boss-creature {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 132px;
  justify-content: center;
  position: relative;
}

.boss-creature span {
  color: #ff5672;
  filter: drop-shadow(0 0 18px rgba(255, 57, 91, 0.8));
  font-size: 74px;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.boss-creature i {
  animation: mission-pulse 1.7s ease-in-out infinite;
  background: rgba(255, 66, 100, 0.22);
  border: 1px solid rgba(255, 94, 119, 0.45);
  border-radius: 50%;
  height: 110px;
  position: absolute;
  width: 110px;
}

.boss-creature b {
  color: #ff9cac;
  font-size: 11px;
  letter-spacing: 0.17em;
}

.boss-health > div {
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.boss-health > i {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  display: block;
  height: 10px;
  overflow: hidden;
}

.boss-health > i > b {
  background: linear-gradient(90deg, #ff3d60, #ff8c65);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.2s ease;
  width: 100%;
}

.mission-primary {
  background: linear-gradient(135deg, #7657ff, #4d7dff);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 12px 30px rgba(84, 74, 255, 0.24);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  padding: 14px 18px;
  width: 100%;
}

.boss-attack {
  background: linear-gradient(135deg, #ff365c, #9b3cff);
}

.mission-primary:active {
  transform: scale(0.985);
}

.mission-primary:disabled {
  cursor: default;
  opacity: 0.7;
}

.mission-reward {
  color: #8f91a4;
  display: block;
  font-size: 11px;
  margin-top: 13px;
  text-align: center;
}

.terminal-window {
  background: #050a08;
  border: 1px solid rgba(93, 239, 167, 0.25);
  border-radius: 16px;
  box-shadow: inset 0 0 35px rgba(44, 255, 151, 0.035);
  color: #62e9a5;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.75;
  margin: 22px 0 13px;
  padding: 18px;
}

.terminal-window p {
  margin: 0;
  opacity: 0.68;
}

.terminal-window strong {
  display: block;
  letter-spacing: 0.12em;
  margin-top: 7px;
}

.terminal-form {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
  padding: 7px 7px 7px 13px;
}

.terminal-form > span {
  color: #62e9a5;
  font-family: monospace;
  font-weight: 900;
}

.terminal-form input {
  background: transparent;
  border: 0;
  color: white;
  font-family: Consolas, monospace;
  min-width: 0;
  outline: 0;
  padding: 10px 2px;
}

.terminal-form button {
  background: #48d995;
  border: 0;
  border-radius: 10px;
  color: #06110d;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 12px;
}

.terminal-form.error {
  animation: mission-shake 0.34s ease;
  border-color: rgba(255, 80, 105, 0.72);
}

.observer-choices {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.observer-choices button {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  color: #ededf8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 15px 12px;
  text-align: left;
}

.observer-choices button:hover {
  background: rgba(102, 116, 255, 0.12);
  border-color: rgba(126, 111, 255, 0.34);
}

@keyframes mission-pulse {
  50% { opacity: 0.52; transform: scale(1.15); }
}

@keyframes mission-shake {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@media (max-width: 720px) {
  .top-rank {
    max-width: 42px;
    padding: 7px 9px;
  }

  .top-rank span {
    display: none;
  }

  .mission-layer {
    align-items: flex-end;
    padding: 8px;
  }

  .mission-card {
    border-radius: 25px 25px 18px 18px;
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    padding: 28px 20px 22px;
  }

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

  .terminal-form {
    grid-template-columns: auto 1fr;
  }

  .terminal-form button {
    grid-column: 1 / -1;
  }
}

:root[data-theme="ocean"] {
  --bg: #061114;
  --bg-2: #081a20;
  --bg-rgb: 6, 17, 20;
  --sidebar: rgba(6, 18, 21, .93);
  --surface: #0d2026;
  --surface-2: #122b33;
  --surface-soft: rgba(177, 245, 249, .035);
  --surface-hover: rgba(111, 226, 234, .075);
  --text: #eafcff;
  --text-soft: #bddadd;
  --muted: #789ca0;
  --faint: #507277;
  --line: rgba(181, 239, 245, .08);
  --line-strong: rgba(41, 204, 190, .34);
  --accent: #21c3b7;
  --accent-2: #348eea;
  --accent-3: #57e2da;
  --accent-rgb: 33, 195, 183;
  --success: #5ce2a3;
  --danger: #ff768b;
  --glow: rgba(25, 191, 180, .25);
  --glow-2: rgba(48, 135, 226, .17);
  --shadow: rgba(0, 8, 10, .54);
  --grid: rgba(98, 216, 212, .05);
}

:root[data-theme="neon"] {
  --bg: #090510;
  --bg-2: #12091e;
  --bg-rgb: 9, 5, 16;
  --sidebar: rgba(10, 6, 18, .93);
  --surface: #181021;
  --surface-2: #21142e;
  --surface-soft: rgba(250, 103, 255, .04);
  --surface-hover: rgba(100, 226, 255, .075);
  --text: #fff0ff;
  --text-soft: #e7d4ea;
  --muted: #a78dac;
  --faint: #705b78;
  --line: rgba(250, 126, 255, .09);
  --line-strong: rgba(89, 225, 255, .38);
  --accent: #f253ff;
  --accent-2: #46dff7;
  --accent-3: #9d5cff;
  --accent-rgb: 242, 83, 255;
  --success: #68f5b1;
  --danger: #ff6f9a;
  --glow: rgba(236, 57, 255, .27);
  --glow-2: rgba(60, 218, 247, .17);
  --shadow: rgba(0, 0, 0, .58);
  --grid: rgba(236, 91, 255, .055);
}

:root[data-theme="sunset"] {
  --bg: #14090e;
  --bg-2: #211018;
  --bg-rgb: 20, 9, 14;
  --sidebar: rgba(22, 9, 15, .93);
  --surface: #26131b;
  --surface-2: #311923;
  --surface-soft: rgba(255, 188, 124, .04);
  --surface-hover: rgba(255, 121, 106, .075);
  --text: #fff2ea;
  --text-soft: #ebd2c6;
  --muted: #b08a80;
  --faint: #765b59;
  --line: rgba(255, 189, 145, .085);
  --line-strong: rgba(255, 116, 97, .35);
  --accent: #ff647a;
  --accent-2: #f3a43e;
  --accent-3: #ff9965;
  --accent-rgb: 255, 100, 122;
  --success: #72e5a3;
  --danger: #ff6d7e;
  --glow: rgba(255, 80, 103, .25);
  --glow-2: rgba(244, 157, 55, .17);
  --shadow: rgba(11, 0, 5, .57);
  --grid: rgba(255, 144, 110, .05);
}

:root[data-theme="forest"] {
  --bg: #07110d;
  --bg-2: #0b1d15;
  --bg-rgb: 7, 17, 13;
  --sidebar: rgba(7, 18, 14, .94);
  --surface: #10221a;
  --surface-2: #162d22;
  --surface-soft: rgba(142, 229, 164, .035);
  --surface-hover: rgba(93, 205, 132, .075);
  --text: #effcf2;
  --text-soft: #cce2d2;
  --muted: #83a48d;
  --faint: #567060;
  --line: rgba(165, 228, 180, .075);
  --line-strong: rgba(74, 203, 119, .32);
  --accent: #48c879;
  --accent-2: #8bb94d;
  --accent-3: #5fe3a1;
  --accent-rgb: 72, 200, 121;
  --success: #61df97;
  --danger: #ff7882;
  --glow: rgba(50, 186, 104, .23);
  --glow-2: rgba(132, 178, 67, .15);
  --shadow: rgba(0, 8, 4, .55);
  --grid: rgba(102, 200, 133, .045);
}

:root[data-theme="graphite"] {
  --bg: #0b0c0f;
  --bg-2: #121318;
  --bg-rgb: 11, 12, 15;
  --sidebar: rgba(12, 13, 16, .94);
  --surface: #18191e;
  --surface-2: #202126;
  --surface-soft: rgba(255, 255, 255, .03);
  --surface-hover: rgba(255, 255, 255, .06);
  --text: #eeeeef;
  --text-soft: #c7c8cc;
  --muted: #898b92;
  --faint: #5d5f66;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(174, 176, 188, .25);
  --accent: #a5a7b2;
  --accent-2: #6f7585;
  --accent-3: #d1d2d8;
  --accent-rgb: 165, 167, 178;
  --success: #64d49b;
  --danger: #ff7288;
  --glow: rgba(164, 166, 177, .16);
  --glow-2: rgba(100, 104, 117, .12);
  --shadow: rgba(0, 0, 0, .58);
  --grid: rgba(184, 185, 194, .035);
}

:root[data-theme="aurora"] {
  --bg: #071013;
  --bg-2: #0a1b1a;
  --bg-rgb: 7, 16, 19;
  --sidebar: rgba(6, 17, 19, .94);
  --surface: #102321;
  --surface-2: #162d2b;
  --surface-soft: rgba(101, 239, 199, .035);
  --surface-hover: rgba(128, 102, 255, .085);
  --text: #effffb;
  --text-soft: #c9e5df;
  --muted: #82a7a1;
  --faint: #52746f;
  --line: rgba(142, 238, 218, .08);
  --line-strong: rgba(101, 229, 184, .35);
  --accent: #55e6b5;
  --accent-2: #8c66ff;
  --accent-3: #4bd9e8;
  --accent-rgb: 85, 230, 181;
  --success: #6befb7;
  --danger: #ff748f;
  --glow: rgba(60, 225, 174, .24);
  --glow-2: rgba(133, 92, 255, .18);
  --shadow: rgba(0, 9, 10, .58);
  --grid: rgba(93, 231, 190, .05);
}

:root[data-theme="ruby"] {
  --bg: #16070c;
  --bg-2: #240b12;
  --bg-rgb: 22, 7, 12;
  --sidebar: rgba(23, 6, 12, .94);
  --surface: #2b1019;
  --surface-2: #391621;
  --surface-soft: rgba(255, 100, 135, .04);
  --surface-hover: rgba(255, 75, 119, .09);
  --text: #fff1f4;
  --text-soft: #e9cbd2;
  --muted: #af838e;
  --faint: #795760;
  --line: rgba(255, 158, 178, .085);
  --line-strong: rgba(255, 75, 115, .38);
  --accent: #ff416d;
  --accent-2: #c83aff;
  --accent-3: #ff7895;
  --accent-rgb: 255, 65, 109;
  --success: #62dda3;
  --danger: #ff4965;
  --glow: rgba(255, 43, 92, .27);
  --glow-2: rgba(198, 51, 255, .16);
  --shadow: rgba(14, 0, 5, .62);
  --grid: rgba(255, 86, 123, .05);
}

:root[data-theme="ice"] {
  --bg: #07131d;
  --bg-2: #0a1e2c;
  --bg-rgb: 7, 19, 29;
  --sidebar: rgba(6, 19, 29, .94);
  --surface: #102839;
  --surface-2: #163449;
  --surface-soft: rgba(167, 226, 255, .04);
  --surface-hover: rgba(92, 196, 255, .09);
  --text: #f1fbff;
  --text-soft: #c9e4ef;
  --muted: #83aabd;
  --faint: #54778a;
  --line: rgba(167, 226, 255, .09);
  --line-strong: rgba(83, 192, 255, .4);
  --accent: #66cfff;
  --accent-2: #7d88ff;
  --accent-3: #a8eaff;
  --accent-rgb: 102, 207, 255;
  --success: #61e2b7;
  --danger: #ff7995;
  --glow: rgba(83, 194, 255, .25);
  --glow-2: rgba(111, 128, 255, .17);
  --shadow: rgba(0, 7, 13, .62);
  --grid: rgba(117, 209, 255, .055);
}

:root[data-theme="sakura"] {
  --bg: #160a12;
  --bg-2: #21101c;
  --bg-rgb: 22, 10, 18;
  --sidebar: rgba(23, 10, 19, .94);
  --surface: #291621;
  --surface-2: #351d2c;
  --surface-soft: rgba(255, 183, 214, .04);
  --surface-hover: rgba(255, 135, 188, .085);
  --text: #fff4fa;
  --text-soft: #ead3df;
  --muted: #ae8b9e;
  --faint: #765e6d;
  --line: rgba(255, 194, 220, .085);
  --line-strong: rgba(255, 136, 187, .36);
  --accent: #ff86b8;
  --accent-2: #b886ff;
  --accent-3: #ffc0da;
  --accent-rgb: 255, 134, 184;
  --success: #74dfa9;
  --danger: #ff6c91;
  --glow: rgba(255, 120, 176, .24);
  --glow-2: rgba(178, 126, 255, .16);
  --shadow: rgba(14, 3, 10, .6);
  --grid: rgba(255, 157, 201, .05);
}

:root[data-theme="royal"] {
  --bg: #090b1a;
  --bg-2: #10142a;
  --bg-rgb: 9, 11, 26;
  --sidebar: rgba(8, 10, 25, .95);
  --surface: #171c37;
  --surface-2: #202748;
  --surface-soft: rgba(255, 216, 111, .035);
  --surface-hover: rgba(100, 126, 255, .085);
  --text: #f8f7ff;
  --text-soft: #d7d5e8;
  --muted: #9295b2;
  --faint: #606480;
  --line: rgba(191, 196, 255, .08);
  --line-strong: rgba(255, 204, 91, .35);
  --accent: #f0c35b;
  --accent-2: #587cff;
  --accent-3: #a28bff;
  --accent-rgb: 240, 195, 91;
  --success: #63dca1;
  --danger: #ff728a;
  --glow: rgba(235, 188, 74, .2);
  --glow-2: rgba(72, 104, 255, .2);
  --shadow: rgba(1, 2, 13, .64);
  --grid: rgba(108, 123, 216, .055);
}

:root[data-theme="sand"] {
  --bg: #171108;
  --bg-2: #231a0d;
  --bg-rgb: 23, 17, 8;
  --sidebar: rgba(24, 17, 8, .95);
  --surface: #2b2113;
  --surface-2: #382b19;
  --surface-soft: rgba(255, 216, 154, .04);
  --surface-hover: rgba(235, 172, 86, .085);
  --text: #fff8eb;
  --text-soft: #e5d7bf;
  --muted: #aa9575;
  --faint: #746348;
  --line: rgba(255, 223, 170, .08);
  --line-strong: rgba(227, 164, 75, .35);
  --accent: #e4a74f;
  --accent-2: #d66c45;
  --accent-3: #f1ce82;
  --accent-rgb: 228, 167, 79;
  --success: #77d99d;
  --danger: #ff765e;
  --glow: rgba(224, 155, 61, .22);
  --glow-2: rgba(210, 91, 57, .15);
  --shadow: rgba(12, 7, 0, .62);
  --grid: rgba(228, 182, 104, .045);
}

:root[data-theme="mint"] {
  --bg: #06130f;
  --bg-2: #0a1e18;
  --bg-rgb: 6, 19, 15;
  --sidebar: rgba(5, 20, 15, .94);
  --surface: #102820;
  --surface-2: #17342a;
  --surface-soft: rgba(139, 255, 209, .035);
  --surface-hover: rgba(81, 225, 169, .08);
  --text: #effff8;
  --text-soft: #c8e8da;
  --muted: #7faa98;
  --faint: #507565;
  --line: rgba(159, 242, 208, .08);
  --line-strong: rgba(73, 218, 162, .36);
  --accent: #50dca7;
  --accent-2: #46bde0;
  --accent-3: #8af0c7;
  --accent-rgb: 80, 220, 167;
  --success: #63e3a8;
  --danger: #ff778d;
  --glow: rgba(61, 211, 155, .24);
  --glow-2: rgba(61, 181, 220, .15);
  --shadow: rgba(0, 10, 6, .6);
  --grid: rgba(89, 224, 173, .05);
}

:root[data-theme="cyber"] {
  --bg: #0b0d08;
  --bg-2: #12170b;
  --bg-rgb: 11, 13, 8;
  --sidebar: rgba(10, 13, 7, .95);
  --surface: #1a2110;
  --surface-2: #242d16;
  --surface-soft: rgba(224, 255, 77, .035);
  --surface-hover: rgba(213, 255, 57, .09);
  --text: #fbffe9;
  --text-soft: #dbe5bc;
  --muted: #97a578;
  --faint: #626e4a;
  --line: rgba(224, 255, 116, .085);
  --line-strong: rgba(205, 255, 52, .4);
  --accent: #c9ff35;
  --accent-2: #20dce6;
  --accent-3: #f0ff75;
  --accent-rgb: 201, 255, 53;
  --success: #65e59d;
  --danger: #ff607b;
  --glow: rgba(190, 255, 33, .22);
  --glow-2: rgba(28, 218, 229, .16);
  --shadow: rgba(3, 5, 0, .64);
  --grid: rgba(200, 255, 73, .055);
}

:root[data-theme="candy"] {
  --bg: #130918;
  --bg-2: #1e0e27;
  --bg-rgb: 19, 9, 24;
  --sidebar: rgba(19, 8, 25, .94);
  --surface: #281532;
  --surface-2: #351b42;
  --surface-soft: rgba(255, 139, 224, .04);
  --surface-hover: rgba(81, 221, 255, .085);
  --text: #fff2fd;
  --text-soft: #ead3e8;
  --muted: #ae8eac;
  --faint: #745d76;
  --line: rgba(255, 177, 236, .085);
  --line-strong: rgba(255, 103, 211, .38);
  --accent: #ff69cf;
  --accent-2: #50d9f4;
  --accent-3: #a985ff;
  --accent-rgb: 255, 105, 207;
  --success: #68e3ad;
  --danger: #ff6b8d;
  --glow: rgba(255, 74, 199, .25);
  --glow-2: rgba(62, 213, 242, .17);
  --shadow: rgba(9, 1, 12, .62);
  --grid: rgba(245, 105, 215, .05);
}

:root[data-theme="volcano"] {
  --bg: #170904;
  --bg-2: #241007;
  --bg-rgb: 23, 9, 4;
  --sidebar: rgba(24, 8, 3, .95);
  --surface: #2d160c;
  --surface-2: #3a1d0f;
  --surface-soft: rgba(255, 149, 78, .04);
  --surface-hover: rgba(255, 88, 48, .09);
  --text: #fff4eb;
  --text-soft: #ead0bf;
  --muted: #ad8670;
  --faint: #765744;
  --line: rgba(255, 180, 128, .085);
  --line-strong: rgba(255, 91, 48, .4);
  --accent: #ff5a32;
  --accent-2: #ffaf37;
  --accent-3: #ff7b3e;
  --accent-rgb: 255, 90, 50;
  --success: #70de98;
  --danger: #ff473d;
  --glow: rgba(255, 68, 30, .28);
  --glow-2: rgba(255, 159, 38, .17);
  --shadow: rgba(14, 3, 0, .65);
  --grid: rgba(255, 101, 54, .055);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html,
body {
  min-height: 100%;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% -15%, var(--glow), transparent 34%),
    radial-gradient(circle at 35% 110%, var(--glow-2), transparent 38%),
    linear-gradient(145deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .25s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--grid) 1px, transparent 1.3px);
  background-size: 27px 27px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
  opacity: .75;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(135px);
  pointer-events: none;
  opacity: .62;
  animation: drift 14s ease-in-out infinite alternate;
}

.ambient-one {
  top: -350px;
  right: 1%;
  background: var(--glow);
}

.ambient-two {
  bottom: -380px;
  left: 22%;
  background: var(--glow-2);
  animation-delay: -7s;
}

@keyframes drift {
  from { transform: translate3d(-18px, -8px, 0) scale(.93); }
  to { transform: translate3d(28px, 20px, 0) scale(1.08); }
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  z-index: 5;
  height: 100vh;
  padding: 20px 15px 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sidebar), rgba(var(--bg-rgb), .88));
  box-shadow: 18px 0 60px rgba(0, 0, 0, .12);
  backdrop-filter: blur(30px) saturate(130%);
}

.sidebar::before {
  content: "";
  position: absolute;
  top: -80px;
  left: -80px;
  width: 240px;
  height: 240px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .12), transparent 68%);
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-head,
.topbar,
.topbar-left,
.topbar-actions,
.brand {
  display: flex;
  align-items: center;
}

.sidebar-head {
  justify-content: space-between;
  padding: 2px 6px;
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 15px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: 0 12px 30px var(--glow), inset 0 1px rgba(255,255,255,.34);
  transform: rotate(-6deg);
  transition: transform .24s ease, box-shadow .24s ease;
}

.brand:hover .brand-mark {
  transform: rotate(2deg) scale(1.05);
  box-shadow: 0 15px 38px var(--glow), inset 0 1px rgba(255,255,255,.4);
}

.brand-mark span {
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  transform: rotate(6deg);
}

.brand-copy strong {
  display: block;
  font-size: 17px;
  letter-spacing: -.025em;
}

.brand-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.icon-button {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.close-sidebar,
.menu-button {
  display: none;
}

.new-chat {
  position: relative;
  width: 100%;
  min-height: 50px;
  margin-top: 24px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 29px 1fr auto;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), .34);
  border-radius: 15px;
  background: linear-gradient(125deg, rgba(var(--accent-rgb), .2), rgba(var(--accent-rgb), .07));
  box-shadow: inset 0 1px rgba(255,255,255,.04);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  transition: .2s ease;
}

.new-chat::after {
  content: "";
  position: absolute;
  top: -40px;
  left: -100px;
  width: 70px;
  height: 130px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transform: skewX(-22deg);
  transition: left .45s ease;
}

.new-chat:hover {
  border-color: rgba(var(--accent-rgb), .62);
  background: linear-gradient(125deg, rgba(var(--accent-rgb), .28), rgba(var(--accent-rgb), .1));
  box-shadow: 0 12px 30px var(--glow);
  transform: translateY(-2px);
}

.new-chat:hover::after {
  left: calc(100% + 25px);
}

.new-chat-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 18px;
  font-weight: 400;
  box-shadow: 0 6px 16px var(--glow);
}

kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--faint);
  font: 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.chat-search {
  height: 40px;
  margin-top: 13px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  color: var(--faint);
  transition: .18s ease;
}

.chat-search:focus-within {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.chat-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.chat-search input::placeholder {
  color: var(--faint);
}

.history-head {
  margin: 24px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.chat-count {
  min-width: 21px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  text-align: center;
  letter-spacing: 0;
}

.chat-history {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 1px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.chat-item {
  position: relative;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
}

.chat-item:hover,
.chat-item.active {
  border-color: var(--line);
  background: var(--surface-soft);
}

.chat-item.active {
  background: linear-gradient(100deg, rgba(var(--accent-rgb), .12), transparent);
}

.chat-item.active::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -1px;
  width: 2px;
  border-radius: 3px;
  background: linear-gradient(var(--accent-2), var(--accent));
  box-shadow: 0 0 12px var(--glow);
}

.chat-open {
  min-width: 0;
  flex: 1;
  padding: 9px 35px 9px 9px;
  display: grid;
  grid-template-columns: 27px minmax(0,1fr);
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.chat-symbol {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.chat-item.active .chat-symbol {
  background: rgba(var(--accent-rgb), .13);
  color: var(--accent);
}

.chat-label {
  min-width: 0;
}

.chat-label strong {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-label small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
}

.delete-chat {
  position: absolute;
  right: 7px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  font-size: 17px;
}

.chat-item:hover .delete-chat {
  color: var(--faint);
}

.delete-chat:hover {
  background: rgba(255, 88, 112, .09);
  color: var(--danger) !important;
}

.history-empty {
  margin: 30px 10px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.sidebar-foot {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.model-card {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
}

.gem-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), .16);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), .1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.model-card strong,
.model-card small {
  display: block;
}

.model-card strong {
  font-size: 11px;
}

.model-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 11px var(--success);
  animation: pulse 2.4s ease-in-out infinite;
}

.participant-card {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.018);
  cursor: pointer;
  text-align: left;
  transition: .18s ease;
}

.participant-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.participant-avatar {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  flex: 0 0 33px;
  border: 1px solid rgba(var(--accent-rgb), .18);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), .12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.participant-copy {
  min-width: 0;
  flex: 1;
}

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

.participant-copy strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-copy small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
}

.participant-edit {
  color: var(--faint);
  font-size: 11px;
}

.owner-note {
  margin: 8px 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--faint);
  font-size: 8px;
}

.owner-note span {
  color: var(--accent);
}

.sidebar-link {
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.sidebar-link:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.sidebar-scrim {
  display: none;
}

.chat-panel {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: 68px minmax(0,1fr) auto;
}

.topbar {
  padding: 0 24px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--bg-rgb), .52);
  backdrop-filter: blur(24px) saturate(130%);
}

.topbar-left,
.topbar-actions {
  gap: 11px;
}

.current-title {
  display: block;
  max-width: min(42vw, 430px);
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
}

.status {
  height: 32px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.022);
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.status.online {
  color: var(--success);
}

.status.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 11px var(--success);
  animation: pulse 2.4s ease-in-out infinite;
}

.status.offline {
  color: var(--danger);
}

.status.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 9px rgba(255, 109, 136, .45);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: .78; }
  50% { transform: scale(1.32); opacity: 1; }
}

.theme-wrap {
  position: relative;
}

.theme-toggle {
  font-size: 18px;
}

.theme-menu {
  position: absolute;
  z-index: 15;
  top: 46px;
  right: 0;
  width: 410px;
  max-width: calc(100vw - 24px);
  max-height: min(520px, calc(100vh - 90px));
  overflow-y: auto;
  padding: 11px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(var(--bg-rgb), .96);
  box-shadow: 0 24px 70px var(--shadow);
  backdrop-filter: blur(28px) saturate(140%);
  animation: menuIn .17s ease-out;
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.theme-menu p {
  grid-column: 1 / -1;
  margin: 5px 7px 6px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.theme-menu button {
  width: 100%;
  min-width: 0;
  padding: 9px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.theme-menu button:hover,
.theme-menu button.selected {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  color: var(--text);
}

.theme-menu button.selected {
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .09);
}

.theme-menu button > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-menu b {
  color: var(--accent);
  text-align: center;
}

.theme-swatch {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
}

.theme-swatch.midnight { background: linear-gradient(135deg, #0b0d18, #8b5cf6 58%, #4f7cff); }
.theme-swatch.ocean { background: linear-gradient(135deg, #071a20, #21c3b7 58%, #348eea); }
.theme-swatch.neon { background: linear-gradient(135deg, #16091f, #f253ff 52%, #46dff7); }
.theme-swatch.sunset { background: linear-gradient(135deg, #251018, #ff647a 55%, #f3a43e); }
.theme-swatch.forest { background: linear-gradient(135deg, #0a1d14, #48c879 55%, #8bb94d); }
.theme-swatch.graphite { background: linear-gradient(135deg, #111216, #767985 58%, #c4c5cb); }
.theme-swatch.aurora { background: linear-gradient(135deg, #071013, #55e6b5 46%, #8c66ff 72%, #4bd9e8); }
.theme-swatch.ruby { background: linear-gradient(135deg, #1c080e, #ff416d 58%, #c83aff); }
.theme-swatch.ice { background: linear-gradient(135deg, #081723, #66cfff 55%, #a8eaff); }
.theme-swatch.sakura { background: linear-gradient(135deg, #1d0c17, #ff86b8 55%, #b886ff); }
.theme-swatch.royal { background: linear-gradient(135deg, #0a0d20, #587cff 50%, #f0c35b); }
.theme-swatch.sand { background: linear-gradient(135deg, #1b1309, #e4a74f 58%, #d66c45); }
.theme-swatch.mint { background: linear-gradient(135deg, #071710, #50dca7 55%, #46bde0); }
.theme-swatch.cyber { background: linear-gradient(135deg, #0c1008, #c9ff35 52%, #20dce6); }
.theme-swatch.candy { background: linear-gradient(135deg, #180b20, #ff69cf 50%, #50d9f4); }
.theme-swatch.volcano { background: linear-gradient(135deg, #1c0a04, #ff5a32 55%, #ffaf37); }

.messages {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.welcome {
  width: min(820px, calc(100% - 44px));
  min-height: 100%;
  margin: 0 auto;
  padding: 48px 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-logo {
  position: relative;
  width: 106px;
  height: 106px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
}

.hero-logo::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 32px;
  background: rgba(var(--accent-rgb), .16);
  filter: blur(24px);
  animation: breathe 3.8s ease-in-out infinite;
}

.hero-orbit {
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(var(--accent-rgb), .34);
  border-radius: 34px;
  transform: rotate(12deg);
  animation: orbit 8s ease-in-out infinite;
}

.hero-orbit::before,
.hero-orbit::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.hero-orbit::before {
  top: 10px;
  right: 8px;
}

.hero-orbit::after {
  bottom: 9px;
  left: 13px;
  background: var(--accent-2);
  box-shadow: 0 0 14px var(--accent-2);
}

.hero-core {
  position: relative;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 24px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  box-shadow: 0 18px 48px var(--glow), inset 0 1px rgba(255,255,255,.38);
  transform: rotate(-5deg);
}

@keyframes orbit {
  0%, 100% { transform: rotate(12deg) translateY(0); }
  50% { transform: rotate(19deg) translateY(-5px); }
}

@keyframes breathe {
  0%, 100% { opacity: .55; transform: scale(.93); }
  50% { opacity: 1; transform: scale(1.08); }
}

.welcome-badge {
  margin-bottom: 14px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.welcome-badge span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 11px var(--success);
}

.welcome h1 {
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(34px, 4.1vw, 52px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.05em;
}

.welcome h1 em {
  background: linear-gradient(105deg, var(--accent-3), var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
  filter: drop-shadow(0 10px 26px var(--glow));
}

.welcome-copy {
  width: min(590px, 100%);
  margin: 15px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.suggestions {
  width: 100%;
  margin-top: 31px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.suggestions button {
  position: relative;
  min-height: 70px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 41px 1fr 18px;
  gap: 11px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  box-shadow: inset 0 1px rgba(255,255,255,.025);
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
}

.suggestions button::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -65px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), .12);
  filter: blur(22px);
  opacity: .35;
  transition: .24s ease;
}

.suggestions button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  box-shadow: 0 16px 38px rgba(0,0,0,.15), inset 0 1px rgba(255,255,255,.04);
  transform: translateY(-3px);
}

.suggestions button:hover::after {
  opacity: .85;
  transform: scale(1.18);
}

.suggestions button > * {
  position: relative;
  z-index: 1;
}

.suggestion-icon {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 13px;
  font-size: 16px;
}

.suggestion-icon.violet { color: #b79cff; background: rgba(139,92,246,.13); }
.suggestion-icon.blue { color: #78a8ff; background: rgba(79,124,255,.13); }
.suggestion-icon.rose { color: #ff8da4; background: rgba(239,83,117,.12); }
.suggestion-icon.green { color: #69d9a9; background: rgba(58,192,142,.12); }

.suggestions strong,
.suggestions small {
  display: block;
}

.suggestions strong {
  color: var(--text-soft);
  font-size: 11px;
}

.suggestions small {
  margin-top: 3px;
  color: var(--faint);
  font-size: 9px;
}

.suggestions b {
  color: var(--faint);
  font-size: 14px;
  font-weight: 500;
}

.welcome-features {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  color: var(--faint);
  font-size: 9px;
}

.welcome-features span::first-letter {
  color: var(--success);
}

.message-list {
  width: min(860px, calc(100% - 44px));
  margin: 0 auto;
  padding: 34px 0 24px;
}

.message {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 12px;
  align-items: start;
  animation: messageIn .24s ease-out both;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 9px 22px var(--glow);
}

.message.user .avatar {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
  box-shadow: none;
}

.message.admin .avatar {
  border-color: rgba(83, 217, 154, .24);
  background: linear-gradient(145deg, #31a972, #52d99a);
  box-shadow: 0 9px 22px rgba(50, 186, 125, .2);
}

.message-body {
  min-width: 0;
}

.message-head {
  height: 25px;
  margin: 0 3px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-name {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.copy-message {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.message:hover .copy-message {
  color: var(--faint);
}

.copy-message:hover {
  background: var(--surface-soft);
  color: var(--text) !important;
}

.bubble {
  width: fit-content;
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 5px 18px 18px 18px;
  background: rgba(255,255,255,.025);
  color: var(--text-soft);
  box-shadow: 0 9px 28px rgba(0,0,0,.06);
  font-size: 13px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.message.user .bubble {
  border-color: rgba(var(--accent-rgb), .16);
  border-radius: 18px 5px 18px 18px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .13), rgba(var(--accent-rgb), .055));
  color: var(--text);
}

.message.admin .bubble {
  border-color: rgba(83, 217, 154, .2);
  background: linear-gradient(135deg, rgba(83, 217, 154, .105), rgba(83, 217, 154, .035));
  color: var(--text);
}

.message.admin .message-name {
  color: var(--success);
}

.message.error .bubble {
  border-color: rgba(255, 92, 119, .25);
  color: var(--danger);
}

.message-text {
  white-space: pre-wrap;
}

.message-text + .message-text {
  margin-top: 8px;
}

.bubble pre {
  margin: 11px 0 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #05060a;
  color: #e6e8f0;
}

.code-header {
  padding: 8px 11px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: #858a9e;
  font: 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.bubble code {
  display: block;
  padding: 13px;
  overflow-x: auto;
  font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
}

.typing {
  display: flex;
  gap: 5px;
  padding: 18px 19px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: .13s; }
.typing i:nth-child(3) { animation-delay: .26s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.composer-wrap {
  padding: 12px 24px 16px;
  background: linear-gradient(transparent, rgba(var(--bg-rgb), .97) 34%);
}

.composer-shell {
  width: min(860px, 100%);
  margin: 0 auto;
}

.composer {
  min-height: 63px;
  padding: 9px 9px 9px 18px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid rgba(var(--accent-rgb), .27);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: 0 18px 50px var(--shadow), inset 0 1px rgba(255,255,255,.045);
  transition: .2s ease;
}

.composer:focus-within {
  border-color: rgba(var(--accent-rgb), .72);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .11), 0 20px 58px var(--shadow);
  transform: translateY(-1px);
}

.composer textarea {
  min-height: 42px;
  max-height: 170px;
  flex: 1;
  padding: 10px 0 8px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: var(--faint);
}

.composer textarea:disabled {
  opacity: .68;
}

.send {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 10px 25px var(--glow);
  cursor: pointer;
  font-size: 21px;
  transition: .18s ease;
}

.send:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-2px) scale(1.02);
}

.send:disabled {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--faint);
  box-shadow: none;
  cursor: default;
  opacity: .55;
}

.stop-square {
  display: none;
  font-size: 11px;
}

.send.loading .send-arrow { display: none; }
.send.loading .stop-square { display: inline; }

.send.loading {
  background: var(--surface-2);
  color: var(--danger);
  box-shadow: none;
}

.composer-meta {
  margin-top: 7px;
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 8px;
}

.toast {
  position: fixed;
  z-index: 50;
  bottom: 28px;
  left: 50%;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  box-shadow: 0 15px 45px var(--shadow);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(3,4,8,.78);
  backdrop-filter: blur(14px);
}

.modal {
  position: relative;
  width: min(430px, 100%);
  padding: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  box-shadow: 0 32px 95px rgba(0,0,0,.58);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 14px;
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.modal-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 21px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 14px 36px var(--glow);
  font-size: 28px;
  font-weight: 900;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .16em;
}

.modal h2 {
  margin: 0;
  font-size: 31px;
  letter-spacing: -.04em;
}

.modal-copy {
  margin: 12px auto 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.public-link,
.developers {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.public-link {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.public-link:hover {
  border-color: var(--line-strong);
}

.public-link span,
.public-link strong,
.developers span,
.developers strong {
  display: block;
}

.public-link span {
  color: var(--faint);
  font-size: 9px;
  text-transform: uppercase;
}

.public-link strong {
  color: var(--accent);
  font-size: 10px;
}

.developers {
  margin-top: 10px;
  padding: 12px;
}

.developers span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.developers strong {
  margin-top: 5px;
  font-size: 11px;
}

.version {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 8px;
}

.name-backdrop {
  background: rgba(3,4,8,.88);
}

.name-modal {
  width: min(450px, 100%);
}

.name-form {
  text-align: left;
}

.name-form label {
  display: block;
  margin: 0 0 7px 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.name-form input {
  width: 100%;
  height: 51px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: rgba(255,255,255,.025);
  color: var(--text);
  font-size: 13px;
  transition: .18s ease;
}

.name-form input:focus {
  border-color: rgba(var(--accent-rgb), .7);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1);
}

.name-form input::placeholder {
  color: var(--faint);
}

.name-form button {
  width: 100%;
  height: 49px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 12px 30px var(--glow);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.device-picker {
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  border: 0;
}

.device-picker legend {
  grid-column: 1 / -1;
  margin: 0 0 8px 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.device-picker button {
  height: 88px;
  margin: 0;
  padding: 9px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  box-shadow: none;
  color: var(--muted);
}

.device-picker button > span { font-size: 22px; }
.device-picker button strong { color: var(--text-soft); font-size: 9px; }
.device-picker button small { color: var(--faint); font-size: 7px; }

.device-picker button.selected {
  border-color: rgba(var(--accent-rgb), .5);
  background: rgba(var(--accent-rgb), .11);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .06);
}

.privacy-notice {
  margin: 14px 2px 0;
  padding: 11px 12px;
  border: 1px solid rgba(var(--accent-rgb), .14);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), .055);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  text-align: left;
}

.privacy-notice span {
  margin-right: 4px;
  color: var(--accent);
}

.prank-layer {
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.prank-layer span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: clamp(25px, 4vw, 55px);
  filter: drop-shadow(0 8px 15px rgba(0,0,0,.35));
  opacity: .78;
  transform: translate(-50%, -50%) rotate(var(--r));
  animation: prank-float 2.8s ease-in-out infinite alternate;
  animation-delay: var(--d);
}

body[data-prank="ducks"] .app-shell {
  filter: saturate(1.2) hue-rotate(-8deg);
}

body[data-prank="cats"] .app-shell {
  transform: rotate(.35deg) scale(.992);
}

body[data-prank="potatoes"] .app-shell {
  filter: sepia(.32) saturate(1.18);
}

body[data-prank="upside-down"] .app-shell {
  transform: rotate(180deg);
}

@keyframes prank-float {
  from { translate: 0 -5px; }
  to { translate: 0 8px; }
}

.moderation-screen {
  position: fixed;
  inset: 0;
  padding: 22px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 15%, rgba(var(--accent-rgb), .2), transparent 33%),
    rgba(3,4,8,.9);
  backdrop-filter: blur(20px);
}

.warning-screen { z-index: 90; }
.ban-screen { z-index: 100; }
.freeze-screen { z-index: 110; cursor: wait; }

.owner-announcement {
  position: fixed;
  z-index: 95;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(680px, calc(100% - 28px));
  min-height: 76px;
  padding: 13px 50px 15px 13px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), .34);
  border-radius: 19px;
  background:
    radial-gradient(circle at 10% 0, rgba(var(--accent-rgb), .2), transparent 42%),
    color-mix(in srgb, var(--surface-2) 94%, transparent);
  box-shadow: 0 24px 70px rgba(0,0,0,.48), 0 0 35px rgba(var(--accent-rgb), .09);
  backdrop-filter: blur(22px) saturate(1.2);
  opacity: 0;
  transform: translate(-50%, -125%) scale(.96);
  transition: opacity .25s ease, transform .35s cubic-bezier(.2,.8,.25,1);
}

.owner-announcement.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.owner-announcement-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), .38);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 10px 24px var(--glow);
  font-size: 12px;
  font-weight: 950;
}

.owner-announcement-copy,
.owner-announcement-copy strong,
.owner-announcement-copy > span {
  display: block;
}

.owner-announcement-copy strong {
  color: var(--text);
  font-size: 11px;
  letter-spacing: -.01em;
}

.owner-announcement-copy > span {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.owner-announcement > button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}

.owner-announcement-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left;
}

.owner-announcement.show .owner-announcement-progress {
  animation: announcement-progress 8s linear forwards;
}

@keyframes announcement-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.moderation-card {
  width: min(470px, 100%);
  padding: 36px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 27px;
  background:
    radial-gradient(circle at 100% 0, rgba(var(--accent-rgb), .14), transparent 38%),
    linear-gradient(145deg, var(--surface-2), var(--surface));
  box-shadow: 0 36px 110px rgba(0,0,0,.65);
  text-align: center;
}

.moderation-symbol {
  width: 68px;
  height: 68px;
  margin: 0 auto 19px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  font-size: 29px;
  font-weight: 950;
}

.moderation-symbol.warning {
  border: 1px solid rgba(255,193,95,.34);
  background: rgba(255,193,95,.11);
  color: #ffc15f;
  box-shadow: 0 16px 38px rgba(255,193,95,.1);
}

.moderation-symbol.ban {
  border: 1px solid rgba(255,109,136,.34);
  background: rgba(255,109,136,.1);
  color: var(--danger);
  box-shadow: 0 16px 38px rgba(255,109,136,.1);
}

.moderation-symbol.announcement {
  border: 1px solid rgba(79,124,255,.34);
  background: rgba(79,124,255,.11);
  color: #8fb2ff;
  box-shadow: 0 16px 38px rgba(79,124,255,.1);
}

.moderation-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .15em;
}

.moderation-card h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(25px, 5vw, 34px);
  letter-spacing: -.045em;
}

.moderation-copy {
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.68;
  white-space: pre-wrap;
}

.moderation-continue {
  width: 100%;
  height: 49px;
  margin-top: 24px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 12px 30px var(--glow);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.moderation-owner {
  width: fit-content;
  margin: 22px auto 0;
  padding: 10px 14px 10px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  text-align: left;
}

.moderation-owner > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #31a972, #52d99a);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.moderation-owner strong,
.moderation-owner small {
  display: block;
}

.moderation-owner strong { font-size: 11px; }
.moderation-owner small { margin-top: 2px; color: var(--muted); font-size: 8px; }

.moderation-hint {
  margin: 17px auto 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}

.appeal-open {
  width: 100%;
  height: 47px;
  margin-top: 17px;
  border: 1px solid rgba(139,92,246,.28);
  border-radius: 14px;
  background: rgba(139,92,246,.1);
  color: #c0aeff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.appeal-open:hover {
  border-color: rgba(139,92,246,.58);
  background: rgba(139,92,246,.16);
}

.appeal-form {
  margin-top: 17px;
  text-align: left;
}

.appeal-form label {
  display: block;
  margin: 0 0 7px 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.appeal-form textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: rgba(255,255,255,.025);
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
}

.appeal-form textarea:focus {
  border-color: rgba(var(--accent-rgb), .65);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .09);
}

.appeal-form > div {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 7px;
}

.appeal-form .appeal-attachment {
  margin-top: 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 9px;
  align-items: center;
}

.appeal-image-pick {
  height: 38px !important;
  padding: 0 12px;
  border: 1px solid rgba(var(--accent-rgb), .24);
  background: rgba(var(--accent-rgb), .07);
  color: var(--accent);
}

.appeal-image-pick span {
  margin-right: 4px;
  font-size: 13px;
}

.appeal-attachment > small {
  color: var(--faint);
  font-size: 8px;
  line-height: 1.45;
}

.appeal-image-preview {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(0,0,0,.2);
}

.appeal-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.appeal-image-preview button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  background: rgba(7,8,13,.82);
  color: #fff;
}

.appeal-form button {
  height: 41px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
}

.appeal-cancel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: var(--muted);
}

.appeal-submit {
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 10px 25px var(--glow);
}

.appeal-submit:disabled {
  opacity: .55;
  cursor: wait;
}

.appeal-status {
  margin: 17px 0 0;
  padding: 12px 13px;
  border: 1px solid rgba(82,217,154,.2);
  border-radius: 13px;
  background: rgba(82,217,154,.07);
  color: var(--success);
  font-size: 9px;
  line-height: 1.55;
}

.appeal-thread {
  margin-top: 17px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(139,92,246,.2);
  border-radius: 15px;
  background: rgba(8,9,15,.45);
  text-align: left;
}

.appeal-thread > header {
  min-height: 49px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(139,92,246,.055);
}

.appeal-thread > header strong,
.appeal-thread > header small { display: block; }
.appeal-thread > header strong { color: var(--text); font-size: 9px; }
.appeal-thread > header small { margin-top: 3px; color: var(--faint); font-size: 7px; }
.appeal-thread > header i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px var(--success); }

.appeal-thread-messages {
  max-height: 220px;
  padding: 10px;
  overflow-y: auto;
}

.appeal-thread-message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
  background: rgba(255,255,255,.035);
}

.appeal-thread-message.participant {
  margin-left: auto;
  border-color: rgba(var(--accent-rgb), .2);
  border-radius: 12px 12px 4px 12px;
  background: rgba(var(--accent-rgb), .09);
}

.appeal-thread-message header { display: flex; justify-content: space-between; gap: 12px; }
.appeal-thread-message header strong { color: var(--muted); font-size: 7px; }
.appeal-thread-message header time { color: var(--faint); font-size: 6px; }
.appeal-thread-message p { margin: 5px 0 0; color: var(--text-soft); font-size: 9px; line-height: 1.5; white-space: pre-wrap; }
.appeal-thread-message img { width: min(220px, 100%); max-height: 150px; margin-top: 7px; display: block; object-fit: contain; border-radius: 9px; background: rgba(0,0,0,.28); cursor: zoom-in; }
.appeal-thread-message img.expanded { width: 100%; max-height: none; }

.appeal-reply-form {
  padding: 9px;
  border-top: 1px solid var(--line);
}

.appeal-reply-form textarea {
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: rgba(255,255,255,.025);
  color: var(--text);
  font-size: 9px;
}

.appeal-reply-tools { margin-top: 7px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }
.appeal-reply-tools button { height: 36px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 8px; font-weight: 800; cursor: pointer; }
.appeal-reply-tools .appeal-reply-send { border-color: rgba(var(--accent-rgb), .25); background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }
.appeal-reply-form .appeal-image-preview { margin-top: 7px; height: 96px; }

.secret-layer {
  position: fixed;
  z-index: 98;
  inset: 0;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(2,3,8,.72);
  backdrop-filter: blur(13px);
  opacity: 0;
  transition: opacity .25s ease;
}

.secret-layer.show { opacity: 1; }

.secret-card {
  position: relative;
  width: min(430px, 100%);
  padding: 34px;
  overflow: hidden;
  border: 1px solid rgba(177,139,255,.34);
  border-radius: 25px;
  background: radial-gradient(circle at 50% 0, rgba(139,92,246,.24), transparent 42%), linear-gradient(145deg, #151323, #090a11);
  box-shadow: 0 35px 100px rgba(0,0,0,.65), 0 0 55px rgba(139,92,246,.12);
  text-align: center;
  transform: translateY(24px) scale(.92);
  transition: transform .38s cubic-bezier(.18,.8,.22,1);
}

.secret-layer.show .secret-card { transform: translateY(0) scale(1); }
.secret-card > button { position: absolute; top: 13px; right: 13px; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.035); color: #aaa5ba; cursor: pointer; font-size: 16px; }
.secret-icon { width: 76px; height: 76px; margin: 0 auto 18px; display: grid; place-items: center; border: 1px solid rgba(177,139,255,.32); border-radius: 24px; background: rgba(139,92,246,.12); box-shadow: 0 18px 50px rgba(139,92,246,.16); font-size: 34px; animation: secret-float 2s ease-in-out infinite alternate; }
.secret-card > p { margin: 0; color: #bda8ff; font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.secret-card > h2 { margin: 7px 0 0; color: #fff; font-size: 27px; letter-spacing: -.04em; }
.secret-card > span { margin-top: 11px; display: block; color: #b8b5c8; font-size: 11px; line-height: 1.6; }
.secret-layer[data-secret="hacker"] .secret-card { border-color: rgba(82,217,154,.35); background: radial-gradient(circle at 50% 0, rgba(82,217,154,.2), transparent 45%), #07110c; }
.secret-layer[data-secret="hacker"] .secret-icon, .secret-layer[data-secret="hacker"] p { color: #52d99a; border-color: rgba(82,217,154,.3); }
.secret-layer[data-secret="classified"] .secret-card, .secret-layer[data-secret="boss"] .secret-card { border-color: rgba(255,109,136,.36); background: radial-gradient(circle at 50% 0, rgba(255,109,136,.2), transparent 44%), #12080d; }
.secret-layer[data-secret="vip"] .secret-card { border-color: rgba(255,193,95,.38); background: radial-gradient(circle at 50% 0, rgba(255,193,95,.2), transparent 45%), #141006; }
.secret-layer[data-secret="portal"] .secret-icon { animation: secret-spin 4s linear infinite; }
@keyframes secret-float { to { transform: translateY(-8px) rotate(2deg); } }
@keyframes secret-spin { to { transform: rotate(360deg); } }

html[data-device="tablet"] .new-chat,
html[data-device="tablet"] .suggestions button,
html[data-device="tablet"] .participant-card { min-height: 52px; }

html[data-device="tablet"] .message-list { width: min(860px, calc(100% - 38px)); }

html[data-device="phone"] .app-shell { grid-template-columns: 1fr; }
html[data-device="phone"] .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(310px, 88vw); box-shadow: 24px 0 75px rgba(0,0,0,.48); transform: translateX(-105%); transition: transform .24s ease; }
html[data-device="phone"] body.sidebar-open .sidebar { transform: translateX(0); }
html[data-device="phone"] .sidebar-scrim { position: fixed; z-index: 4; inset: 0; display: block; border: 0; background: rgba(2,3,7,.64); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
html[data-device="phone"] body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
html[data-device="phone"] .close-sidebar,
html[data-device="phone"] .menu-button { display: grid; }
html[data-device="phone"] .chat-panel { height: 100svh; grid-template-rows: 58px minmax(0,1fr) auto; }
html[data-device="phone"] .topbar { padding: 0 10px; }
html[data-device="phone"] .current-subtitle,
html[data-device="phone"] .status span:last-child,
html[data-device="phone"] .keyboard-hint { display: none; }
html[data-device="phone"] .current-title { max-width: 43vw; }
html[data-device="phone"] .status { width: 30px; padding: 0; justify-content: center; }
html[data-device="phone"] .welcome { width: min(100% - 24px, 620px); padding: 22px 0 18px; }
html[data-device="phone"] .hero-logo { width: 76px; height: 76px; }
html[data-device="phone"] .hero-core { width: 51px; height: 51px; border-radius: 17px; font-size: 23px; }
html[data-device="phone"] .welcome h1 { font-size: 29px; }
html[data-device="phone"] .suggestions { margin-top: 18px; grid-template-columns: 1fr; gap: 7px; }
html[data-device="phone"] .suggestions button { min-height: 56px; }
html[data-device="phone"] .message-list { width: calc(100% - 20px); padding-top: 18px; }
html[data-device="phone"] .message { grid-template-columns: 31px minmax(0,1fr); gap: 8px; }
html[data-device="phone"] .avatar { width: 31px; height: 31px; border-radius: 10px; }
html[data-device="phone"] .bubble { padding: 11px 12px; border-radius: 14px; font-size: 11px; }
html[data-device="phone"] .composer-wrap { padding: 8px 8px max(9px, env(safe-area-inset-bottom)); }
html[data-device="phone"] .composer { min-height: 54px; border-radius: 16px; }
html[data-device="phone"] .composer-meta { display: none; }

.confetti-layer {
  position: fixed;
  z-index: 70;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.emoji-rain-layer {
  position: fixed;
  z-index: 75;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.emoji-rain-layer span {
  position: absolute;
  top: -70px;
  left: var(--x);
  font-size: clamp(25px, 4vw, 48px);
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.3));
  opacity: 0;
}

.emoji-rain-layer.active span {
  animation: emoji-rain var(--duration) cubic-bezier(.2,.72,.35,1) var(--delay) forwards;
}

@keyframes emoji-rain {
  0% { opacity: 0; transform: translate3d(0,-60px,0) rotate(0); }
  12% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(30px,115vh,0) rotate(var(--spin)); }
}

body[data-owner-effect="rainbow"] .app-shell {
  animation: owner-rainbow 4.5s linear infinite;
}

body[data-owner-effect="mirror"] .app-shell {
  transform: scaleX(-1);
}

body[data-owner-effect="tilt"] .app-shell {
  transform: rotate(2.2deg) scale(.965);
}

body[data-owner-effect="neon"] .app-shell {
  filter: saturate(1.45) contrast(1.08);
  box-shadow: inset 0 0 70px rgba(185,91,255,.18), 0 0 80px rgba(79,124,255,.16);
}

body[data-owner-effect="mono"] .app-shell {
  filter: grayscale(1) contrast(1.08);
}

body[data-owner-effect="cinema"] .app-shell {
  filter: sepia(.38) saturate(1.12) contrast(1.04);
}

body[data-owner-effect="crystal"] .app-shell {
  filter: saturate(.88) hue-rotate(178deg) brightness(1.08);
  box-shadow: inset 0 0 80px rgba(125,220,255,.18);
}

body[data-owner-effect="float"] .app-shell {
  animation: owner-float 3.8s ease-in-out infinite alternate;
}

@keyframes owner-rainbow {
  from { filter: hue-rotate(0deg) saturate(1.15); }
  to { filter: hue-rotate(360deg) saturate(1.15); }
}

@keyframes owner-float {
  from { transform: translateY(0) scale(.992); }
  to { transform: translateY(-9px) scale(.992); }
}

.confetti-layer i {
  position: absolute;
  top: -25px;
  left: var(--x);
  width: 9px;
  height: 16px;
  border-radius: 2px;
  background: var(--color);
  opacity: 0;
}

.confetti-layer i.round {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.confetti-layer.active i {
  animation: confetti-fall var(--duration) cubic-bezier(.18,.75,.35,1) var(--delay) forwards;
}

@keyframes confetti-fall {
  0% { opacity: 1; transform: translate3d(0,-20px,0) rotate(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(45px,110vh,0) rotate(var(--spin)); }
}

.freeze-spinner {
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(130,202,255,.25);
  border-radius: 25px;
  background: rgba(130,202,255,.08);
  box-shadow: 0 18px 45px rgba(73,156,255,.1);
}

.freeze-spinner i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #82caff;
  animation: freeze-pulse 1.1s ease-in-out infinite;
}

.freeze-spinner i:nth-child(2) { animation-delay: .15s; }
.freeze-spinner i:nth-child(3) { animation-delay: .3s; }

@keyframes freeze-pulse {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-5px); }
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 88vw);
    box-shadow: 24px 0 75px rgba(0,0,0,.48);
    transform: translateX(-105%);
    transition: transform .24s ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 4;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(2,3,7,.64);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .close-sidebar,
  .menu-button {
    display: grid;
  }

  .chat-panel {
    height: 100svh;
    grid-template-rows: 62px minmax(0,1fr) auto;
  }

  .topbar {
    padding: 0 14px;
  }

  .current-title {
    max-width: 39vw;
  }

  .status {
    width: 31px;
    padding: 0;
    justify-content: center;
  }

  .status span:last-child {
    display: none;
  }

  .welcome {
    width: min(100% - 28px, 700px);
    padding: 28px 0 22px;
  }

  .hero-logo {
    width: 84px;
    height: 84px;
    margin-bottom: 15px;
  }

  .hero-core {
    width: 56px;
    height: 56px;
    border-radius: 19px;
    font-size: 25px;
  }

  .welcome-copy {
    font-size: 12px;
  }

  .suggestions {
    margin-top: 23px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .suggestions button {
    min-height: 59px;
  }

  .welcome-features {
    margin-top: 18px;
    gap: 10px;
  }

  .message-list {
    width: calc(100% - 28px);
    padding-top: 24px;
  }

  .message {
    grid-template-columns: 34px minmax(0,1fr);
    gap: 9px;
  }

  .avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .bubble {
    padding: 12px 13px;
    font-size: 12px;
  }

  .composer-wrap {
    padding: 10px 11px 11px;
  }

  .composer {
    min-height: 57px;
    border-radius: 17px;
  }

  .composer-meta {
    justify-content: center;
  }

  .keyboard-hint {
    display: none;
  }
}

@media (max-width: 470px) {
  .device-picker { grid-template-columns: 1fr; }
  .device-picker button { height: 58px; padding: 8px 12px; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: 1fr 1fr; column-gap: 8px; text-align: left; }
  .device-picker button > span { grid-row: 1 / 3; align-self: center; font-size: 21px; }
  .device-picker button strong { align-self: end; }
  .device-picker button small { align-self: start; }

  .secret-card { padding: 29px 20px 25px; border-radius: 21px; }
  .secret-icon { width: 65px; height: 65px; border-radius: 21px; font-size: 29px; }
  .secret-card > h2 { font-size: 23px; }

  .owner-announcement {
    top: max(9px, env(safe-area-inset-top));
    width: calc(100% - 18px);
    min-height: 68px;
    padding: 10px 43px 12px 10px;
    grid-template-columns: 37px minmax(0, 1fr);
    gap: 9px;
    border-radius: 16px;
  }

  .owner-announcement-icon {
    width: 37px;
    height: 37px;
    border-radius: 11px;
  }

  .owner-announcement-copy strong { font-size: 10px; }
  .owner-announcement-copy > span { font-size: 9px; }

  .moderation-screen {
    padding: 12px;
  }

  .moderation-card {
    max-height: calc(100svh - 24px);
    padding: 25px 18px;
    overflow-y: auto;
    border-radius: 22px;
  }

  .appeal-form .appeal-attachment {
    grid-template-columns: 1fr;
  }

  .appeal-image-preview {
    grid-column: 1;
  }

  .welcome h1 {
    font-size: 31px;
  }

  .welcome-badge {
    font-size: 8px;
  }

  .welcome-features span:nth-child(3) {
    display: none;
  }

  .current-subtitle {
    display: none;
  }

  .current-title {
    max-width: 44vw;
  }

  .theme-menu {
    position: fixed;
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: calc(100dvh - 84px);
  }

  .theme-menu button {
    grid-template-columns: 30px minmax(0, 1fr) 13px;
    gap: 6px;
    padding: 7px;
    font-size: 10px;
  }

  .theme-swatch {
    width: 29px;
    height: 29px;
  }

  .modal {
    padding: 32px 20px 24px;
  }
}

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