:root {
  --bg: #05060a;
  --surface: #0b0d14;
  --surface-2: #10131c;
  --line: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.12);
  --text: #e8ecf5;
  --text-2: #7a8199;
  --text-3: #3f4557;
  --cyan: #00e5ff;
  --violet: #8b5cff;
  --lime: #b8ff3d;
  --pink: #ff2e88;
  --amber: #ffb020;
}

html[data-theme="light"] {
  --bg: #f2f4f9;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --line: rgba(0,0,0,0.08);
  --line-2: rgba(0,0,0,0.14);
  --text: #0d1220;
  --text-2: #5a627a;
  --text-3: #98a0b8;
}

html[data-theme="comfort"] {
  --bg: #1a1410;
  --surface: #241b15;
  --surface-2: #2e2319;
  --line: rgba(255,220,180,0.08);
  --line-2: rgba(255,220,180,0.14);
  --text: #f0e4d0;
  --text-2: #a89680;
  --text-3: #6b5a48;
  --cyan: #e8a05a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv03', 'cv04';
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Убираем дефолтный стиль ссылок на всей странице */
a,
a:visited,
a:hover,
a:active,
a:focus {
  color: inherit;
  text-decoration: none;
}

/* На всякий случай — если ссылка обёрнута вокруг блока */
a * {
  text-decoration: none;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
textarea, input { font: inherit; }

::selection { background: var(--cyan); color: var(--bg); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

.mono { font-family: 'JetBrains Mono', monospace; }

/* ============ STATUS BAR ============ */
.statusbar {
  height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--surface);
  font-size: 11.5px; font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2);
  flex-shrink: 0; position: relative; z-index: 20;
}
.statusbar::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 180px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.sb-left, .sb-center, .sb-right { display: flex; align-items: center; gap: 20px; }
.sb-item { display: flex; align-items: center; gap: 7px; }
.sb-item .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 8px var(--amber);
  animation: pulse 2s infinite;
}
.sb-item .dot.on { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.sb-item .dot.off { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }
.sb-item .val { color: var(--text); font-weight: 500; }
.sb-logo {
  font-weight: 800; font-size: 14px; letter-spacing: -0.02em; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.sb-logo .mark {
  width: 18px; height: 18px; border-radius: 5px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: grid; place-items: center; font-size: 9px; color: #000; font-weight: 900;
}
.sb-logo .ver { font-size: 10px; color: var(--text-3); font-weight: 500; }

/* ============ NOW PLAYING ============ */
.nowplaying-bar {
  height: 32px; flex-shrink: 0; overflow: hidden;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  position: relative; z-index: 19;
}
#cosmoNowPlayingInner { height: 100%; overflow: hidden; }
.marquee-container { height: 100%; width: 100%; overflow: hidden; position: relative; }
.marquee-content { height: 100%; display: flex; align-items: center; will-change: transform; }
.marquee-item {
  display: inline-flex; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--text-2); white-space: nowrap;
}

/* ============ APP LAYOUT ============ */
.app {
  flex: 1; display: grid;
  grid-template-columns: minmax(60px, 220px) 1fr;
  min-height: 0; position: relative;
}

/* ============ LEFT RAIL ============ */
.rail {
  border-right: 1px solid var(--line); padding: 20px 0;
  display: flex; flex-direction: column; overflow-y: auto; background: var(--surface);
  min-width: 0;
}
.rail-section { padding: 0 16px; margin-bottom: 24px; }
.rail-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-3);
  padding: 0 10px; margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.rail-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all 0.15s;
  position: relative; width: 100%; text-align: left;
}
.rail-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.rail-item.active { color: var(--text); background: rgba(0,229,255,0.06); }
.rail-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--cyan);
  border-radius: 0 3px 3px 0; box-shadow: 0 0 12px var(--cyan);
}
.rail-item i { width: 16px; font-size: 13px; opacity: 0.85; }
.rail-item .kbd {
  margin-left: auto; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-3); padding: 1px 5px;
  border: 1px solid var(--line-2); border-radius: 4px; line-height: 1.2;
}
.rail-item.active .kbd { color: var(--cyan); border-color: rgba(0,229,255,0.3); }

