/* ============ FeuerQuiz – Basis ============ */
:root {
  --red: #d7261e;
  --red-dark: #a8160f;
  --ink: #1b1d22;
  --ink-2: #4a4f5a;
  --muted: #7a808c;
  --bg: #f3f1ee;
  --card: #ffffff;
  --line: #e2ded8;
  --night: #15171c;
  --night-2: #22252d;
  --ok: #26890c;
  --bad: #e21b3c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 0; border-radius: 10px; padding: .7em 1.2em; font-weight: 700; cursor: pointer;
  background: var(--ink); color: #fff; text-decoration: none; line-height: 1.1;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); transition: transform .06s, filter .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.red { background: var(--red); }
.btn.light { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 rgba(0,0,0,.06); }
.btn.ghost { background: transparent; color: inherit; box-shadow: none; }
.btn.ghost:hover { background: rgba(127,127,127,.12); filter: none; }
.btn.small { padding: .45em .8em; font-size: .9em; }
.btn.big { padding: .9em 1.6em; font-size: 1.15em; }
.btn.danger { background: #fff; color: var(--bad); box-shadow: inset 0 0 0 1px #f2c3cb; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0;
  background: var(--ink); color: #fff; padding: .8em 1.2em; border-radius: 10px; font-weight: 600;
  transition: all .25s; z-index: 1000; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--bad); }
.toast.ok { background: var(--ok); }

.logo { display: inline-flex; align-items: center; gap: .45em; font-weight: 900; letter-spacing: -.02em; }
.logo .flame { width: 1.3em; height: 1.3em; }
.logo b { color: var(--red); }

.shape { width: 1em; height: 1em; flex: none; }

