/* Оболочка мини-приложения: вкладки, карточки, профиль, рамки аватарок, онлайн-игры.
   Цвета — из theme.css. */
html, body { height: 100%; }
body { background: radial-gradient(1200px 600px at 50% -200px, #1a1240 0%, var(--bg) 60%) no-repeat, var(--bg); }
#app { min-height: 100vh; }
.view { max-width: 560px; margin: 0 auto; padding: 14px 14px calc(86px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: var(--cyan); }
.sec { margin-top: 18px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.sec-head h3 { font-size: 15px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.gap { height: 10px; }
.stack { display: grid; gap: 10px; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- вкладки снизу */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: #0a0a16;
  border-top: 1px solid var(--line);
}
.tab { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; border-radius: 12px; }
.tab .ti { font-size: 21px; filter: grayscale(.8) opacity(.75); transition: transform .15s, filter .15s; }
.tab.on { color: var(--text); }
.tab.on .ti { filter: none; transform: translateY(-1px) scale(1.08); text-shadow: 0 0 12px rgba(41, 240, 255, .6); }

/* ---------- чипы и сегменты */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px;
  padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, #18c8ff, #8a4dff); box-shadow: 0 4px 14px rgba(80, 120, 255, .35); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 9px 6px; border-radius: 10px; cursor: pointer; }
.seg button.on { background: var(--card2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), 0 0 14px rgba(41, 240, 255, .18); }

/* ---------- шапка главной */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(41, 240, 255, .10), rgba(155, 92, 255, .14) 55%, rgba(255, 63, 180, .10)), var(--card); }
.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 63, 180, .35), transparent 70%); pointer-events: none; }
.hero-top { display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; }
.hero-name { font-size: 19px; font-weight: 800; }
.hero-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 9px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.pill.gold { color: var(--gold); border-color: rgba(255, 210, 63, .4); }
.pill.cyan { color: var(--cyan); border-color: rgba(41, 240, 255, .4); }
.pill.pink { color: var(--pink); border-color: rgba(255, 63, 180, .4); }
.pill.lime { color: var(--lime); border-color: rgba(166, 255, 58, .4); }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 10px; position: relative; z-index: 1; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
  box-shadow: 0 0 12px rgba(41, 240, 255, .6); transition: width .5s ease; }
.bar-cap { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 5px; position: relative; z-index: 1; }

