/* =========================================================================
   TaalToren — clean CSS (v1)
   Неймспейс через body.tt-theme, щоб не чіпати глобальні стилі проєкту
   ========================================================================= */

/* ===== WebView-safe base (drop-in) ===== */
:root{
  --tt-bg: #0b0f14;          /* головний фон */
  --tt-bg-2: #0a0f18;        /* градієнт вниз */
  --tt-text: #e8f1ff;        /* текст */
  --tt-dynamic-bg-image: none;
  --tt-dynamic-bg-opacity: .35;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #0b0f14; /* страховка для WebView */
  color: var(--tt-text);
}

body.tt-theme,
.tt-theme {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(0,229,255,0.08), transparent 60%),
    radial-gradient(900px 480px at 100% 40%, rgba(124,255,199,0.08), transparent 60%),
    linear-gradient(180deg, var(--tt-bg) 0%, var(--tt-bg-2) 100%);
}

/* Фоновий шар позаду контенту */
body.tt-theme::before,
.tt-theme::before {
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--tt-dynamic-bg-image);
  background-size: cover;
  background-position: center;
  opacity: var(--tt-dynamic-bg-opacity);
  transition: opacity .3s ease, background-image .3s ease;
}

/* Якщо десь лишився старий селектор `.tt-theme body {...}`, перекриємо його так */
.tt-theme body { background: transparent !important; }

/* На випадок "білих" контейнерів із дефолтними стилями — прибираємо задній фон */
.app, .page, main, [class*="container"], [class*="wrapper"] {
  background: transparent !important;
}

/* Скляні картки + фолбек без backdrop-filter (часто в WebView його нема) */
.tt-card, .tt-lvl, .auth-card, .glass {
  background: rgba(10,16,24,0.55);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .tt-card, .tt-lvl, .auth-card, .glass {
    background: rgba(10,16,24,0.85); /* щільніший фон, щоб не «вибілювало» */
  }
}

/* Кнопки/інтерактивні — дрібний тюн для темної теми */
button, .btn {
  color: #eaf3ff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
}
button:hover, .btn:hover {
  background: rgba(255,255,255,.1);
}

/* Посилання */
a { color: #8fd3ff; text-decoration: none; }
a:hover { text-decoration: underline; }


/* ---------- CSS variables / theme ---------- */
:root {
  --tt-bg: #0b0f14;
  --tt-bg-2: #070a0f;
  --tt-text: #e9eef5;
  --tt-muted: #a7b0bd;
  --tt-border: rgba(255,255,255,0.12);
  --tt-glass: rgba(255,255,255,0.06);
  --tt-accent: #00e5ff;
  --tt-accent-2: #7cffc7;
  --tt-radius: 18px;
  --tt-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.03);
  --tt-dynamic-bg-image: none;
  --tt-dynamic-bg-opacity: 0.0;
}

body.tt-theme {
  color-scheme: dark;
}

.tt-theme .pill-input{
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--tt-border);
  color: var(--tt-text);
  padding: 10px 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.tt-theme .pill-input:focus{
  outline: none;
  border-color: rgba(124,255,199,0.45);
  box-shadow: 0 0 0 3px rgba(124,255,199,0.14);
}
.tt-theme .pill-input::placeholder{ color: rgba(233,238,245,0.55); }
.tt-theme select.pill-input{
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20'%3E%3Cpath fill='%23e9eef5' d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 10.1l3.71-2.87a.75.75 0 0 1 .94 1.17l-4.24 3.28a.75.75 0 0 1-.94 0L5.21 8.4a.75.75 0 0 1 .02-1.19Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.tt-theme select.pill-input option{
  color: var(--tt-text);
  background-color: var(--tt-bg);
}

/* ---------- Base / reset (scoped) ---------- */
.tt-theme * { box-sizing: border-box; }
.tt-theme html, .tt-theme body { height: 100%; }
.tt-theme body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--tt-text);
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(0,229,255,0.08), transparent 60%),
    radial-gradient(900px 480px at 100% 40%, rgba(124,255,199,0.08), transparent 60%),
    linear-gradient(180deg, var(--tt-bg) 0%, var(--tt-bg-2) 100%);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}
.tt-theme::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background-image: var(--tt-dynamic-bg-image, none);
  background-size:cover;
  background-position:center;
  opacity: var(--tt-dynamic-bg-opacity, 0.35);
  transition: opacity .3s ease, background-image .3s ease;
}

@media (max-width: 960px){
  .tt-theme .tt-wrap { padding: 22px 16px 32px; }
  .tt-theme .tt-row { gap: 10px; flex-wrap: wrap; }
}

@media (max-width: 720px){
  .tt-theme .tt-row { flex-direction: column; align-items: flex-start; }
  .tt-theme h1 { font-size: 20px; }
  .tt-theme h2 { font-size: 18px; }
  .tt-theme .tt-card { padding: 16px; }
  .tt-theme .tt-wrap { padding: 20px 14px 28px; }
  .tt-theme .tt-grid { grid-template-columns: 1fr; }
}

.tt-theme::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background-image: var(--tt-dynamic-bg-image, none);
  background-size:cover;
  background-position:center;
  opacity: var(--tt-dynamic-bg-opacity, 0.35);
  transition: opacity .3s ease, background-image .3s ease;
}

/* ---------- Layout helpers ---------- */
.tt-theme .tt-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 18px 36px; }
.tt-theme .tt-wrap.sm { max-width: 980px; }
.tt-theme .tt-row { display: flex; align-items: center; gap: 12px; }
.tt-theme .tt-space { height: 18px; }

.tt-theme h1 { font-size: 22px; margin: 0; letter-spacing: .3px; }
.tt-theme h2 { font-size: 20px; margin: 0; }
.tt-theme h3 { font-size: 18px; margin: 0; }
.tt-theme p  { margin: 0; color: var(--tt-muted); line-height: 1.4; }

/* ---------- Header bits ---------- */
.tt-theme .tt-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--tt-accent), var(--tt-accent-2));
  box-shadow: 0 0 24px rgba(0,229,255,0.35);
}

/* ---------- Grid ---------- */
.tt-theme .tt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 980px) { .tt-theme .tt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tt-theme .tt-grid { grid-template-columns: 1fr; } }

/* ---------- Card ---------- */
.tt-theme .tt-card {
  position: relative;
  background: var(--tt-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  padding: 18px;
  box-shadow: var(--tt-shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.tt-theme .tt-card::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(0,229,255,0.18), rgba(124,255,199,0.18));
  opacity: 0; transition: opacity .2s ease;
}
.tt-theme .tt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,.45);
  border-color: rgba(124,255,199,0.35);
}
.tt-theme .tt-card:hover::after { opacity: .35; }