/* ============ Teilnehmer (Handy) ============ */
body.player { background: var(--night); color: #fff; min-height: 100vh; min-height: 100dvh; overscroll-behavior: none; }
.p-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.p-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 700; background: rgba(255,255,255,.04); }
.p-top .pts { background: rgba(255,255,255,.1); padding: .3em .7em; border-radius: 99px; font-variant-numeric: tabular-nums; }
.p-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px; gap: 18px; text-align: center; }
.p-join { max-width: 380px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.p-join .logo { font-size: 2.2rem; justify-content: center; margin-bottom: 10px; }
.p-join input {
  width: 100%; padding: 16px; font-size: 1.35rem; font-weight: 700; text-align: center; border-radius: 12px;
  border: 2px solid transparent; background: #fff; color: var(--ink); outline: none;
}
.p-join input:focus { border-color: var(--red); }
.p-join .btn { width: 100%; padding: 16px; font-size: 1.2rem; }
.p-join .err { color: #ff8a8a; min-height: 1.3em; font-weight: 600; }
.p-join .hint { color: #9aa0ab; font-size: .9rem; }
.p-big { font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.p-sub { color: #b9bec8; font-size: 1.05rem; }
.p-spinner { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; border: 5px solid rgba(255,255,255,.15); border-top-color: var(--red); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-name-badge { display: inline-block; margin: 0 auto; background: #fff; color: var(--ink); padding: .5em 1.1em; border-radius: 99px; font-weight: 800; font-size: 1.25rem; }
.p-chosen { width: 110px; height: 110px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); }
.p-chosen .shape { width: 60px; height: 60px; }
.p-qtext { font-size: 1.15rem; font-weight: 700; line-height: 1.3; text-align: left; background: rgba(255,255,255,.07); padding: 12px 14px; border-radius: 12px; }
.p-qimg { max-height: 22vh; object-fit: contain; border-radius: 10px; background: #000; align-self: center; }
.p-question { padding: 12px; gap: 12px; justify-content: flex-start; }
.p-answers { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 52vh; }
.p-answers.n3, .p-answers.n5 { grid-template-columns: 1fr 1fr; }
.p-answers.tf { grid-template-columns: 1fr; }
.p-ans {
  border: 0; border-radius: 12px; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 12px; font-weight: 700; font-size: 1.05rem; line-height: 1.2; box-shadow: inset 0 -5px 0 rgba(0,0,0,.25);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; min-height: 90px; word-break: break-word;
}
.p-ans .shape { width: 44px; height: 44px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.2)); }
.p-ans:active { transform: scale(.97); }
.p-ans.only-shape .shape { width: 64px; height: 64px; }
.p-timer { height: 8px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; }
.p-timer i { display: block; height: 100%; background: #fff; border-radius: 99px; transform-origin: left; }
.p-result { margin: -20px; padding: 40px 20px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.p-result.ok { background: linear-gradient(180deg, #2a9a0f, #1d6e09); }
.p-result.bad { background: linear-gradient(180deg, #e0334f, #a8122b); }
.p-result.none { background: linear-gradient(180deg, #4a4f5a, #2d3038); }
.p-result .icon { width: 96px; height: 96px; margin: 0 auto; background: rgba(255,255,255,.2); border-radius: 50%; display: grid; place-items: center; }
.p-result .icon .shape { width: 56px; height: 56px; }
.p-result .gain { display: inline-block; margin: 0 auto; background: rgba(0,0,0,.25); padding: .4em 1em; border-radius: 99px; font-size: 1.5rem; font-weight: 900; }
.p-result .info { background: rgba(0,0,0,.2); border-radius: 12px; padding: 12px 14px; text-align: left; font-size: 1rem; line-height: 1.4; }
.p-rankline { font-size: 1.2rem; font-weight: 700; }
.p-final .medal { font-size: 4.5rem; line-height: 1; }
.p-final .place { font-size: 3.2rem; font-weight: 900; }

/* ============ Beamer / Spielleitung ============ */
body.host { background: var(--night); color: #fff; overflow: hidden; height: 100vh; }
.h-app { height: 100vh; display: flex; flex-direction: column; }
.h-bar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: rgba(0,0,0,.25); font-weight: 700; flex: none; }
.h-bar .logo { font-size: 1.3rem; }
.h-bar .spacer { flex: 1; }
.h-bar .pill { background: rgba(255,255,255,.1); padding: .35em .9em; border-radius: 99px; font-variant-numeric: tabular-nums; }
.h-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2.2vh 3vw; gap: 2vh; position: relative; }
.h-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 10px 24px 16px; flex: none; }
.h-foot .btn.ghost { color: #c9cdd6; }

.h-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2vh; }
.h-card { background: #fff; color: var(--ink); border-radius: 18px; padding: 28px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }

.h-lobby { display: grid; grid-template-columns: 1fr auto; gap: 3vw; align-items: center; }
.h-join { font-size: 2.4vh; }
.h-join .url { font-size: 4vh; font-weight: 800; color: var(--ink); cursor: pointer; word-break: break-all; }
.h-join .pin-label { margin-top: 2vh; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 2vh; }
.h-join .pin { font-size: 13vh; font-weight: 900; letter-spacing: .06em; line-height: 1; font-variant-numeric: tabular-nums; }
.h-qr { width: 34vh; height: 34vh; background: #fff; border-radius: 18px; padding: 1.2vh; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.h-qr svg { width: 100%; height: 100%; display: block; }
.h-players-head { display: flex; align-items: center; gap: 16px; font-size: 2.6vh; font-weight: 800; }
.h-players-head .count { background: #fff; color: var(--ink); border-radius: 12px; padding: .2em .7em; font-size: 3.4vh; }
.h-players { display: flex; flex-wrap: wrap; gap: 1vh; align-content: flex-start; overflow: auto; flex: 1; min-height: 0; }
.h-chip { background: rgba(255,255,255,.12); padding: .5em 1em; border-radius: 10px; font-weight: 700; font-size: 2.4vh; cursor: pointer; animation: pop .35s ease-out; border: 0; color: #fff; }
.h-chip:hover { background: var(--bad); text-decoration: line-through; }
.h-chip.off { opacity: .45; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.h-empty { color: #8f95a1; font-size: 2.4vh; }

.h-qhead { display: flex; align-items: center; gap: 2vw; }
.h-qtext { flex: 1; background: #fff; color: var(--ink); border-radius: 16px; padding: 2.2vh 2vw; font-size: 4.2vh; font-weight: 800; line-height: 1.2; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.h-mid { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 3vw; }
.h-img { min-width: 0; max-height: 100%; max-width: 60%; object-fit: contain; border-radius: 14px; background: #000; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.h-side { display: flex; flex-direction: column; align-items: center; gap: 1vh; font-weight: 800; }
.h-timer { width: 17vh; height: 17vh; position: relative; }
.h-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.h-timer .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7vh; font-weight: 900; font-variant-numeric: tabular-nums; }
.h-timer.warn .num { color: #ffcf33; }
.h-count { font-size: 6vh; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.h-count-label { font-size: 2vh; color: #b9bec8; text-transform: uppercase; letter-spacing: .08em; }
.h-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4vh; flex: none; }
.h-answers.tf { grid-template-columns: 1fr 1fr; }
.h-ans { display: flex; align-items: center; gap: 1.6vw; padding: 2vh 1.6vw; border-radius: 12px; font-size: 3.2vh; font-weight: 800; min-height: 10vh; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); transition: opacity .3s, transform .3s; position: relative; }
.h-ans .shape { width: 5.5vh; height: 5.5vh; filter: drop-shadow(0 2px 0 rgba(0,0,0,.2)); }
.h-ans .txt { flex: 1; line-height: 1.15; }
.h-ans .mark { width: 5vh; height: 5vh; }
.h-ans.dim { opacity: .28; }
.h-ans.right { transform: scale(1.015); }
.h-preview { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; }
.h-preview .h-qtext { flex: none; font-size: 5.4vh; max-width: 85vw; padding: 4vh 3vw; animation: pop .4s ease-out; }
.h-preview .bar { width: 50vw; height: 1.2vh; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; }
.h-preview .bar i { display: block; height: 100%; background: var(--red); width: 100%; transform-origin: left; }
.h-badge { display: inline-flex; gap: .5em; align-items: center; background: rgba(255,255,255,.12); padding: .4em 1em; border-radius: 99px; font-weight: 800; font-size: 2.2vh; }
.h-badge.double { background: #ffcf33; color: var(--ink); }
.h-chart { display: flex; align-items: stretch; justify-content: center; gap: 1.6vw; height: 100%; max-height: 34vh; flex: 0 1 auto; }
.h-bar-col { display: flex; flex-direction: column; align-items: center; width: 8.5vw; max-width: 130px; height: 100%; }
.h-bar-col .v { font-size: 3.4vh; font-weight: 900; display: flex; align-items: center; gap: .3em; margin-bottom: .6vh; }
.h-bar-col .v .shape { width: 3vh; height: 3vh; }
.h-bar-col .track { flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; }
.h-bar-col .col { width: 100%; border-radius: 8px 8px 0 0; height: 0; transition: height .8s cubic-bezier(.2,.9,.3,1); }
.h-bar-col .lbl { width: 100%; border-radius: 0 0 8px 8px; padding: .8vh; display: grid; place-items: center; border-top: 3px solid rgba(0,0,0,.25); }
.h-bar-col .lbl .shape { width: 3vh; height: 3vh; color: #fff; }
.h-bar-col.dim { opacity: .35; }
.h-explain { background: rgba(255,255,255,.1); border-left: 6px solid #ffcf33; border-radius: 10px; padding: 1.8vh 1.6vw; font-size: 2.5vh; line-height: 1.35; flex: 0 1 30vw; max-height: 100%; overflow: auto; align-self: center; }
.h-explain b { display: block; color: #ffcf33; font-size: 2vh; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4vh; }

.h-title { font-size: 5.5vh; font-weight: 900; text-align: center; margin: 0; }
.h-board { width: min(900px, 80vw); margin: 0 auto; display: flex; flex-direction: column; gap: 1.2vh; }
.h-row { display: flex; align-items: center; gap: 1.5vw; background: #fff; color: var(--ink); border-radius: 12px; padding: 1.6vh 1.8vw; font-size: 3.2vh; font-weight: 800; animation: slidein .5s both; }
.h-row .rk { width: 2.2em; color: var(--muted); }
.h-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-row .sc { font-variant-numeric: tabular-nums; }
.h-row .plus { font-size: 2.2vh; color: var(--ok); width: 5em; text-align: right; }
.h-row.first { background: #ffcf33; }
@keyframes slidein { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }

.h-podium { display: flex; align-items: flex-end; justify-content: center; gap: 2vw; flex: 1; min-height: 0; padding-top: 2vh; }
.h-pod { display: flex; flex-direction: column; align-items: center; gap: 1vh; width: 18vw; max-width: 260px; animation: rise .9s cubic-bezier(.2,.9,.3,1) both; }
.h-pod .who { font-size: 3.4vh; font-weight: 900; text-align: center; word-break: break-word; }
.h-pod .pts { font-size: 2.4vh; color: #c9cdd6; font-weight: 700; }
.h-pod .block { width: 100%; border-radius: 12px 12px 0 0; display: flex; justify-content: center; padding-top: 1.5vh; font-size: 8vh; font-weight: 900; color: rgba(0,0,0,.35); }
.h-pod.p1 .block { height: 34vh; background: linear-gradient(#ffd84d, #e6b800); }
.h-pod.p2 .block { height: 24vh; background: linear-gradient(#e3e6ea, #b9bec6); }
.h-pod.p3 .block { height: 17vh; background: linear-gradient(#e7a56b, #c97a3b); }
.h-pod.p1 { animation-delay: 1.2s; } .h-pod.p2 { animation-delay: .6s; } .h-pod.p3 { animation-delay: 0s; }
@keyframes rise { from { transform: translateY(40vh); opacity: 0; } to { transform: none; opacity: 1; } }
.h-rest { display: flex; flex-wrap: wrap; justify-content: center; gap: 1vh 2vw; color: #c9cdd6; font-size: 2.2vh; font-weight: 600; }

.h-setup { max-width: 560px; width: 92vw; }
.h-setup h2 { margin: 0 0 6px; font-size: 1.6rem; }
.h-setup p { color: var(--ink-2); margin: 0 0 18px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--red); margin-top: 1px; flex: none; }
.check small { display: block; color: var(--muted); font-weight: 400; }
.check span { font-weight: 700; }

/* ============ Backend ============ */
body.admin { background: var(--bg); }
.a-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 60px; background: var(--night); color: #fff; }
.a-top .logo { font-size: 1.25rem; }
.a-tabs { display: flex; gap: 4px; margin-left: 12px; height: 100%; }
.a-tab { background: none; border: 0; color: #b9bec8; font-weight: 700; padding: 0 14px; cursor: pointer; border-bottom: 3px solid transparent; height: 100%; }
.a-tab:hover { color: #fff; }
.a-tab.active { color: #fff; border-bottom-color: var(--red); }
.a-top .spacer { flex: 1; }
.a-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }
.a-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.a-head h1 { font-size: 1.7rem; margin: 0; flex: 1; letter-spacing: -.01em; }
.a-banner { background: #fff4d6; border: 1px solid #f0d98a; color: #6b5200; padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; }
.a-banner.info { background: #e8f1fd; border-color: #bcd5f5; color: #1c4a80; }

.a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.a-quiz { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.a-quiz .cover { height: 120px; background: linear-gradient(135deg, var(--red), #6d0f0a); background-size: cover; background-position: center; position: relative; }
.a-quiz .cover .n { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: .8rem; padding: .3em .6em; border-radius: 6px; }
.a-quiz .body { padding: 14px 16px; flex: 1; }
.a-quiz h3 { margin: 0 0 4px; font-size: 1.1rem; }
.a-quiz p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.a-quiz .actions { display: flex; gap: 6px; padding: 0 16px 16px; flex-wrap: wrap; }
.a-quiz .actions .btn.red { flex: 1; }
.a-new { border: 2px dashed #cfc9c0; background: transparent; border-radius: var(--radius); min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; color: var(--ink-2); font-weight: 700; font-size: 1.05rem; }
.a-new:hover { border-color: var(--red); color: var(--red); }
.a-new .plus { font-size: 2.6rem; line-height: 1; }

.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; min-width: 180px; z-index: 30; }
.menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.menu-list button:hover { background: var(--bg); }
.menu-list button.danger { color: var(--bad); }

.a-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.a-table { width: 100%; border-collapse: collapse; }
.a-table th, .a-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.a-table th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.a-table td.r, .a-table th.r { text-align: right; }
.a-empty { text-align: center; color: var(--muted); padding: 40px 20px; }

label.f { display: block; font-weight: 700; font-size: .85rem; color: var(--ink-2); margin-bottom: 6px; }
.inp, select.inp, textarea.inp { width: 100%; padding: 10px 12px; border: 1px solid #d5d0c8; border-radius: 8px; background: #fff; outline: none; }
.inp:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,38,30,.15); }
textarea.inp { resize: vertical; min-height: 70px; line-height: 1.4; }

/* Editor */
.e-top { position: sticky; top: 60px; z-index: 15; background: var(--bg); padding: 14px 0; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.e-top .title { flex: 1; font-size: 1.3rem; font-weight: 800; border: 1px solid transparent; background: transparent; padding: 6px 10px; border-radius: 8px; }
.e-top .title:hover { border-color: #d5d0c8; background: #fff; }
.e-top .title:focus { border-color: var(--red); background: #fff; outline: none; }
.e-status { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.e-status.dirty { color: #b37400; font-weight: 700; }
.e-layout { display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start; }
.e-list { position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.e-item { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 10px; padding: 10px; cursor: pointer; border: 2px solid transparent; box-shadow: var(--shadow); text-align: left; width: 100%; }
.e-item:hover { border-color: #e8c4c1; }
.e-item.active { border-color: var(--red); }
.e-item .no { font-weight: 900; color: var(--muted); width: 22px; flex: none; text-align: center; }
.e-item .t { flex: 1; font-size: .9rem; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.e-item .t.empty { color: var(--muted); font-style: italic; font-weight: 400; }
.e-item .thumb { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; flex: none; background: #eee; }
.e-item .warn { color: #c78100; flex: none; font-weight: 900; }
.e-addrow { display: flex; gap: 6px; margin-top: 6px; }
.e-addrow .btn { flex: 1; }
.e-form { display: flex; flex-direction: column; gap: 18px; }
.e-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.e-qtext { font-size: 1.25rem; font-weight: 700; min-height: 90px; }
.e-img { border: 2px dashed #cfc9c0; border-radius: 12px; min-height: 160px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--muted); background: #faf9f7; cursor: pointer; position: relative; overflow: hidden; text-align: center; padding: 12px; }
.e-img:hover, .e-img.drag { border-color: var(--red); color: var(--red); }
.e-img img { max-height: 320px; border-radius: 8px; }
.e-img .img-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.e-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.e-ans { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 8px 10px 8px 8px; border: 2px solid var(--line); }
.e-ans.correct { border-color: var(--ok); background: #f1f9ee; }
.e-ans .sw { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.e-ans .sw .shape { width: 24px; height: 24px; }
.e-ans input[type=text] { flex: 1; border: 0; background: transparent; outline: none; font-weight: 600; font-size: 1.02rem; padding: 8px 4px; min-width: 0; }
.e-ans .tick { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #c9c4bc; background: #fff; cursor: pointer; display: grid; place-items: center; flex: none; color: transparent; }
.e-ans.correct .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.e-ans .tick svg { width: 18px; height: 18px; }
.e-ans .rm { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.3rem; padding: 0 4px; }
.e-ans .rm:hover { color: var(--bad); }
.e-tools { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.e-hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.e-problems { background: #fff4d6; color: #6b5200; border-radius: 8px; padding: 8px 12px; font-size: .9rem; font-weight: 600; }

.modal-bg { position: fixed; inset: 0; background: rgba(15,16,20,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.modal h2 { margin-top: 0; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--night); padding: 20px; }
.login { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login .logo { font-size: 1.8rem; justify-content: center; }
.login p { margin: 0; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .e-layout { grid-template-columns: 1fr; }
  .e-list { position: static; max-height: none; flex-direction: row; overflow-x: auto; }
  .e-item { min-width: 200px; }
  .e-row { grid-template-columns: 1fr; }
  .e-answers { grid-template-columns: 1fr; }
  .a-top { padding: 0 12px; gap: 8px; }
  .a-top .logo span { display: none; }
  .a-tab { padding: 0 8px; font-size: .9rem; }
  .e-top { top: 60px; flex-wrap: wrap; }
}
