/* Unterlagen GE 24-10-1 – Kittelblau & Pflasterrot · Schrift: Lexend (für gute Lesbarkeit entwickelt) */
@font-face { font-family: "Lexend"; src: url("/static/fonts/lexend.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F3F6F9; --card: #FFFFFF; --ink: #17242F; --muted: #5E6E7B; --line: #DCE4EB;
  --brand: #1F5F8B; --brand-ink: #FFFFFF; --soft: #E3EEF7; --signal: #E2574C;
  --ad3: #2C7A68; --ad3-soft: #E0F1EC;
  --warn: #A3511A; --warn-bg: #FCEFE4; --danger: #B42318;
  --radius: 14px; --radius-s: 8px;
  --shadow: 0 1px 2px rgba(23, 36, 47, .06), 0 4px 14px rgba(23, 36, 47, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] {
  --bg: #0F1820; --card: #16222C; --ink: #E6EDF2; --muted: #93A4B1; --line: #263644;
  --brand: #7DB6E3; --brand-ink: #0B1A26; --soft: #1A3043; --signal: #F07A6F;
  --ad3: #6FC7B1; --ad3-soft: #173530; --warn: #F0A46B; --warn-bg: #33241A; --danger: #FF8A7A;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark; } }
:root[data-theme="dunkel"] {
  --bg: #0F1820; --card: #16222C; --ink: #E6EDF2; --muted: #93A4B1; --line: #263644;
  --brand: #7DB6E3; --brand-ink: #0B1A26; --soft: #1A3043; --signal: #F07A6F;
  --ad3: #6FC7B1; --ad3-soft: #173530; --warn: #F0A46B; --warn-bg: #33241A; --danger: #FF8A7A;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Lexend", -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
main { max-width: 1120px; margin: 0 auto; padding: 32px 20px 80px; }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: .1em 0 .35em; }
h2 { font-size: 1.2rem; font-weight: 800; margin: 1.8em 0 .7em; }
.muted { color: var(--muted); } .tiny { font-size: .86rem; } small { color: var(--muted); font-weight: 400; }
code { background: var(--soft); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Kopfzeile */
.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  padding: 10px 20px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; display: block; }
.brand small { font-weight: 700; font-size: .8rem; color: var(--muted); }
.top nav { display: flex; gap: 4px; align-items: center; }
.top nav a { color: var(--ink); font-weight: 700; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.top nav a:hover { background: var(--soft); text-decoration: none; }
.top nav a.on { color: var(--brand); background: var(--soft); }
.top nav a.btn { color: var(--brand-ink); }
.search { flex: 1; min-width: 200px; position: relative; margin: 0; }
.search input { width: 100%; padding-left: 38px; margin: 0; border-radius: 999px; background: var(--bg); }
.search::before { content: ""; position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); z-index: 1;
  background: var(--muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat; }

/* ---------- Bedienelemente */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; background: var(--brand); color: var(--brand-ink) !important;
  padding: 11px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: 7px 15px; font-size: .92rem; }
.btn.ghost { background: var(--soft); color: var(--brand) !important; }
.btn:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; font: inherit; color: var(--brand); cursor: pointer; padding: 0; font-weight: 700; }
.link:hover { text-decoration: underline; }
.danger { color: var(--danger) !important; }
.danger-btn { background: var(--danger) !important; color: #fff !important; margin: 8px 0; }

input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius-s); padding: 10px 13px; margin-top: 6px; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--soft); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 8px 0 0; accent-color: var(--brand); }
input[type=file] { padding: 18px; border-style: dashed; background: var(--bg); cursor: pointer; }
label { display: block; font-weight: 600; margin: 0 0 18px; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--radius-s); margin: 0 0 18px; padding: 10px 14px; }
legend { font-weight: 700; padding: 0 4px; }
label.chk { font-weight: 400; margin: 7px 0; display: flex; align-items: flex-start; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.narrow { max-width: 700px; margin: 0 auto; }
.alert { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-s); padding: 11px 15px; }
.alert.soft { font-size: .94rem; }
.ok { background: var(--soft); color: var(--brand); border-radius: var(--radius-s); padding: 11px 15px; font-weight: 700; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.crumb { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.row { display: flex; gap: 10px; align-items: center; } .row input { margin: 0; }

/* ---------- Login */
.login { max-width: 460px; margin: 9vh auto 0; }
.login .logo { width: 64px; height: 64px; display: block; margin-bottom: 14px; }
.login h1 { font-size: 1.7rem; }

/* ---------- Startseite */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.welcome h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0; }
.welcome p { margin: 6px 0 0; color: var(--muted); font-size: 1.05rem; }
.group-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 36px 0 12px; }
.group-h h2 { margin: 0; }
.group-h span { color: var(--muted); font-size: .92rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cecard { --c: var(--brand); --cs: var(--soft); position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 168px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px 23px; color: var(--ink);
  box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s, transform .15s; }
.cecard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.cecard.ad3 { --c: var(--ad3); --cs: var(--ad3-soft); }
.cecard:hover { border-color: var(--c); text-decoration: none; transform: translateY(-2px); }
.cenum { font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--c); letter-spacing: -.03em; }
.cenum small { font-size: .95rem; font-weight: 800; color: var(--c); margin-right: 2px; }
.cetitle { font-weight: 600; line-height: 1.32; overflow-wrap: anywhere; hyphens: auto; }
.count { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .86rem; }
.count .files { background: var(--cs); color: var(--c); font-weight: 800; padding: 1px 9px; border-radius: 999px; }
.count .files.zero { background: transparent; color: var(--muted); font-weight: 400; padding: 0; }