.tt-theme .tt-card h3 { margin: 6px 0 6px; }
.tt-theme .tt-card p  { font-size: 14px; }

/* ---------- Pills (small links with icon) ---------- */
.tt-theme .tt-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 10px;
  border-radius: 14px; text-decoration: none; font-weight: 600; letter-spacing: .2px;
  color: var(--tt-text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--tt-border);
}
.tt-theme .tt-pill svg { width: 22px; height: 22px; filter: drop-shadow(0 0 10px rgba(0,229,255,0.3)); }

/* ---------- Buttons ---------- */
.tt-theme .tt-btn,
.tt-theme .tt-enter,
.tt-theme .tt-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 700;
  background: linear-gradient(135deg, var(--tt-accent), var(--tt-accent-2));
  color: #0b0f14;
  box-shadow: 0 8px 18px rgba(0,229,255,0.35);
  transition: transform .12s ease;
  border: none;
}
.tt-theme .tt-btn:hover,
.tt-theme .tt-enter:hover,
.tt-theme .tt-back:hover { transform: translateY(-1px); }
.tt-theme .tt-btn:disabled { opacity: .6; pointer-events: none; }

/* ---------- Levels grid ---------- */
.tt-theme .tt-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 18px;
  overflow: visible !important; height: auto !important; max-height: none !important;
}
@media (max-width: 800px) { .tt-theme .tt-levels { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tt-theme .tt-levels { grid-template-columns: 1fr; } }

/* гарантовано показувати всі елементи рівнів навіть якщо глобальні стилі щось ховають */
.tt-theme .tt-levels > * { display: block !important; visibility: visible !important; }

.tt-theme .tt-lvl {
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  background: var(--tt-glass);
  backdrop-filter: blur(10px);
  padding: 18px; position: relative; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.tt-theme .tt-lvl:hover { transform: translateY(-2px); border-color: rgba(124,255,199,0.35); }
.tt-theme .tt-lvl h3 { margin: 0 0 8px; }
.tt-theme .tt-lvl p  { margin: 0; font-size: 13px; }
.tt-theme .tt-go { margin-top: 12px; }

/* ---------- Footer ---------- */
.tt-theme .tt-footer {
  margin-top: 28px; color: var(--tt-muted); font-size: 12px; text-align: center; opacity: .75;
}

/* ---------- Decorative ring (optional) ---------- */
.tt-theme .tt-ring {
  position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,229,255,0.18), transparent 70%);
  filter: blur(18px); pointer-events: none;
}
:root {
  --tt-bg: #0b0f14; --tt-bg-2: #070a0f; --tt-text: #e9eef5; --tt-muted: #a7b0bd;
  --tt-border: rgba(255,255,255,0.12); --tt-glass: rgba(255,255,255,0.06);
  --tt-accent: #00e5ff; --tt-accent-2: #7cffc7; --tt-radius: 18px;
  --tt-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.03);
}

body.tt-theme { color: var(--tt-text); background:
  radial-gradient(1200px 600px at 10% 0%, rgba(0,229,255,0.08), transparent 60%),
  radial-gradient(900px 480px at 100% 40%, rgba(124,255,199,0.08), transparent 60%),
  linear-gradient(180deg, var(--tt-bg) 0%, var(--tt-bg-2) 100%);
}
body.tt-theme, body.tt-theme * { box-sizing: border-box; }

.tt-theme .tt-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 18px 36px; }
.tt-theme .tt-wrap.sm { max-width: 980px; }
.tt-theme .tt-row { display:flex; align-items:center; gap:12px; }
.tt-theme h1{ font-size:22px; margin:0; letter-spacing:.3px }
.tt-theme h3{ font-size:18px; margin:6px 0 6px }
.tt-theme p{ margin:0; color:var(--tt-muted); line-height:1.4 }

.tt-theme .tt-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px }
@media (max-width:980px){ .tt-theme .tt-grid{ grid-template-columns:repeat(2,1fr) } }
@media (max-width:560px){ .tt-theme .tt-grid{ grid-template-columns:1fr } }

.tt-theme .tt-card{ position:relative; background:var(--tt-glass); backdrop-filter:blur(10px);
  border:1px solid var(--tt-border); border-radius:var(--tt-radius); padding:18px; overflow:hidden;
  box-shadow:var(--tt-shadow); transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease }
.tt-theme .tt-card::after{ content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(135deg, rgba(0,229,255,0.18), rgba(124,255,199,0.18)); opacity:0; transition:opacity .2s ease }
.tt-theme .tt-card:hover{ transform:translateY(-2px); border-color:rgba(124,255,199,0.35); box-shadow:0 16px 36px rgba(0,0,0,.45) }
.tt-theme .tt-card:hover::after{ opacity:.35 }

.tt-theme .tt-pill{ display:inline-flex; align-items:center; gap:10px; padding:12px 14px; margin-bottom:10px;
  border-radius:14px; text-decoration:none; font-weight:600; letter-spacing:.2px; color:var(--tt-text);
  background:rgba(255,255,255,0.04); border:1px solid var(--tt-border) }
.tt-theme .tt-pill svg{ width:22px; height:22px; filter:drop-shadow(0 0 10px rgba(0,229,255,0.3)) }

.tt-theme .tt-btn, .tt-theme .tt-enter, .tt-theme .tt-back{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 12px; border-radius:12px; text-decoration:none; font-weight:700; color:#0b0f14;
  background:linear-gradient(135deg, var(--tt-accent), var(--tt-accent-2)); box-shadow:0 8px 18px rgba(0,229,255,0.35);
  transition:transform .12s ease; border:none }
.tt-theme .tt-btn:hover, .tt-theme .tt-enter:hover, .tt-theme .tt-back:hover{ transform:translateY(-1px) }
.tt-theme .tt-btn:disabled{ opacity:.6; pointer-events:none }

.tt-theme .tt-levels{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:18px; overflow:visible !important; height:auto !important; max-height:none !important }
@media (max-width:800px){ .tt-theme .tt-levels{ grid-template-columns:repeat(2,1fr) } }
@media (max-width:520px){ .tt-theme .tt-levels{ grid-template-columns:1fr } }
.tt-theme .tt-levels > *{ display:block !important; visibility:visible !important }
.tt-theme .tt-lvl{ border:1px solid var(--tt-border); border-radius:var(--tt-radius); background:var(--tt-glass);
  backdrop-filter:blur(10px); padding:18px; position:relative; overflow:hidden; transition:transform .18s ease, border-color .18s ease }