/* ---------- плитки */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { position: relative; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 13px;
  cursor: pointer; overflow: hidden; min-height: 92px; display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.tile:active { transform: scale(.98); }
.tile .te { font-size: 30px; line-height: 1; filter: drop-shadow(0 0 10px rgba(41, 240, 255, .35)); }
.tile .tt { font-weight: 800; font-size: 15px; }
.tile .ts { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tile .tr { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; color: var(--gold); }
.tile.big { grid-column: span 2; flex-direction: row; align-items: center; gap: 14px; min-height: 80px; }
.tile.big .te { font-size: 40px; }
.tile.glow-c { border-color: rgba(41, 240, 255, .45); box-shadow: 0 0 22px rgba(41, 240, 255, .14) inset; }
.tile.glow-p { border-color: rgba(255, 63, 180, .45); box-shadow: 0 0 22px rgba(255, 63, 180, .14) inset; }
.tile.glow-g { border-color: rgba(255, 210, 63, .5); box-shadow: 0 0 22px rgba(255, 210, 63, .14) inset; }
.tile.glow-l { border-color: rgba(166, 255, 58, .45); box-shadow: 0 0 22px rgba(166, 255, 58, .12) inset; }
.daily-badge { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px;
  background: linear-gradient(135deg, #ffd23f, #ff8a2a); color: #1a0d00; }

/* ---------- задания дня */
.quest { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.quest .qtext { flex: 1; font-size: 14px; }
.quest .qbar { height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .08); margin-top: 6px; overflow: hidden; }
.quest .qbar i { display: block; height: 100%; background: var(--lime); box-shadow: var(--glow-lime); }
.quest.done { opacity: .6; }

/* ---------- списки и рейтинги */
.list { display: grid; gap: 8px; }
.li { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); cursor: pointer; color: var(--text); text-align: left; width: 100%; }
.li.me { border-color: rgba(41, 240, 255, .55); box-shadow: 0 0 16px rgba(41, 240, 255, .15) inset; }
.li .place { width: 28px; text-align: center; font-weight: 800; color: var(--muted); flex: none; }
.li .place.m { font-size: 20px; }
.li .lmain { flex: 1; min-width: 0; }
.li .lname { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .lsub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .lval { font-weight: 800; text-align: right; flex: none; }
.li .lval small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 26px 12px; font-size: 14px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: rgba(155, 92, 255, .18); color: #cdb6ff; margin-left: 4px; vertical-align: 1px; }
.tag.rp { background: rgba(255, 63, 180, .16); color: #ffb3e0; }
.tag.fl { background: rgba(41, 240, 255, .14); color: #a8f8ff; }

/* ---------- аватарки и рамки */
.ava { --s: 44px; position: relative; width: var(--s); height: var(--s); flex: none; border-radius: 50%; padding: calc(var(--s) * .07); }
.ava-in { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #1c1c3a; display: flex; align-items: center;
  justify-content: center; font-size: calc(var(--s) * .48); font-weight: 800; color: var(--text); position: relative; z-index: 1; }
.ava-in img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava::before { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.ava::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; pointer-events: none; z-index: 2; }
.ava .lvl { position: absolute; right: -4px; bottom: -3px; z-index: 3; font-size: calc(var(--s) * .22); min-width: calc(var(--s) * .38); height: calc(var(--s) * .38);
  padding: 0 4px; border-radius: 99px; background: #0b0b18; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--cyan); }
.f-none::before { background: var(--line); }
.f-neon::before { background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 0 10px rgba(41, 240, 255, .55); }
.f-ice::before { background: conic-gradient(from 0deg, #e8fbff, #6fd8ff, #b9f2ff, #3fb6ff, #e8fbff); box-shadow: 0 0 12px rgba(111, 216, 255, .6); }
.f-rose::before { background: linear-gradient(135deg, #ff3fb4, #ff9ad5); box-shadow: 0 0 12px rgba(255, 63, 180, .6); }
.f-acid::before { background: linear-gradient(135deg, #a6ff3a, #29f0ff); box-shadow: 0 0 12px rgba(166, 255, 58, .6); }
.f-gold::before { background: conic-gradient(#fff3b0, #ffd23f, #b8860b, #ffe680, #ffd23f, #fff3b0); box-shadow: 0 0 14px rgba(255, 210, 63, .65); }
.f-fire::before { background: conic-gradient(#ff2a00, #ff8a2a, #ffd23f, #ff3f3f, #ff8a2a, #ff2a00); box-shadow: 0 0 16px rgba(255, 110, 40, .75); animation: spin 2.4s linear infinite; }
.f-rainbow::before { background: conic-gradient(#ff4d5e, #ff8a2a, #ffd23f, #a6ff3a, #29f0ff, #4d8dff, #9b5cff, #ff3fb4, #ff4d5e); box-shadow: 0 0 14px rgba(155, 92, 255, .6); animation: spin 4s linear infinite; }
.f-galaxy::before { background: conic-gradient(#1b0f4a, #9b5cff, #29f0ff, #1b0f4a, #ff3fb4, #1b0f4a); box-shadow: 0 0 18px rgba(155, 92, 255, .7); animation: spin 7s linear infinite; }
.f-legend::before { background: conic-gradient(#ffd23f, #ff3fb4, #9b5cff, #29f0ff, #a6ff3a, #ffd23f); box-shadow: 0 0 22px rgba(255, 210, 63, .8), 0 0 40px rgba(255, 63, 180, .4); animation: spin 3s linear infinite; }
.f-legend::after { box-shadow: 0 0 0 2px rgba(255, 210, 63, .6); }
.f-hearts::before { background: linear-gradient(135deg, #ff4d8d, #ff9ad5); box-shadow: 0 0 12px rgba(255, 77, 141, .6); }
.f-hearts::after { content: "💗"; inset: auto; top: -6%; right: -6%; font-size: calc(var(--s) * .3); }
.f-glitch::before { background: linear-gradient(90deg, #29f0ff, #ff3fb4, #29f0ff); background-size: 200% 100%; animation: glitch 1.2s steps(4) infinite; box-shadow: 2px 0 0 rgba(255, 63, 180, .7), -2px 0 0 rgba(41, 240, 255, .7); }
.f-aurora::before { background: conic-gradient(#00ffa3, #29f0ff, #9b5cff, #00ffa3, #4d8dff, #00ffa3); box-shadow: 0 0 18px rgba(0, 255, 163, .55); animation: spin 6s linear infinite; }
.f-thunder::before { background: linear-gradient(135deg, #4d8dff, #ffd23f, #4d8dff); box-shadow: 0 0 14px rgba(255, 210, 63, .6); animation: flash 2.2s infinite; }
.f-thunder::after { content: "⚡"; inset: auto; top: -8%; right: -6%; font-size: calc(var(--s) * .3); }
.f-crown::before { background: conic-gradient(#ffd23f, #fff3b0, #b8860b, #ffd23f); box-shadow: 0 0 16px rgba(255, 210, 63, .7); }
.f-crown::after { content: "👑"; inset: auto; top: -24%; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: calc(var(--s) * .36); }
.f-void::before { background: conic-gradient(#000, #3b0a5e, #000, #12123a, #000); box-shadow: 0 0 0 1px #9b5cff, 0 0 22px rgba(155, 92, 255, .8); animation: spin 5s linear infinite reverse; }
.f-streak::before { background: conic-gradient(#ff8a2a, #ff3fb4, #ff8a2a, #ffd23f, #ff8a2a); box-shadow: 0 0 14px rgba(255, 138, 42, .7); animation: spin 3.5s linear infinite; }
.f-streak::after { content: "🔥"; inset: auto; bottom: -8%; left: -6%; font-size: calc(var(--s) * .3); }
.f-champ::before { background: linear-gradient(135deg, #a6ff3a, #ffd23f, #a6ff3a); box-shadow: 0 0 16px rgba(166, 255, 58, .65); }
.f-champ::after { content: "🏆"; inset: auto; top: -8%; right: -8%; font-size: calc(var(--s) * .3); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glitch { 0% { background-position: 0 0; } 100% { background-position: 200% 0; } }
@keyframes flash { 0%, 86%, 100% { filter: none; } 90% { filter: brightness(2.2); } }

.frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.frame-card { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 6px 10px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; cursor: pointer; color: var(--text); font-size: 12px; font-weight: 700; text-align: center; }
.frame-card.on { border-color: var(--cyan); box-shadow: 0 0 16px rgba(41, 240, 255, .25) inset; }
.frame-card.locked { opacity: .55; }
.frame-card .need { font-size: 11px; color: var(--muted); font-weight: 600; }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatars button { aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); font-size: 24px; cursor: pointer; }
.avatars button.on { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

/* ---------- профиль */
.prof { text-align: center; padding: 20px 14px 16px; }
.prof .ava { margin: 0 auto; }
.prof-name { font-size: 22px; font-weight: 800; margin-top: 12px; }
.prof-title { color: var(--muted); font-size: 14px; margin-top: 2px; }
.prof-bio { margin-top: 8px; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #2a2a4d; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: linear-gradient(135deg, #18c8ff, #8a4dff); }
.switch input:checked + i::after { transform: translateX(20px); }

/* ---------- поля ввода */
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 700; }
.input, textarea.input, select.input { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); padding: 11px 12px;
  font-size: 15px; color: var(--text); outline: none; }
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(41, 240, 255, .15); }
textarea.input { min-height: 96px; resize: vertical; }

/* ---------- проект (карточка чата) */
.proj-head { padding: 18px 16px; border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255, 63, 180, .12), rgba(41, 240, 255, .10)), var(--card); }
.proj-title { font-size: 22px; font-weight: 800; line-height: 1.2; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding: 8px 2px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; height: 100%; }
.chart .col i { display: block; border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .m { background: linear-gradient(180deg, var(--cyan), rgba(41, 240, 255, .35)); }
.chart .p { background: linear-gradient(180deg, var(--pink), rgba(255, 63, 180, .35)); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chan { display: flex; gap: 12px; align-items: center; }
.chan .ce { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, rgba(41, 240, 255, .25), rgba(155, 92, 255, .25)); flex: none; }

/* ---------- окно снизу */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .2s; }
.sheet-box { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--bg2);
  border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up .25s ease-out; max-width: 560px; margin: 0 auto; }
.sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 90;
  background: rgba(27, 27, 54, .97); border: 1px solid var(--line); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600;
  max-width: 88vw; text-align: center; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.boot-logo { font-size: 56px; animation: pulse 1.2s infinite; filter: drop-shadow(0 0 18px rgba(41, 240, 255, .7)); }
.boot-text { color: var(--muted); font-size: 15px; text-align: center; padding: 0 30px; line-height: 1.45; }

/* ---------- экран игры */
.play { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.hud { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(7, 7, 15, .92);
  border-bottom: 1px solid var(--line); }
.hud-mid { flex: 1; min-width: 0; }
.hud-title { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-status { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-score { text-align: right; }
.hud-score b { font-size: 22px; display: block; line-height: 1.1; color: var(--cyan); text-shadow: var(--glow-cyan); }
.hud-score span { font-size: 11px; }
.play-root { padding: 12px; }
.result { text-align: center; padding: 24px 16px; }
.result .big { font-size: 46px; font-weight: 900; margin: 6px 0; }
.result .rec { color: var(--gold); text-shadow: var(--glow-gold); font-weight: 800; }
.gains { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.lvlup { margin: 10px auto; padding: 12px; border-radius: 16px; border: 1px solid rgba(255, 210, 63, .5); background: rgba(255, 210, 63, .08); font-weight: 800; color: var(--gold); }

/* ---------- онлайн */
.og { display: flex; gap: 12px; align-items: flex-start; }
.og .te { font-size: 34px; line-height: 1; }
.og-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.og-btns .btn { padding: 0 6px; font-size: 13px; }
.seats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; font-size: 12px; text-align: center; }
.seat .nm { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.empty .ava-in { background: transparent; border: 2px dashed var(--line); color: var(--muted); }
.vs { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.vs .side { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.vs .side.r { flex-direction: row-reverse; text-align: right; }
.vs .side .nm { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs .side.turn .ava { animation: pulse 1s infinite; }
.vs .sc { font-size: 22px; font-weight: 900; min-width: 64px; text-align: center; }
.turnline { text-align: center; font-weight: 800; margin: 10px 0; min-height: 22px; }
.turnline.mine { color: var(--lime); text-shadow: var(--glow-lime); }
.timer { height: 4px; border-radius: 9px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-bottom: 10px; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), var(--gold), var(--red)); transition: width .25s linear; }
.note { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; margin-top: 8px; }

.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 330px; margin: 0 auto; }
.ttt button { aspect-ratio: 1; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 52px; font-weight: 900; cursor: pointer; }
.ttt .X { color: var(--cyan); text-shadow: var(--glow-cyan); }
.ttt .O { color: var(--pink); text-shadow: var(--glow-pink); }
.ttt .win { background: rgba(166, 255, 58, .14); border-color: var(--lime); }
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 8px; border-radius: 18px; background: #101036; border: 1px solid var(--line); max-width: 420px; margin: 0 auto; }
.c4 button { aspect-ratio: 1; border-radius: 50%; border: 0; background: #05051a; cursor: pointer; padding: 0; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .7); }
.c4 .p1 { background: radial-gradient(circle at 35% 35%, #ff9ad5, var(--pink)); box-shadow: 0 0 10px rgba(255, 63, 180, .7); }
.c4 .p2 { background: radial-gradient(circle at 35% 35%, #c9fbff, var(--cyan)); box-shadow: 0 0 10px rgba(41, 240, 255, .7); }
.c4 .win { outline: 3px solid var(--lime); outline-offset: -3px; }
.c4 .last { animation: drop .35s ease-out; }
@keyframes drop { from { transform: translateY(-120px); } }
.dots svg { width: 100%; max-width: 360px; display: block; margin: 0 auto; touch-action: manipulation; }
.sea { display: grid; gap: 2px; padding: 4px; border-radius: 12px; background: #0a1430; border: 1px solid var(--line); margin: 0 auto; }
.sea button { aspect-ratio: 1; border: 0; padding: 0; border-radius: 3px; background: #0f2147; font-size: 11px; cursor: pointer; color: #fff; }
.sea .ship { background: #3a5fa8; box-shadow: inset 0 0 0 1px #6f95e8; }
.sea .hit { background: var(--red); box-shadow: 0 0 6px rgba(255, 77, 94, .8); }
.sea .sunk { background: #7a1020; }
.sea .miss { background: #0f2147; color: var(--muted); }
.sea .miss::after { content: "•"; }
.sea .lastshot { outline: 2px solid var(--gold); outline-offset: -2px; }
.rps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rps button { aspect-ratio: 1; border-radius: 20px; border: 1px solid var(--line); background: var(--card); font-size: 46px; cursor: pointer; }
.rps button.on { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.rounds { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; font-size: 20px; }
.rounds span { padding: 4px 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.rounds .w { border-color: var(--lime); }
.rounds .l { border-color: var(--red); }
.qd-q { font-size: 18px; font-weight: 800; text-align: center; margin: 8px 0 14px; line-height: 1.35; }
.score-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }

.code { font-family: var(--mono); font-size: 26px; letter-spacing: .18em; font-weight: 800; color: var(--gold); text-shadow: var(--glow-gold); }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; font-size: 11px; font-weight: 700; color: var(--text); cursor: pointer; min-height: 70px; text-align: center; line-height: 1.15; }
.act .ae { font-size: 24px; }
.act.on { border-color: var(--pink); box-shadow: var(--glow-pink); }
.people { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.person { background: none; border: 0; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; padding: 4px 0; }
.person .nm { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.on .ava::after { box-shadow: 0 0 0 3px var(--pink), 0 0 14px rgba(255, 63, 180, .8); }
.spin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.loading { display: flex; justify-content: center; padding: 30px; }
.sec > .tile.big { width: 100%; }
.tile.big:has(.daily-badge) > div:last-child { padding-right: 70px; }
.chart .col i[style*="height:0%"] { min-height: 0; }

/* ---------- стол игр чата */
.tfeed { display: flex; flex-direction: column; gap: 8px; }
.tmsg { max-width: 92%; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 14px; line-height: 1.42; word-break: break-word; }
.tmsg.bot { align-self: flex-start; border-top-left-radius: 6px; }
.tmsg.user { align-self: flex-start; background: var(--card2); }
.tmsg.mine { align-self: flex-end; background: rgba(41, 240, 255, .12); border-color: rgba(41, 240, 255, .35); border-top-right-radius: 6px; }
.tmsg.sys { align-self: center; background: none; border: 0; color: var(--muted); font-size: 12px; text-align: center; padding: 2px 8px; }
.tfrom { font-size: 12px; font-weight: 800; color: var(--pink); margin-bottom: 2px; }
.ttext a { color: var(--cyan); }
.ttext code, .ttext pre { font-family: var(--mono); font-size: 13px; background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 5px; }
.ttext pre { display: block; padding: 8px; white-space: pre-wrap; }
.ttext blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--violet); color: #d7d7f2; }
.ttext .spoiler { background: #3a3a5c; color: transparent; border-radius: 4px; cursor: pointer; }
.ttext .spoiler:active { color: inherit; }
.timg { display: block; width: 100%; border-radius: 12px; margin-bottom: 8px; }
.taudio { width: 100%; margin-bottom: 6px; }
.tbtns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tbtns .btn { flex: 1 1 auto; min-height: 38px; font-size: 13px; padding: 4px 10px; white-space: normal; line-height: 1.2; }
.tinput { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); display: flex; gap: 8px; margin-top: 10px; padding: 8px 0; background: linear-gradient(180deg, transparent, var(--bg) 30%); z-index: 3; }

/* ---------- быстродействие и компьютер */
.ava.still::before { animation: none; }                 /* в списках рамки не крутятся — меньше нагрузка */
.list, .tiles, .stack { contain: layout paint; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (hover: hover) and (pointer: fine) {             /* мышь: видимая полоса прокрутки у рядов фильтров */
  .chips { scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-bottom: 6px; cursor: grab; }
  .chips::-webkit-scrollbar { display: block; height: 6px; }
  .chips::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
  .tile:hover, .li:hover, .chip:hover { border-color: rgba(41, 240, 255, .45); }
}
