:root {
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  /* brand paleta (logo / ikonka) */
  --brand-blue: #3b82f6;
  --brand-amber: #fbbf24;
  --brand-rose: #fb7185;
  --brand-emerald: #10b981;
  --ink: #1e2532;
  --muted: #6b7280;
  --line: #e6e8ec;
  --page: #f4f6f8;
  --surface: #ffffff;
  --correct-bg: #b9ec9c;
  --correct-text: #16500a;
  --correct-border: #7fce5c;
  --wrong-bg: #d3d8df;
  --wrong-text: #353a42;
  --wrong-border: #aab2bd;
  --sel-bg: #d3e4ff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: var(--blue); text-decoration: none; }

/* ---------- obecné prvky ---------- */
.wordmark { color: var(--blue); font-weight: 800; font-size: 26px; letter-spacing: -0.5px; }
.brand-logo { height: 30px; width: auto; display: block; }
.auth-logo { width: 64px; height: 64px; display: block; margin: 0 auto 16px; }
.btn {
  border: none; border-radius: 12px; padding: 11px 18px; font-size: 15px; font-weight: 600;
  background: var(--blue); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--blue-dark); }
.btn-ghost {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 16px; font-size: 14px; font-weight: 600;
}
.btn-ghost:hover { background: var(--page); }
.btn-danger { color: #b4453a; }
.icon-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.icon-btn.solid { background: var(--blue); color: #fff; border-color: var(--blue); }
.icon-btn:hover { background: var(--page); }
.icon-btn.solid:hover { background: var(--blue-dark); }

label.fld { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
input.txt, textarea.txt, select.txt {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px;
  font-size: 15px; color: var(--ink); background: var(--surface); outline: none;
}
input.txt:focus, textarea.txt:focus, select.txt:focus { border-color: var(--blue); }
textarea.txt { resize: vertical; }
select.type-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; font-weight: 600;
  padding-right: 36px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
  background-repeat: no-repeat; background-position: right 12px center;
}
.error { color: #b4453a; font-size: 14px; margin: 8px 0 0; }

/* ---------- přihlášení ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.auth-top { width: 100%; padding: 24px 32px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border-radius: 22px;
  border: 1px solid var(--line); padding: 32px; margin: 6vh auto;
}
.auth-card h1 { font-size: 30px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; }
.auth-card .btn { width: 100%; padding: 13px; font-size: 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.switch-line { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.switch-line button { background: none; border: none; color: var(--blue); font-weight: 700; font-size: 14px; }
.join-box { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.gbtn { display: flex; justify-content: center; min-height: 44px; }

/* ---------- úvodní obrazovka rozdělená na dvě poloviny ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 24px 40px; }
.landing-top { display: flex; justify-content: center; padding: 8px 0 30px; }
.landing-top .brand-logo { height: 46px; }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 980px; margin: 0 auto; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px; display: flex; flex-direction: column; }
.panel-teacher { border-top: 5px solid var(--brand-blue); }
.panel-student { border-top: 5px solid var(--brand-amber); }
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.panel-emoji { font-size: 34px; line-height: 1; }
.panel-head h2 { margin: 0; font-size: 26px; }
.panel-head .sub { margin: 3px 0 0; }
.student-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; }
.code-input { font-size: 24px; font-weight: 800; letter-spacing: 3px; text-align: center; padding: 16px; }
.btn-student { background: var(--brand-amber); color: #4a3800; font-size: 18px; padding: 15px; }
.btn-student:hover { background: #f0a91f; }
.student-note { color: var(--muted); font-size: 13px; margin: 16px 0 0; text-align: center; }

@media (max-width: 760px) {
  .panels { grid-template-columns: 1fr; max-width: 460px; }
  .landing { padding: 20px 16px 32px; }
  .panel { min-width: 0; padding: 26px 20px; }
  .gbtn { max-width: 100%; overflow: hidden; }
}

/* ---------- nástěnka učitele ---------- */
.dash { max-width: 1080px; margin: 0 auto; padding: 0 24px 60px; }
.dash-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; max-width: 1080px; margin: 0 auto;
}
.dash-bar .right { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.dash h1 { font-size: 34px; margin: 12px 0 4px; }
.dash .sub { color: var(--muted); margin: 0 0 24px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; }
.dash-tools { display: flex; gap: 12px; align-items: stretch; margin: 4px 0 26px; flex-wrap: wrap; }
.dash-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; flex: 1; min-width: 240px; max-width: 480px; color: var(--muted); }
.dash-search:focus-within { border-color: var(--blue); color: var(--blue); }
.search-input { flex: 1; min-width: 0; border: none; background: none; outline: none; padding: 13px 0; font: inherit; font-size: 15px; color: var(--ink); }
.fav-filter { display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.fav-filter svg { color: var(--brand-amber); }
.fav-filter:hover { border-color: var(--brand-amber); }
.fav-filter.on { background: #fff7e6; border-color: var(--brand-amber); color: #92600a; }
.fav-filter.on svg { fill: var(--brand-amber); }
/* hvězdička oblíbené na kartě */
.icon-btn.fav svg { color: var(--muted); }
.icon-btn.fav:hover svg { color: var(--brand-amber); }
.icon-btn.fav.on { border-color: var(--brand-amber); }
.icon-btn.fav.on svg { color: var(--brand-amber); fill: var(--brand-amber); }
.qcount { background: #f59e0b; color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 7px; }

/* vlaječka „problémová" v editoru */
.problem-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 10px; padding: 9px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.problem-toggle:hover { border-color: #f59e0b; }
.problem-toggle.on { background: #fff3e0; border-color: #f59e0b; color: #92600a; }
/* kopírování kvadrantu mezi sadami */
.quad-clip { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.quad-clip .btn-ghost { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.quad-clip .btn-ghost svg { width: 16px; height: 16px; }
.quad-clip .paste { border-color: var(--blue); color: var(--blue); font-weight: 700; }

/* vlaječka na tabuli (jen učitel) */
.quad-flag { position: absolute; top: 16px; right: 110px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.85); font-size: 18px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 6; }
.quad-flag:hover { border-color: #f59e0b; }
.quad-flag.on { background: #f59e0b; border-color: #f59e0b; }

/* boční panel se všemi otázkami */
.qpanel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 70; }
.qpanel-overlay.show { opacity: 1; pointer-events: auto; }
.qpanel { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--surface); box-shadow: -10px 0 40px rgba(0,0,0,.15); transform: translateX(105%); transition: transform .25s; z-index: 71; display: flex; flex-direction: column; padding: 22px; overflow-y: auto; }
.qpanel.open { transform: translateX(0); }
.qpanel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.qpanel-head h3 { margin: 0; font-size: 21px; }
.qpf { margin-bottom: 14px; align-self: flex-start; }
.qrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 11px 13px; margin-bottom: 8px; font: inherit; cursor: pointer; }
.qrow:hover { border-color: var(--blue); }
.qrow.problem { border-color: #f59e0b; background: #fff8ee; }
.qrow-flag { color: #f59e0b; flex: none; font-size: 16px; }
.qrow-text { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow-set { flex: none; max-width: 40%; font-size: 12px; color: var(--muted); background: var(--page); padding: 3px 9px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* uvítací okno */
.welcome-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.5); display: none; align-items: flex-start; justify-content: center; z-index: 90; padding: 40px 16px; overflow-y: auto; }
.welcome-overlay.show { display: flex; }
.welcome-modal { position: relative; background: var(--surface); border-radius: 22px; max-width: 640px; width: 100%; padding: 36px 40px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.welcome-close { position: absolute; top: 16px; right: 16px; }
.welcome-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.welcome-logo img { width: 56px; height: 56px; }
.welcome-content h2 { text-align: center; font-size: 28px; margin: 6px 0 14px; }
.welcome-content h3 { font-size: 17px; margin: 22px 0 8px; color: var(--blue-dark); }
.welcome-content p { margin: 0 0 10px; line-height: 1.55; color: var(--ink); }
.welcome-lead { font-size: 16px; }
.welcome-content ul, .welcome-content ol { margin: 0 0 10px; padding-left: 22px; line-height: 1.6; }
.welcome-content li { margin-bottom: 5px; }
.welcome-end { margin-top: 18px; background: var(--page); border-radius: 12px; padding: 14px 16px; }
.welcome-tip { color: var(--muted); font-size: 14px; }
.welcome-foot { margin-top: 20px; display: flex; justify-content: center; }
.welcome-foot .btn { padding: 13px 28px; font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.set-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.set-top .set-dots { margin-bottom: 0; }
/* mini náhled otázek v pravém horním rohu karty */
.set-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 210px; flex: none; }
.pv-cell { position: relative; height: 50px; padding: 6px 9px; border-radius: 7px; background: var(--page); border-left: 4px solid var(--line); font-size: 12px; line-height: 1.3; color: var(--ink); overflow: hidden; }
.pv-cell .pv-txt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pv-cell[data-full] { cursor: help; }
.pv-cell[data-full]:hover { overflow: visible; z-index: 20; }
.pv-cell[data-full]:hover::after {
  content: attr(data-full); position: absolute; top: -4px; left: -4px;
  width: max-content; min-width: 100%; max-width: 230px;
  background: var(--ink); color: #fff; padding: 8px 11px; border-radius: 9px;
  font-size: 12px; font-weight: 500; line-height: 1.35; white-space: normal; overflow-wrap: anywhere;
  box-shadow: 0 10px 26px rgba(0,0,0,.22); z-index: 20;
}
.pv0 { border-left-color: var(--brand-blue); }
.pv1 { border-left-color: var(--brand-amber); }
.pv2 { border-left-color: var(--brand-rose); }
.pv3 { border-left-color: var(--brand-emerald); }
.pv-empty { color: #c7cdd6; }
.set-dots { display: grid; grid-template-columns: 12px 12px; gap: 5px; margin-bottom: 16px; }
.set-dots i { width: 12px; height: 12px; border-radius: 4px; display: block; }
.set-card h3 { margin: 0 0 4px; font-size: 19px; }
.set-name { cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border-radius: 7px; }
.set-name .rename-pen { opacity: 0; color: var(--muted); display: inline-flex; transition: opacity .12s; }
.set-name:hover { color: var(--blue); }
.set-name:hover .rename-pen { opacity: 1; color: var(--blue); }
.rename-input { font: inherit; font-size: 19px; font-weight: 700; color: var(--ink); width: 100%; border: 1px solid var(--blue); border-radius: 8px; padding: 2px 8px; outline: none; background: var(--surface); }
.set-card .code { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.set-card .code b { color: var(--ink); letter-spacing: 1px; }
.set-actions { display: flex; gap: 8px; align-items: center; }
.set-actions .btn-ghost { flex: 1; text-align: center; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px; text-align: center; color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 50;
}

/* skupiny sad */
.set-group { margin-bottom: 30px; }
.group-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 14px; }
.group-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--line); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }

/* kontextové menu na kartě sady */
.card-menu { position: absolute; z-index: 60; width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.15); padding: 6px; }
.card-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.card-menu button:hover { background: var(--page); }
.card-menu button svg { color: var(--muted); flex: none; }
.card-menu button.danger, .card-menu button.danger svg { color: #b4453a; }
.card-menu .menu-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 9px 10px 4px; }
.card-menu .menu-line { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- editor ---------- */
.editor-meta { display: flex; gap: 16px; flex-wrap: wrap; max-width: 680px; margin-bottom: 18px; }
.editor { max-width: 1080px; margin: 0 auto; padding: 24px; }
.editor-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.editor h1 { font-size: 24px; margin: 0; }
.quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.quad-edit {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 3px solid var(--qcolor, var(--brand-blue));
  padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 13px;
}
.quad-edit:nth-child(1) { --qcolor: var(--brand-blue); }
.quad-edit:nth-child(2) { --qcolor: var(--brand-amber); }
.quad-edit:nth-child(3) { --qcolor: var(--brand-rose); }
.quad-edit:nth-child(4) { --qcolor: var(--brand-emerald); }
/* hlavička karty: barevná tečka + číslo + nenápadný nadpis */
.qe-head { display: flex; align-items: center; gap: 10px; }
.qe-dot { width: 13px; height: 13px; border-radius: 4px; background: var(--qcolor); flex: none; }
.qe-num { font-size: 12.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.qe-title {
  flex: 1; min-width: 0; border: none; background: transparent; font: inherit; font-size: 14px;
  color: var(--ink); padding: 4px 2px; border-bottom: 1px dashed transparent; outline: none;
}
.qe-title::placeholder { color: var(--muted); }
.qe-title:hover { border-bottom-color: var(--line); }
.qe-title:focus { border-bottom-color: var(--qcolor); }
.qe-field { display: flex; flex-direction: column; }
.type-extras { display: flex; flex-direction: column; gap: 8px; }
.type-extras:empty { display: none; }
.type-extras .fld { margin-bottom: 0; }
/* patička karty: obrázek + sekundární akce, oddělené linkou */
.qe-meta { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 13px; display: flex; flex-direction: column; gap: 12px; }
.qe-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qe-actions-right { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.qe-meta .btn-ghost, .qe-meta .problem-toggle { font-size: 13px; padding: 8px 12px; }
.opt-row { display: flex; align-items: center; gap: 9px; }
.opt-row .lt { width: 16px; font-weight: 700; color: var(--muted); }
.editor-foot { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- žákovská tabule ---------- */
.board-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.board-top .back { background: none; border: none; color: var(--ink); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.board-top .title { font-weight: 700; font-size: 17px; }
.board-top .code { color: var(--muted); font-size: 14px; letter-spacing: 1px; }
.board {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  height: calc(100vh - 53px); background: var(--surface);
}
.quad {
  position: relative; padding: 22px 26px; display: flex; flex-direction: column;
  transition: background .2s; overflow: hidden; min-height: 0;
}
.quad.q0 { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quad.q1 { border-bottom: 1px solid var(--line); }
.quad.q2 { border-right: 1px solid var(--line); }
/* jemný brand proužek nahoře – barvy dle ikonky (modrá/žlutá/růžová/zelená) */
.quad.q0 { box-shadow: inset 0 4px 0 var(--brand-blue); }
.quad.q1 { box-shadow: inset 0 4px 0 var(--brand-amber); }
.quad.q2 { box-shadow: inset 0 4px 0 var(--brand-rose); }
.quad.q3 { box-shadow: inset 0 4px 0 var(--brand-emerald); }
.quad.correct { background: var(--correct-bg); }
.quad.wrong { background: var(--wrong-bg); }
.quad-label { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.quad-title { font-size: 15px; font-weight: 700; margin: 2px 0 0; }
.quad-question { font-size: clamp(30px, 3.4vw, 60px); font-weight: 800; margin: 12px 0 0; line-height: 1.2; overflow-wrap: anywhere; }
.quad-question.empty { color: #c7cdd6; }
.quad.correct .quad-label, .quad.correct .quad-title, .quad.correct .quad-question { color: var(--correct-text); }
.quad.wrong .quad-label, .quad.wrong .quad-title, .quad.wrong .quad-question { color: var(--wrong-text); }
.quad-answer { margin-top: auto; }
/* obrázek v kvadrantu (žákovská tabule) – pružně vyplní volné místo mezi otázkou a odpovědí, nikdy nezvětší kvadrant */
.quad-img { flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; object-position: left center; border-radius: 10px; margin: 10px 0; }
/* náhled obrázku v editoru */
.quad-image-preview { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.quad-image-preview img { max-height: 140px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.marks { position: absolute; top: 16px; right: 18px; display: flex; gap: 8px; }
.mark {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.7); color: var(--muted); font-size: 17px; display: inline-flex;
  align-items: center; justify-content: center;
}
.mark.check.on { background: var(--correct-text); color: #fff; border-color: var(--correct-text); }
.mark.cross.on { background: var(--wrong-text); color: #fff; border-color: var(--wrong-text); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 14px; padding: 12px 16px; font-size: 16px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.choice.sel { border-color: var(--blue); background: var(--sel-bg); color: var(--blue-dark); box-shadow: 0 2px 8px rgba(37,99,235,.14); }
.choice .lt {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 9px; background: #eef1f6;
  color: var(--muted); font-size: 14px; font-weight: 800;
}
.choice.sel .lt { background: var(--blue); color: #fff; }
.choice .opt-text { min-width: 0; overflow-wrap: anywhere; }

/* typ „co nepatří" (odd) */
.odd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.odd-why { margin-top: 12px; min-height: 46px; font-size: 16px; }
.odd-reason { display: block; margin-top: 14px; font-size: clamp(16px, 2.6vh, 28px); font-weight: 600; opacity: .92; }
/* u „co nepatří"/přiřazování/řazení je v kvadrantu víc obsahu → menší zadání */
.quad:has(.odd-grid) .quad-question,
.quad:has(.match-two) .quad-question,
.quad:has(.order-grid) .quad-question,
.quad:has(.ana-blanks) .quad-question { font-size: clamp(22px, 2.6vw, 36px); margin-bottom: 14px; }

/* přesmyčka (anagram) */
.ana-blanks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 22px; }
.ana-blank { min-width: 46px; height: 58px; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }
.ana-blank.empty { color: #c7cdd6; border-bottom: 4px solid var(--line); border-radius: 2px; }
.ana-blank.filled { background: var(--sel-bg); color: var(--blue-dark); border: 2px solid var(--blue); border-radius: 11px; cursor: pointer; }
.ana-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ana-tile { min-width: 46px; height: 54px; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; border: 1px solid var(--line); background: var(--page); color: var(--ink); border-radius: 11px; cursor: pointer; }
.ana-tile:hover { background: var(--surface); border-color: var(--blue); }
.ana-tile.used { visibility: hidden; }
.ana-word { letter-spacing: 6px; }

/* přiřazování (match) */
.match-edit { display: flex; align-items: center; gap: 8px; }
.match-arrow { color: var(--muted); font-weight: 700; }
/* zadání správné odpovědi v editoru */
.opt-row .txt { flex: 1 1 auto; min-width: 0; }
.correct-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.correct-check input { width: 16px; height: 16px; accent-color: var(--brand-emerald); }
.yn-pick-row { display: flex; gap: 10px; }
.yn-pick { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; padding: 10px 22px; font-size: 15px; font-weight: 700; cursor: pointer; }
.yn-pick.on { border-color: var(--brand-emerald); background: #e7f8ef; color: var(--correct-text); }
/* přiřazování – dva viditelné sloupce (vlevo položky + políčko na písmeno, vpravo protějšky) */
.match-two { display: flex; gap: 20px; align-items: flex-start; }
.match-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.match-row { display: flex; align-items: center; gap: 10px; }
.match-left { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.match-letter { width: 48px; height: 46px; flex: none; text-align: center; font-size: 20px; font-weight: 800; text-transform: uppercase; border: 2px dashed var(--line); border-radius: 10px; outline: none; background: var(--page); color: var(--blue-dark); }
.match-letter:focus { border-style: solid; border-color: var(--blue); background: var(--surface); }
.match-opt { font-size: 16px; font-weight: 600; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.match-opt b { color: var(--blue); margin-right: 4px; }

/* tisk pracovního listu (Cmd+P) – schovat ovládací prvky */
@media print {
  .board-btns, .marks, .board-top .back, .board-top .code { display: none !important; }
  .board { height: auto !important; }
  .quad { box-shadow: none !important; border: 1px solid #bbb !important; break-inside: avoid; }
}

/* řazení (order) */
.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.order-item { display: flex; align-items: center; gap: 11px; text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.order-item.sel { border-color: var(--blue); background: var(--sel-bg); color: var(--blue-dark); }
.order-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; font-weight: 800; flex: none; }
.order-num:empty { display: none; }
.yesno { display: flex; gap: 12px; }
.yn {
  flex: 1; border: 1px solid var(--line); background: var(--page); color: var(--ink);
  border-radius: 12px; padding: 18px 0; font-size: 18px; font-weight: 700;
}
.yn.sel { border-color: var(--blue); background: var(--sel-bg); color: var(--blue-dark); }
.free-input {
  width: 100%; border: 1px solid var(--line); background: var(--page); border-radius: 12px;
  padding: 14px 16px; font-size: 17px; color: var(--ink); outline: none; min-height: 56px; resize: none;
}
.free-input:focus { border-color: var(--blue); background: var(--surface); }

/* doplňovačka (typ „fill") */
.fill-hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.quad-fill { line-height: 1.5; }
.fill-input {
  display: inline-block; min-width: 2.4em; max-width: 100%;
  font: inherit; color: var(--blue-dark); text-align: center;
  border: none; border-bottom: 3px solid var(--blue); background: rgba(59,130,246,.10);
  border-radius: 7px 7px 0 0; padding: 0 .3em; margin: 0 .12em; outline: none; vertical-align: baseline;
}
.fill-input:focus { background: rgba(59,130,246,.20); }
.fill-sentence { line-height: 1.4; }
.fill-ans { font-weight: 800; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }

.board-btns { position: fixed; right: 26px; bottom: 24px; display: flex; gap: 10px; z-index: 20; }
.show-btn {
  background: var(--ink); color: #fff;
  border: none; border-radius: 999px; padding: 15px 28px; font-size: 15px; font-weight: 700;
  letter-spacing: .5px; display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.sol-btn { background: var(--brand-emerald); color: #043b21; }
.sol-btn:hover { background: #0e9f6e; }
/* režim řešení – zelené kvadranty (jen pro učitele) */
.quad.solution { background: #eafaf1; }
.quad.solution .reveal-title, .quad.solution .ans-text, .quad.solution .ans-letter, .quad.solution .odd-reason, .quad.solution .fill-ans { color: var(--correct-text); }
/* prezentační režim po stisku UKÁZAT – velké odpovědi uprostřed kvadrantů */
.quad.reveal { align-items: center; justify-content: center; text-align: center; padding: 28px; }
.reveal-title { font-size: 16px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.quad.reveal.correct .reveal-title { color: var(--correct-text); }
.quad.reveal.wrong .reveal-title { color: var(--wrong-text); }
.reveal-answer {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 100%; flex: 1; min-height: 0; overflow: auto;
}
.reveal-answer .ans-letter { font-size: clamp(56px, 11vh, 130px); font-weight: 800; line-height: 1; }
.reveal-answer .ans-text { font-size: clamp(22px, 3.4vh, 40px); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; white-space: pre-wrap; max-width: 100%; }
.reveal-answer.empty { font-size: 22px; font-weight: 600; color: #c7cdd6; }

@media (max-width: 760px) {
  .quad-grid { grid-template-columns: 1fr; }
  /* kvadranty na výšku obsahu – žádné velké prázdné mezery, pohodlné scrollování */
  .board { grid-template-columns: 1fr; grid-template-rows: repeat(4, auto); height: auto; padding-bottom: 96px; }
  .quad { overflow: visible; min-height: 130px; border-bottom: 1px solid var(--line); }
  .quad.q0, .quad.q1, .quad.q2 { border-right: none; }
  .quad-question { font-size: clamp(26px, 6vw, 38px); }
  .quad-answer { margin-top: 18px; }
  /* na mobilu má kvadrant výšku dle obsahu, takže obrázek dostane pevný strop místo pružného vyplnění */
  .quad-img { flex: none; max-height: 34vh; }
  .match-two { gap: 12px; }
}

@media (max-width: 560px) {
  /* dlouhý e-mail v hlavičce ať nerozhodí tlačítka */
  .dash-bar .right > span { max-width: 36vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .welcome-modal { padding: 26px 20px; }
  .welcome-content h2 { font-size: 24px; }
  .welcome-content h3 { font-size: 16px; }
}

/* ---------- tisk / pracovní list (#/print/:id) ---------- */
.print-wrap { max-width: 920px; margin: 0 auto; padding: 16px 20px 70px; }
.print-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; position: sticky; top: 0; background: var(--page); padding: 10px 0; z-index: 5; }
.print-bar .btn { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.print-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.print-toggle input { width: 17px; height: 17px; accent-color: var(--blue); }

.sheet { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 12px; padding: 28px 30px; box-shadow: 0 6px 24px rgba(15,23,42,.08); }
.sheet-head { border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 18px; }
.sheet-head h1 { font-size: 23px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.key-tag { font-size: 12px; font-weight: 800; letter-spacing: 1px; border: 1.5px solid #111; border-radius: 6px; padding: 2px 7px; }
.sheet-fields { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; }
.sheet-fields .line { display: inline-block; border-bottom: 1px solid #111; min-width: 170px; }
.sheet-fields .line.short { min-width: 80px; }

.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pq { border: 1px solid #111; border-radius: 9px; padding: 14px 16px; display: flex; gap: 10px; break-inside: avoid; }
.pq-num { font-weight: 800; font-size: 17px; line-height: 1.2; }
.pq-body { flex: 1; min-width: 0; }
.pq-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #555; margin-bottom: 3px; }
.pq-q { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; overflow-wrap: anywhere; }
.pq-hint { font-size: 12px; color: #555; margin-bottom: 8px; }
.pq-img { max-width: 100%; max-height: 130px; object-fit: contain; display: block; margin: 0 0 10px; }
.pq-opts { display: flex; flex-direction: column; gap: 7px; }
.pq-opt { font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.pq-opt.ok { font-weight: 800; }
.pq-bub { display: inline-block; width: 17px; }
.pq-yn { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.pq-yn .circ { border: 2px solid #111; border-radius: 999px; padding: 1px 13px; }
.pq-yn .sep { font-weight: 400; color: #888; }
.blank-inline { display: inline-block; min-width: 92px; border-bottom: 1px solid #111; text-decoration: none; }
.fill-key { font-weight: 800; text-decoration: none; border-bottom: 1px solid #111; padding: 0 2px; }
.pq-line { margin-top: 10px; font-size: 14px; }
.pq-line .line { display: inline-block; border-bottom: 1px solid #111; min-width: 130px; }
.pq-key { margin-top: 10px; font-size: 14px; font-weight: 700; padding: 7px 9px; border: 1px dashed #111; border-radius: 6px; }
.pq-match { display: flex; gap: 16px; }
.pq-mcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pq-mrow { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 14px; }
.pq-ml { min-width: 0; overflow-wrap: anywhere; }
.pq-mbox { width: 27px; height: 25px; border: 1px solid #111; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.pq-mopt { font-size: 14px; overflow-wrap: anywhere; }
.pq-orow { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.pq-anag { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 4px; }
.pq-tiles, .pq-boxes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pq-tile { width: 31px; height: 36px; border: 1px solid #111; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.pq-letterbox { width: 31px; height: 36px; border: 1px solid #111; border-bottom-width: 3px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.pq-writelines { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.wline { border-bottom: 1px solid #111; height: 0; }

/* dvě kopie na jednu stránku (na rozstřižení) */
.cut-line { border-top: 2px dashed #b3b9c2; margin: 22px 0; text-align: center; }
.cut-line span { display: inline-block; transform: translateY(-50%); background: var(--page); color: #8a909b; font-size: 12px; font-weight: 600; padding: 0 12px; letter-spacing: .3px; }

@media print {
  body { background: #fff !important; }
  .print-bar { display: none !important; }
  .print-wrap { max-width: none; padding: 0; }
  .sheet { border: none; box-shadow: none; border-radius: 0; padding: 0; }
  .pq { break-inside: avoid; }
  .copy { break-inside: avoid; }
  .cut-line { margin: 0; }
  .cut-line span { background: #fff; }
  /* 2× na stránku: první kopie zabere horní půlku, linka řezu padne doprostřed A4 */
  .print-page.two-up .copy:first-child { min-height: 128mm; }
  @page { size: A4 portrait; margin: 13mm; }
}