.tt-theme .tt-lvl:hover{ transform:translateY(-2px); border-color:rgba(124,255,199,0.35) }
.tt-theme .tt-lvl p{ font-size:13px }
.tt-theme .tt-go{ margin-top:12px }

.tt-theme .tt-ring{ position:absolute; right:-30px; top:-30px; width:140px; height:140px; border-radius:50%;
  background:radial-gradient(closest-side, rgba(0,229,255,0.18), transparent 70%); filter:blur(18px); pointer-events:none }

.tt-theme .tt-footer{ margin-top:28px; color:var(--tt-muted); font-size:12px; text-align:center; opacity:.75 }
/* ===== Auth UI (scoped to body.tt-theme) =============================== */
.tt-theme .auth-shell{
  min-height: 100dvh; display: grid; place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(900px 480px at 100% 40%, rgba(124,255,199,0.07), transparent 60%),
    radial-gradient(1200px 600px at 10% 0%, rgba(0,229,255,0.07), transparent 60%),
    linear-gradient(180deg, var(--tt-bg) 0%, var(--tt-bg-2) 100%);
}
.tt-theme .auth-card{
  width: 100%; max-width: 420px;
  background: var(--tt-glass); backdrop-filter: blur(10px);
  border: 1px solid var(--tt-border); border-radius: var(--tt-radius);
  box-shadow: var(--tt-shadow);
  padding: 20px 18px;
}
.tt-theme .auth-header, .tt-theme .auth-footer{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.tt-theme .auth-header{ margin-bottom: 8px; }
.tt-theme .auth-footer{ margin-top: 10px; }

.tt-theme .brand{
  font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(135deg, var(--tt-accent), var(--tt-accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.tt-theme .auth-main .title{ margin: 8px 0 12px; font-size: 22px; }

.tt-theme form label{ display:block; font-size: 13px; color: var(--tt-muted); margin: 8px 0 4px; }
.tt-theme form input{
  width: 100%; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--tt-border); outline: none; background: rgba(255,255,255,0.04); color: var(--tt-text);
}
.tt-theme form input:focus{ border-color: rgba(124,255,199,0.45); box-shadow: 0 0 0 3px rgba(124,255,199,0.18); }

.tt-theme .row{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tt-theme .auth-divider{ display:flex; align-items:center; gap:12px; margin:18px 0 14px; font-size:12px; color:var(--tt-muted); }
.tt-theme .auth-divider::before, .tt-theme .auth-divider::after{ content:''; flex:1 1 auto; height:1px; background:rgba(255,255,255,0.12); }
.tt-theme .auth-divider span{ white-space:nowrap; }
.tt-theme .auth-google{ display:flex; justify-content:center; }
.tt-theme .auth-google .abcRioButton,.tt-theme .auth-google .abcRioButtonLightBlue{ box-shadow:none !important; border:none !important; }
.tt-theme .auth-google .abcRioButtonContentWrapper{ border:none !important; }
.tt-theme .btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 700; border: 0;
  background: linear-gradient(135deg, var(--tt-accent), var(--tt-accent-2)); color: #0b0f14;
  box-shadow: 0 8px 18px rgba(0,229,255,0.35); transition: transform .12s ease;
}
.tt-theme .btn:hover{ transform: translateY(-1px); }

.tt-theme .link{ color: var(--tt-text); text-decoration: underline; text-underline-offset: 3px; }
.tt-theme .link:hover{ opacity: .9; }
.tt-theme .muted{ color: var(--tt-muted); font-size: 13px; }

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

.tt-theme .hidden{ display:none!important; }
.tt-theme .sep{
  border: none; height: 1px; background: var(--tt-border); margin: 16px 0;
}

/* дрібні повідомлення під формами */
.tt-theme #msgLogin, .tt-theme #msgReg1, .tt-theme #msgReg2,
.tt-theme #msgResetStart, .tt-theme #msgResetFinish{
  margin-top: 8px; font-size: 13px; color: var(--tt-muted);
}
/* ===== Game styles ===== */
.tt-card{ border:1px solid var(--tt-border); border-radius: var(--tt-radius); background: var(--tt-glass); padding: 14px; }
.tt-card h3{ margin: 0 0 6px; }
.tt-card-inner{ padding: 6px 0; }
.tt-prompt{ font-size: 20px; }

.tt-theme .tt-options-row{
  display:flex;
  align-items:stretch;
  gap:clamp(8px,2.8vw,12px);
  margin-top:10px;
  flex-wrap:nowrap;
  overflow-x:auto;
  padding-bottom:4px;
  scroll-snap-type:x proximity;
}
.tt-theme .tt-options-row::-webkit-scrollbar{
  height:6px;
}
.tt-theme .tt-options-row::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,0.22);
  border-radius:999px;
}
.tt-theme .tt-options-row > .tt-option{
  scroll-snap-align:center;
}

.tt-option{ cursor:pointer; }
.tt-theme .tt-option{
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(13,20,38,0.45);
  color: var(--tt-text);
  white-space:nowrap;
  font-size:clamp(13px,3.4vw,16px);
  padding:10px clamp(14px,4vw,22px);
  flex:0 0 auto;
  transition: box-shadow .25s ease, border-color .25s ease, transform .18s ease, color .25s ease, text-shadow .25s ease;
}
.tt-theme .tt-option:hover{ box-shadow:0 0 12px rgba(0,229,255,0.18); }
.tt-theme .tt-option:disabled{ opacity:1; }
.tt-theme .tt-option:active{ transform: translateY(1px); }
.tt-theme .tt-option.is-correct,
.tt-theme .tt-option.is-wrong{
  pointer-events:none;
  opacity:1 !important;
  transform: translateY(0);
}
.tt-theme .tt-option.is-correct{
  border-color:#33ffaf;
  box-shadow:
    0 0 10px rgba(51,255,175,0.85),
    0 0 24px rgba(51,255,175,0.45),
    inset 0 0 12px rgba(51,255,175,0.25);
  color: var(--tt-text);
  text-shadow:0 0 8px rgba(51,255,175,0.7);
}
.tt-theme .tt-option.is-wrong{
  border-color:#ff4d7d;
  box-shadow:
    0 0 10px rgba(255,77,125,0.85),
    0 0 24px rgba(255,77,125,0.45),
    inset 0 0 12px rgba(255,77,125,0.22);
  color: var(--tt-text);
  text-shadow:0 0 8px rgba(255,77,125,0.7);
}

