/* Žybsnis — sąsiuvinio estetika: langeliai lentai, linijos mokytojo darbui, raudona paraštė. */
@font-face {
  font-family: 'Lexend';
  font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/lexend-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lexend';
  font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/lexend-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #F7F9FC;
  --paper-2: #EEF3FA;
  --grid: #DCE5F1;
  --rule: #C7D5EA;
  --ink: #16235E;
  --ink-2: #4B577F;
  --ink-3: #8390B3;
  --margin: #E0475A;
  --white: #FFFFFF;
  --m0: #D7263D; /* raudonas flomasteris */
  --m1: #2D6BE4; /* mėlynas */
  --m2: #F4B400; /* geltonas */
  --m3: #0E8048; /* žalias */
  --m4: #7B4BD6; /* violetinis */
  --m5: #E26A10; /* oranžinis */
  --ok: #0E8048;
  --bad: #D7263D;
  --spark: #FFC21A;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(22, 35, 94, .08), 0 6px 18px -10px rgba(22, 35, 94, .35);
  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 2.2rem; font-weight: 750; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--m1); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--m1); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.stack > * + * { margin-top: .75rem; }

/* ---------- Popieriai ---------- */
.paper-grid {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell, 28px) var(--cell, 28px);
}
.paper-lined {
  background-color: var(--white);
  background-image: linear-gradient(transparent calc(100% - 1px), var(--rule) calc(100% - 1px));
  background-size: 100% 2.25rem;
}