.rail-user {
  margin-top: auto; margin-inline: 16px;
  padding: 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.rail-user .av {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13px;
  flex-shrink: 0; position: relative;
  background-size: cover; background-position: center;
}
.rail-user .av::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--lime); border: 2px solid var(--surface-2);
}
.rail-user .info { flex: 1; min-width: 0; }
.rail-user .name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.rail-user .lvl { font-size: 10.5px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

/* ============ CENTER ============ */
.center { overflow-y: auto; overflow-x: hidden; padding: clamp(16px, 3vw, 32px); position: relative; }
.center::before {
  content: ''; position: fixed; top: -200px; left: 0;
  width: 50vw; height: 500px;
  background: radial-gradient(ellipse, rgba(139,92,255,0.14), transparent 60%);
  filter: blur(60px); pointer-events: none; z-index: 0;
}
.center > * { position: relative; z-index: 1; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 1px solid var(--line); gap: 20px; flex-wrap: wrap;
}
.page-head h1 {
  font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.04em; line-height: 1;
}
.page-head h1 .accent { color: var(--cyan); }
.page-head .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.1em; display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.page-head .meta strong { color: var(--text); font-weight: 500; }

.inline-search {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text); outline: none; min-width: 220px;
}
.inline-search:focus { border-color: var(--cyan); }

/* ============ HERO ============ */
.hero {
  position: relative; border-radius: 20px; overflow: hidden;
  margin-bottom: 40px; aspect-ratio: 21 / 9;
  background: linear-gradient(135deg, #1a0e3d 0%, #0a1a3d 50%, #3d0e2a 100%);
  cursor: pointer; transition: transform 0.3s;
  width: 100%; text-align: left; display: block;
}
.hero:hover { transform: scale(1.005); }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(139,92,255,0.5), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,229,255,0.35), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(255,46,136,0.3), transparent 60%);
  mix-blend-mode: screen;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(115deg, transparent 0 40px, rgba(255,255,255,0.02) 40px 41px),
    linear-gradient(180deg, transparent 40%, rgba(5,6,10,0.9) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 2; padding: 36px 40px; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 5px;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15); color: var(--text);
}
.tag.live {
  background: var(--pink); border-color: var(--pink); color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
}
.tag.live::before {
  content: ''; width: 5px; height: 5px;
  background: #fff; border-radius: 50%; animation: pulse 1.2s infinite;
}
.hero-bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 40px; flex-wrap: wrap;
}
.hero-title {
  font-size: clamp(30px, 4.2vw, 56px); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1;
  max-width: 620px; text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
.hero-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: rgba(255,255,255,0.7); letter-spacing: 0.05em;
  margin-top: 12px; text-transform: uppercase;
}
.hero-play {
  width: 72px; height: 72px; border-radius: 50%;
  background: #fff; color: var(--bg);
  display: grid; place-items: center; font-size: 22px;
  flex-shrink: 0; transition: transform 0.25s;
  box-shadow: 0 20px 60px rgba(255,255,255,0.3);
}
.hero:hover .hero-play { transform: scale(1.08) rotate(-8deg); }

/* ============ STRIP ============ */
.strip-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px; gap: 20px;
}
.strip-title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 12px;
}
.strip-title .count {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-3); font-weight: 400;
}
.strip-all {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-2); display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.15s, gap 0.2s;
}
.strip-all:hover { color: var(--cyan); gap: 12px; }

.games-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 200px;
  gap: 12px; overflow-x: auto;
  padding: 4px 0 12px; margin: 0 -32px 40px;
  padding-inline: 32px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.games-rail::-webkit-scrollbar { display: none; }