/* rating bubble (правий нижній кут) */
.rating-bubble{
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  background: var(--tt-glass); border: 1px solid var(--tt-border);
  border-radius: 9999px; padding: 10px 14px; backdrop-filter: blur(8px);
  box-shadow: var(--tt-shadow);
  font-weight: 700; color: var(--tt-text);
}

/* leaderboard list */
.lb-list{ list-style: none; margin:0; padding: 0; }
.lb-list li{ display:flex; align-items:center; justify-content:space-between; border-bottom: 1px solid var(--tt-border); padding: 8px 0; }
.lb-list .rank{ width: 38px; color: var(--tt-muted); }
.lb-list .name{ flex:1; }
.lb-list .score{ font-weight: 800; }
.tt-card{ border:1px solid var(--tt-border); border-radius: var(--tt-radius); background: var(--tt-glass); padding:14px; }
.tt-card h3{ margin:0 0 6px; }
.rating-bubble{
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  background: var(--tt-glass); border: 1px solid var(--tt-border);
  border-radius: 9999px; padding: 10px 14px; backdrop-filter: blur(8px);
  box-shadow: var(--tt-shadow); font-weight:700; color: var(--tt-text);
}
/* Slot machine */
.slot-wrap{
  display:flex; gap:12px; justify-content:center; align-items:center;
  padding:8px;
}
.reel{
  width:84px; height:84px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background: var(--tt-glass, rgba(255,255,255,.06));
  border:1px solid var(--tt-border, rgba(255,255,255,.12));
  box-shadow: 0 8px 18px rgba(0,229,255,0.12) inset;
  font-size:42px; line-height:1;
}
.pill-input{
  background: var(--tt-glass, rgba(255,255,255,.06));
  border:1px solid var(--tt-border, rgba(255,255,255,.12));
  color: var(--tt-text, #e9eef5);
  padding:8px 10px; border-radius:999px; outline:none;
}
.pill-input:focus{ border-color: rgba(124,255,199,0.45); box-shadow: 0 0 0 3px rgba(124,255,199,0.15); }

.chip-group{ display:flex; gap:6px; }
.btn-chip{
  border:1px solid var(--tt-border, rgba(255,255,255,.12));
  background: var(--tt-glass, rgba(255,255,255,.06));
  color: var(--tt-text, #e9eef5);
  padding:8px 12px; border-radius:999px; cursor:pointer; font-weight:700;
}
.btn-chip:hover{ border-color: rgba(124,255,199,0.45); }
.btn-chip:disabled{ opacity:.6; cursor:not-allowed; }
/* --- TTS --- */
.tts-bar{
  display:flex; gap:12px; align-items:center; flex-wrap:wrap;
  margin:8px 0 10px;
}
.tts-voices{ display:flex; gap:6px; align-items:center; }
.switch{ display:flex; gap:8px; align-items:center; cursor:pointer; }

.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:999px;
  border:1px solid var(--tt-border, rgba(255,255,255,.12));
  background: var(--tt-glass, rgba(255,255,255,.06));
  color: var(--tt-text, #e9eef5);
  cursor:pointer; user-select:none;
}
.icon-btn:hover{ border-color: rgba(124,255,199,0.45); }
.icon-btn svg{ width:18px; height:18px; }

/* ----- Sentences builder ----- */
.tt-theme .sentence-controls{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.tt-theme .sentence-card{
  display:flex; flex-direction:column; gap:12px;
}
.tt-theme .sentence-meta{ display:flex; flex-direction:column; gap:4px; }
.tt-theme .sentence-hint{
  color: var(--tt-muted);
  font-size: 14px;
}
.tt-theme .assemble-zone{
  min-height:64px;
  border:1px dashed rgba(124,255,199,0.45);
  border-radius: var(--tt-radius);
  padding:12px;
  display:flex; flex-wrap:wrap; gap:10px;
  transition:border-color .2s ease, background .2s ease;
  background: rgba(255,255,255,0.02);
}
.tt-theme .assemble-zone.empty::before{
  content:"Перетягніть слова сюди";
  color: var(--tt-muted);
  font-size: 14px;
}
.tt-theme .assemble-zone.drop-active{
  border-color: rgba(124,255,199,0.8);
  background: rgba(124,255,199,0.08);
}
.tt-theme .word-pool{
  display:flex; flex-wrap:wrap; gap:10px;
  min-height:64px;
  padding:10px;
  border-radius: var(--tt-radius);
  border:1px solid var(--tt-border);
  background: rgba(255,255,255,0.03);
  transition:border-color .2s ease, background .2s ease;
}
.tt-theme .word-pool.drop-active{ border-color: rgba(124,255,199,0.6); background: rgba(124,255,199,0.08); }
.tt-theme .word-chip{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.12);
  color: var(--tt-text);
  font-weight:600;
  cursor:grab;
  user-select:none;
  transition:transform .12s ease, box-shadow .12s ease;
  flex:0 0 auto;
}
.tt-theme .word-chip:active{ transform:scale(0.96); }
.tt-theme .word-chip.dragging{
  opacity:.7;
  box-shadow:0 12px 30px rgba(0,0,0,0.35);
  cursor:grabbing;
}
.tt-theme .sentence-actions{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
.tt-theme .btn-ghost{
  border-radius:12px;
  padding:10px 14px;
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  color: var(--tt-text);
  font-weight:700;
  cursor:pointer;
  transition:transform .12s ease, border-color .12s ease;
}
.tt-theme .btn-ghost:hover{ transform:translateY(-1px); border-color: rgba(124,255,199,0.5); }
.tt-theme .pill-area{
  width:100%;
  border-radius:16px;
  border:1px solid var(--tt-border);
  background: rgba(255,255,255,0.04);
  color: var(--tt-text);
  padding:10px 12px;
  font-family: inherit;
  resize: vertical;
}
.tt-theme .pill-area:focus{
  border-color: rgba(124,255,199,0.45);
  box-shadow:0 0 0 3px rgba(124,255,199,0.12);
  outline:none;
}
.tt-theme .sentence-form{
  display:flex; flex-direction:column; gap:12px;
}
.tt-theme .sentence-form-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:12px;
}
.tt-theme .sentence-field{ display:flex; flex-direction:column; gap:6px; font-size:14px; }
.tt-theme .sentence-form-actions{
  display:flex; gap:12px; align-items:center; flex-wrap:wrap;
}

@media (max-width: 720px){
  .tt-theme .assemble-zone,
  .tt-theme .word-pool{
    flex-wrap:nowrap;
    overflow-x:auto;
    justify-content:flex-start;
    padding-bottom:12px;
    scroll-snap-type:x proximity;
  }
  .tt-theme .assemble-zone::before{
    white-space:nowrap;
  }
  .tt-theme .assemble-zone::-webkit-scrollbar,
  .tt-theme .word-pool::-webkit-scrollbar{
    height:6px;
  }
  .tt-theme .assemble-zone::-webkit-scrollbar-thumb,
  .tt-theme .word-pool::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,0.22);
    border-radius:999px;
  }
  .tt-theme .word-chip{
    scroll-snap-align:center;
  }
}