.ceid { display: inline-block; align-self: flex-start; font-weight: 800; color: var(--brand); background: var(--soft);
  padding: 2px 11px; border-radius: 999px; font-size: .86rem; }
.ceid.big { font-size: 1rem; }

/* ---------- CE-Seite */
.le { margin-bottom: 14px; }
.lehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lehead h2 { margin: 0; font-size: 1.08rem; }
.lehead h2 span { font-weight: 700; }

/* ---------- Dateilisten */
.docs { list-style: none; padding: 0; margin: 12px 0 0; }
.doc { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.doc::before { content: ""; grid-row: 1 / span 2; width: 30px; height: 36px; background: var(--brand); opacity: .22;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 36'%3E%3Cpath d='M4 0h15l11 11v21a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 36'%3E%3Cpath d='M4 0h15l11 11v21a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z'/%3E%3C/svg%3E") center/contain no-repeat; }
.doc .title { grid-column: 2; }
.doc .name { font-weight: 700; word-break: break-word; }
.doc .meta { grid-column: 2; color: var(--muted); font-size: .9rem; }
.doc .actions { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 16px; align-items: center; font-size: .94rem; }
.doc .actions form { margin: 0; }
.snip { color: var(--ink); }
.tag { display: inline-block; font-size: .76rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; background: var(--soft); color: var(--brand); margin-left: 6px; vertical-align: 2px; }
.tag.dup, .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.wait { background: var(--line); color: var(--muted); }
.tag.ce, .tag.ce2 { margin-left: 0; margin-right: 6px; }

/* ---------- Lernzettel */
.lzlist { list-style: none; padding: 0; }
.lzlist li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 0; border-top: 1px solid var(--line); }
.lzlist a { font-weight: 700; }
.lzlist .meta { color: var(--muted); font-size: .9rem; }
.st { font-weight: 800; } .st-fertig { color: var(--ad3); } .st-fehler { color: var(--danger); } .st-läuft, .st-wartet { color: var(--warn); }
.lz header { border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 14px; }
.lz pre { white-space: pre-wrap; font: inherit; background: var(--bg); padding: 12px; border-radius: var(--radius-s); }
.md { max-width: 72ch; line-height: 1.65; }
.md h2 { border-top: 2px solid var(--soft); padding-top: 1em; color: var(--brand); }
.md table { border-collapse: collapse; width: 100%; } .md td, .md th { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
.md blockquote { margin: 0; padding-left: 14px; border-left: 4px solid var(--signal); }
.q { display: inline-block; font-size: .72rem; font-weight: 800; color: var(--brand); background: var(--soft); border-radius: 6px; padding: 0 6px; }
.src { padding-left: 0; } .src li { margin: 5px 0; list-style: none; }
.wait-box { display: flex; gap: 18px; align-items: center; padding: 28px 0; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nutzermenü */
.usermenu { position: relative; margin-left: auto; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px;
  border-radius: 999px; border: 1.5px solid var(--line); font-weight: 700; font-size: .95rem; white-space: nowrap; background: var(--card); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { border-color: var(--brand); }
.usermenu .tag { margin-left: 0; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .9rem; font-weight: 800; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 30, 45, .18); padding: 6px; z-index: 20; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 7px; color: var(--ink);
  background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--soft); text-decoration: none; }
.usermenu .menu form { margin: 0; }
.usermenu .menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.usermenu .mlabel { display: block; padding: 6px 12px 2px; font-size: .85rem; font-weight: 800; color: var(--muted); }
.usermenu .menu form.mlogin { padding: 4px 6px 8px; }
.usermenu .menu form.mlogin input { margin: 4px 0 8px; padding: 8px 10px; }
.usermenu .menu form.mlogin button.btn { display: inline-flex; width: auto; padding: 7px 16px; color: var(--brand-ink); background: var(--brand); border-radius: 999px; }

/* ---------- Einstellungen */
.setgrid { display: grid; gap: 16px; max-width: 700px; margin: 0 auto; } .setgrid h2 { margin-top: 0; }
.codebox { font-family: ui-monospace, Menlo, monospace; font-size: 1.35rem; letter-spacing: 2px; background: var(--soft); color: var(--brand);
  padding: 10px 16px; border-radius: var(--radius-s); display: inline-block; }
.radios { display: flex; gap: 18px; flex-wrap: wrap; } .radios label { font-weight: 400; display: flex; align-items: center; gap: 6px; margin: 0; }

/* ---------- Admin */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1.5px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; font-weight: 700; }
.tabs a.on { color: var(--brand); border-color: var(--brand); text-decoration: none; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; } .stat span { color: var(--muted); font-size: .9rem; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: .86rem; color: var(--muted); }
.tbl .num { text-align: right; } .tbl tr.blocked td { opacity: .55; }
.acts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .acts form { margin: 0; }
form.inline { display: flex; gap: 8px; align-items: center; margin: 0; }
.small-in { width: 170px; padding: 6px 9px; margin: 0; }
.adoc { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.adoc details { grid-column: 1 / -1; }
.adoc summary { cursor: pointer; color: var(--brand); font-size: .92rem; font-weight: 700; }
.editf { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.editf select, .editf input { width: auto; margin: 0; padding: 7px 9px; }
.editf input[name=description] { flex: 1; min-width: 180px; }

/* ---------- Klein & Druck */
@media (max-width: 760px) {
  main { padding: 22px 16px 64px; }
  .top { padding: 10px 16px; gap: 10px 12px; }
  .top nav { order: 3; width: 100%; overflow-x: auto; }
  .search { order: 4; flex-basis: 100%; }
  .usermenu summary .uname, .brand small { display: none; }
  .usermenu { flex: none; }
  .doc { grid-template-columns: auto 1fr; } .doc .actions { grid-column: 2; grid-row: auto; }
  .tbl { font-size: .9rem; } .tbl th, .tbl td { padding: 8px 6px; } .adoc { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}
@media print {
  .top, .noprint { display: none !important; } body { background: #fff; color: #000; font-size: 12pt; }
  .card { border: 0; padding: 0; box-shadow: none; } .md { max-width: none; }
}
.head .cenum, .lz header .cenum { display: block; margin-bottom: 8px; }

.backupbox { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; border-left: 5px solid var(--ad3); }
.backupbox h2 { margin: 0 0 6px; } .backupbox p { margin: 4px 0; max-width: 60ch; }

/* ---------- Prüfung & Termine */
.row.wrap { flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; margin-top: 18px; }
.two h2:first-child { margin-top: 0; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.results li:first-child { border-top: 0; }
.card.results { padding: 4px 20px; }
.score { font-weight: 800; white-space: nowrap; } .good { color: var(--ad3); } .mid { color: var(--warn); } .low { color: var(--danger); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.mode { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); border: 2px solid var(--line); color: var(--ink); background: var(--bg); }
.mode b { font-size: 1.15rem; color: var(--brand); } .mode span { color: var(--muted); font-size: .92rem; }
.mode:hover { border-color: var(--brand); text-decoration: none; }
.mode.exam b { color: var(--signal); } .mode.exam:hover { border-color: var(--signal); }
.mode.cards b { color: var(--ad3); } .mode.cards:hover { border-color: var(--ad3); }

.play { max-width: 760px; margin: 0 auto; }
.playhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.mode-badge { font-weight: 800; font-size: .9rem; padding: 4px 12px; border-radius: 999px; background: var(--soft); color: var(--brand); }
.mode-badge.m-pruefung { background: color-mix(in srgb, var(--signal) 14%, transparent); color: var(--signal); }
.mode-badge.m-karten { background: var(--ad3-soft); color: var(--ad3); }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.1rem; } .timer.urgent { color: var(--danger); }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.qcard { margin-top: 8px; padding: 28px; }
.qtext { font-size: 1.25rem; line-height: 1.45; margin: 0 0 20px; font-weight: 600; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; font: inherit; padding: 14px 16px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color .12s; }
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt.chosen { border-color: var(--brand); background: var(--soft); font-weight: 600; }
.opt.right { border-color: var(--ad3); background: var(--ad3-soft); font-weight: 600; }
.opt.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.opt:disabled { cursor: default; color: var(--ink); }
.feedback { margin-top: 18px; padding: 16px; border-radius: 10px; background: var(--bg); border-left: 5px solid var(--ad3); }
.feedback.f-no { border-color: var(--danger); } .feedback p { margin: 6px 0 12px; }
.navrow { justify-content: space-between; margin-top: 20px; }
.qmap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; }
.qdot { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; }
.qdot.done { background: var(--soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.qdot.cur { outline: 2px solid var(--brand); outline-offset: 1px; }
.qmap .btn { margin-left: auto; }
.flash .face { min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.flash .face.back { border-top: 4px solid var(--ad3); padding-top: 14px; }
.result-head { text-align: center; padding: 10px 0 18px; }
.bigscore { font-size: 3.4rem; font-weight: 800; line-height: 1; }
.review { padding: 12px 0 12px 14px; border-left: 4px solid var(--ad3); margin: 10px 0; }
.review.r-no { border-color: var(--danger); } .review p { margin: 4px 0; }
.review .yours { color: var(--danger); } .review .correct { color: var(--ad3); font-weight: 600; }

.tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.termin { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.tests .termin { margin-bottom: 0; }
.countdown { flex: none; width: 68px; height: 68px; border-radius: 12px; background: var(--soft); color: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.countdown b { font-size: 1.5rem; line-height: 1; } .countdown span { font-size: .75rem; font-weight: 700; }
.termin.soon .countdown { background: color-mix(in srgb, var(--signal) 14%, transparent); color: var(--signal); }
.countdown b:only-child { font-size: 1rem; }
.tbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tbody .focus { font-size: .9rem; }
.tacts { margin-top: 8px; } .tacts form { margin: 0; }
.hint-card { background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 26px 0 0; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } .qcard { padding: 18px; } .qtext { font-size: 1.1rem; } .tests { grid-template-columns: 1fr; } }

.privacy-box { grid-column: 2 / -1; background: var(--warn-bg); color: var(--ink); border-radius: var(--radius-s); padding: 10px 14px; font-size: .92rem; margin: 6px 0; }
.privacy-box form { display: inline; }
.camera { background: var(--bg); border: 1.5px dashed var(--line); border-radius: var(--radius-s); padding: 12px 14px; }
.camera input { background: var(--card); }
.hint-card.gap { margin: 0 0 16px; }

/* ---------- v7: Hubs, Lernwerkzeuge, Klasse */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.tool { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); transition: border-color .15s, transform .15s; }
a.tool:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.tool .ico { font-size: 1.8rem; line-height: 1; }
.tool b { font-size: 1.1rem; color: var(--brand); } .tool > span:not(.ico) { color: var(--muted); font-size: .92rem; }
.tool form { margin: 0; } .tool .btn { align-self: flex-start; margin-top: 4px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.quick a { padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .92rem; }
.quick a:hover { border-color: var(--brand); text-decoration: none; }
.exam-banner { display: flex; gap: 18px; align-items: center; margin: 22px 0 0; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--ad3))); color: var(--brand-ink); }
.exam-banner h2 { margin: 0 0 4px; color: inherit; } .exam-banner p { margin: 0 0 4px; opacity: .9; } .exam-banner a { color: inherit; text-decoration: underline; }
.exam-days { flex: none; width: 84px; height: 84px; border-radius: 16px; background: rgba(255,255,255,.18); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.exam-days b { font-size: 2rem; line-height: 1; } .exam-days span { font-size: .8rem; font-weight: 700; }
.mini-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }

/* Rechnen */
.calc-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { font: inherit; font-size: .86rem; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.calc-task { font-size: 1.15rem; line-height: 1.5; font-weight: 600; min-height: 4.5em; margin-bottom: 14px; }
#answer input { max-width: 200px; font-size: 1.1rem; } .unit { font-weight: 700; color: var(--muted); }
pre.way { white-space: pre-wrap; font: inherit; background: var(--card); padding: 10px 12px; border-radius: var(--radius-s); margin: 10px 0 12px; }
.tips { padding-left: 18px; font-size: .92rem; } .tips li { margin: 6px 0; }

/* Fortschritt */
.next-up { border-left: 5px solid var(--signal); margin: 20px 0; }
.next-up h2 { margin-top: 0; } .next-up li { align-items: center; }
.bars { padding: 14px 20px; }
.barrow { display: grid; grid-template-columns: 150px 1fr 110px; gap: 12px; align-items: center; padding: 6px 0; font-size: .92rem; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; } .fill.good { background: var(--ad3); } .fill.mid { background: var(--warn); } .fill.low { background: var(--danger); }
.bv { text-align: right; font-weight: 700; }

/* Lernplan */
.plan { list-style: none; padding: 0; display: grid; gap: 10px; }
.pday { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.pday.done { opacity: .6; } .pday.done b { text-decoration: line-through; }
.pday ul { margin: 8px 0 0; padding-left: 26px; } .pday li { margin: 6px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pcheck { margin: 0; display: flex; align-items: center; font-weight: 700; }

/* Fragen an die Klasse */
.filter { margin-bottom: 12px; } .filter select { width: auto; margin: 0; } .filter .chk { margin: 0; }
.qitem { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; color: var(--ink); padding: 16px 18px; }
.qitem:hover { border-color: var(--brand); text-decoration: none; } .qitem.solved { opacity: .7; }
.good-tag { background: var(--ad3-soft); color: var(--ad3); }
.prewrap { white-space: pre-wrap; } .answer { margin-bottom: 10px; padding: 16px 20px; }

/* Fall, mündlich, frag */
.case { border-left: 5px solid var(--brand); margin-bottom: 18px; }
.planform { margin-bottom: 18px; }
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; } .msg p { margin: 2px 0 0; white-space: pre-wrap; }
.msg .who { font-size: .78rem; font-weight: 700; color: var(--muted); }
.msg.them { background: var(--soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--bg); border: 1px solid var(--line); align-self: flex-end; border-bottom-right-radius: 4px; }
.chatform { margin-top: 12px; } .chatform textarea { margin-bottom: 8px; } .endform { margin-top: 10px; }
.askform select { margin: 0; }

/* Challenge */
.challenge-card h2 { margin: 8px 0 12px; }
.ranking { list-style: none; padding: 0; margin: 0; }
.ranking li { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.ranking li:first-child { border-top: 0; } .ranking li.me { font-weight: 700; color: var(--brand); }
.place { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.ranking li:nth-child(1) .place { background: #F5C451; color: #4A3500; }

/* Live-Mitschrift */
.notes { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.notes .mine textarea { font-size: 1rem; line-height: 1.55; min-height: 50vh; }
.others { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }
.other { padding: 12px 16px; } .other p { margin: 4px 0 0; font-size: .92rem; }
.publish { margin-top: 18px; }
@media (max-width: 760px) { .notes { grid-template-columns: 1fr; } .barrow { grid-template-columns: 90px 1fr 70px; } .exam-banner { flex-direction: column; align-items: flex-start; } }

/* ---- Admin v8: Aktivität, Diagramme, zuletzt da ---- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); margin-right: 7px; vertical-align: 1px; }
.dot.on { background: #2EB67D; box-shadow: 0 0 0 3px rgba(46, 182, 125, .2); }
.stat.live b { color: #2EB67D; }
.stat b.smallb { font-size: 1rem; word-break: break-all; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 18px; }
.bars .bc { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; position: relative; }
.bars .bc i { display: block; width: 100%; max-width: 34px; background: var(--brand); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bars.alt .bc i { background: var(--ad3); }
.bars.alt2 .bc i { background: var(--signal); }
.bars .bv { font-size: .72rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; white-space: nowrap; }
.bars .bl { font-size: .68rem; color: var(--muted); text-align: center; line-height: 1.15; margin-top: 4px; height: 2.3em; }
.bars.dense { gap: 2px; } .bars.dense .bv { display: none; }
.bars.hours { height: 110px; gap: 2px; } .bars.hours .bl { height: 1.2em; }
.seen { list-style: none; margin: 0; padding: 0; }
.seen li { display: flex; align-items: center; gap: 4px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.seen li:last-child { border: 0; } .seen li a { flex: 1; font-weight: 700; }
.events { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow: auto; }
.events li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.events .ev-d { flex: 1; min-width: 140px; color: var(--muted); overflow-wrap: anywhere; }
.events .ev-t { white-space: nowrap; }
.ev-k { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--brand); white-space: nowrap; }
.ev-upload, .ev-mitschrift { background: var(--ad3-soft); color: var(--ad3); }
.ev-gelöscht, .ev-admin-login, .ev-admin { background: var(--warn-bg); color: var(--warn); }
.userhead { display: flex; gap: 16px; align-items: center; }
.userhead h2 { margin: 0 0 4px; }
.avatar.big { width: 56px; height: 56px; font-size: 1.5rem; flex: none; }
.tblwrap { overflow-x: auto; }
.tbl.users td { white-space: nowrap; }
.tag.ok { background: var(--ad3-soft); color: var(--ad3); }
.announce { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; border: 1.5px solid; }
.announce p { margin: 0; white-space: pre-line; font-weight: 600; }
.announce span { font-size: 1.3rem; line-height: 1.2; }
.a-info { background: var(--soft); border-color: var(--brand); }
.a-wichtig { background: var(--warn-bg); border-color: var(--warn); }
.a-erfolg { background: var(--ad3-soft); border-color: var(--ad3); }
@media (max-width: 640px) { .bars .bv { display: none; } .bars { height: 120px; } }

/* ---- v9: Wiederholen, Begriffe, Medikamente, Mindmap, Duell ---- */
:root { --mm0: #1F5F8B; --mm1: #2C7A68; --mm2: #C2410C; --mm3: #7C3AED; --mm4: #B42318; --mm5: #A16207; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --mm0: #7DB6E3; --mm1: #6FC7B1; --mm2: #F0A46B; --mm3: #B79CF5; --mm4: #FF8A7A; --mm5: #E5C15A; } }
:root[data-theme="dunkel"] { --mm0: #7DB6E3; --mm1: #6FC7B1; --mm2: #F0A46B; --mm3: #B79CF5; --mm4: #FF8A7A; --mm5: #E5C15A; }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--signal); color: #fff; font-size: .72rem; font-weight: 800; vertical-align: 2px; }
.tool.hot { border-color: var(--signal); }
.quick a.hotq { background: var(--signal); border-color: var(--signal); color: #fff; }
a.announce { color: var(--ink); text-decoration: none; }
.duel-note { margin-top: 0; }
.empty-state { text-align: center; padding: 34px 20px; }
.empty-state .results { max-width: 320px; margin: 0 auto 16px; text-align: left; }
.stack { display: grid; gap: 12px; margin-top: 12px; }
form.inline { display: inline; }
/* Lexikon */
.gl-filter { margin-top: 16px; } .gl-collect { margin: 12px 0; align-items: center; }
.abc { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 4px; position: sticky; top: 64px; background: var(--bg); padding: 6px 0; z-index: 2; }
.abc a { min-width: 30px; text-align: center; padding: 4px 6px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.abc-h { margin: 22px 0 8px; color: var(--brand); scroll-margin-top: 120px; }
.gloss { margin: 0; display: grid; gap: 8px; }
.gitem { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 16px; }
.gitem dt { font-weight: 800; font-size: 1.05rem; } .gitem dt .tag { margin-left: 6px; vertical-align: 2px; }
.gitem dd { margin: 4px 0 0; } .gsrc { display: block; margin-top: 4px; }
/* Medikamente */
.drug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.drugcard { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }
.drugcard:hover { border-color: var(--brand); text-decoration: none; } .drugcard .pill { font-size: 1.3rem; }
.drugcard.st-fehler { opacity: .6; } .drugcard.st-wartet, .drugcard.st-läuft { border-style: dashed; }
.merke { background: var(--soft); border-left: 4px solid var(--brand); padding: 12px 16px; border-radius: var(--radius-s); margin: 14px 0; }
.drug-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.dsec { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 16px; }
.dsec h3 { margin: 0 0 6px; font-size: 1rem; color: var(--brand); } .dsec ul { margin: 0; padding-left: 18px; } .dsec p { margin: 0; }
.dsec.empty { opacity: .65; border-style: dashed; }
.ds-nebenwirkungen h3, .ds-kontraindikationen h3 { color: var(--danger); } .ds-pflege { background: var(--ad3-soft); } .ds-pflege h3 { color: var(--ad3); }
/* Mindmap */
.cecard.dim { opacity: .55; }
.mm-wrap { overflow-x: auto; padding: 24px 16px; margin-top: 14px; }
.mm-tree, .mm-tree ul { list-style: none; margin: 0; padding: 0; }
.mm-tree li { display: flex; align-items: center; position: relative; padding: 5px 0 5px 26px; }
.mm-tree > li { padding-left: 0; }
.mm-tree ul { display: flex; flex-direction: column; position: relative; margin-left: 22px; }
.mm-tree ul::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; border-top: 2px solid var(--c, var(--line)); }
.mm-tree ul > li::before { content: ""; position: absolute; left: 0; top: 50%; width: 26px; border-top: 2px solid var(--c, var(--line)); }
.mm-tree ul > li::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--c, var(--line)); }
.mm-tree ul > li:first-child::after { top: 50%; } .mm-tree ul > li:last-child::after { bottom: 50%; }
.mm-tree ul > li:only-child::after { display: none; }
.mm-tree li.closed > ul { display: none; }
.mm-node { font: inherit; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; padding: 7px 13px; border-radius: 999px; border: 2px solid var(--c, var(--line)); background: var(--card); color: var(--ink); cursor: pointer; position: relative; z-index: 1; }
.mm-node i { font-style: normal; color: var(--c); font-weight: 900; margin-left: 4px; }
.mm-node.root { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 800; font-size: 1.05rem; padding: 12px 18px; border-radius: 14px; cursor: default; white-space: normal; max-width: 200px; }
.mm-node.d1 { background: var(--c); color: #fff; font-weight: 800; border-color: var(--c); }
:root[data-theme="dunkel"] .mm-node.d1 { color: #0B1A26; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .mm-node.d1 { color: #0B1A26; } }
.mm-node.d2 { font-weight: 600; } .mm-node.d3 { font-size: .9rem; border-width: 1.5px; }
li.has-kids.closed > .mm-node::after { content: " +"; font-weight: 900; }
.mm-pop { position: fixed; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); z-index: 20; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.mm-pop h3 { margin: 0 24px 6px 0; } .mm-x { position: absolute; right: 12px; top: 10px; font-size: 1.1rem; }
@media print { .mm-tree li.closed > ul { display: flex !important; } .mm-pop, header.top { display: none !important; } .mm-wrap { overflow: visible; box-shadow: none; } }
/* Duell */
.duel-stats { display: flex; gap: 8px; } .duel-stats span { padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: .88rem; background: var(--card); border: 1px solid var(--line); }
.duel-stats .w { color: var(--ad3); } .duel-stats .l { color: var(--danger); }
.duel-list { display: grid; gap: 10px; margin-bottom: 18px; }
.duelcard { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }
.duelcard:hover { border-color: var(--brand); text-decoration: none; } .duelcard > div { flex: 1; display: flex; flex-direction: column; }
.duelcard .vs { font-size: 1.6rem; } .duelcard.turn { border: 2px solid var(--signal); }
.duelcard.res-win { border-left: 5px solid var(--ad3); } .duelcard.res-loss { border-left: 5px solid var(--danger); } .duelcard.res-draw { border-left: 5px solid var(--warn); }
.duel-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; padding: 26px; }
.duel-board .side { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; border-radius: var(--radius); }
.duel-board .side.won { background: var(--ad3-soft); } .duel-board .side.won .dscore { color: var(--ad3); }
.dscore { font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.duel-board .mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vsbig { font-size: 1.6rem; font-weight: 900; color: var(--signal); } .verdict { font-size: 1.1rem; }
@media (max-width: 560px) { .duel-board { grid-template-columns: 1fr; } .dscore { font-size: 2rem; } }
.mm-node { flex-shrink: 0; } .mm-tree { width: max-content; min-width: 100%; }
@media (max-width: 640px) {
  .top nav a { padding: 7px 9px; } .top nav .badge { margin-left: 4px; }
  .mm-wrap { padding: 16px 12px; }
  .mm-tree { width: auto; }
  .mm-tree li, .mm-tree ul { display: block; }
  .mm-tree li { padding: 4px 0 4px 20px; }
  .mm-tree > li { padding-left: 0; }
  .mm-tree ul { margin: 4px 0 0 12px; }
  .mm-tree ul::before { display: none; }
  .mm-tree ul > li::before { top: 23px; width: 18px; }
  .mm-tree ul > li::after, .mm-tree ul > li:first-child::after { top: 0; bottom: 0; }
  .mm-tree ul > li:last-child::after, .mm-tree ul > li:only-child::after { display: block; bottom: auto; height: 23px; }
  .mm-node { white-space: normal; max-width: none; text-align: left; }
  .mm-node.root { max-width: none; display: inline-block; }
}

/* ---- v10: Spiele ---- */
.games-top { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; margin-top: 18px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gamecard { --gc: var(--brand); display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--gc);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); transition: transform .15s, border-color .15s; }
.gamecard:hover { transform: translateY(-3px); text-decoration: none; border-color: var(--gc); }
.gamecard b { font-size: 1.15rem; } .gico { font-size: 2.2rem; line-height: 1; }
.gc-tetris { --gc: #8E5CD9; } .gc-tictactoe { --gc: var(--signal); } .gc-snake { --gc: var(--ad3); } .gc-2048 { --gc: #E8A531; } .gc-memory { --gc: var(--brand); }
.gstats { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; margin-top: auto; padding-top: 8px; }
.myrank { color: var(--gc); font-weight: 700; }
.gleader { font-size: .82rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; }
.overall h2 { margin-top: 0; }
.board { list-style: none; margin: 10px 0; padding: 0; counter-reset: none; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.board li:nth-child(odd) { background: var(--bg); }
.board li.me { background: var(--soft); outline: 2px solid var(--brand); }
.board .rk { width: 30px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.board .nm { flex: 1; display: flex; flex-direction: column; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.board .nm small { font-weight: 400; color: var(--muted); font-size: .76rem; }
.board .pt { font-weight: 800; font-variant-numeric: tabular-nums; }
.board li.p1 .pt { color: #C28A00; }
.namepref { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 10px; }
.board-tabs { display: flex; gap: 6px; }
.game-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.game-stage { position: relative; min-height: 460px; }
.game-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.game-head h1 { font-size: 1.6rem; margin: 0; }
.game-live { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .92rem; }
.game-live b { color: var(--ink); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.game-area { display: flex; flex-direction: column; align-items: center; gap: 14px; outline: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(3px); border-radius: var(--radius); z-index: 5; padding: 16px; }
.ov-box { text-align: center; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ov-title { font-size: 1.8rem; font-weight: 800; }
.ov-box #ov-text { font-size: 1.1rem; color: var(--ink); font-weight: 600; margin: 0; }
.row.center { justify-content: center; }
.touchpad { display: none; gap: 8px; justify-content: center; }
.tbtn { font: inherit; font-size: 1.4rem; width: 58px; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.tbtn:active { background: var(--soft); }
.dpad { grid-template-columns: repeat(3, 58px); }
@media (pointer: coarse), (max-width: 760px) { .touchpad { display: flex; } .dpad { display: grid; } }
/* Tetris */
.tetris-wrap { display: flex; gap: 14px; align-items: flex-start; }
.tetris-board, .snake-board { border-radius: 10px; border: 2px solid var(--line); display: block; }
.tetris-side { display: flex; flex-direction: column; gap: 6px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px; }
/* 2048 */
.g2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: #BBADA0; padding: 10px; border-radius: 12px; width: min(420px, 100%); aspect-ratio: 1; touch-action: none; }
.g2048 .cell { display: grid; place-items: center; border-radius: 8px; background: rgba(238, 228, 218, .35); font-weight: 800; font-size: clamp(1.2rem, 6vw, 2.1rem); color: #776E65; transition: background .1s; }
.g2048 .pop { animation: pop .18s ease; } @keyframes pop { 50% { transform: scale(1.12); } }
.g2048 .v2 { background: #EEE4DA; } .g2048 .v4 { background: #EDE0C8; } .g2048 .v8 { background: #F2B179; color: #fff; } .g2048 .v16 { background: #F59563; color: #fff; }
.g2048 .v32 { background: #F67C5F; color: #fff; } .g2048 .v64 { background: #F65E3B; color: #fff; } .g2048 .v128 { background: #EDCF72; color: #fff; font-size: clamp(1rem, 5vw, 1.8rem); }
.g2048 .v256 { background: #EDCC61; color: #fff; font-size: clamp(1rem, 5vw, 1.8rem); } .g2048 .v512 { background: #EDC850; color: #fff; font-size: clamp(1rem, 5vw, 1.8rem); }
.g2048 .v1024, .g2048 .v2048, .g2048 .v4096 { background: #EDC22E; color: #fff; font-size: clamp(.9rem, 4.2vw, 1.5rem); box-shadow: 0 0 18px rgba(237, 194, 46, .6); }
/* Tic Tac Toe */
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(360px, 100%); aspect-ratio: 1; }
.ttt-cell { font: inherit; font-size: clamp(2.4rem, 12vw, 4rem); font-weight: 800; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: background .12s, transform .12s; }
.ttt-cell:hover:not(:disabled) { background: var(--soft); } .ttt-cell:disabled { cursor: default; }
.ttt-cell.X { color: var(--brand); } .ttt-cell.O { color: var(--signal); }
.ttt-cell.win { background: var(--ad3-soft); border-color: var(--ad3); transform: scale(1.04); }
/* Memory */
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(440px, 100%); }
.mcard { aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; perspective: 600px; position: relative; font: inherit; }
.mcard span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px; backface-visibility: hidden; transition: transform .35s; font-size: clamp(1.8rem, 9vw, 2.6rem); }
.mcard .back { background: var(--brand); color: var(--brand-ink); font-size: 1.6rem; font-weight: 800; }
.mcard .front { background: var(--card); border: 2px solid var(--line); transform: rotateY(180deg); }
.mcard.up .back { transform: rotateY(180deg); } .mcard.up .front { transform: rotateY(360deg); }
.mcard.done .front { border-color: var(--ad3); background: var(--ad3-soft); }
@media (max-width: 900px) { .games-top, .game-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .game-stage { padding: 14px 10px; } .tetris-side { padding: 6px; } .tetris-side canvas { width: 64px; height: 64px; } }