.game-tile {
  scroll-snap-align: start; aspect-ratio: 3 / 4; border-radius: 14px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform 0.25s cubic-bezier(.2,.9,.3,1.2);
  border: 1px solid var(--line);
  width: 100%; text-align: left; padding: 0; display: block;
}
.game-tile:hover { transform: translateY(-6px); border-color: rgba(255,255,255,0.2); }
.game-tile::before {
  content: ''; position: absolute; inset: 0; transition: transform 0.4s;
}
.game-tile:hover::before { transform: scale(1.05); }
.game-tile.g1::before { background: linear-gradient(160deg, #2a1a5c, #7c2fff 60%, #ff2e88); }
.game-tile.g2::before { background: linear-gradient(160deg, #0a2e3d, #00b8d4 60%, #00e5ff); }
.game-tile.g3::before { background: linear-gradient(160deg, #3d1a08, #ff6b20 60%, #ffb020); }
.game-tile.g4::before { background: linear-gradient(160deg, #2a3d0a, #7cb800 60%, #b8ff3d); }
.game-tile.g5::before { background: linear-gradient(160deg, #3d0a2a, #c4177a 60%, #ff2e88); }
.game-tile.g6::before { background: linear-gradient(160deg, #1a1a3d, #5c5cff 60%, #8b5cff); }
.game-tile.g7::before { background: linear-gradient(160deg, #1a3d2a, #14a55c 60%, #3dffa0); }
.game-tile.g8::before { background: linear-gradient(160deg, #3d2a1a, #a55c14 60%, #ffa03d); }
.game-tile::after {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 20px, rgba(255,255,255,0.03) 20px 21px),
    linear-gradient(180deg, transparent 50%, rgba(5,6,10,0.95) 100%);
}
.game-meta {
  position: absolute; inset: 0; padding: 16px; z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between;
}
.game-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
  display: grid; place-items: center; font-size: 18px; color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}
.game-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  width: fit-content; font-weight: 700;
}
.game-badge.hot { background: var(--pink); border-color: var(--pink); color: #fff; }
.game-badge.new { background: var(--lime); border-color: var(--lime); color: #000; }
.game-bottom h3 {
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1; text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}
.game-bottom .online {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: rgba(255,255,255,0.7);
  margin-top: 4px; display: flex; align-items: center; gap: 6px;
}
.game-bottom .online .pulse {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 6px var(--lime);
}

/* ============ SPLIT ============ */
.col-split {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px; margin-bottom: 40px;
}
.block-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.block-title h2 {
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.block-title h2::before {
  content: ''; width: 3px; height: 14px;
  background: var(--cyan); border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan);
}
.block-title .k {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============ STREAM ============ */
.stream-row {
  display: grid; grid-template-columns: 60px 1fr auto;
  gap: 14px; align-items: center;
  padding: 12px 10px; border-radius: 10px;
  cursor: pointer; transition: background 0.15s;
  border: 1px solid transparent;
  width: 100%; text-align: left;
}
.stream-row:hover { background: var(--surface-2); border-color: var(--line); }
.stream-thumb {
  width: 60px; height: 40px; border-radius: 8px;
  position: relative; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  display: grid; place-items: center;
  font-size: 18px; color: #fff;
}
.stream-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}
.stream-thumb.s1 { background: linear-gradient(135deg, #0077ff, #2aabee); }
.stream-thumb.s2 { background: linear-gradient(135deg, #2aabee, #00e5ff); }
.stream-thumb.s3 { background: linear-gradient(135deg, #ff0033, #ff5c8a); }
.stream-thumb.s4 { background: linear-gradient(135deg, #c4177a, #ff2e88); }
.stream-info h4 {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stream-info span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--text-3);
  display: block; margin-top: 3px; letter-spacing: 0.03em;
}
.stream-viewers {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.stream-viewers i { color: var(--pink); font-size: 10px; }

/* ============ SESSION row ============ */
.session-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 10px; border-radius: 10px;
  cursor: pointer; transition: background 0.15s;
  border: 1px solid transparent;
  width: 100%; text-align: left;
}
.session-row:hover { background: var(--surface-2); border-color: var(--line); }
.session-info h4 {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-info span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--text-3);
  letter-spacing: 0.03em;
}
.session-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--text-2); text-transform: uppercase;
}
.session-status.open { color: var(--lime); border-color: rgba(184,255,61,0.3); }
.session-status.playing { color: var(--cyan); border-color: rgba(0,229,255,0.3); }

/* ============ APPS ============ */
.apps-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-top: 4px;
}
.app-tile {
  padding: 18px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
  width: 100%; text-align: left;
}
.app-tile:hover {
  border-color: rgba(255,255,255,0.18);
  background: var(--surface-2);
  transform: translateY(-3px);
}
.app-tile::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.app-tile:hover::after { opacity: 1; }
.app-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 16px; color: #fff;
}
.app-icon.a1 { background: linear-gradient(135deg, var(--violet), var(--pink)); }
.app-icon.a2 { background: linear-gradient(135deg, var(--cyan), var(--violet)); }
.app-icon.a3 { background: linear-gradient(135deg, var(--lime), var(--cyan)); color: #000; }
.app-icon.a4 { background: linear-gradient(135deg, var(--amber), var(--pink)); }
.app-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.app-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--text-3);
  letter-spacing: 0.02em; margin-top: 2px;
}

/* ============ CHAT ============ */
.chat-feed {
  flex: 1; overflow-y: auto; padding: 18px 18px 8px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}

/* Chat events — события ChatManager */
.chat-event {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.5; color: var(--text-2);
  word-wrap: break-word; animation: slide 0.3s;
}
@keyframes slide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-event--message .chat-user { font-weight: 700; color: var(--text); margin-right: 6px; }
.chat-event--message .chat-text { color: var(--text-2); }
.chat-event--donation {
  background: rgba(255,46,136,0.08); border: 1px solid rgba(255,46,136,0.25);
  padding: 8px 12px; border-radius: 10px; color: var(--text);
}
.chat-event--donation .chat-amount { color: var(--pink); font-weight: 700; }
.chat-event--alert {
  background: rgba(255,176,32,0.08); border: 1px solid rgba(255,176,32,0.25);
  padding: 8px 12px; border-radius: 10px; color: var(--text);
}
.chat-event--track {
  background: rgba(0,229,255,0.06); border: 1px solid rgba(0,229,255,0.25);
  padding: 8px 12px; border-radius: 10px; color: var(--text);
}
.chat-event--system {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.06em; padding: 8px 12px; text-align: center;
  background: var(--surface-2); border-radius: 8px;
}
.chat-icon { font-size: 14px; flex-shrink: 0; }

.chat-input-wrap {
  padding: 14px 18px 18px; border-top: 1px solid var(--line); flex-shrink: 0;
}
.chat-form {
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 6px 6px 14px;
  transition: border-color 0.15s;
}
.chat-form:focus-within {
  border-color: rgba(0,229,255,0.4);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.08);
}
.chat-form textarea {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 13.5px; color: var(--text); padding: 6px 0;
  resize: none; max-height: 120px; font-family: inherit;
}
.chat-form textarea::placeholder { color: var(--text-3); }
.chat-send {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--cyan); color: #000;
  display: grid; place-items: center; font-size: 12px;
  transition: transform 0.15s, background 0.15s; flex-shrink: 0;
}
.chat-send:hover { background: var(--lime); transform: scale(1.05); }

/* ============ SETTINGS ============ */
.settings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.settings-card {
  padding: 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.settings-card h3 {
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 4px; display: flex; align-items: center; gap: 10px;
}
.settings-card h3 i { color: var(--cyan); font-size: 13px; }
.settings-card .desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--text-3);
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 18px;
}
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label { font-size: 13px; color: var(--text); flex: 1; }
.setting-row .label small {
  display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em;
}
.seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0;
}
.seg button {
  padding: 5px 10px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
  transition: all 0.15s; letter-spacing: 0.04em; text-transform: uppercase;
}
.seg button:hover { color: var(--text-2); }
.seg button.active { background: var(--cyan); color: #000; }
.btn {
  padding: 10px 18px; border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; transition: all 0.15s;
}
.btn-danger { background: var(--pink); color: #fff; }
.btn-danger:hover { background: #ff5ca8; }
.lib-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-3);
  padding: 3px 7px; border-radius: 4px;
  border: 1px solid var(--line-2); flex-shrink: 0;
}

/* ============ TOAST ============ */
.toast-stack {
  position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: 8px;
  z-index: 9999; pointer-events: none; align-items: center;
}
.toast {
  background: rgba(11,13,20,0.95);
  border: 1px solid rgba(0,229,255,0.3);
  box-shadow: 0 0 24px rgba(0,229,255,0.15), 0 12px 40px rgba(0,0,0,0.6);
  color: #e8ecf5; padding: 10px 18px; border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 600;
  opacity: 0; transform: translateY(10px);
  transition: all .28s cubic-bezier(.2,.9,.3,1.2);
  max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ============ PAGES ============ */
.page { display: none; }
.page.active { display: block; }

/* ТОЛЬКО страница чата — flex-контейнер на всю высоту */
.page[data-page="chat"].active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-full-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.page[data-page="chat"] .chat-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.page[data-page="chat"] .chat-input-wrap {
  flex-shrink: 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
  .app { grid-template-columns: 60px 1fr; }
  .rail-label, .rail-item span:not(.kbd), .rail-user .info { display: none; }
  .rail-item { justify-content: center; padding: 12px; }
  .rail-item .kbd { display: none; }
  .rail-user { padding: 8px; justify-content: center; }
  .rail-user .av { margin: 0; }
  .rail-section { padding: 0 8px; }
}

@media (max-width: 900px) {
  body { overflow: auto; height: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .rail {
    flex-direction: row; padding: 8px 12px; border-right: none;
    border-bottom: 1px solid var(--line); overflow-x: auto;
    gap: 4px; align-items: center;
  }
  .rail-section { padding: 0; margin: 0; display: flex; gap: 4px; }
  .rail-label { display: none; }
  .rail-user { margin: 0 0 0 auto; padding: 6px; flex-shrink: 0; }
  .rail-user .info { display: block; }
  .games-rail { margin-inline: -16px; padding-inline: 16px; grid-auto-columns: 160px; }
  .col-split { grid-template-columns: 1fr; }
  .apps-strip { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .statusbar { font-size: 10px; padding: 0 12px; }
  .sb-center { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page-head h1 { font-size: clamp(22px, 6vw, 28px); }
  .hero { aspect-ratio: 4 / 5; }
  .hero-content { padding: 20px; }
  .hero-play { width: 52px; height: 52px; font-size: 16px; }
  .apps-strip { grid-template-columns: 1fr; }
  .sb-left .sb-item:not(:first-child) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Страница games — сетка, карточки крупнее */
.page[data-page="games"] .games-rail {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-columns: auto;
  gap: 16px;
  overflow-x: visible;
  scroll-snap-type: none;
  margin: 0;
  padding: 4px 0 12px;
}

/* На широких — 3–4 колонки */
@media (min-width: 900px) {
  .page[data-page="games"] .games-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1400px) {
  .page[data-page="games"] .games-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Карточки на странице games — квадратные и крупные */
.page[data-page="games"] .game-tile {
  aspect-ratio: 1 / 1;   /* было 1/1 — теперь выше */
  border-radius: 16px;
  min-height: 260px;     /* страховка на узких экранах */
}

/* Иконка и текст — крупнее */
.page[data-page="games"] .game-tile .game-icon {
  width: 64px;
  height: 64px;
  font-size: 28px;
  border-radius: 16px;
}
.page[data-page="games"] .game-tile .game-bottom h3 {
  font-size: 20px;
}
.page[data-page="games"] .game-tile .game-bottom .online {
  font-size: 12px;
}