.word-tooltip{
  position: absolute;
  z-index: 200;
  max-width: 260px;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(124,255,199,0.35);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--tt-text);
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 14px 30px rgba(8,8,15,0.45);
  backdrop-filter: blur(12px) saturate(150%);
  pointer-events: none;
  opacity: 1;
  transition: opacity .12s ease;
}
.word-tooltip.hidden{
  opacity: 0;
  visibility: hidden;
}

.tt-gloss{
  position: relative;
  cursor: help;
  padding: 0 2px;
  border-bottom: 1px dashed rgba(124,255,199,0.6);
}

.tt-slot-grid{
  display:grid;
  grid-template-columns: minmax(0,2.1fr) minmax(0,1fr);
  gap:14px;
  margin-top:12px;
}
.slot-machine-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.slot-jackpot{
  font-weight:800;
  font-size:18px;
  padding:8px 14px;
  border-radius:999px;
  background: rgba(124,255,199,0.12);
  border:1px solid rgba(124,255,199,0.28);
  box-shadow:0 8px 20px rgba(0,229,255,0.18);
}
.slot-last{
  font-size:14px;
  color: var(--tt-muted);
  text-align:right;
  min-height:20px;
}
.slot-reels{
  display:flex;
  gap:14px;
  justify-content:center;
  align-items:center;
  margin-bottom:16px;
}
.slot-reel{
  width:96px;
  height:96px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.16);
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(10,25,45,0.4));
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 16px 36px rgba(0,0,0,0.45), inset 0 0 22px rgba(255,255,255,0.06);
}
.slot-reel img{
  width:64px;
  height:64px;
  display:block;
}
.slot-controls{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}
.slot-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:150px;
}
.slot-inline{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:200px;
}
.slot-withdraw{
  display:flex;
  gap:8px;
  align-items:flex-end;
}
.slot-play{
  padding:12px 18px;
}
.slot-leaderboard{
  margin-left:auto;
}
.slot-msg{
  margin-top:14px;
  color: var(--tt-text);
  font-weight:600;
}
.slot-guide-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.slot-guide-list li{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  background: rgba(255,255,255,0.04);
}
.slot-guide-icons{
  display:flex;
  gap:6px;
  align-items:center;
}
.slot-guide-icons img{
  width:30px;
  height:30px;
  display:block;
}
.slot-guide-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:13px;
}
.slot-guide-text strong{ font-size:14px; }
.slot-note{ margin-top:12px; }
.slot-mini{ margin-top:14px; }

@media (max-width: 720px){
  .tt-theme .sentence-controls{ flex-direction: column; align-items: stretch; }
  .tt-theme .sentence-actions{ flex-direction: column; align-items: stretch; }
  .tt-theme .word-chip{
    width: 100%;
    justify-content: center;
    font-size: 16px;
    padding: 12px 14px;
  }
  .tt-theme .sentence-card{ gap: 10px; }
  .tt-theme .word-pool,
  .tt-theme .assemble-zone{ padding: 10px; min-height: 56px; }
  .tt-theme .sentence-form-grid{ grid-template-columns: 1fr; }
  .rating-bubble{ right: 10px; bottom: 10px; font-size: 13px; padding: 8px 12px; }
  .tt-slot-grid{ grid-template-columns: 1fr; }
  .slot-leaderboard{ width:100%; text-align:center; }
  .slot-controls{ flex-direction:column; align-items:stretch; }
  .slot-field, .slot-inline, .slot-withdraw{ width:100%; }
  .slot-reel{ width:84px; height:84px; }
  .slot-guide-list li{ flex-wrap:wrap; }
}

@media (max-width: 640px){
  .slot-withdraw{
    flex-direction:column;
    align-items:stretch;
  }
  .slot-withdraw > *{
    width:100%;
  }
}

/* ---------- Dialogs ---------- */
.tt-theme.dialogs-page .dialog-head{align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px;}
.tt-theme .dialog-head-copy p{max-width:480px;}

.tt-theme .dialog-hero{display:flex;gap:20px;flex-wrap:wrap;align-items:flex-start;}
.tt-theme .dialog-hero-main{flex:1 1 260px;min-width:220px;display:flex;flex-direction:column;gap:8px;}
.tt-theme .dialog-meta{font-size:14px;color:var(--tt-muted);background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.12);padding:12px 14px;border-radius:14px;line-height:1.4;}
.tt-theme .dialog-controls{flex:1 1 360px;min-width:260px;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;}
.tt-theme .dialog-control{display:flex;flex-direction:column;gap:6px;font-size:14px;}

.tt-theme .dialog-layout{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(0,1fr);gap:18px;margin-top:20px;align-items:start;}
@media (max-width: 980px){.tt-theme .dialog-layout{grid-template-columns:1fr;}}

.tt-theme .dialog-chat{display:flex;flex-direction:column;gap:14px;min-height:520px;}
.tt-theme .dialog-chat-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;}
.tt-theme .toggle{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--tt-muted);cursor:pointer;user-select:none;}
.tt-theme .toggle input{accent-color:var(--tt-accent);width:18px;height:18px;}

.tt-theme .dialog-messages{flex:1 1 auto;min-height:280px;max-height:540px;overflow-y:auto;padding:12px;border-radius:16px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.04);display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth;}
.tt-theme .dialog-placeholder{margin:auto;color:var(--tt-muted);text-align:center;padding:24px;max-width:280px;line-height:1.4;}

