:root {
  --bg: #0a0b10; --panel: #12141c; --panel-2: #191c27; --line: #252937; --text: #e9ebf2; --muted: #8b91a5;
  --accent: #8b6cff; --accent-2: #a995ff; --cyan: #22d3ee; --ok: #3ecf8e; --warn: #f5a524; --danger: #ff5c6c; --radius: 14px;
  --grad: linear-gradient(135deg, #8b6cff, #22d3ee);
  --c-system: #8b6cff; --c-tools: #22d3ee; --c-idea: #f5a524; --c-project: #3ecf8e; --c-output: #ff6fa8;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(600px 400px at 12% -5%, rgba(139,108,255,.22), transparent 70%), radial-gradient(520px 380px at 92% 8%, rgba(34,211,238,.14), transparent 70%); animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(0, 18px, 0) scale(1.04); } }
a { color: var(--accent-2); text-decoration: none; }
button, select, textarea, input { font: inherit; color: inherit; }
.hidden { display: none !important; }
::selection { background: rgba(139,108,255,.4); }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #2a2f3f; border-radius: 8px; }

/* Шапка и главное меню */
.top { display: flex; align-items: center; gap: 24px; padding: 12px max(16px, calc((100% - 1160px) / 2)); border-bottom: 1px solid var(--line);
  background: rgba(10,11,16,.72); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.brand > span { display: inline-flex; }
.brand img { width: 30px; height: 30px; transition: transform .4s cubic-bezier(.2,1.4,.4,1); }
.brand:hover img { transform: rotate(-8deg) scale(1.12); }
.brand b { font-weight: inherit; }
.brand .jail { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 9px; transition: .15s; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--panel-2); }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.userbox b { color: var(--text); font-weight: 600; }

.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 9px 16px; border-radius: 11px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s, box-shadow .2s; }
.btn:hover { border-color: #3a4156; background: #212536; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 22px -8px rgba(139,108,255,.8); }
.btn.primary:hover { box-shadow: 0 10px 28px -8px rgba(34,211,238,.6); filter: brightness(1.08); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.big { padding: 15px 30px; font-size: 16px; border-radius: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Главная */
.home { max-width: 1160px; margin: 0 auto; padding: 0 16px 72px; }
.hero { text-align: center; padding: 72px 0 40px; }
.hero .pill { display: inline-block; font-size: 13px; color: var(--accent-2); border: 1px solid rgba(139,108,255,.35); background: rgba(139,108,255,.1); padding: 5px 14px; border-radius: 99px; margin-bottom: 20px; animation: rise .6s both; }
.hero h1 { font-size: clamp(38px, 7vw, 68px); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 18px; animation: rise .6s .08s both; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 auto 28px; animation: rise .6s .16s both; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; animation: rise .6s .24s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.demo { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 16px; margin: 20px 0 8px; }
.win { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px -40px rgba(139,108,255,.6); }
.win .bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.win .bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a2f3f; display: inline-block; }
.win .bar i:nth-child(1) { background: #ff5f57; } .win .bar i:nth-child(2) { background: #febc2e; } .win .bar i:nth-child(3) { background: #28c840; }
.win .bar span { margin-left: 8px; }
.demo-chat { padding: 16px; min-height: 330px; display: flex; flex-direction: column; gap: 9px; }
.demo-in { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: center; }
.demo-in .fake { flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; min-height: 40px; color: var(--text); font-size: 14px; }
.demo-in .fake::after { content: "▍"; color: var(--accent-2); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-stage { display: flex; flex-direction: column; }
.demo-game { flex: 1; min-height: 330px; position: relative; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 120%, #0e3a52, #0a0b10 70%); }
.demo-game canvas { width: 100%; height: 100%; position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.demo-game.on canvas { opacity: 1; }
.demo-game .ph { color: var(--muted); font-size: 14px; text-align: center; transition: opacity .4s; }
.demo-game.on .ph { opacity: 0; }
.demo-link { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.demo-link b { color: var(--cyan); font-weight: 600; word-break: break-all; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 56px 0 8px; counter-reset: s; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; transition: .2s; }
.step:hover { border-color: #3a4156; transform: translateY(-3px); }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: 18px; right: 20px; font-size: 40px; font-weight: 800; color: rgba(139,108,255,.18); }
.step .ic { font-size: 26px; margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: 17px; } .step p { margin: 0; color: var(--muted); font-size: 14px; }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0 0; }
.feat { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), transparent); }
.feat b { display: block; margin-bottom: 4px; } .feat span { color: var(--muted); font-size: 14px; }
h2 { font-size: 24px; letter-spacing: -.02em; margin: 56px 0 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; color: var(--text); transition: transform .2s, border-color .2s, box-shadow .2s; animation: rise .5s both; }
.card:hover { border-color: #3d4560; transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(139,108,255,.7); }
.card .cover { aspect-ratio: 16 / 10; background: var(--panel-2) center / cover; transition: transform .4s; }
.card:hover .cover { transform: scale(1.05); }
.card .wrap { overflow: hidden; }
.card .info { padding: 12px 14px 14px; }
.card .info b { display: block; margin-bottom: 4px; }
.card .info span { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .info small { display: block; margin-top: 8px; color: var(--accent-2); }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 44px 16px; text-align: center; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0 0; }

.overlay { position: fixed; inset: 0; background: rgba(4,5,8,.66); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; width: 100%; max-width: 420px; text-align: center; animation: pop .28s cubic-bezier(.2,1.3,.4,1) both; max-height: 92vh; overflow: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.modal h3 { margin: 0 0 8px; font-size: 20px; }
.modal p { color: var(--muted); margin: 0 0 18px; }
.modal .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal .status { margin-top: 16px; color: var(--muted); font-size: 14px; min-height: 20px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent-2); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Студия */
.studio-body { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.studio-body .top { position: static; }
.studio { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr) 280px; }
.side { background: rgba(18,20,28,.8); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side.right { border-right: 0; border-left: 1px solid var(--line); }
.side h4 { margin: 0; padding: 14px 16px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side .list { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.side .newchat { margin: 12px 12px 0; }
.item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 9px; color: var(--text); cursor: pointer; transition: background .15s; }
.item:hover { background: var(--panel-2); }
.item.active { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.side .hint { color: var(--muted); font-size: 13px; padding: 8px 10px; }
.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.messages { flex: 1; overflow: auto; padding: 20px max(16px, calc((100% - 780px) / 2)); display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; animation: rise .3s both; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.note { align-self: center; color: var(--muted); font-size: 13px; background: none; }
.dots i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--accent-2); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.composer { border-top: 1px solid var(--line); padding: 12px max(16px, calc((100% - 780px) / 2)) 16px; background: rgba(10,11,16,.8); }
.box { display: flex; align-items: flex-end; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px; transition: border-color .2s, box-shadow .2s; position: relative; }
.box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139,108,255,.12); }
.box textarea { flex: 1; background: none; border: 0; outline: 0; resize: none; max-height: 160px; padding: 6px 4px; }
.iconbtn { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 18px; line-height: 1; flex: none; transition: .15s; }
.iconbtn:hover { border-color: #3a4156; transform: translateY(-1px); }
.iconbtn.send { background: var(--grad); border-color: transparent; color: #fff; }
.iconbtn:disabled { opacity: .5; cursor: not-allowed; }
.box select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; max-width: 190px; }
.rule { color: var(--muted); font-size: 12px; margin-top: 8px; text-align: center; }

/* Бар токенов */
.meter { position: relative; flex: none; }
.meter-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 12px; color: var(--muted); transition: .15s; }
.meter-btn:hover { border-color: #3a4156; color: var(--text); }
.ring { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--ringc, var(--ok)) calc(var(--p, 0) * 1%), #2a2f3f 0); display: grid; place-items: center; transition: background .5s; }
.ring::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--panel-2); }
.meter.warn { --ringc: var(--warn); } .meter.crit { --ringc: var(--danger); }
.pop { position: absolute; right: 0; bottom: 46px; width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; z-index: 40; box-shadow: 0 24px 60px -20px #000; opacity: 0; transform: translateY(8px) scale(.97); pointer-events: none; transition: .22s cubic-bezier(.2,1.2,.4,1); }
.meter.open .pop { opacity: 1; transform: none; pointer-events: auto; }
.pop h5 { margin: 0 0 2px; font-size: 14px; } .pop .sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.stack { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: #232736; }
.stack div { height: 100%; width: 0; transition: width .8s cubic-bezier(.2,.9,.3,1); }
.legend { margin-top: 12px; display: grid; gap: 6px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend span { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.pop .big { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pop .big b { font-size: 22px; font-variant-numeric: tabular-nums; } .pop .big small { color: var(--muted); }

.mobile-tabs { display: none; }
@media (max-width: 900px) {
  .demo, .steps { grid-template-columns: 1fr; }
  .nav { display: none; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 58px; bottom: 0; width: min(300px, 86vw); z-index: 10; transform: translateX(-105%); transition: transform .2s; }
  .side.right { right: 0; left: auto; transform: translateX(105%); }
  .side.open { transform: none; }
  .mobile-tabs { display: flex; gap: 8px; }
  .box select { max-width: 110px; } .meter-btn .t { display: none; }
  .pop { width: min(320px, 86vw); }
}

/* Студия: события, карточки, модалки */
.chip { align-self: flex-start; font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 4px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; animation: slide .3s both; }
@keyframes slide { from { opacity: 0; transform: translateX(-10px); } }
.chip.ok { border-color: #1f5c43; } .chip.bad { border-color: #7a2d36; color: #ff9aa5; } .chip.warn { border-color: #6b5320; }
.msg.err { border-color: #7a2d36; color: #ffb3bb; }
.card2 { display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.card2 ul { margin: 4px 0 0; padding-left: 18px; } .card2 small { color: var(--muted); }
.card2.done { border-color: rgba(62,207,142,.45); box-shadow: 0 0 0 1px rgba(62,207,142,.15), 0 12px 40px -20px rgba(62,207,142,.6); }
.linkbox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: #0b0c10; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; color: var(--cyan); word-break: break-all; cursor: pointer; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.modal.left { text-align: left; } .modal.wide { max-width: 860px; } .modal .row { margin-top: 14px; }
.form label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
.inp { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: 0; }
.inp:focus { border-color: var(--accent); }
.covimg { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--panel-2); margin-bottom: 10px; }
.code { background: #0b0c10; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 60vh; overflow: auto; font-size: 13px; white-space: pre; }
.playframe { width: 100%; height: min(70vh, 640px); border: 1px solid var(--line); border-radius: 14px; background: #000; display: block; }
.row2 { display: flex; align-items: center; }
.row2 .item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 6px; }
.x:hover { color: var(--danger); background: var(--panel-2); }
.item.file { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tag { color: var(--muted); font-size: 12px; white-space: normal; }
.badge, .muted { color: var(--muted); }
.gamepage { padding-top: 28px; } .gamepage h1 { margin: 0 0 6px; }
.modal.left h3 { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Вложения: серое фото, замок и ключ, клетка на верёвке */
.msg.user .thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.msg.user .thumbs img { width: 132px; max-width: 100%; height: 132px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); animation: thumbIn .5s cubic-bezier(.2,.9,.3,1.2) both; }
.msg.user .thumb-file { padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.22); font-size: 13px; }
@keyframes thumbIn { from { opacity: 0; transform: scale(.8); filter: blur(6px); } }
.chip .cthumb { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; border: 1px solid var(--line); }
.composer.drag .box { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139,108,255,.22); }

.att-tray { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; padding: 4px 6px 12px; position: relative; z-index: 30; }
.att-tray:empty { display: none; }
.att-tray.nudge { animation: nudge .45s; }
@keyframes nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.att { position: relative; width: 84px; height: 106px; animation: attIn .38s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes attIn { from { opacity: 0; transform: translateY(12px) scale(.82); } }
.att.failed { animation: nudge .45s, attOut .4s .1s both; }
@keyframes attOut { to { opacity: 0; transform: scale(.7); } }
.att-body { position: relative; width: 84px; height: 84px; }
.att-media { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; background: #1b1e29; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.att-media img, .att-file { width: 100%; height: 100%; display: block; object-fit: cover; }
.att-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 30px; padding: 6px; }
.att-file small { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checking .att-media img, .checking .att-file { filter: grayscale(1) blur(5px) brightness(.55); transform: scale(1.14); }
.att-veil { position: absolute; inset: 0; border-radius: 14px; pointer-events: none; opacity: 0; z-index: 2; }
.checking .att-veil { opacity: 1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.2) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.att-lock { position: absolute; left: 50%; top: 50%; width: 44px; height: 53px; margin: -27px 0 0 -22px; z-index: 3; opacity: 0; pointer-events: none; filter: drop-shadow(0 3px 8px rgba(0,0,0,.55)); }
.checking .att-lock { opacity: 1; animation: lockPulse 1.8s ease-in-out infinite; }
@keyframes lockPulse { 50% { transform: scale(1.07); } }
.unlocking .att-lock { animation: lockLife 2s linear both; }
@keyframes lockLife { 0%, 58% { opacity: 1; transform: scale(1); } 63% { transform: scale(1.08) rotate(-4deg); } 69% { transform: scale(1) rotate(3deg); } 77% { opacity: 1; transform: scale(1.12); } 100% { opacity: 0; transform: scale(1.6); } }
.att-lock .shackle { transform-origin: 29px 22px; }
.unlocking .att-lock .shackle { animation: shackleOpen .38s 1.25s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes shackleOpen { to { transform: translateY(-3px) rotate(-38deg); } }

.att-key { position: absolute; left: 50%; top: calc(50% - 4px); width: 60px; height: 24px; z-index: 4; opacity: 0; pointer-events: none; transform-origin: 0 50%; filter: drop-shadow(0 0 7px rgba(255,211,92,.85)); }
.unlocking .att-key { animation: keyFly .95s cubic-bezier(.25,.8,.3,1) both, keyTurn .4s .95s cubic-bezier(.5,0,.2,1.35) both, keyOut .35s 1.6s ease-in forwards; }
@keyframes keyFly {
  0% { opacity: 0; transform: translate(130px,-120px) rotate(-75deg) scale(.4); }
  30% { opacity: 1; }
  62% { transform: translate(28px,-24px) rotate(-20deg) scale(1.12); }
  84% { transform: translate(-5px,2px) rotate(5deg) scale(1); }
  100% { opacity: 1; transform: translate(0,0) rotate(0) scale(1); }
}
@keyframes keyTurn { from { transform: rotate(0); } to { transform: rotate(90deg); } }
@keyframes keyOut { from { opacity: 1; transform: rotate(90deg) scale(1); } to { opacity: 0; transform: rotate(90deg) scale(1.5); } }

.att-ring { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 2px solid #ffd35c; opacity: 0; z-index: 3; pointer-events: none; }
.unlocking .att-ring { animation: ringPulse .75s 1.55s ease-out both; }
@keyframes ringPulse { from { opacity: .95; transform: scale(.3); } to { opacity: 0; transform: scale(2.1); } }
.att-sparks i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #ffd35c; box-shadow: 0 0 9px #ffd35c; opacity: 0; z-index: 5; pointer-events: none; }
.unlocking .att-sparks i { animation: spark .85s 1.55s ease-out both; }
@keyframes spark { from { opacity: 1; transform: rotate(var(--a)) translateX(4px) scale(1); } to { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(.2); } }

.unlocking .att-media img, .unlocking .att-file { animation: reveal .8s 1.55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes reveal {
  0% { filter: grayscale(1) blur(5px) brightness(.55); transform: scale(1.14); }
  45% { filter: grayscale(.2) blur(1px) brightness(1.55); transform: scale(1.16); }
  100% { filter: none; transform: scale(1); }
}
.unlocking .att-veil { opacity: 1; background: rgba(120,126,150,.35); animation: veilOut .45s 1.5s both; }
@keyframes veilOut { to { opacity: 0; } }
.open .att-media { border-color: #1f5c43; animation: okGlow .9s both; }
@keyframes okGlow { 0% { box-shadow: 0 0 0 0 rgba(62,207,142,.7); } 100% { box-shadow: 0 6px 18px rgba(0,0,0,.35); } }

.att-cap { position: absolute; left: -6px; right: -6px; top: 88px; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.unlocking .att-cap, .open .att-cap { color: var(--ok); }
.caging .att-cap { color: var(--danger); }
.att-x { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 14px; line-height: 1; opacity: 0; pointer-events: none; z-index: 7; transition: .15s; }
.open .att-x { opacity: 1; pointer-events: auto; }
.att-x:hover { background: var(--danger); border-color: var(--danger); }

/* блокировка: клетка прилетает, смыкается и уносится на верёвке */
.caging .att-veil { opacity: 1; background: rgba(255,92,108,.38); animation: redFlash .5s both; }
@keyframes redFlash { from { opacity: 0; } to { opacity: 1; } }
.caging .att-media img, .caging .att-file { filter: grayscale(1) blur(4px) brightness(.5); transform: scale(1.14); }
.caging .att-media { border-color: #7a2d36; animation: squeeze .35s 1.55s both; }
@keyframes squeeze { 50% { transform: scale(.86); } 100% { transform: scale(.94); } }
.caging .att-lock { opacity: 1; animation: lockDeny .6s both; }
@keyframes lockDeny { 20%, 60% { transform: translateX(-4px) rotate(-6deg); } 40%, 80% { transform: translateX(4px) rotate(6deg); } 100% { transform: none; } }

.att-cage { position: absolute; left: 50%; top: 50%; width: 96px; height: 104px; margin: -60px 0 0 -48px; z-index: 6; opacity: 0; pointer-events: none; transform-origin: 50% -330px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.caging .att-cage { animation: cageIn .95s .3s cubic-bezier(.2,.9,.3,1) both; }
@keyframes cageIn {
  0% { opacity: 0; transform: translate(130px,-200px) rotate(26deg); }
  15% { opacity: 1; }
  60% { transform: translate(-10px,6px) rotate(-7deg); }
  80% { transform: translate(4px,-3px) rotate(3deg); }
  100% { opacity: 1; transform: translate(0,0) rotate(0); }
}
.cage-rope { position: absolute; left: 50%; bottom: 100%; width: 5px; height: 330px; margin: 0 0 -3px -2.5px; border-radius: 3px; background: repeating-linear-gradient(160deg, #c9a05f 0 3px, #8a6232 3px 6px); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.cage-bar { stroke-dasharray: 100; stroke-dashoffset: 100; }
.caging .cage-bar { animation: barDraw .38s calc(1.2s + var(--i) * .06s) ease-out both; }
@keyframes barDraw { to { stroke-dashoffset: 0; } }
.cage-base { opacity: 0; }
.caging .cage-base { animation: fadeIn .2s 1.15s both; }
@keyframes fadeIn { to { opacity: 1; } }

.caging .att-body { transform-origin: 50% -330px; animation: liftUp 1.2s 2.05s cubic-bezier(.55,0,.85,.35) both; }
@keyframes liftUp {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  16% { transform: translateY(10px) rotate(0); }
  38% { transform: translateY(-34px) rotate(-3deg); }
  70% { transform: translateY(-200px) rotate(3deg); opacity: 1; }
  100% { transform: translateY(-440px) rotate(-2deg); opacity: 0; }
}
.att-note { align-self: center; color: #ffb3bb; font-size: 13px; padding: 6px 12px; border: 1px solid #7a2d36; border-radius: 10px; background: rgba(255,92,108,.08); animation: slide .3s both; transition: opacity .4s; }
.att-note.out { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .att, .att * { animation-duration: .01s !important; animation-delay: 0s !important; }
}

/* ---------- маскот ИИ: летающий дух без рта ---------- */
.catbox { display: flex; align-items: center; gap: 10px; position: relative; padding: 6px 12px 6px 6px; background: rgba(139,124,255,.08); border: 1px solid rgba(139,124,255,.25); border-radius: 18px; width: fit-content; overflow: visible; }
.catbox svg { overflow: visible; animation: catFloat 2.6s ease-in-out infinite; }
.cat-label { font-size: 13px; color: #cfd4ff; }
.cat-label::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dotsTxt 1.2s steps(4) infinite; }
@keyframes dotsTxt { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@keyframes catFloat { 50% { transform: translateY(-3px) rotate(-1.5deg); } }
.cat-body .eye { transform-box: fill-box; transform-origin: 50% 50%; animation: catBlink 4s infinite; }
@keyframes catBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
.cat-body .pupil { transition: transform .3s; }
.mood-think .pupil { animation: lookUp 2.4s ease-in-out infinite; }
@keyframes lookUp { 0%, 100% { transform: translate(-2px, -3px); } 50% { transform: translate(3px, -4px); } }
.mood-search .pupil, .mood-check .pupil, .mood-look .pupil { animation: scan 1.1s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translate(-3px, 0); } 50% { transform: translate(3px, 0); } }
.mood-code .pupil { animation: lookDown 1.6s ease-in-out infinite; }
@keyframes lookDown { 0%, 100% { transform: translate(-2px, 2px); } 50% { transform: translate(2px, 3px); } }
.mood-play .cat-body { animation: playBob .5s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes playBob { 50% { transform: scale(1.04, .96) translateY(1px); } }
.mood-play .pupil { animation: scan .6s ease-in-out infinite; }
.mood-happy .eye { animation: none; transform: scaleY(.45); }
.mood-happy .pupil { opacity: 0; }
.mood-happy svg { animation: catJump .6s ease-out 2; }
@keyframes catJump { 40% { transform: translateY(-10px) scale(1.06); } }
.mood-worry .eye { transform: scaleY(1.1); }
.cat-sparks { position: absolute; left: 36px; top: 6px; width: 0; height: 0; pointer-events: none; }
.cat-sparks .spk { position: absolute; left: var(--x); top: 0; font-style: normal; font-size: 13px; font-weight: 700; color: #ffd35c; text-shadow: 0 0 8px rgba(255,211,92,.8); opacity: 0; animation: spkFly 1.7s var(--dl) ease-out forwards; white-space: nowrap; }
@keyframes spkFly { 0% { opacity: 0; transform: translateY(8px) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-48px) scale(1.15) rotate(8deg); } }
/* кнопка остановки */
.iconbtn.send.stop { background: #ff5d73; color: #fff; animation: stopPulse 1.4s ease-in-out infinite; font-size: 15px; }
@keyframes stopPulse { 50% { box-shadow: 0 0 0 7px rgba(255,93,115,.18); } }

/* ---------- мессенджер-стиль: аватар котика у сообщений ---------- */
.brow { display: flex; align-items: flex-end; gap: 10px; align-self: flex-start; max-width: 92%; animation: rise .3s both; }
.brow > .msg, .brow > details { animation: none; }
.brow .avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #2b2f4a, #171a2b); border: 1px solid rgba(139,124,255,.4); display: grid; place-items: center; box-shadow: 0 4px 14px -4px rgba(139,124,255,.6); position: relative; }
.brow .avatar svg { width: 30px; height: 28px; margin-top: 2px; animation: none; }
.brow.cont .avatar { visibility: hidden; height: 0; margin-top: -8px; }
.brow.cont { margin-top: -6px; }
.brow.cont .avatar { height: 36px; margin: 0; }
.brow .msg.bot { align-self: auto; border-bottom-left-radius: 5px; }
.brow .msg.bot:first-child { }
.catbox { background: none; border: 0; padding: 0; }
.catbox .avatar.live { width: 44px; height: 44px; animation: avatarBeat 2.2s ease-in-out infinite; }
.catbox .avatar.live svg { width: 38px; height: 35px; animation: catFloat 2.6s ease-in-out infinite; }
@keyframes avatarBeat { 50% { box-shadow: 0 0 0 7px rgba(139,124,255,.12), 0 4px 18px -4px rgba(139,124,255,.8); } }
.catbox .cat-sparks { left: 22px; top: 2px; }
.typingbubble { padding: 9px 14px; }
.catbox svg { overflow: visible; }
/* действия ИИ одним сворачиваемым блоком */
.steps { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0; min-width: 260px; max-width: 100%; overflow: hidden; }
.steps summary { cursor: pointer; padding: 8px 12px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; list-style: none; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.steps[open] summary::after { transform: rotate(180deg); }
.steps .sum-t { color: #cfd4ff; font-weight: 600; white-space: nowrap; }
.steps .sum-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; max-width: 320px; }
.steps[open] .sum-last { display: none; }
.steps-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px 10px; max-height: 260px; overflow: auto; }
.steps-list .chip { align-self: stretch; }
/* вопрос ИИ */
.qtext { font-size: 15px; line-height: 1.5; font-weight: 500; }
.qhint { opacity: .7; }
.opts .qopt { transition: transform .15s, background .2s, border-color .2s; }
.opts .qopt:hover:not(:disabled) { transform: translateY(-1px); border-color: #8b7cff; }
.opts .qopt.picked { background: var(--grad); color: #fff; border-color: transparent; }
.card2 { border-left: 3px solid #8b7cff; }
.card2.done { border-left-color: #3ecf8e; }
/* общая полировка */
.msg.bot { box-shadow: 0 6px 22px -14px rgba(0,0,0,.6); line-height: 1.55; }
.msg.user { box-shadow: 0 8px 24px -12px rgba(139,124,255,.7); }
.composer .box { transition: box-shadow .2s, border-color .2s; }
.composer .box:focus-within { box-shadow: 0 0 0 3px rgba(139,124,255,.18); border-color: #8b7cff; }
.messages::-webkit-scrollbar { width: 8px; } .messages::-webkit-scrollbar-thumb { background: #2a2e45; border-radius: 8px; }
@media (max-width: 700px) { .brow { max-width: 100%; } .brow .avatar { width: 30px; height: 30px; } .brow .avatar svg { width: 25px; height: 23px; } }
@media (prefers-reduced-motion: reduce) { .brow, .cat-body *, .catbox svg { animation: none !important; } }

/* ---------- блок действий ИИ: статус + плавно раскрывающийся список ---------- */
.actrow { align-self: stretch; max-width: 100%; }
.act-box { flex: 1; min-width: 0; max-width: 640px; }
.act-head { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 4px; color: var(--muted); font-size: 14px; max-width: 100%; }
.act-head:hover { color: #dfe3ff; }
.act-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-label.swap { animation: labelIn .45s ease both; }
@keyframes labelIn { from { opacity: 0; transform: translateY(5px); filter: blur(3px); } }
.actrow.live .act-label { background: linear-gradient(90deg, #7d83a6 0%, #fff 45%, #7d83a6 90%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2s linear infinite; }
.actrow.live .act-label.swap { animation: labelIn .45s ease both, shine 2s linear infinite; }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.act-chev { display: inline-block; transition: transform .3s cubic-bezier(.2,.8,.2,1); font-size: 18px; line-height: 1; margin-left: 2px; flex: none; }
.act-box.open > .act-head .act-chev, .act-item.open > .act-ihead .act-chev { transform: rotate(90deg); }
.act-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s cubic-bezier(.2,.8,.2,1), opacity .3s; opacity: 0; }
.open > .act-wrap { grid-template-rows: 1fr; opacity: 1; }
.act-inner { overflow: hidden; min-height: 0; }
.act-list { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px 6px; border-left: 2px solid rgba(139,124,255,.25); margin-left: 4px; }
.act-item { border-radius: 10px; animation: slide .3s both; }
.act-ihead { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 9px; cursor: default; font-size: 13px; color: var(--muted); }
.act-item.has > .act-ihead { cursor: pointer; }
.act-item.has > .act-ihead:hover { background: rgba(255,255,255,.04); color: #dfe3ff; }
.act-item:not(.has) .act-chev { visibility: hidden; }
.act-ico { flex: none; width: 18px; text-align: center; }
.act-itext { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.act-item.ok .act-itext { color: #9be3c2; } .act-item.bad .act-itext { color: #ff9aa5; } .act-item.warn .act-itext { color: #e8c97a; }
.act-item.run .act-ico { animation: sp 1s linear infinite; display: inline-block; }
.act-meta { display: flex; gap: 6px; font: 600 12px ui-monospace, Menlo, Consolas, monospace; }
.act-meta .plus { color: #3ecf8e; } .act-meta .minus { color: #ff6b81; }
.act-detail { margin: 2px 4px 8px 26px; }
.act-thought { font-size: 13px; color: #b9bedc; font-style: italic; padding: 5px 8px 5px 14px; position: relative; animation: slide .3s both; }
.act-thought::before { content: "💭"; position: absolute; left: -2px; font-style: normal; font-size: 11px; opacity: .7; }
/* дифф как в редакторе */
.diff { font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; background: #0d0f18; border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 340px; }
.dl { display: flex; white-space: pre; min-width: max-content; }
.dl b { flex: none; width: 22px; text-align: center; font-weight: 700; opacity: .8; user-select: none; }
.dl code { padding-right: 12px; font: inherit; }
.dl.add { background: rgba(62,207,142,.13); color: #aef0d2; } .dl.add b { color: #3ecf8e; }
.dl.rem { background: rgba(255,93,115,.13); color: #ffb3bd; } .dl.rem b { color: #ff6b81; }
.dl.ctx { color: #7d83a6; } .dl.hunk { color: #6f78a8; background: rgba(139,124,255,.08); }
.plines { font: 12px/1.55 ui-monospace, Menlo, Consolas, monospace; background: #0d0f18; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-height: 260px; overflow: auto; color: #aab0d0; white-space: pre-wrap; word-break: break-word; }
.plines .bad { color: #ff9aa5; } .plines small { color: #6f78a8; }
.act-detail img.cthumb { width: 120px; height: 120px; border-radius: 10px; margin: 0; }
/* плейтест: живой экран, кнопки, запись */
.pt-body { display: flex; flex-direction: column; gap: 8px; }
.pt-screen { position: relative; width: 100%; max-width: 560px; aspect-ratio: 16/10; background: #05060b; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px -14px rgba(139,124,255,.5); }
.pt-screen.replay { height: auto !important; }
.pt-iframe { position: absolute; left: 0; top: 0; width: 960px; height: 600px; border: 0; transform-origin: 0 0; pointer-events: none; background: #000; }
.pt-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pt-hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: #cfd4ff; min-height: 26px; }
.pt-act.bad { color: #ff9aa5; }
.pt-keys { display: flex; gap: 4px; }
.pt-keys kbd, .pt-hud kbd { background: linear-gradient(#2b3050, #1c2038); border: 1px solid #4a5280; border-bottom-width: 3px; border-radius: 6px; padding: 1px 7px; font: 600 12px ui-monospace, Menlo, monospace; color: #fff; animation: keyDown .18s ease-out; }
@keyframes keyDown { from { transform: translateY(-3px); } }
.pt-time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-ctl { display: flex; align-items: center; gap: 10px; max-width: 560px; }
.pt-bar { flex: 1; accent-color: #8b7cff; }
.pt-log { font: 12px/1.6 ui-monospace, Menlo, monospace; max-height: 160px; overflow: auto; color: #7d83a6; max-width: 560px; }
.pt-log div { padding: 0 6px; border-radius: 5px; } .pt-log .now { background: rgba(139,124,255,.18); color: #fff; } .pt-log .bad { color: #ff9aa5; }
.pt-more summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.act-item.pt.run { }
@media (max-width: 700px) { .act-detail { margin-left: 8px; } .act-itext { font-size: 12px; } }

/* =====================================================================
   DeepJail v2: единая дизайн-система (токены, шапка, лендинг, документация, студия)
   ===================================================================== */
:root {
  --bg: #07080d; --panel: #0e1018; --panel-2: #151826; --line: #1d2133; --line-2: #2a3047; --text: #eceef7; --muted: #8b91a8; --muted-2: #626883;
  --accent: #8b6cff; --accent-2: #b3a2ff; --cyan: #22d3ee; --radius: 14px; --radius-lg: 20px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px -18px rgba(0,0,0,.8);
  --font: "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
body { font-family: var(--font); font-feature-settings: "cv11", "ss01"; text-rendering: optimizeLegibility; }
h1, h2, h3 { letter-spacing: -.025em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }
code, kbd, pre { font-family: var(--mono); }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* маскот */
.cat-body .wing { transform-box: fill-box; animation: wingL .55s ease-in-out infinite alternate; }
.cat-body .wing.l { transform-origin: 100% 90%; }
.cat-body .wing.r { transform-origin: 0% 90%; animation-name: wingR; }
@keyframes wingL { from { transform: rotate(7deg); } to { transform: rotate(-15deg); } }
@keyframes wingR { from { transform: rotate(-7deg); } to { transform: rotate(15deg); } }
.cat-body .bulb { animation: bulbPulse 2.2s ease-in-out infinite; }
@keyframes bulbPulse { 50% { opacity: .4; } }
.cat-body .brows { opacity: 0; transition: opacity .25s; }
.cat-body .pupil { transform-box: fill-box; transform-origin: center; }
.brow:not(.live):not(.actrow) .cat-body .wing { animation-duration: 1.6s; }
.mood-code .cat-body .wing, .mood-play .cat-body .wing { animation-duration: .28s; }
.mood-happy .cat-body .wing { animation-duration: .22s; }
.mood-happy .cat-body .bulb { fill: #3ecf8e; animation: none; }
.mood-worry .cat-body .brows { opacity: 1; }
.mood-worry .cat-body .bulb { fill: #f5a524; animation-duration: .5s; }
.mood-worry .cat-body .wing { animation: none; }
.mood-worry .cat-body .wing.l { transform: rotate(-24deg); }
.mood-worry .cat-body .wing.r { transform: rotate(24deg); }
.mood-worry .cat-body { animation: fret .35s ease-in-out 3; }
@keyframes fret { 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
.brow .avatar svg { width: 32px; height: 32px; margin: 0; }
.catbox .avatar.live svg { width: 40px; height: 40px; }
.brow .avatar { background: radial-gradient(circle at 30% 20%, #262a46, #11131f); }
@media (max-width: 700px) { .brow .avatar svg { width: 26px; height: 26px; } }

/* шапка */
.top { height: 62px; padding-top: 0; padding-bottom: 0; background: rgba(7,8,13,.78); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { font-size: 19px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav a { font-size: 14px; font-weight: 500; padding: 7px 13px; }
.nav a.on { background: rgba(139,108,255,.12); color: #fff; }
.btn { background: var(--panel-2); border-color: var(--line-2); font-weight: 500; }
.btn.primary { background: linear-gradient(135deg, #8b6cff 0%, #5b8cff 55%, #22d3ee 130%); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 28px -10px rgba(110,100,255,.9); }
.btn.ghost { background: transparent; }

/* лендинг */
.home { max-width: 1180px; }
.l-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; padding: 76px 0 36px; }
.l-hero .pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent-2); border: 1px solid rgba(139,108,255,.3); background: rgba(139,108,255,.08); padding: 5px 13px 5px 8px; border-radius: 99px; margin-bottom: 22px; }
.l-hero .pill i { width: 7px; height: 7px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 0 4px rgba(62,207,142,.18); }
.l-hero h1 { font-size: clamp(38px, 5.6vw, 64px); line-height: 1.04; letter-spacing: -.04em; margin: 0 0 20px; font-weight: 800; }
.l-hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-hero p.lead { color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 540px; margin: 0 0 30px; }
.l-hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 28px; color: var(--muted-2); font-size: 13px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; } .trust .ico { width: 15px; height: 15px; color: #3ecf8e; }
.l-stage { position: relative; aspect-ratio: 1 / .95; display: grid; place-items: center; }
.l-stage::before { content: ""; position: absolute; inset: 6% 8%; border-radius: 50%; background: radial-gradient(circle, rgba(139,108,255,.34), rgba(34,211,238,.1) 55%, transparent 72%); filter: blur(10px); }
.l-stage .big { width: min(60%, 300px); position: relative; animation: heroFloat 4.2s ease-in-out infinite; filter: drop-shadow(0 28px 36px rgba(100,80,255,.45)); }
.l-stage .big svg { width: 100%; height: auto; display: block; overflow: visible; }
@keyframes heroFloat { 50% { transform: translateY(-14px) rotate(-1.5deg); } }
.chipfloat { position: absolute; display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px var(--mono); padding: 8px 12px; border-radius: 12px; background: rgba(21,24,38,.86); border: 1px solid var(--line-2); backdrop-filter: blur(8px); box-shadow: var(--shadow-1); white-space: nowrap; animation: chipBob 5s ease-in-out infinite; }
.chipfloat i { width: 8px; height: 8px; border-radius: 50%; background: #3ecf8e; } .chipfloat.warn i { background: #f5a524; } .chipfloat.vio i { background: var(--accent); }
.chipfloat.c1 { left: -2%; top: 14%; } .chipfloat.c2 { right: -2%; top: 30%; animation-delay: -1.5s; } .chipfloat.c3 { left: 4%; bottom: 12%; animation-delay: -3s; } .chipfloat.c4 { right: 2%; bottom: 6%; animation-delay: -2.2s; }
@keyframes chipBob { 50% { transform: translateY(-7px); } }
.statbar { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); margin: 30px 0 0; overflow: hidden; }
.statbar div { padding: 20px 22px; border-right: 1px solid var(--line); } .statbar div:last-child { border-right: 0; }
.statbar b { display: block; font-size: 28px; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statbar span { color: var(--muted); font-size: 13px; }
.sec { margin: 84px 0 0; } .sec > h2 { margin: 0 0 10px; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.035em; }
.sec > .sub { color: var(--muted); max-width: 640px; margin: 0 0 30px; font-size: 16px; }
.kicker { display: block; color: var(--accent-2); font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fcard { padding: 22px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), rgba(14,16,24,.4)); transition: border-color .2s, transform .2s; }
.fcard:hover { border-color: var(--line-2); transform: translateY(-3px); }
.fcard .fi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; color: var(--accent-2); background: rgba(139,108,255,.1); border: 1px solid rgba(139,108,255,.22); }
.fcard h3 { margin: 0 0 6px; font-size: 16.5px; } .fcard p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: f; }
.flow .fs { position: relative; padding: 18px 16px 4px 0; }
.flow .fs::before { counter-increment: f; content: counter(f); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--accent-2); font-weight: 700; font-size: 13px; position: relative; z-index: 1; }
.flow .fs::after { content: ""; position: absolute; left: 36px; right: 6px; top: 33px; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.flow .fs:last-child::after { display: none; }
.flow h4 { margin: 12px 0 4px; font-size: 15px; } .flow p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.toolcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.toolcloud code { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; color: #cfd4ff; }
.toolgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tg { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel); } .tg h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mcard { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); position: relative; }
.mcard.hl { border-color: rgba(139,108,255,.5); background: linear-gradient(180deg, rgba(139,108,255,.1), var(--panel)); }
.mcard h3 { margin: 0 0 4px; font-size: 18px; } .mcard .tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: rgba(34,211,238,.12); color: var(--cyan); margin-bottom: 12px; }
.mcard p { color: var(--muted); font-size: 14px; margin: 8px 0 0; line-height: 1.6; }
.faq { max-width: 820px; } .faq details { border-bottom: 1px solid var(--line); padding: 16px 0; } .faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; } .faq summary::after { content: "+"; color: var(--accent-2); font-size: 20px; line-height: 1; transition: transform .2s; } .faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); margin: 10px 0 0; line-height: 1.65; }
.ctaband { margin: 84px 0 0; padding: 48px 28px; text-align: center; border-radius: 26px; border: 1px solid rgba(139,108,255,.35); background: radial-gradient(600px 220px at 50% 0, rgba(139,108,255,.28), transparent 70%), var(--panel); }
.ctaband h2 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 38px); } .ctaband p { color: var(--muted); margin: 0 0 22px; }
.sitefoot { border-top: 1px solid var(--line); margin-top: 80px; padding: 36px max(16px, calc((100% - 1180px) / 2)) 44px; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; color: var(--muted); font-size: 14px; }
.sitefoot b { display: block; color: var(--text); margin-bottom: 10px; font-size: 13px; } .sitefoot a { display: block; color: var(--muted); padding: 3px 0; } .sitefoot a:hover { color: #fff; }
.sitefoot .copy { grid-column: 1 / -1; color: var(--muted-2); font-size: 12.5px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .l-hero { grid-template-columns: 1fr; padding-top: 44px; } .l-stage { max-width: 420px; margin: 0 auto; width: 100%; } .fgrid, .mgrid { grid-template-columns: 1fr; } .flow { grid-template-columns: 1fr; gap: 6px; } .flow .fs::after { display: none; } .statbar { grid-template-columns: 1fr 1fr; } .statbar div:nth-child(2) { border-right: 0; } .statbar div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } .sitefoot { grid-template-columns: 1fr 1fr; } .demo { grid-template-columns: 1fr; } }

/* документация */
.docs { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; padding: 28px 20px 40px; }
.docs-nav { position: sticky; top: 82px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; padding-right: 8px; }
.docs-nav .dsearch { width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 11px; padding: 9px 12px; margin-bottom: 14px; outline: 0; }
.docs-nav .dsearch:focus { border-color: var(--accent); }
.docs-nav h5 { margin: 16px 0 6px; font-size: 11.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .1em; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; border-left: 2px solid transparent; } .docs-nav a:hover { color: #fff; background: var(--panel); }
.docs-nav a.on { color: #fff; border-left-color: var(--accent); background: rgba(139,108,255,.08); }
.doc { min-width: 0; max-width: 840px; } .doc h1 { font-size: clamp(30px, 4vw, 42px); margin: 6px 0 10px; letter-spacing: -.035em; }
.doc .lead { color: var(--muted); font-size: 17px; line-height: 1.65; margin: 0 0 8px; }
.doc section { padding-top: 46px; scroll-margin-top: 76px; } .doc h2 { font-size: 26px; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 17px; margin: 26px 0 8px; } .doc p, .doc li { color: #c5c9db; line-height: 1.7; font-size: 15.5px; } .doc ul, .doc ol { padding-left: 22px; } .doc li { margin: 4px 0; }
.doc code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; color: #d9d4ff; }
.doc pre { background: #0a0c14; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; overflow: auto; font-size: 13px; line-height: 1.65; color: #cfd4ff; } .doc pre code { background: none; border: 0; padding: 0; }
.callout { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: rgba(139,108,255,.06); border-radius: 12px; padding: 12px 16px; margin: 16px 0; color: #c5c9db; font-size: 14.5px; line-height: 1.65; }
.callout.ok { border-left-color: #3ecf8e; background: rgba(62,207,142,.06); } .callout.warn { border-left-color: #f5a524; background: rgba(245,165,36,.06); }
.callout b { color: #fff; }
.dtable { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; } .dtable th, .dtable td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } .dtable th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.dtable td:first-child { white-space: nowrap; } .dtable td { color: #c5c9db; }
.tool { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin: 10px 0; overflow: hidden; } .tool summary { cursor: pointer; list-style: none; padding: 13px 16px; display: flex; align-items: center; gap: 12px; } .tool summary::-webkit-details-marker { display: none; }
.tool summary code { background: rgba(139,108,255,.12); border-color: rgba(139,108,255,.3); font-weight: 600; } .tool summary span { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tool[open] summary span { display: none; } .tool .tb { padding: 0 16px 16px; color: #c5c9db; font-size: 14.5px; line-height: 1.65; } .tool .params { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .tool .params code.req { border-color: rgba(245,165,36,.5); }
.toolgrp h3 { display: flex; align-items: center; gap: 10px; } .toolgrp h3 small { color: var(--muted-2); font-weight: 500; font-size: 13px; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .docs-nav { position: static; max-height: none; } }

/* студия: доработка */
.side { background: rgba(14,16,24,.82); } .side h4 { letter-spacing: .1em; font-size: 11.5px; }
.item { padding: 10px 12px; font-size: 14px; border-radius: 10px; } .item.active { background: rgba(139,108,255,.1); box-shadow: inset 2px 0 0 var(--accent); }
.msg.bot { background: var(--panel); border-color: var(--line-2); } .msg.user { background: linear-gradient(135deg, #7d5cff, #4f8cff); box-shadow: 0 10px 26px -14px rgba(100,110,255,.9); }
.composer { background: rgba(7,8,13,.86); backdrop-filter: blur(10px); } .box { background: var(--panel); border-color: var(--line-2); border-radius: 18px; }
.box select { background: var(--panel-2); font-size: 13px; cursor: pointer; }
.iconbtn.send { background: linear-gradient(135deg, #8b6cff, #4f8cff); box-shadow: 0 8px 20px -10px rgba(110,100,255,.9); }
.modelnote { color: var(--muted); font-size: 12px; margin-top: 6px; text-align: center; min-height: 16px; } .modelnote b { color: var(--accent-2); font-weight: 600; }

/* Маскот Кит DeepJail (свободный, без ключа, очки при коде, виляет хвостом) */
.free-whale-companion {
  position: absolute;
  top: 14px;
  right: 24px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: auto;
  cursor: pointer;
  transition: transform .3s ease;
}
.free-whale-companion:hover {
  transform: scale(1.06);
}
.whale-bubble {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-width: 220px;
  text-align: right;
  animation: floatSubtle 4s ease-in-out infinite;
}
.whale-anim-wrap {
  position: relative;
  width: 136px;
  height: 110px;
  animation: whale-float 4.5s ease-in-out infinite;
}
.whale-body-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(99,102,241,0.4));
  transition: transform .2s ease;
}
.whale-glasses-fx {
  position: absolute;
  top: 42%;
  left: 48%;
  width: 44px;
  height: 25px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect x='2' y='4' width='24' height='20' rx='5' fill='%231e1b4b' stroke='%2338bdf8' stroke-width='3'/%3E%3Crect x='34' y='4' width='24' height='20' rx='5' fill='%231e1b4b' stroke='%2338bdf8' stroke-width='3'/%3E%3Cline x1='26' y1='14' x2='34' y2='14' stroke='%2338bdf8' stroke-width='3'/%3E%3Cline x1='6' y1='8' x2='18' y2='20' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' opacity='0.8'/%3E%3Cline x1='38' y1='8' x2='50' y2='20' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' opacity='0.8'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: 0;
  transform: translateY(-8px) scale(0.8);
  transition: opacity .35s cubic-bezier(.2,1.2,.4,1), transform .35s cubic-bezier(.2,1.2,.4,1);
  pointer-events: none;
}
.free-whale-companion.inspecting .whale-glasses-fx {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.free-whale-companion.inspecting .whale-anim-wrap {
  animation: whale-inspect 2.2s ease-in-out infinite;
}
.free-whale-companion.wiggling .whale-anim-wrap {
  animation: whale-wiggle .7s ease-in-out;
}
@keyframes whale-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-3deg); }
}
@keyframes whale-inspect {
  0%, 100% { transform: translateY(-3px) rotate(2deg) scale(1.05); }
  50% { transform: translateY(-12px) rotate(-4deg) scale(1.05); }
}
@keyframes whale-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-14deg) scale(1.1); }
  50% { transform: rotate(14deg) scale(1.1); }
  75% { transform: rotate(-8deg) scale(1.05); }
}
@keyframes whale-tail-wag {
  0%, 100% { transform: rotate(0deg); transform-origin: 360px 210px; }
  50% { transform: rotate(-14deg); transform-origin: 360px 210px; }
}

/* Маскот в чате */
.avatar .dj-whale-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.brow .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #1d2138, #0b0d17);
  border: 1.5px solid rgba(99,102,241,.45);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px -2px rgba(99,102,241,.4);
  position: relative;
  overflow: visible;
}
.brow .avatar svg {
  width: 42px;
  height: 42px;
  display: block;
}
.catbox .avatar.live, .actrow.live .avatar {
  width: 52px;
  height: 52px;
}
.catbox .avatar.live svg, .actrow.live .avatar svg {
  width: 46px;
  height: 46px;
}
.avatar.live .whale-tail,
.mood-code .whale-tail,
.mood-think .whale-tail {
  animation: whale-tail-wag 1s ease-in-out infinite;
}
.whale-glasses {
  opacity: 0;
  transform: translateY(-14px) scale(0.85);
  transform-origin: 282px 244px;
  transition: opacity .35s cubic-bezier(.2,1.2,.4,1), transform .35s cubic-bezier(.2,1.2,.4,1);
}
.avatar.live .whale-glasses,
.mood-code .whale-glasses,
.mood-look .whale-glasses,
.mood-check .whale-glasses {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Подсказки (Smart Suggestions) внутри ответа ИИ */
.smart-suggestions-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.smart-sugg-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 2px;
}
.smart-sugg-spark {
  color: #38bdf8;
  font-size: 13px;
}
.smart-sugg-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
}
.smart-sugg-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #10141f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.smart-sugg-btn:hover {
  background: #0d1a2d;
  border-color: #0284c7;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  color: #fff;
  transform: translateY(-1px);
}
.smart-sugg-btn:active {
  transform: scale(0.98);
}
.smart-sugg-btn.active-sugg,
.smart-sugg-btn.picked {
  border-color: #0284c7;
  background: #0d1a2d;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
  color: #fff;
}
.smart-sugg-ico {
  font-size: 15px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.smart-sugg-txt {
  line-height: 1.35;
}

/* YouTube-стиль карточек галереи */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 4px;
}
.game-tag-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(99,102,241,0.14);
  color: #818cf8;
  border: 1px solid rgba(99,102,241,0.25);
}
.card-stats-row {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.btn-publish-glow {
  background: linear-gradient(135deg, #4f46e5, #06b6d4) !important;
  box-shadow: 0 4px 18px rgba(79,70,229,0.5) !important;
}

/* YouTube-стиль Game Page (game.html) */
.game-page-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}
.game-viewport-wrap {
  width: 100%;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}
.game-viewport-inner {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}
.game-viewport-inner iframe {
  border: none;
  display: block;
}
.game-viewport-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.game-viewport-controls {
  display: flex;
  gap: 8px;
}
.game-details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  margin-top: 20px;
}
@media (max-width: 960px) {
  .game-details-layout {
    grid-template-columns: 1fr;
  }
}
.game-primary-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.game-title-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-title-row h1 {
  font-size: 26px;
  margin: 0;
  letter-spacing: -.02em;
}
.channel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.channel-author-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.channel-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.channel-info b {
  display: block;
  font-size: 16px;
}
.channel-info span {
  font-size: 13px;
  color: var(--muted);
}
.btn-sub {
  background: var(--text);
  color: #000;
  font-weight: 700;
  border-radius: 99px;
  padding: 8px 18px;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.btn-sub.subscribed {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.instructions-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
}
.instructions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.instructions-header h3 {
  margin: 0;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.instructions-body {
  color: #c9cddb;
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-line;
}

/* Комментарии и Groq Анализ фото */
.comments-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.comment-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.comment-composer textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  outline: none;
  resize: vertical;
}
.comment-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.groq-vision-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(16,185,129,0.12);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 99px;
}
.groq-analysis-box {
  background: rgba(16,185,129,0.06);
  border-left: 3px solid #34d399;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: #a7f3d0;
}
.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.comment-content {
  flex: 1;
}
.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.comment-author {
  font-weight: 600;
  font-size: 14px;
}
.comment-date {
  font-size: 12px;
  color: var(--muted);
}
.comment-del-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
}

/* Модалки настроек и профиля */
.chk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 14px;
  cursor: pointer;
}
.row2-inps {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row2-inps .inp {
  flex: 1;
}

/* =========================================================
   Галерея: Поиск и фильтры по тегам
   ========================================================= */
.gallery-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.gallery-search-inp {
  width: 100%;
  padding: 12px 18px;
  background: var(--card-bg, #111422);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gallery-search-inp:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.gallery-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.g-filter-chip {
  padding: 7px 14px;
  background: var(--card-bg, #111422);
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.g-filter-chip:hover {
  color: var(--fg);
  border-color: var(--border-hover, #374151);
  background: rgba(255, 255, 255, 0.04);
}
.g-filter-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Hover-превью на карточках игр */
.card-interactive {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-interactive:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.card-interactive .wrap {
  position: relative;
  overflow: hidden;
}
.card-play-hover {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 22, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.card-play-hover span {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: 99px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}
.card-interactive:hover .card-play-hover {
  opacity: 1;
}
.card-interactive:hover .card-play-hover span {
  transform: scale(1);
}

/* =========================================================
   Кнопка лайка игры (YouTube-style)
   ========================================================= */
.btn-like-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.btn-like-wrap:active {
  transform: scale(0.92);
}
.btn-like-wrap.liked {
  border-color: rgba(244, 63, 94, 0.6) !important;
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.12) !important;
}

/* =========================================================
   Таблица рекордов (Leaderboard Card)
   ========================================================= */
.yt-leaderboard-card {
  margin-top: 24px;
  background: var(--card-bg, #111422);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.yt-lb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.yt-lb-head h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.yt-lb-sub {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.yt-lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.yt-lb-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  transition: background 0.15s ease;
}
.yt-lb-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.yt-lb-rank {
  width: 50px;
  font-weight: 700;
  color: var(--accent, #f59e0b);
}
.yt-lb-name {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yt-lb-score {
  font-weight: 700;
  color: var(--primary, #6366f1);
  font-variant-numeric: tabular-nums;
}
.yt-lb-empty {
  padding: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* =========================================================
   Модальное окно QR-кода "На телефон"
   ========================================================= */
.qr-modal {
  max-width: 360px !important;
  text-align: center;
}
.qr-modal h3 {
  margin-top: 0;
  margin-bottom: 8px;
}
.qr-modal p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.qr-img-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  width: fit-content;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.qr-image {
  width: 200px;
  height: 200px;
  display: block;
}
.qr-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.qr-link-box .inp {
  flex: 1;
  font-size: 12px;
  text-align: left;
}

/* =========================================================
   YouTube-Style Плеер и Страница Игры (DeepJail Game Room)
   ========================================================= */
body.yt-game-page {
  background: #08090d;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.yt-game-page .top {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  background: rgba(10, 11, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 max(24px, calc((100% - 1280px) / 2));
}

body.yt-game-page .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

body.yt-game-page .brand img {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

body.yt-game-page .top .nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.yt-container {
  width: 100%;
  max-width: 1240px;
  margin: 20px auto 60px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Экран плеера */
.yt-player-box {
  width: 100%;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(139, 108, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-bottom: 20px;
}

.yt-player-box.theater {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.95), 0 0 40px rgba(99, 102, 241, 0.2);
}

.yt-iframe-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 380px;
  max-height: 78vh;
  background: #050608;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.yt-iframe-wrap.theater {
  max-width: 100% !important;
  max-height: 85vh !important;
}

.yt-frame {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block !important;
  background: #000;
  outline: none;
}

/* Заглушка ошибки в плеере */
.yt-frame-error {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #121526, #090a10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.yt-frame-error .err-box {
  text-align: center;
  max-width: 440px;
  animation: rise .4s ease-out;
}

.yt-frame-error .err-whale {
  width: 90px;
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 24px rgba(139, 108, 255, 0.4));
}

.yt-frame-error h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.yt-frame-error p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

/* Панель управления под плеером */
.yt-player-bar {
  width: 100%;
  background: rgba(16, 18, 28, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
}

.yt-bar-left, .yt-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.yt-bar-left .btn, .yt-bar-right .btn {
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.yt-bar-left .btn:hover, .yt-bar-right .btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Метаданные игры, заголовок и кнопки действий */
.yt-details {
  margin-top: 16px;
}

.yt-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.yt-title {
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
  line-height: 1.25;
}

.yt-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.yt-action-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

.yt-action-buttons .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Теги игры */
.yt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.yt-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(139, 108, 255, 0.12);
  border: 1px solid rgba(139, 108, 255, 0.3);
  color: #a995ff;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.15s ease;
}

.yt-tag-pill:hover {
  background: rgba(139, 108, 255, 0.22);
  border-color: rgba(139, 108, 255, 0.5);
  transform: scale(1.03);
}

/* Статистика: просмотры, запуски, дата */
.yt-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.yt-meta-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yt-meta-stats .dot {
  opacity: 0.4;
}

/* Канал автора в стиле YouTube */
.yt-channel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(18, 20, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.yt-channel-left {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.yt-channel-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel-2);
  border: 2px solid rgba(139, 108, 255, 0.3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-channel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yt-channel-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.yt-channel-handle {
  font-size: 13px;
  color: var(--accent-2);
}

.yt-channel-stats {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Описание и Инструкция (Как играть) */
.yt-desc-box {
  background: rgba(18, 20, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.yt-desc-text {
  font-size: 15px;
  line-height: 1.6;
  color: #d1d5db;
  margin-bottom: 18px;
  white-space: pre-wrap;
}

.yt-instructions-block {
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 16px 20px;
}

.yt-inst-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.yt-inst-head .inst-icon {
  font-size: 18px;
}

.yt-inst-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f3f4f6;
  flex: 1;
}

.yt-inst-content {
  font-size: 14px;
  line-height: 1.55;
  color: #9ca3af;
  white-space: pre-wrap;
}

/* Секция комментариев */
.yt-comments-section {
  margin-top: 36px;
}

.yt-comments-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 20px;
}

.yt-comment-form {
  display: flex;
  gap: 16px;
  background: rgba(18, 20, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 28px;
}

.comment-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.comment-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-inputs textarea {
  width: 100%;
  background: rgba(10, 11, 16, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  resize: vertical;
  min-height: 68px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.comment-inputs textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.2);
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.comment-attach-btn {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

/* =========================================================
   Мобильная оптимизация плеера и элементов управления
   ========================================================= */
@media (max-width: 768px) {
  .yt-player-box {
    margin: -16px -16px 16px -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .yt-iframe-wrap {
    border-radius: 0;
    min-height: 260px;
  }
  .yt-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .yt-action-buttons {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: flex-start;
  }
  .gallery-filter-chips {
    overflow-x: auto;
    padding-bottom: 6px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .g-filter-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* =========================================================
   Субагенты: Карточка, статус, значки и модальное окно Подробнее
   ========================================================= */
.act-ico svg {
  display: block;
  vertical-align: middle;
}
.subagent-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.subagent-badge.ok {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.subagent-badge.bad {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.btn-sub-detail {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.15s ease;
}
.btn-sub-detail:hover {
  background: var(--primary);
  color: #fff;
}

.subagent-card-preview {
  padding: 8px 10px;
  background: rgba(15, 18, 30, 0.7);
  border-radius: 8px;
  font-size: 13px;
  margin-top: 4px;
}
.subagent-prev-row {
  margin-bottom: 6px;
  color: var(--fg);
}
.subagent-prev-result {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--primary);
  color: var(--muted);
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

/* Окно Подробнее (Инспектор действий субагента) */
.subagent-modal-view {
  min-width: 540px;
  max-width: 680px;
  font-family: system-ui, -apple-system, sans-serif;
}
@media (max-width: 600px) {
  .subagent-modal-view {
    min-width: 100%;
  }
}
.sub-m-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.sub-m-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sub-m-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.sub-m-ico {
  display: inline-flex;
  padding: 6px;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  color: #818cf8;
}
.sub-m-ico svg {
  width: 20px;
  height: 20px;
}

.sub-m-block {
  margin-bottom: 16px;
}
.sub-m-block h5 {
  margin: 0 0 6px 0;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.sub-m-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.sub-m-ctx {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px 8px;
  border-radius: 4px;
}

.sub-log-list {
  max-height: 200px;
  overflow-y: auto;
  background: #090b14;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sub-log-row {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sub-log-row::before {
  content: "›";
  color: #64748b;
  font-weight: 700;
}
.sub-log-row.act {
  color: #cbd5e1;
}
.sub-log-row.ok {
  color: #34d399;
  font-weight: 600;
}
.sub-log-row.bad {
  color: #f87171;
  font-weight: 600;
}

.sub-m-res {
  background: #090b14;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
}
.sub-m-res pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
}

/* =========================================================
   Модальное окно профиля автора (Channel Modal)
   ========================================================= */
.modal.channel-modal {
  max-width: 680px;
  width: 94%;
  padding: 26px 30px;
  border-radius: 20px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  position: relative;
}

.channel-modal-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.chan-modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 16px rgba(139, 108, 255, 0.35);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chan-modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.channel-modal-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.modal-handle {
  font-size: 13px;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.modal-status-badge {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #38bdf8;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.modal-bio {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  max-width: 480px;
}

.channel-stats-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 14px 20px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
}

.channel-stats-row > div b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.channel-stats-row > div span {
  font-size: 12px;
  color: var(--muted);
}

.channel-modal h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}

.modal-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  max-height: 380px;
  overflow-y: auto;
  padding: 2px 2px 8px;
}

.modal-games-grid .card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.modal-games-grid .card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.modal-games-grid .card .cover {
  height: 110px;
  background: #0d0f17 center / cover no-repeat;
}

.modal-games-grid .card .info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-games-grid .card .info b {
  font-size: 14px;
  color: #fff;
}

.modal-games-grid .card .info span {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-games-grid .card .info small {
  font-size: 11px;
  color: var(--cyan);
  margin-top: 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ---------- Оформление сообщений ИИ: жирный, радуга, акцентные цвета ---------- */
.dj-txt-bold {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.dj-txt-em {
  font-style: italic;
  color: #e2e8f0;
}

.dj-txt-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 1.5px 6px;
  color: #38bdf8;
}

/* Плавная, стильная радужная анимация (приятная для глаз) */
.dj-txt-rainbow {
  font-weight: 800;
  background: linear-gradient(
    90deg,
    #ff6b8b,
    #ffa652,
    #ffe853,
    #4deeea,
    #74ee15,
    #ffe853,
    #ffa652,
    #ff6b8b
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: djRainbowFlow 5.5s linear infinite;
  display: inline-block;
  text-shadow: 0 0 14px rgba(255, 232, 83, 0.22);
}

@keyframes djRainbowFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.dj-txt-red {
  color: #ff5c77;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 92, 119, 0.25);
}

.dj-txt-green {
  color: #34d399;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
}

.dj-txt-blue {
  color: #38bdf8;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.dj-txt-cyan {
  color: #22d3ee;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.25);
}

.dj-txt-gold,
.dj-txt-yellow {
  color: #fbbf24;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}

.dj-txt-purple,
.dj-txt-violet {
  color: #c084fc;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.25);
}

.dj-txt-orange {
  color: #fb923c;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(251, 146, 60, 0.25);
}

.dj-txt-pink {
  color: #f472b6;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(244, 114, 182, 0.25);
}

.dj-txt-sparkle {
  color: #e0e7ff;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(129, 140, 248, 0.45);
}

/* =========================================================
   Roblox-style IgnoreGuiInset: Полное окно игры в Студии
   ========================================================= */
.dj-play-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #000;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  animation: fade 0.15s ease both;
}

.dj-play-topbar {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.dj-play-title-pill {
  pointer-events: auto;
  background: rgba(15, 18, 30, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dj-play-close-btn {
  pointer-events: auto;
  background: rgba(220, 38, 38, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s ease, background 0.1s ease;
}

.dj-play-close-btn:hover {
  background: rgba(239, 68, 68, 0.95);
  transform: scale(1.04);
}

.dj-play-iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: #000;
  flex: 1;
  display: block;
}

/* =========================================================
   CSS Fullscreen Overlay для мобильных и плеера игры
   ========================================================= */
.yt-iframe-wrap.yt-fullscreen-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: unset !important;
  z-index: 9999999 !important;
  background: #000 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

.yt-fullscreen-close {
  display: none;
}

.yt-iframe-wrap.yt-fullscreen-active .yt-fullscreen-close {
  display: flex !important;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10000000;
  background: rgba(220, 38, 38, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.1s ease, background 0.1s ease;
}

.yt-iframe-wrap.yt-fullscreen-active .yt-fullscreen-close:hover {
  background: rgba(239, 68, 68, 0.95);
  transform: scale(1.04);
}