/* ---------- Logotipas ---------- */
.logo { display: inline-flex; align-items: center; gap: .45em; font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo svg { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Mygtukai ir laukai ---------- */
.btn {
  --bg: var(--white); --fg: var(--ink); --bd: var(--rule);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .55em 1.1em; border-radius: var(--radius);
  border: 1.5px solid var(--bd); background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s ease, background-color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn.primary:hover { --bg: #22337f; }
.btn.spark { --bg: var(--spark); --fg: var(--ink); --bd: #E5A800; }
.btn.danger { --fg: var(--bad); --bd: #f1b8c0; }
.btn.ghost { --bg: transparent; --bd: transparent; }
.btn.ghost:hover { --bg: var(--paper-2); }
.btn.big { min-height: 56px; font-size: 1.1rem; padding: .7em 1.4em; }
.btn.small { min-height: 34px; padding: .3em .75em; font-size: .9rem; }
.btn .ico { width: 1.15em; height: 1.15em; }

label.field { display: block; font-weight: 600; font-size: .92rem; }
label.field > span { display: block; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--rule); border-radius: 8px; padding: .6em .75em; min-height: 44px;
}
textarea { resize: vertical; min-height: 5em; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--m1); box-shadow: 0 0 0 3px rgba(45, 107, 228, .18); }
.check { display: inline-flex; align-items: center; gap: .5em; cursor: pointer; font-weight: 500; }
.check input { width: 1.2em; height: 1.2em; accent-color: var(--ink); }

.seg { display: inline-flex; border: 1.5px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.seg button { font: inherit; border: 0; background: transparent; padding: .5em .9em; cursor: pointer; color: var(--ink-2); font-weight: 600; min-height: 40px; }
.seg button + button { border-left: 1.5px solid var(--rule); }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }

.tag { white-space: nowrap; display: inline-block; font-size: .78rem; font-weight: 600; padding: .1em .55em; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); }
.tag.ok { background: #DDF3E7; color: var(--ok); }
.tag.warn { background: #FFF1C9; color: #8A5B00; }
.tag.bad { background: #FBE0E4; color: var(--bad); }

/* ---------- Dialogai ir pranešimai ---------- */
dialog {
  border: 0; border-radius: 14px; padding: 0; color: var(--ink); background: var(--white);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px -20px rgba(22, 35, 94, .5);
}
dialog::backdrop { background: rgba(22, 35, 94, .45); }
dialog .dlg-head { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1.5px solid var(--grid); }
dialog .dlg-head h2 { margin: 0; font-size: 1.3rem; flex: 1; }
dialog .dlg-body { padding: 1.2rem 1.4rem; overflow: auto; max-height: calc(100vh - 190px); }
dialog .dlg-foot { display: flex; gap: .75rem; justify-content: flex-end; padding: 1rem 1.4rem; border-top: 1.5px solid var(--grid); background: var(--paper); }

#toasts { position: fixed; z-index: 9999; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; animation: toast-in .2s ease; max-width: 90vw; }
.toast.bad { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Mokytojo aplinka ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.5rem; background: var(--white); border-bottom: 1.5px solid var(--grid); }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { padding: .5em .85em; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.topbar nav a:hover { background: var(--paper-2); }
.topbar nav a[aria-current=page] { color: var(--ink); background: var(--paper-2); box-shadow: inset 0 -3px 0 var(--spark); }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: .75rem; }

.page { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; flex: 1; }

/* Sąsiuvinio lapas su raudona paraštė */
.sheet { position: relative; background: var(--white); border: 1.5px solid var(--grid); border-radius: 6px; padding-left: 64px; }
.sheet::before { content: ''; position: absolute; top: 0; bottom: 0; left: 48px; width: 2px; background: var(--margin); opacity: .75; }
.sheet .sheet-empty { padding: 3rem 1.5rem; color: var(--ink-2); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.25rem .85rem 0; border-bottom: 1.5px solid var(--grid); min-height: 72px; position: relative; }
.rows > li:last-child { border-bottom: 0; }
.rows > li:hover { background: linear-gradient(90deg, transparent, var(--paper) 30%); }
.rows .r-main { flex: 1; min-width: 0; }
.rows .r-title { font-weight: 650; font-size: 1.05rem; text-decoration: none; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .r-meta { font-size: .86rem; color: var(--ink-2); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.rows .r-num { position: absolute; left: -46px; width: 36px; text-align: center; font-weight: 700; color: var(--ink-3); font-size: .9rem; }
.rows .r-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

.filters { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters > * { flex: 1 1 180px; }
.filters input[type=search] { flex: 3 1 260px; }

.banner { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.2rem; border-radius: var(--radius); background: #FFF6D6; border: 1.5px solid #F3DB8C; margin-bottom: 1.25rem; flex-wrap: wrap; }
.banner.info { background: #E9F0FD; border-color: #C6D7F7; }
.banner.live { background: var(--ink); color: #fff; border-color: var(--ink); }
.banner.live .btn { --bg: var(--spark); --fg: var(--ink); --bd: var(--spark); }

table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.tbl th, table.tbl td { text-align: left; padding: .6rem .7rem; border-bottom: 1.5px solid var(--grid); vertical-align: middle; }
table.tbl th { font-size: .82rem; color: var(--ink-2); font-weight: 600; background: var(--paper); position: sticky; top: 0; }
table.tbl tr:hover td { background: var(--paper); }
.tbl-wrap { overflow: auto; border: 1.5px solid var(--grid); border-radius: 8px; background: var(--white); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.panel { background: var(--white); border: 1.5px solid var(--grid); border-radius: 10px; padding: 1.25rem 1.4rem; }
.panel h3 { margin-bottom: .75rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.25rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; }

/* Režimų pasirinkimas */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.mode { text-align: left; font: inherit; color: var(--ink); background: var(--white); border: 2px solid var(--grid); border-radius: 12px; padding: 1rem; cursor: pointer; display: grid; gap: .3rem; }
.mode:hover { border-color: var(--ink-3); }
.mode[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--paper); }
.mode b { font-size: 1.05rem; display: flex; gap: .5rem; align-items: center; }
.mode small { color: var(--ink-2); line-height: 1.35; }
.mode .warn { color: #8A5B00; font-size: .8rem; }

/* ---------- Įžanginis puslapis ---------- */
.land-hero { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); --cell: 34px; }
.land-board { position: relative; padding: 2.5rem 3rem 3rem 120px; display: flex; flex-direction: column; }
.land-board::before { content: ''; position: absolute; top: 0; bottom: 0; left: 88px; width: 3px; background: var(--margin); opacity: .8; }
.land-board h1 { font-size: clamp(2.4rem, 5.2vw, 4.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; margin: 2.5rem 0 1.2rem; max-width: 13ch; }
.land-board .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 46ch; }
.land-demo { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 560px; }
.land-demo .tile { min-height: 74px; font-size: 1.15rem; }
.land-points { list-style: none; padding: 0; margin: 2rem 0; display: grid; gap: .6rem; max-width: 52ch; }
.land-points li { display: flex; gap: .75rem; align-items: baseline; }
.land-points li::before { content: ''; width: .7em; height: .7em; flex: none; border-radius: 2px; background: var(--c, var(--m1)); transform: translateY(.05em); }
.land-side { background: var(--white); border-left: 1.5px solid var(--grid); padding: 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; justify-content: center; }
.join-box { background: var(--ink); color: #fff; border-radius: 14px; padding: 1.4rem; }
.join-box h2 { color: #fff; }
.join-box input { font-size: 1.6rem; letter-spacing: .25em; text-align: center; font-weight: 700; }
.auth-box { border: 1.5px solid var(--grid); border-radius: 14px; padding: 1.4rem; }
@media (max-width: 900px) {
  .land-hero { grid-template-columns: 1fr; }
  .land-board { padding: 1.5rem 1.25rem 2rem 64px; }
  .land-board::before { left: 44px; }
  .land-side { border-left: 0; border-top: 1.5px solid var(--grid); padding: 1.5rem; }
}

/* ---------- Atsakymų plytelės (lenta ir įrenginiai) ---------- */
.tile {
  --c: var(--m1);
  position: relative; display: flex; align-items: center; gap: .7em; text-align: left;
  min-height: 3.2em; padding: .5em .9em .5em .6em; border-radius: 12px; border: 0;
  background: var(--c); color: #fff; font: inherit; font-weight: 650; line-height: 1.2;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16);
}
.tile .let { flex: none; width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .95); color: var(--c); font-weight: 800; }
.tile .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tile .timg { max-height: 4em; border-radius: 6px; background: #fff; }
.c0 { --c: var(--m0); } .c1 { --c: var(--m1); } .c2 { --c: var(--m2); } .c3 { --c: var(--m3); } .c4 { --c: var(--m4); } .c5 { --c: var(--m5); }
.tile.c2 { color: var(--ink); }
.tile.c2 .let { color: #8A5B00; }
.tile.dim { filter: saturate(.25) brightness(1.15); opacity: .55; }
.tile .count { font-weight: 800; font-size: 1.1em; padding-left: .5em; }
.tile .bar { position: absolute; left: 0; bottom: 0; height: 6px; background: rgba(255, 255, 255, .75); border-radius: 0 3px 0 12px; transition: width .6s ease; }
.tile .mark { flex: none; width: 1.6em; height: 1.6em; border-radius: 50%; background: #fff; color: var(--ok); display: grid; place-items: center; font-weight: 900; }

/* ---------- Lenta (scena) ---------- */
body.stage-body { overflow: hidden; height: 100vh; }
.stage { --cell: clamp(22px, 2.2vw, 46px); height: 100vh; display: grid; grid-template-columns: clamp(190px, 15vw, 300px) 1fr; font-size: clamp(15px, 1.45vw, 36px); }
.stage-margin { position: relative; padding: 1.1em 1.1em 1em; display: flex; flex-direction: column; gap: 1em; border-right: 3px solid var(--margin); background: rgba(255, 255, 255, .55); font-size: clamp(13px, .95vw, 22px); }
.stage-margin .logo { font-size: 1.25em; }
.stage-main { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 1.2em 1.8em 1.4em; min-width: 0; }
.stage-ctl { display: grid; gap: .5em; margin-top: auto; }
.stage-ctl .btn { width: 100%; min-height: 3em; font-size: 1em; }
.stage-ctl .btn.next { min-height: 4em; font-size: 1.15em; }
.stage-toggles { display: flex; gap: .4em; flex-wrap: wrap; }
.stage-toggles .btn { width: auto; flex: 1; min-height: 2.6em; padding: .3em; }
.mcode { font-weight: 800; font-size: 1.9em; letter-spacing: .06em; line-height: 1; }
.mlabel { font-size: .85em; color: var(--ink-2); font-weight: 600; }
.mcount { font-weight: 800; font-size: 2.6em; line-height: 1; }

.timer { position: relative; width: 7em; height: 7em; align-self: center; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 10; }
.timer .tr-bg { stroke: var(--grid); }
.timer .tr-fg { stroke: var(--ink); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.low .tr-fg { stroke: var(--margin); }
.timer .tr-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 2.4em; }

.q-head { display: flex; align-items: center; gap: .8em; color: var(--ink-2); font-weight: 600; font-size: .8em; margin-bottom: .6em; }
.q-prompt { font-size: 2.05em; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .6em; max-width: 32ch; overflow-wrap: anywhere; }
.q-prompt.long { font-size: 1.55em; max-width: 46ch; }
.q-body { flex: 1; display: flex; flex-direction: column; gap: .8em; min-height: 0; }
.q-media { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.q-media img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.q-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .55em; }
.q-tiles .tile { min-height: 3.4em; font-size: 1.05em; }
.q-tiles.n1, .q-tiles.n2 { grid-template-columns: 1fr 1fr; }
.q-tiles.tf .tile { min-height: 4em; font-size: 1.4em; justify-content: center; }
.q-body:not(.has-media) > .q-tiles { flex: 1 1 auto; max-height: 60vh; grid-auto-rows: 1fr; }
.q-body:not(.has-media) > .q-tiles .tile { font-size: 1.35em; }
.q-body:not(.has-media) > .q-tiles.tf .tile { font-size: 1.9em; }

.chips { display: flex; flex-wrap: wrap; gap: .45em; }
.chip { background: var(--white); border: 2px solid var(--rule); border-radius: 10px; padding: .35em .75em; font-weight: 600; box-shadow: 0 2px 0 var(--grid); }
.chip.ok { border-color: var(--ok); color: var(--ok); }
.chip.bad { border-color: var(--bad); color: var(--bad); text-decoration: line-through; }

.hint-big { margin: auto; text-align: center; color: var(--ink-2); font-size: 1.4em; font-weight: 600; }

/* Laukimo kambarys */
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 2em; align-items: start; height: 100%; }
.lobby-join { background: var(--white); border: 2px solid var(--ink); border-radius: 16px; padding: 1.2em 1.4em; box-shadow: 8px 8px 0 var(--grid); display: grid; gap: .6em; justify-items: center; width: 17em; }
.lobby-join .qr { width: 12em; height: 12em; }
.lobby-join .url { font-weight: 700; font-size: 1.05em; }
.lobby-join .code { font-weight: 800; font-size: 2.6em; letter-spacing: .06em; line-height: 1; white-space: nowrap; }
.lobby-players { display: flex; flex-wrap: wrap; gap: .5em; align-content: flex-start; }
.pchip { display: inline-flex; align-items: center; gap: .4em; background: var(--white); border: 2px solid var(--rule); border-radius: 99px; padding: .25em .8em .25em .35em; font-weight: 650; animation: pop .25s ease; cursor: pointer; }
.pchip .av { font-size: 1.3em; line-height: 1; }
.pchip.off { opacity: .45; }
.pchip:hover { border-color: var(--bad); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.lobby-title { font-size: 2.2em; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 .2em; line-height: 1.05; }
.teams-cols { display: grid; gap: .8em; grid-template-columns: repeat(var(--n, 2), 1fr); }
.team-col { border-radius: 12px; padding: .7em; background: var(--white); border-top: 8px solid var(--c); }
.team-col h3 { font-size: 1.1em; display: flex; gap: .4em; align-items: center; }

/* Rezultatai */
.lb { display: grid; gap: .45em; max-width: 46em; width: 100%; margin: 0 auto; }
.lb-row { display: grid; grid-template-columns: 2.2em 2em 1fr auto; align-items: center; gap: .6em; background: var(--white); border: 2px solid var(--grid); border-radius: 12px; padding: .45em .8em; font-weight: 650; animation: slidein .35s ease both; }
.lb-row .rk { font-weight: 800; color: var(--ink-3); }
.lb-row .av { font-size: 1.4em; }
.lb-row .sc { font-weight: 800; }
.lb-row:nth-child(1) { border-color: var(--spark); box-shadow: 0 0 0 2px var(--spark) inset; }
@keyframes slidein { from { opacity: 0; transform: translateX(-20px); } }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 1em; max-width: 40em; margin: 0 auto; width: 100%; }
.pod { text-align: center; }
.pod .av { font-size: 3em; }
.pod .nm { font-weight: 750; font-size: 1.2em; overflow-wrap: anywhere; }
.pod .blk { margin-top: .4em; border-radius: 12px 12px 0 0; background: var(--ink); color: #fff; font-weight: 800; font-size: 2em; display: grid; place-items: center; }
.pod.p1 .blk { height: 6em; background: var(--spark); color: var(--ink); }
.pod.p2 .blk { height: 4.4em; }
.pod.p3 .blk { height: 3.2em; background: var(--ink-2); }
.pod .pts { font-size: .9em; color: var(--ink-2); font-weight: 650; }

.cloud { display: flex; flex-wrap: wrap; gap: .3em .8em; justify-content: center; align-items: center; align-content: center; flex: 1; padding: 1em; }
.cloud span { font-weight: 750; line-height: 1; animation: pop .3s ease; transition: font-size .3s ease; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9em, 1fr)); gap: .7em; overflow: auto; }
.gallery figure { margin: 0; background: #fff; border: 2px solid var(--grid); border-radius: 10px; padding: .3em; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: contain; display: block; }
.gallery figcaption { font-size: .75em; font-weight: 600; text-align: center; padding-top: .2em; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.4em, 1fr)); gap: .4em; }
.cards-grid div { aspect-ratio: 1; border-radius: 10px; border: 2px dashed var(--rule); display: grid; place-items: center; font-weight: 800; color: var(--ink-3); background: rgba(255, 255, 255, .7); }
.cards-grid div.on { border: 2px solid var(--ink); background: var(--ink); color: #fff; animation: pop .2s ease; }

.self-grid { overflow: auto; }
.self-grid table { border-collapse: separate; border-spacing: 3px; font-size: .8em; }
.self-grid th { font-weight: 600; color: var(--ink-2); padding: 0 .3em; }
.self-grid td.nm { font-weight: 650; padding-right: .8em; white-space: nowrap; }
.self-grid td.c { width: 1.8em; height: 1.8em; border-radius: 5px; background: var(--white); border: 1.5px solid var(--grid); text-align: center; font-weight: 800; }
.self-grid td.y { background: var(--ok); border-color: var(--ok); color: #fff; }
.self-grid td.x { background: var(--bad); border-color: var(--bad); color: #fff; }
.self-grid td.p { background: var(--m2); border-color: var(--m2); }
.self-grid td.n { background: var(--ink-3); border-color: var(--ink-3); }
.self-grid td.cur { box-shadow: inset 0 0 0 2px var(--ink); }

.slide-view { margin: auto 0; display: grid; gap: .8em; max-width: 60em; }
.slide-view h2 { font-size: 2.6em; font-weight: 800; letter-spacing: -0.025em; margin: 0; }
.slide-view .body { font-size: 1.35em; white-space: pre-wrap; max-width: 44ch; }
.slide-view.has-img { grid-template-columns: 1fr 1fr; align-items: center; max-width: none; }
.slide-view img { max-height: 60vh; border-radius: 12px; box-shadow: var(--shadow); }

.explain { background: #FFF6D6; border-left: 6px solid var(--spark); border-radius: 8px; padding: .5em .9em; font-weight: 550; }

/* Lentos režimas: komandų juostos */
.lanes { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: .7em; flex: 1; min-height: 0; }
.lane { display: flex; flex-direction: column; gap: .45em; padding: .6em; border-radius: 14px; background: rgba(255, 255, 255, .8); border-top: 10px solid var(--c); }
.lane h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 .2em; font-size: 1.05em; }
.lane .tile { flex: 1; min-height: 2.6em; font-size: .95em; touch-action: manipulation; }
.lane.done .tile:not(.picked) { opacity: .4; }
.lane .tile.picked { outline: 5px solid var(--ink); outline-offset: 2px; }
.lane .gain { font-weight: 800; font-size: 1.3em; text-align: center; min-height: 1.4em; }

.team-bar { display: flex; gap: .6em; flex-wrap: wrap; }
.team-bar .tb { display: flex; align-items: center; gap: .4em; background: var(--white); border-radius: 10px; padding: .25em .7em; border-left: 8px solid var(--c); font-weight: 700; }

/* ---------- Mokinio įrenginys ---------- */
body.play-body { min-height: 100vh; min-height: 100dvh; }
.play { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; --cell: 26px; }
.play-top { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; background: var(--white); border-bottom: 1.5px solid var(--grid); font-weight: 650; }
.play-top .av { font-size: 1.6rem; }
.play-top .score { margin-left: auto; font-weight: 800; }
.play-main { flex: 1; display: flex; flex-direction: column; padding: 1rem; gap: 1rem; max-width: 720px; width: 100%; margin: 0 auto; }
.play-prompt { font-size: 1.35rem; font-weight: 700; line-height: 1.25; margin: 0; }
.play-main .tiles { display: grid; gap: .6rem; flex: 1; grid-auto-rows: minmax(76px, 1fr); }
.play-main .tiles.two { grid-template-columns: 1fr 1fr; }
.play-main .tile { font-size: 1.15rem; justify-content: flex-start; }
.play-main .tile:active { transform: scale(.98); }
.play-main .tile[aria-pressed=true] { outline: 5px solid var(--ink); outline-offset: 3px; }
.play-center { margin: auto; text-align: center; display: grid; gap: 1rem; justify-items: center; padding: 1rem; }
.play-center .big { font-size: 4rem; line-height: 1; }
.play-center h2 { font-size: 1.6rem; }
.result-card { border-radius: 16px; padding: 1.6rem; color: #fff; text-align: center; display: grid; gap: .4rem; width: 100%; }
.result-card.ok { background: var(--ok); }
.result-card.bad { background: var(--bad); }
.result-card.part { background: var(--m2); color: var(--ink); }
.result-card.neutral { background: var(--ink); }
.result-card .big { font-size: 3rem; }
.result-card .pts { font-size: 1.6rem; font-weight: 800; }
.join-form { width: 100%; max-width: 420px; margin: auto; display: grid; gap: 1rem; padding: 1.5rem 1rem; }
.join-form .code-in { font-size: 2rem; text-align: center; letter-spacing: .3em; font-weight: 800; }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; }
.avatars button { font-size: 1.7rem; aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--grid); background: #fff; cursor: pointer; }
.avatars button[aria-pressed=true] { border-color: var(--ink); background: var(--paper-2); }
.namelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.namelist .btn { justify-content: flex-start; white-space: normal; text-align: left; }
.big-input { font-size: 1.4rem !important; min-height: 60px !important; }
.timebar { height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.timebar i { display: block; height: 100%; background: var(--ink); transition: width .25s linear; }
.timebar.low i { background: var(--margin); }

/* Rikiavimas, poros, grupės */
.sortlist { display: grid; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.sortlist li { display: flex; align-items: center; gap: .6rem; background: var(--white); border: 2px solid var(--rule); border-radius: 12px; padding: .6rem .7rem; font-weight: 650; font-size: 1.1rem; touch-action: none; user-select: none; cursor: grab; }
.sortlist li .handle { color: var(--ink-3); font-size: 1.3rem; }
.sortlist li .n { width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .85rem; flex: none; }
.sortlist li.drag { box-shadow: 0 12px 28px -10px rgba(22, 35, 94, .5); border-color: var(--ink); position: relative; z-index: 5; }
.sortlist li .mv { margin-left: auto; display: flex; gap: .3rem; }
.sortlist li .mv button { width: 40px; height: 40px; border-radius: 8px; border: 1.5px solid var(--rule); background: var(--paper); font-size: 1rem; cursor: pointer; }
.sortlist li.ok { border-color: var(--ok); }
.sortlist li.bad { border-color: var(--bad); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
.match .col { display: grid; gap: .5rem; align-content: start; }
.match button { font: inherit; font-weight: 650; font-size: 1.05rem; text-align: left; padding: .6rem .8rem; min-height: 54px; border-radius: 12px; border: 2px solid var(--rule); background: var(--white); cursor: pointer; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.match button.sel { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 35, 94, .2); }
.match button .dot { width: 1.3em; height: 1.3em; border-radius: 50%; flex: none; background: var(--grid); color: #fff; font-size: .75rem; display: grid; place-items: center; font-weight: 800; }
.match button.ok { border-color: var(--ok); }
.match button.bad { border-color: var(--bad); }

.groups { display: grid; gap: .6rem; }
.groups .pool { display: flex; flex-wrap: wrap; gap: .45rem; min-height: 52px; padding: .5rem; border-radius: 12px; border: 2px dashed var(--rule); }
.groups .buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; }
.groups .bucket { border-radius: 12px; border: 2px solid var(--rule); background: rgba(255, 255, 255, .85); padding: .5rem; min-height: 110px; display: flex; flex-direction: column; gap: .4rem; cursor: pointer; }
.groups .bucket h4 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: .4rem; }
.groups .bucket h4::before { content: ''; width: .8em; height: .8em; border-radius: 3px; background: var(--c); }
.groups .bucket.target { border-color: var(--ink); background: var(--paper-2); }
.groups .bucket .in { display: flex; flex-wrap: wrap; gap: .35rem; }
.groups .word { font: inherit; font-weight: 650; padding: .4rem .7rem; border-radius: 10px; border: 2px solid var(--rule); background: #fff; cursor: pointer; color: var(--ink); min-height: 44px; }
.groups .word.sel { border-color: var(--ink); background: var(--ink); color: #fff; }
.groups .word.ok { border-color: var(--ok); }
.groups .word.bad { border-color: var(--bad); }

.drawpad { display: grid; gap: .5rem; }
.drawpad canvas { width: 100%; aspect-ratio: 4/3; background: #fff; border: 2px solid var(--rule); border-radius: 12px; touch-action: none; }
.drawpad .tools { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.drawpad .sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--rule); cursor: pointer; }
.drawpad .sw[aria-pressed=true] { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- Redaktorius ---------- */
.ed { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 62px); }
.ed-side { border-right: 1.5px solid var(--grid); background: var(--white); display: flex; flex-direction: column; max-height: calc(100vh - 62px); position: sticky; top: 62px; }
.ed-list { list-style: none; margin: 0; padding: .5rem; overflow: auto; flex: 1; display: grid; gap: .35rem; align-content: start; }
.ed-list li { display: grid; grid-template-columns: 1.8em 1fr auto; gap: .5rem; align-items: center; padding: .55rem .6rem; border-radius: 9px; border: 1.5px solid transparent; cursor: pointer; }
.ed-list li:hover { background: var(--paper); }
.ed-list li[aria-current=true] { border-color: var(--ink); background: var(--paper-2); }
.ed-list .n { font-weight: 800; color: var(--ink-3); text-align: center; }
.ed-list .t { font-size: .78rem; color: var(--ink-2); font-weight: 600; }
.ed-list .p { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-list .warn { color: #B07400; font-weight: 800; }
.ed-add { padding: .75rem; border-top: 1.5px solid var(--grid); display: grid; gap: .5rem; }
.ed-main { padding: 1.5rem 2rem 4rem; }
.ed-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr); gap: 1.5rem; align-items: start; }
.ed-split > .ed-prev { position: sticky; top: 80px; }
@media (max-width: 1300px) { .ed-split { grid-template-columns: 1fr; } .ed-split > .ed-prev { position: static; } }
.ed-meta { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.ed-card { background: var(--white); border: 1.5px solid var(--grid); border-radius: 12px; padding: 1.25rem; display: grid; gap: 1rem; }
.ed-card .ttl { display: flex; align-items: center; gap: .75rem; }
.ed-card .ttl h2 { margin: 0; flex: 1; font-size: 1.2rem; }
.opt-row { display: grid; grid-template-columns: 2.2em 1fr auto auto; gap: .5rem; align-items: center; }
.opt-row .let { width: 2.2em; height: 2.2em; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--c); }
.opt-row .c2 { color: var(--ink); }
.toggle-ok { min-width: 8.5em; }
.toggle-ok[aria-pressed=true] { --bg: #DDF3E7; --fg: var(--ok); --bd: var(--ok); }
.pair-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: .5rem; align-items: center; }
.imgdrop { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.imgdrop img { max-height: 90px; border-radius: 8px; border: 1.5px solid var(--grid); }
.typepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.typepick button { font: inherit; text-align: left; padding: .7rem; border-radius: 10px; border: 1.5px solid var(--grid); background: #fff; cursor: pointer; display: grid; gap: .15rem; color: var(--ink); }
.typepick button:hover { border-color: var(--ink); }
.typepick b { font-size: .95rem; }
.typepick small { color: var(--ink-2); font-size: .78rem; line-height: 1.3; }
.preview-box { border: 1.5px solid var(--grid); border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; position: relative; }
.preview-box .stage { height: 100%; font-size: 11px; --cell: 18px; }
.preview-box .stage-margin { font-size: 9px; }
.modes-ok { display: flex; gap: .35rem; flex-wrap: wrap; }
@media (max-width: 860px) {
  .ed { grid-template-columns: 1fr; }
  .ed-side { position: static; max-height: none; }
  .ed-meta { grid-template-columns: 1fr; }
}

/* ---------- Pultas ir skeneris ---------- */
.remote { min-height: 100vh; display: flex; flex-direction: column; }
.remote-main { padding: 1rem; display: grid; gap: 1rem; max-width: 640px; margin: 0 auto; width: 100%; }
.remote .btn { width: 100%; }
.scan-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 3/4; }
.scan-wrap video, .scan-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-count { position: absolute; left: 10px; top: 10px; background: rgba(22, 35, 94, .85); color: #fff; font-weight: 800; border-radius: 10px; padding: .3em .7em; font-size: 1.2rem; }

/* ---------- Kortelės spausdinimui ---------- */
.print-cards { display: grid; gap: 0; max-width: 190mm; margin: 0 auto; }
.pcard { position: relative; display: grid; place-items: center; border: 1px dashed #bbb; break-inside: avoid; page-break-inside: avoid; background: #fff; }
.pcard .mk { width: 62%; aspect-ratio: 1; }
.pcard .mk svg { width: 100%; height: 100%; display: block; }
.pcard .l { position: absolute; font-weight: 800; font-size: 20pt; color: #333; }
.pcard .lA { top: 4%; left: 50%; transform: translateX(-50%); }
.pcard .lB { right: 4%; top: 50%; transform: translateY(-50%) rotate(90deg); }
.pcard .lC { bottom: 4%; left: 50%; transform: translateX(-50%) rotate(180deg); }
.pcard .lD { left: 4%; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.pcard .no { position: absolute; left: 4%; top: 3%; font-size: 10pt; font-weight: 700; color: #555; }
.pcard .nm { position: absolute; right: 4%; bottom: 3%; font-size: 9pt; color: #555; max-width: 40%; text-align: right; }
.print-cards.s2 { grid-template-columns: 1fr; }
.print-cards.s2 .pcard { height: 138mm; }
.print-cards.s2 .pcard .mk { width: 96mm; }
.print-cards.s4 { grid-template-columns: 1fr 1fr; }
.print-cards.s4 .pcard { height: 138mm; }
.print-cards.s4 .pcard .mk { width: 62mm; }
.print-cards.s4 .pcard .l { font-size: 14pt; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  @page { size: A4; margin: 10mm; }
}

/* ---------- Ataskaita ---------- */
.rep-grid td.y { background: #DDF3E7; color: var(--ok); font-weight: 700; }
.rep-grid td.x { background: #FBE0E4; color: var(--bad); font-weight: 700; }
.rep-grid td.p { background: #FFF1C9; color: #8A5B00; font-weight: 700; }
.rep-grid td { white-space: nowrap; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.pctbar { height: 10px; background: var(--grid); border-radius: 5px; overflow: hidden; min-width: 80px; }
.pctbar i { display: block; height: 100%; background: var(--ok); }
.pctbar.mid i { background: var(--m2); }
.pctbar.low i { background: var(--bad); }

/* Konfeti (vienas momentas pabaigoje) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

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

.noanim, .noanim * { animation: none !important; }
.preview-box .stage { grid-template-columns: 20% 1fr; }

/* ---------- Automatiniai vaizdai ---------- */
.vis { display: block; max-width: 100%; }
svg.vis { height: 100%; width: auto; max-height: 40vh; }
.q-media svg.vis { height: 100%; max-height: 38vh; min-height: 6em; }
.vis-emoji { font-size: 4.2em; line-height: 1.1; text-align: center; letter-spacing: .05em; }
.vis-count { display: flex; flex-wrap: wrap; gap: .3em .9em; justify-content: center; font-size: 3em; line-height: 1.1; max-width: 16em; }
.vis-count .grp { white-space: nowrap; }
.tile .tvis { flex: none; display: grid; place-items: center; background: #fff; border-radius: 8px; padding: .15em; height: 2.6em; min-width: 2.6em; }
.tile .tvis svg.vis { height: 2.3em; width: auto; max-height: none; }
.tile .tvis .vis-emoji { font-size: 1.8em; }
.tile .tvis .vis-count { font-size: 1em; }
.q-tiles .tile.has-vis .tvis { height: 4.2em; min-width: 4.2em; }
.q-tiles .tile.has-vis .tvis svg.vis { height: 3.9em; }
.play-vis { display: grid; place-items: center; }
.play-vis svg.vis { height: 26vh; max-height: 220px; }
.play-vis .vis-emoji { font-size: 3rem; }
.play-vis .vis-count { font-size: 2rem; }
.play-main .tile .tvis { height: 3.4em; min-width: 3.4em; }
.play-main .tile .tvis svg.vis { height: 3.1em; }
.slide-vis { display: grid; place-items: center; }
.slide-vis svg.vis { height: 50vh; max-height: 50vh; }

/* ---------- Talismanas ---------- */
.mascot { width: 6em; height: 6em; display: block; animation: float 3.2s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(22,35,94,.18)); }
.mascot.big { width: 9em; height: 9em; }
.mascot.small { width: 3.4em; height: 3.4em; }
.mascot.hop { animation: hop .7s ease; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
@keyframes hop { 0% { transform: scale(.6) rotate(-20deg); } 60% { transform: scale(1.15) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }

/* ---------- Įžanga 3-2-1 ---------- */
.intro { margin: auto; display: grid; justify-items: center; gap: .8em; text-align: center; max-width: 50em; }
.intro .q-prompt { margin: 0; max-width: 30ch; }
.intro .cnt { width: 3.4em; height: 3.4em; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 2.6em; font-weight: 800; animation: pulse 1s ease infinite; }
@keyframes pulse { 0% { transform: scale(.85); } 30% { transform: scale(1.08); } 100% { transform: scale(1); } }
.intro .tag { font-size: .9em; }
.intro-bar { width: 22em; height: .5em; background: var(--grid); border-radius: 99px; overflow: hidden; }
.intro-bar i { display: block; height: 100%; background: var(--spark); animation: grow 3s linear forwards; }
@keyframes grow { from { width: 0; } to { width: 100%; } }

/* ---------- Tik lenta: režimai, mokinys prie lentos, ekraninės klaviatūros ---------- */
.bo-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .7em; }
.bo-mode { font: inherit; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: .15em .7em; align-items: start; padding: .8em 1em; border-radius: 14px; border: 3px solid var(--rule); background: var(--white); color: var(--ink); cursor: pointer; }
.bo-mode .ic { grid-row: span 2; font-size: 2em; line-height: 1; }
.bo-mode b { font-size: 1.05em; }
.bo-mode .muted { font-size: .78em; line-height: 1.35; }
.bo-mode[aria-pressed=true] { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 35, 94, .15); }
.bo-tally { background: #fff; border-radius: 12px; padding: .6em .7em; display: grid; gap: .1em; border-left: 8px solid var(--ok); }
.bo-tally b { font-size: 1.6em; line-height: 1.1; }
.bo-tally span { font-size: .8em; color: var(--ink-2); }

.bo .tile { touch-action: manipulation; cursor: pointer; }
.bo .tile[aria-pressed=true] { outline: 5px solid var(--ink); outline-offset: 3px; }
.bo .tile.bad { outline: 6px solid var(--bad); outline-offset: 3px; }
.bo .tile.good { outline: 6px solid var(--ok); outline-offset: 3px; }
.bo-solo { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .4em; }
.bo-solo.has-media { grid-template-rows: none; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 1.4em; align-items: start; }
.bo-left { display: grid; gap: .6em; min-height: 0; }
.bo-left .q-prompt { margin: 0; }
.bo-solo.has-media .q-media { max-height: 52vh !important; }
.bo-area { min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.bo-area.wide { flex: 1; font-size: 1em; }
.bo-input { display: grid; gap: .6em; align-content: start; }
.bo-solo .bo-input > .q-tiles { grid-auto-rows: minmax(3.2em, auto); }
.bo-solo:not(.has-media) .bo-input > .q-tiles { min-height: 34vh; grid-auto-rows: 1fr; }
.bo-solo:not(.has-media) .bo-input > .q-tiles .tile { font-size: 1.25em; }
.bo-solo .q-tiles.tf .tile { font-size: 1.7em; }
.bo-fb { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; margin-top: .6em; min-height: 3.6em; }
.bo-fb .btn.big { min-height: 2.6em; font-size: .9em; padding: .4em 1.2em; }
.bo-fb .bo-check { min-width: 9em; }
.bo-msg { display: flex; align-items: center; gap: .5em; font-weight: 750; font-size: 1.15em; }
.bo-msg.ok { color: var(--ok); }
.bo-msg.bad { color: var(--ink); }
.bo-msg .mascot { width: 2.4em; height: 2.4em; }
.bo .explain { margin-top: .5em; }
.bo-big { font-size: 2.8em; font-weight: 800; line-height: 1.1; text-align: center; }
.bo-big.ok { color: var(--ok); } .bo-big.bad { color: var(--bad); }
.bo-range { width: 100%; height: 3em; accent-color: var(--ink); }
.bo-slider { max-width: 30em; }
.bo-sol:empty { display: none; }
.bo-sol { font-weight: 750; font-size: 1.2em; color: var(--ok); }
.bo-list { margin: 0; padding-left: 1.4em; display: grid; gap: .2em; }
.bo-pairs { display: grid; gap: .3em; }
.bo-pairs div { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6em; }
.bo-groups { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: .5em; font-size: .85em; color: var(--ink); }
.bo .sortlist li { font-size: .95em; padding: .4em .6em; }
.bo .sortlist li .n { font-size: .65em; }
.bo .sortlist li .mv button { width: 2.2em; height: 2.2em; font-size: .7em; }
.bo .match button { font-size: .9em; min-height: 2.3em; }
.bo .match button .dot { font-size: .55em; width: 1.8em; height: 1.8em; }
.bo .groups .word { font-size: .9em; min-height: 2em; }
.bo .groups .bucket h4 { font-size: .9em; }
.bo .groups .bucket { min-height: 4em; }
.bo-draw .drawpad canvas { width: auto; max-width: 100%; max-height: 58vh; justify-self: center; }
.bo .drawpad .sw { width: 1.6em; height: 1.6em; }
.drawpad.locked canvas { pointer-events: none; opacity: .95; }
.drawpad.locked .tools { display: none; }

/* Juostose – kompaktiška */
.lane .bo-input { flex: 1; display: flex; flex-direction: column; gap: .45em; min-height: 0; }
.lane .bo-input > .q-tiles { flex: 1; }
.lane .q-tiles { grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: .45em; }
.lane .q-tiles.tf { grid-template-columns: 1fr; }
.lane .q-tiles .tile { min-height: 2.4em; font-size: .9em; }
.lane .q-tiles.tf .tile { font-size: 1.1em; }
.lane-ok { min-height: 2.4em; font-size: .9em; }
.lane-sent { text-align: center; font-weight: 750; color: var(--ok); }
.lane .kb { font-size: .62em; }
.lane-draw .bo-input { align-content: start; }
.lane-draw .drawpad canvas { max-height: 46vh; width: auto; max-width: 100%; justify-self: center; }
.lane-draw .drawpad .sw { width: 1.6em; height: 1.6em; }
.lane-draw .drawpad .tools { font-size: .7em; }
.lane-draw .gain .btn { width: 100%; }

/* Ekraninė klaviatūra */
.kb { display: grid; gap: .45em; user-select: none; -webkit-user-select: none; touch-action: manipulation; border-radius: 14px; }
.kb-display { min-height: 1.9em; background: #fff; border: 3px solid var(--rule); border-radius: 12px; padding: .2em .6em; font-weight: 750; font-size: 1.25em; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.kb-ph { color: var(--ink-3); font-weight: 500; }
.kb-caret { width: 3px; height: 1.1em; background: var(--ink); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.kb.locked .kb-caret, .kb.locked .kb-keys { display: none; }
.kb.masked .kb-val { color: transparent; text-shadow: 0 0 .5em rgba(22, 35, 94, .6); }
.kb-display.ok, .kb.kb-active .kb-display.ok { border-color: var(--ok); color: var(--ok); }
.kb-display.bad, .kb.kb-active .kb-display.bad { border-color: var(--bad); color: var(--bad); text-decoration: line-through; }
.kb.kb-active .kb-display { border-color: var(--ink); }
.kb-keys { display: grid; gap: .3em; }
.kb-row { display: flex; gap: .3em; justify-content: center; }
.kb-key { font: inherit; flex: 1 1 0; min-width: 0; max-width: 3.2em; min-height: 2.2em; padding: 0; border-radius: 9px; border: 2px solid var(--rule); background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; box-shadow: inset 0 -3px 0 var(--grid); }
.kb-key:active { background: var(--paper-2); transform: translateY(1px); box-shadow: none; }
.kb-key.kb-space { flex-grow: 4; max-width: none; font-size: .8em; font-weight: 600; }
.kb-key.kb-del { flex-grow: 1.6; max-width: none; }
.kb-key.kb-ok { flex-grow: 2.2; max-width: none; background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3); }
.kb-num { width: min(100%, 11em); }
.kb-num .kb-key { max-width: none; min-height: 2.4em; font-size: 1.15em; }
.bo-solo .kb-txt { width: min(100%, 27em); font-size: .85em; }
.bo-solo .kb-num { font-size: .95em; }
.bo-solo.t-number:not(.has-media) .bo-input, .bo-solo.t-type:not(.has-media) .bo-input { justify-items: center; }
.bo-cloud { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.2em; align-items: start; }
.bo-cloud-view { background: rgba(255, 255, 255, .7); border-radius: 16px; min-height: 50vh; height: 100%; display: flex; }
.bo-cloud-kb .kb { font-size: .8em; }
@media (prefers-reduced-motion: reduce) { .kb-caret { animation: none; } }