.tt-theme .dialog-message{display:flex;flex-direction:column;gap:8px;padding:14px 16px;border-radius:16px;backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,0.1);background:linear-gradient(145deg,rgba(124,255,199,0.08),rgba(0,229,255,0.04));position:relative;}
.tt-theme .dialog-message.is-user{align-self:flex-end;background:linear-gradient(145deg,rgba(0,229,255,0.16),rgba(124,255,199,0.08));border-color:rgba(124,255,199,0.38);box-shadow:0 10px 24px rgba(0,229,255,0.24);}
.tt-theme .dialog-message-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:rgba(233,238,245,0.65);letter-spacing:.4px;text-transform:uppercase;}
.tt-theme .dialog-status{font-size:11px;padding:2px 8px;border-radius:999px;background:rgba(255,255,255,0.08);color:var(--tt-text);letter-spacing:.2px;text-transform:none;display:inline-flex;align-items:center;gap:4px;}
.tt-theme .dialog-body{display:flex;flex-direction:column;gap:6px;font-size:15px;line-height:1.5;}
.tt-theme .dialog-translation{color:var(--tt-muted);font-size:14px;}
.tt-theme .dialog-tip{color:rgba(124,255,199,0.92);font-size:14px;}
.tt-theme .dialog-chat.translation-off .dialog-translation{display:none;}

.tt-theme .dialog-pill-row{display:flex;flex-wrap:wrap;gap:8px;}
.tt-theme .dialog-pill-toggle{
  display:inline-flex;align-items:center;gap:6px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.05);
  color:var(--tt-text);
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:transform .12s ease,border-color .12s ease,background .12s ease;
}
.tt-theme .dialog-pill-toggle:hover{transform:translateY(-1px);border-color:rgba(124,255,199,0.45);}
.tt-theme .dialog-pill-toggle.active{
  background:linear-gradient(135deg,rgba(0,229,255,0.32),rgba(124,255,199,0.24));
  border-color:rgba(124,255,199,0.6);
  box-shadow:0 10px 24px rgba(0,229,255,0.25);
}

.tt-theme .dialog-message[data-status="pending"]{opacity:.78;}
.tt-theme .dialog-message[data-status="pending"] .dialog-status{background:rgba(124,255,199,0.18);color:var(--tt-text);}
.tt-theme .dialog-message[data-status="error"]{border-color:rgba(255,120,120,0.6);background:linear-gradient(145deg,rgba(255,120,120,0.16),rgba(0,0,0,0.04));box-shadow:0 12px 26px rgba(255,82,82,0.22);}
.tt-theme .dialog-message[data-status="error"] .dialog-status{background:rgba(255,120,120,0.28);color:#fff;}

.tt-theme .dialog-quick{display:flex;flex-wrap:wrap;gap:10px;}
.tt-theme .pill-suggestion{padding:9px 13px;border-radius:999px;border:1px solid rgba(255,255,255,0.16);background:rgba(255,255,255,0.05);color:var(--tt-text);font-size:14px;cursor:pointer;transition:transform .12s ease,border-color .12s ease;}
.tt-theme .pill-suggestion:hover{transform:translateY(-1px);border-color:rgba(124,255,199,0.45);}

.tt-theme .dialog-form{display:flex;flex-direction:column;gap:10px;}
.tt-theme .dialog-form-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}

.tt-theme .dialog-sidebar{display:flex;flex-direction:column;gap:18px;}
.tt-theme .dialog-summary{display:flex;flex-direction:column;gap:8px;}
.tt-theme .dialog-summary-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px;color:var(--tt-muted);font-size:14px;}
.tt-theme .dialog-summary-list li{padding:10px 12px;border-radius:12px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);line-height:1.4;}
.tt-theme .dialog-tips{display:flex;flex-direction:column;gap:10px;}
.tt-theme .dialog-tips-list{list-style:disc;padding-left:20px;margin:0;color:var(--tt-muted);font-size:14px;line-height:1.5;}

@media (max-width: 640px){
  .tt-theme.dialogs-page .dialog-head{flex-direction:column-reverse;align-items:flex-start;}
  .tt-theme .dialog-chat{min-height:auto;}
  .tt-theme .dialog-messages{max-height:none;}
}

/* ---------- Tests ---------- */
.tt-theme.tests-page .tests-setup{display:flex;flex-direction:column;gap:18px;margin-bottom:20px;}
.tt-theme .tests-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;}
.tt-theme .tests-field{display:flex;flex-direction:column;gap:8px;font-size:14px;}
.tt-theme .tests-types{border:1px dashed rgba(255,255,255,0.15);border-radius:16px;padding:14px 16px;min-height:100px;}
.tt-theme .tests-types legend{padding:0 6px;font-weight:700;color:var(--tt-muted);}
.tt-theme .tests-chip{display:inline-flex;align-items:center;gap:8px;font-size:14px;margin:6px 0;}
.tt-theme .tests-chip input{accent-color:var(--tt-accent);}
.tt-theme .tests-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center;}
.tt-theme .tests-actions .muted{min-height:20px;}

.tt-theme .tests-results{margin-bottom:16px;}
.tt-theme .tests-score{display:flex;flex-direction:column;gap:10px;align-items:flex-start;}
.tt-theme .tests-score-value{font-size:28px;font-weight:800;margin:0;}
.tt-theme .tests-score.correct{border-color:rgba(124,255,199,0.4);}

.tt-theme .tests-list{display:flex;flex-direction:column;gap:16px;margin-bottom:18px;}
.tt-theme .test-question{display:flex;flex-direction:column;gap:12px;position:relative;border:1px solid rgba(255,255,255,0.12);}
.tt-theme .test-question-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;}
.tt-theme .test-question-number{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:rgba(0,229,255,0.16);color:var(--tt-text);font-weight:700;}
.tt-theme .test-question-title{margin:0;font-size:18px;}
.tt-theme .test-question-difficulty{font-size:13px;padding:4px 10px;border-radius:999px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);color:var(--tt-muted);}
.tt-theme .test-question-body{display:flex;flex-direction:column;gap:10px;}
.tt-theme .test-question-footer{min-height:20px;}
.tt-theme .test-question.correct{border-color:rgba(124,255,199,0.5);box-shadow:0 0 0 1px rgba(124,255,199,0.35) inset;}
.tt-theme .test-question.correct .test-question-feedback{color:rgba(124,255,199,0.95);}
.tt-theme .test-question.incorrect{border-color:rgba(255,120,120,0.6);box-shadow:0 0 0 1px rgba(255,120,120,0.4) inset;}
.tt-theme .test-question.incorrect .test-question-feedback{color:rgba(255,160,160,0.95);}

.tt-theme .test-choice-list{display:flex;flex-direction:column;gap:8px;}
.tt-theme .test-choice-option{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:14px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.04);cursor:pointer;transition:transform .12s ease,border-color .12s ease;}
.tt-theme .test-choice-option:hover{transform:translateY(-1px);border-color:rgba(124,255,199,0.45);}
.tt-theme .test-choice-option input{accent-color:var(--tt-accent);}

