.mat {
  overflow-y: auto;
  padding: 22px 16px 18px;
  background: radial-gradient(circle at 50% -10%, #16304a 0%, var(--bg) 55%);
  scrollbar-width: none;
}
.mat::-webkit-scrollbar { display: none; }

.mat-head { text-align: center; margin-bottom: 18px; }
.mat-head .ico { font-size: 34px; }
.mat-head h1 { margin: 6px 0 4px; font-size: 26px; }
.mat-head p { margin: 0; color: #c9c9d8; font-size: 14px; line-height: 1.4; }

.list { display: flex; flex-direction: column; gap: 12px; }
.empty { text-align: center; color: var(--dim); font-size: 14px; }

.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.item-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.kind, .badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
}
.kind { background: rgba(0, 194, 255, .14); color: #6fd8ff; }
.badge { background: rgba(255, 46, 136, .14); color: #ff7ab3; }
.item h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.item p { margin: 0 0 10px; font-size: 13px; color: #b5b5c8; line-height: 1.4; }
.item .meta { font-size: 12px; color: var(--dim); margin-bottom: 12px; }

.actions { display: flex; gap: 8px; }
.actions a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 14px; font-weight: 700;
  padding: 10px 12px; border-radius: 12px;
}
.actions .open { background: #fff; color: #111; }
.actions .download { background: #242433; color: #fff; border: 1px solid #33334a; }

.back {
  display: inline-block;
  margin-bottom: 8px;
  color: #c9c9d8;
  font-size: 14px;
  text-decoration: none;
}
.back:hover { color: #fff; }

/* Light theme (default; dark when chosen in the player) */
:root[data-theme="light"] { color-scheme: light; --bg: #fff; --card: #f6f6f8; --line: #e6e6ea; --dim: #6b6b74; }
:root[data-theme="light"] body { background: #fff; color: #161823; }
:root[data-theme="light"] .mat { background: radial-gradient(circle at 50% -10%, #e6f0ff 0%, #fff 55%); }
:root[data-theme="light"] .mat-head p, :root[data-theme="light"] .item p { color: #4a4d57; }
:root[data-theme="light"] .actions .open { background: #161823; color: #fff; }
:root[data-theme="light"] .actions .download { background: #fff; color: #161823; border-color: #d9d9de; }
:root[data-theme="light"] .back { color: #4a4d57; }
:root[data-theme="light"] .back:hover { color: #161823; }
:root[data-theme="light"] .kind { color: #06739c; background: rgba(0, 150, 210, 0.12); }
:root[data-theme="light"] .badge { color: #c41d55; background: rgba(254, 44, 85, 0.1); }

/* ---- Teacher page: wider than the phone column, for a laptop or projector ---- */
body[data-page="materialy"] .app { width: min(100%, 760px); }
:root { --accent: #6fd8ff; --strong: #fff; --input: #0f0f17; --danger: #ff6b81; --ok: #30d158; }
:root[data-theme="light"] { --accent: #06739c; --strong: #161823; --input: #fff; --danger: #d61f45; --ok: #1a8a3a; }

.section-title { margin: 22px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.hidden { display: none !important; }

/* ---- Moje třída (ucitel.js) ---- */
.trida {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.trida h2 { margin: 0 0 8px; font-size: 18px; }
.trida .hint { margin: 0 0 10px; font-size: 13px; color: var(--dim); line-height: 1.4; }
.trida .hint.center { text-align: center; }
.link-text { color: var(--accent); font-weight: 600; word-break: break-all; }

.trida button, .trida input { font: inherit; }
.trida button {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.trida button:disabled { opacity: .45; cursor: default; }
.trida button.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.trida button.danger { color: var(--danger); }
.trida button.danger.confirm { background: var(--danger); border-color: var(--danger); color: #fff; }

.trida-form { display: flex; gap: 8px; }
.trida-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input);
  color: inherit;
  font-size: 14px;
}
.trida-form input:focus { outline: none; border-color: var(--accent); }

.trida-meta { margin: 0 0 8px; text-align: center; font-size: 14px; color: var(--dim); }
.trida-meta strong { color: var(--strong); }
#tridaOpen { color: var(--ok); }
#tridaOpen.closed { color: var(--danger); }

/* Big enough to read from the back of the classroom */
.big-code {
  margin: 0 0 10px;
  padding: 14px 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--input);
  text-align: center;
  font-size: clamp(36px, 10vw, 64px);
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--accent);
  user-select: all;
}

.trida-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
@media (max-width: 560px) { .trida-actions { grid-template-columns: 1fr 1fr; } }

.trida-msg { margin: 10px 0 0; font-size: 13px; color: var(--dim); word-break: break-all; }
.trida-msg:empty { display: none; }
.trida-msg.err { color: var(--danger); }
.trida-msg.ok { color: var(--ok); }

/* Live stats */
.trida-stats { margin-top: 6px; }
.trida-stats .students { display: flex; gap: 8px; margin-bottom: 12px; }
.trida-stats .students div {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input);
}
.trida-stats .students b { display: block; font-size: 26px; }
.trida-stats .students span { font-size: 12px; color: var(--dim); }
.trida-stats h3 { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.decision { margin-bottom: 14px; }
.decision .dtitle { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.decision .dtitle span { font-weight: 400; font-size: 12px; color: var(--dim); white-space: nowrap; }
.opt { margin: 4px 0; font-size: 13px; }
.opt .olabel { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); }
.opt .olabel b { color: var(--strong); font-weight: 700; }
.opt .obar { height: 8px; margin-top: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.opt .obar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #25f4ee, var(--pink)); transition: width .5s; }
.note, .stats-empty { font-size: 13px; font-style: italic; color: var(--dim); }
.endings-stats { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.endings-stats li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.updated { margin-top: 10px; font-size: 11px; color: var(--dim); }