.tt-theme .test-gap-input{width:100%;padding:10px 12px;border-radius:14px;border:1px solid var(--tt-border);background:rgba(255,255,255,0.05);color:var(--tt-text);}
.tt-theme .test-gap-input:focus{outline:none;border-color:rgba(124,255,199,0.45);box-shadow:0 0 0 3px rgba(124,255,199,0.16);}

.tt-theme .test-order{display:flex;flex-direction:column;gap:10px;}
.tt-theme .test-order-pool,
.tt-theme .test-order-answer{display:flex;flex-wrap:wrap;gap:8px;padding:10px;border-radius:14px;border:1px dashed rgba(255,255,255,0.18);background:rgba(255,255,255,0.03);min-height:48px;}
.tt-theme .test-token{padding:8px 12px;border-radius:999px;background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.14);cursor:pointer;font-weight:600;color:var(--tt-text);transition:transform .12s ease,border-color .12s ease;}
.tt-theme .test-token:hover{transform:translateY(-1px);border-color:rgba(124,255,199,0.45);}
.tt-theme .test-token.disabled{opacity:.45;pointer-events:none;}

.tt-theme .tests-evaluate-card{display:flex;gap:12px;align-items:center;flex-wrap:wrap;justify-content:flex-end;}

@media (max-width: 700px){
  .tt-theme .tests-evaluate-card{justify-content:center;}
  .tt-theme .test-question-head{flex-direction:column;align-items:flex-start;}
}


.tt-card-light{background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.1);border-radius:18px;padding:16px;}

.videochat-page .videochat-shell{display:flex;flex-direction:column;gap:18px;}
.videochat-header{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;align-items:flex-start;}
.videochat-session-info{min-height:20px;color:var(--tt-muted);}
.videochat-browser,.videochat-join{display:flex;flex-direction:column;gap:14px;}
.videochat-browser-head{display:flex;justify-content:space-between;align-items:center;gap:12px;}
.videochat-session-list{display:grid;gap:14px;}
.videochat-session-card{display:flex;flex-direction:column;gap:6px;}
.videochat-session-card h3{margin:0;font-size:18px;}
.videochat-session-card p{margin:0;}
.videochat-session-actions{display:flex;gap:10px;flex-wrap:wrap;}
.videochat-session-empty{padding:20px 0;text-align:center;}
.videochat-collapse-body{display:flex;flex-direction:column;gap:12px;}
[data-collapsed="true"] .videochat-collapse-body{display:none;}
.videochat-collapse-btn{display:inline-flex;align-items:center;gap:6px;min-width:0;}
.videochat-browser-actions{display:flex;gap:8px;align-items:center;}
.videochat-join-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.videochat-form{display:flex;flex-direction:column;gap:12px;}
.videochat-join-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center;}
.videochat-call{display:flex;flex-direction:column;gap:18px;}
.videochat-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));}
.videochat-remote-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));}
.videochat-tile{position:relative;border-radius:18px;overflow:hidden;background:rgba(0,0,0,0.45);border:1px solid rgba(255,255,255,0.12);aspect-ratio:4/3;display:flex;justify-content:center;align-items:center;}
.videochat-tile video{width:100%;height:100%;object-fit:cover;background:#000;transform:none!important;}
.videochat-local video{transform:none!important;}
.videochat-label{position:absolute;left:12px;bottom:12px;background:rgba(0,0,0,0.55);padding:4px 10px;border-radius:999px;font-size:12px;}
.videochat-main{display:grid;gap:16px;grid-template-columns:minmax(0,2fr) minmax(0,1fr);}
.videochat-main.chat-hidden{grid-template-columns:1fr;}
.videochat-main.chat-hidden #videoChatPanel{display:none;}
.videochat-chat{display:flex;flex-direction:column;gap:12px;background:rgba(10,16,24,0.55);border:1px solid rgba(255,255,255,0.08);border-radius:18px;padding:14px;}
.videochat-chat-head{display:flex;align-items:flex-start;gap:12px;justify-content:space-between;width:100%;}
.videochat-chat-list{display:flex;flex-direction:column;gap:10px;max-height:320px;overflow:auto;padding-right:4px;flex:1 1 auto;}
.videochat-chat-head h3{margin:0;font-size:16px;}
.videochat-chat-form{display:flex;align-items:center;gap:8px;margin-top:8px;flex-shrink:0;width:100%;}
.videochat-chat-form .pill-input{flex:1 1 auto;min-width:0;}
.videochat-chat-target{flex:0 0 auto;min-width:120px;max-width:180px;margin-left:auto;font-size:12px;padding:4px 10px;border-radius:999px;align-self:flex-start;}
#videoChatInput{width:100%;}
.videochat-chat-send{width:42px;height:42px;border-radius:999px;border:none;background:linear-gradient(135deg,var(--tt-accent),var(--tt-accent-2));color:#03161b;font-size:20px;font-weight:700;display:grid;place-items:center;cursor:pointer;box-shadow:0 8px 18px rgba(0,229,255,0.25);transition:transform .12s ease,box-shadow .12s ease;}
.videochat-chat-send:hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(0,229,255,0.35);}
.videochat-chat-send:active{transform:translateY(1px);}
.videochat-chat-message.private{background:rgba(124,255,199,0.12);border-color:rgba(124,255,199,0.32);}
.videochat-chat-message.private.system{background:rgba(255,255,255,0.06);border-color:rgba(255,255,255,0.16);}
.videochat-chat-badge{padding:2px 6px;border-radius:999px;background:rgba(124,255,199,0.22);color:#06281f;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;}
.videochat-chat-message{display:flex;flex-direction:column;gap:4px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:14px;padding:10px 12px;font-size:14px;}
.videochat-chat-message.self{align-self:flex-end;background:rgba(124,255,199,0.12);border-color:rgba(124,255,199,0.28);}
.videochat-chat-message.system{background:rgba(255,255,255,0.02);font-style:italic;}
.videochat-chat-meta{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--tt-muted);}
.videochat-chat-text{white-space:pre-wrap;}
@media (max-width:520px){
  .videochat-chat-form{flex-wrap:wrap;}
  .videochat-chat-send{width:36px;height:36px;font-size:18px;}
}
@media (max-width:680px){
  .videochat-chat-head{flex-direction:column;align-items:stretch;}
  .videochat-chat-target{margin-left:0;width:100%;max-width:none;}
}

@media (max-width:860px){
  .videochat-main{grid-template-columns:1fr;}
}

.videochat-controls{display:flex;gap:16px;flex-wrap:wrap;justify-content:center;align-items:center;margin-top:16px;}

.videochat-control-btn{min-width:0;width:48px;height:48px;border-radius:999px;padding:0;display:grid;place-items:center;border:1px solid rgba(255,255,255,0.18);background:rgba(255,255,255,0.07);color:var(--tt-text);transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease;}
.videochat-control-btn:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(0,229,255,0.28);border-color:rgba(0,229,255,0.45);}
.videochat-control-btn:active{transform:translateY(1px);}
.videochat-control-btn.danger{border-color:rgba(255,125,125,0.6);background:rgba(255,125,125,0.18);color:#fff;}
.videochat-control-btn.danger:hover{box-shadow:0 10px 24px rgba(255,125,125,0.35);border-color:rgba(255,125,125,0.85);}
.videochat-control-btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none;transform:none;border-color:rgba(255,255,255,0.12);color:var(--tt-muted);}
.videochat-control-icon{font-size:22px;line-height:1;}
@media (max-width:520px){
  .videochat-control-btn{width:42px;height:42px;}
  .videochat-control-icon{font-size:20px;}
}

@media (max-width:680px){
  .videochat-controls{justify-content:center;}
  .videochat-header{flex-direction:column;align-items:flex-start;}
}

/* ---------- Index ---------- */
.index-page .index-wrap{max-width:960px;margin:0 auto;padding:36px 20px 48px;display:flex;flex-direction:column;gap:26px;}
.index-page .index-hero{display:flex;gap:28px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
.index-page .index-hero-copy{max-width:520px;display:flex;flex-direction:column;gap:12px;}
.index-page .index-hero-copy h1{font-size:28px;margin:0;}
.index-page .index-hero-copy p{font-size:16px;color:var(--tt-muted);} 
.index-page .index-hero-actions{display:flex;gap:12px;flex-wrap:wrap;}
.index-page .index-pill{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:999px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.12);font-weight:600;color:var(--tt-text);text-decoration:none;transition:transform .15s ease,border-color .15s ease;}
.index-page .index-pill:hover{transform:translateY(-1px);border-color:rgba(124,255,199,0.4);} 
.index-page .index-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px;}
.index-page .index-card{position:relative;padding:18px;border-radius:18px;background:var(--tt-glass);border:1px solid rgba(255,255,255,0.12);box-shadow:0 10px 26px rgba(0,0,0,0.28);display:flex;flex-direction:column;gap:10px;}
.index-page .index-card span{font-size:24px;}
.index-page .index-note{font-size:13px;color:var(--tt-muted);margin-top:4px;display:inline-block;}
.index-page .index-hero-img{flex:1 1 260px;min-width:240px;display:flex;justify-content:center;}
.index-page .index-hero-blob{width:220px;height:220px;border-radius:32px;background:linear-gradient(135deg,rgba(0,229,255,0.35),rgba(124,255,199,0.25));border:1px solid rgba(255,255,255,0.18);box-shadow:0 16px 40px rgba(0,0,0,0.35);display:grid;place-items:center;position:relative;overflow:hidden;}
.index-page .index-hero-blob::after{content:"";position:absolute;width:160%;height:160%;background:radial-gradient(circle at 30% 30%,rgba(255,255,255,0.25),rgba(255,255,255,0));opacity:0.8;animation:index-glow 6s ease-in-out infinite;}
.index-page .index-hero-blob strong{font-size:48px;color:var(--tt-text);z-index:1;}
.index-page .index-footer{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;font-size:13px;color:var(--tt-muted);}

@keyframes index-glow{0%,100%{transform:rotate(0deg);}50%{transform:rotate(12deg);}}

@media (max-width: 760px){
  .index-page .index-hero{flex-direction:column;align-items:flex-start;text-align:left;}
  .index-page .index-hero-actions{justify-content:flex-start;}
  .index-page .index-hero-blob{width:180px;height:180px;}
  .index-page .index-hero-copy h1{font-size:24px;}
}

@media (max-width: 520px){
  .index-page .index-wrap{padding:28px 16px 40px;}
  .index-page .index-hero{gap:20px;}
  .index-page .index-grid{gap:14px;}
}
/* A) контейнер від Google рендерера */
#container-div.haAclf {
  padding: 0 !important;           /* <- знімає білу "рамку" */
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* B) власне кнопка Google */
#container-div .nsm7Bb-HzV7m-LgbsSe,
#container-div .nsm7Bb-HzV7m-LgbsSe:hover,
#container-div .nsm7Bb-HzV7m-LgbsSe:active,
#container-div .nsm7Bb-HzV7m-LgbsSe:focus,
#container-div .nsm7Bb-HzV7m-LgbsSe:focus-visible {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* внутрішні елементи, де інколи сидить тінь/обвід */
#container-div .nsm7Bb-HzV7m-LgbsSe-MJoBVe,
#container-div .nsm7Bb-HzV7m-LgbsSe-bN97Pc-sM5MNb,
#container-div .nsm7Bb-HzV7m-LgbsSe-Bz112c-haAclf,
#container-div .nsm7Bb-HzV7m-LgbsSe-Bz112c {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background-clip: padding-box !important;
}
/* Маска: відсікає будь-які обводи/тіні від внутрішніх елементів */
.gsi-mask{
  display:inline-block;
  border-radius:24px;     /* під форму pill */
  overflow:hidden;        /* ключ: ріже «білу рамку» */
}

/* Прибрати всі контури/тіні у контейнера і всередині нього */
#googleSignInButton,
#googleSignInButton *{
  padding:0 !important;
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
  background-clip:padding-box !important;
}

/* Google інколи додає haAclf із внутрішнім паддінгом — глушимо */
#googleSignInButton.haAclf{ padding:0 !important; }

/* Класи нової GSI-кнопки */
#googleSignInButton .nsm7Bb-HzV7m-LgbsSe,
#googleSignInButton .nsm7Bb-HzV7m-LgbsSe:hover,
#googleSignInButton .nsm7Bb-HzV7m-LgbsSe:active,
#googleSignInButton .nsm7Bb-HzV7m-LgbsSe:focus,
#googleSignInButton .nsm7Bb-HzV7m-LgbsSe:focus-visible{
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
}
/* Центрує кнопку Google */
.gsi-mask {
  display: block;
  width: fit-content;        /* або max-content */
  width: -moz-fit-content;   /* для Firefox старіших */
  margin: 16px auto;         /* центр по горизонталі */
}
