/* ==========================================================
   KidExam – candidate (child) interface
   Big touch targets, high contrast, rounded friendly shapes
   ========================================================== */
:root {
  --fs: 1;                       /* font scale (admin + child adjustable) */
  --radius: 28px;
  --ink: #2B2350;
  --ink-soft: #6B6490;
  --card: #ffffff;
  --ok: #22B573;
  --bad: #FF4D6D;
  --shadow: 0 10px 0 rgba(43, 35, 80, .12), 0 18px 40px rgba(43, 35, 80, .12);
  --font: 'Baloo 2', 'Nirmala UI', 'Mangal', system-ui, sans-serif;
}
.theme-sunny  { --p: #FF8A00; --p2: #FFC93C; --p3: #FFF3D6; --bg1: #FFF8E7; --bg2: #FFE3B3; --accent: #6C4CF1; }
.theme-ocean  { --p: #1E88E5; --p2: #4DD0E1; --p3: #E1F5FE; --bg1: #EAF7FF; --bg2: #BDE6FF; --accent: #FF7A59; }
.theme-jungle { --p: #2E9E5B; --p2: #A5D85C; --p3: #EAF8E3; --bg1: #F1FBEA; --bg2: #CDEFB8; --accent: #FF9F1C; }
.theme-candy  { --p: #E0458B; --p2: #B57BFF; --p3: #FCE7F3; --bg1: #FFF0F7; --bg2: #EBD9FF; --accent: #2EC4B6; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg2), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, var(--bg2), transparent 60%), var(--bg1);
  font-size: calc(18px * var(--fs));
  overflow-x: hidden;
  user-select: none; -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; cursor: pointer; border: 0; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ---------- background ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud { position: absolute; width: 180px; height: 60px; background: #fff; border-radius: 60px; opacity: .8; animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; top: -40px; left: 25px; }
.cloud::after { width: 60px; height: 60px; top: -28px; left: 90px; }
.c1 { top: 8%; left: -200px; } .c2 { top: 28%; left: -200px; animation-delay: -25s; transform: scale(.7); } .c3 { top: 70%; left: -200px; animation-delay: -45s; transform: scale(.9); }
@keyframes drift { to { left: 110%; } }
.bubble { position: absolute; border-radius: 50%; background: var(--p2); opacity: .18; animation: float 12s ease-in-out infinite; }
.b1 { width: 120px; height: 120px; left: 6%; bottom: 8%; } .b2 { width: 70px; height: 70px; right: 10%; top: 18%; animation-delay: -3s; background: var(--accent); }
.b3 { width: 50px; height: 50px; right: 30%; bottom: 12%; animation-delay: -6s; } .b4 { width: 90px; height: 90px; left: 40%; top: 6%; animation-delay: -9s; background: var(--p); }
@keyframes float { 50% { transform: translateY(-30px) scale(1.06); } }

#app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- generic ---------- */
.center-wrap { flex: 1; display: grid; place-items: center; padding: 24px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.title { font-size: 2.1em; font-weight: 800; margin: 0 0 4px; line-height: 1.1; }
.subtitle { color: var(--ink-soft); font-size: 1.1em; margin: 0 0 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--p); color: #fff; font-weight: 800; font-size: 1.25em;
  padding: 14px 30px; border-radius: 999px; min-height: 64px;
  box-shadow: 0 6px 0 rgba(0,0,0,.18); transition: transform .08s, box-shadow .08s, filter .2s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn[disabled] { background: #C9C4DD; cursor: not-allowed; box-shadow: none; }
.btn.alt { background: #fff; color: var(--ink); border: 3px solid #E6E1F5; box-shadow: 0 6px 0 #E6E1F5; }
.btn.go { background: var(--ok); }
.btn.big { font-size: 1.5em; padding: 18px 44px; min-height: 76px; }
.btn.accent { background: var(--accent); }
.icon-btn {
  width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--ink);
  font-size: 1.5em; display: inline-grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.1);
}
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px; font-weight: 700; background: var(--p3); color: var(--ink); }

/* ---------- login ---------- */
.login { width: min(520px, 100%); text-align: center; position: relative; padding-top: 110px; }
.mascot { width: 150px; height: 150px; position: absolute; top: -75px; left: 50%; transform: translateX(-50%); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateX(-50%) translateY(-8px) rotate(-3deg); } }
.exam-logo { max-height: 70px; margin-bottom: 6px; }
.field { text-align: left; margin-bottom: 18px; }
.field label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15em; margin-bottom: 6px; }
.field input {
  width: 100%; font-family: inherit; font-size: 1.5em; font-weight: 700; letter-spacing: 1px;
  padding: 14px 20px; border-radius: 20px; border: 4px solid #E6E1F5; outline: none; color: var(--ink); background: #FBFAFF;
}
.field input:focus { border-color: var(--p); background: #fff; }
.err { color: var(--bad); font-weight: 700; min-height: 1.4em; margin: 6px 0; }
.lang-switch { display: inline-flex; background: #F1EEFB; border-radius: 999px; padding: 4px; gap: 4px; }
.lang-switch button { background: transparent; font-weight: 800; font-size: 1em; padding: 8px 16px; border-radius: 999px; color: var(--ink-soft); }
.lang-switch button.on { background: var(--p); color: #fff; }

/* ---------- waiting room ---------- */
.wait { width: min(900px, 100%); display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.wait .hello { grid-column: 1 / -1; display: flex; gap: 20px; align-items: center; }
.avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--p3); display: grid; place-items: center; font-size: 3em; overflow: hidden; flex: none; border: 5px solid #fff; box-shadow: 0 6px 0 rgba(0,0,0,.08); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.countdown { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
.countdown .unit { background: var(--p); color: #fff; border-radius: 22px; padding: 10px 6px; min-width: 92px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.countdown .num { font-size: 2.6em; font-weight: 800; line-height: 1; }
.countdown .lbl { font-size: .9em; opacity: .9; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #FBFAFF; border-radius: 18px; font-weight: 600; }
.checklist .st { margin-left: auto; font-size: 1.4em; }
.cam-box { width: 100%; aspect-ratio: 4/3; background: #1f1b33; border-radius: 20px; overflow: hidden; display: grid; place-items: center; color: #fff; }
.cam-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.instructions { white-space: pre-line; line-height: 1.5; }

/* ---------- exam ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(8px); box-shadow: 0 4px 20px rgba(43,35,80,.08);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15em; min-width: 0; }
.topbar .brand img { height: 44px; }
.topbar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.timer { font-size: 1.5em; font-weight: 800; padding: 6px 20px; border-radius: 999px; background: var(--p3); display: flex; align-items: center; gap: 8px; min-width: 150px; justify-content: center; }
.timer.low { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.tools { display: flex; gap: 8px; align-items: center; }
.tools .icon-btn { width: 48px; height: 48px; font-size: 1.2em; }

.exam-body { flex: 1; width: min(1100px, 100%); margin: 0 auto; padding: 18px 18px 120px; }
.palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 16px; }
.palette button {
  width: 48px; height: 48px; border-radius: 50%; font-weight: 800; font-size: 1.1em;
  background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.1); position: relative;
}
.palette button.done { background: var(--ok); color: #fff; }
.palette button.cur { outline: 4px solid var(--p); outline-offset: 3px; transform: scale(1.12); }
.palette button[disabled] { opacity: .5; cursor: not-allowed; }

.qcard { position: relative; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.qno { background: var(--accent); color: #fff; font-weight: 800; padding: 6px 18px; border-radius: 999px; font-size: 1.05em; }
.qtext { font-size: 2.1em; font-weight: 800; line-height: 1.3; margin: 6px 0 14px; display: flex; gap: 14px; align-items: flex-start; }
.qtext .t { flex: 1; }
.speak { flex: none; width: 66px; height: 66px; border-radius: 50%; background: var(--p); color: #fff; font-size: 1.9em; display: grid; place-items: center; box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.speak.playing { animation: ring 1s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255,138,0,.6), 0 6px 0 rgba(0,0,0,.15); } 100% { box-shadow: 0 0 0 22px rgba(255,138,0,0), 0 6px 0 rgba(0,0,0,.15); } }
.qimg { display: block; margin: 0 auto 16px; max-height: 300px; border-radius: 20px; background: #fff; }
.multi-hint { display: inline-flex; align-items: center; gap: 8px; background: #FFF4CC; color: #8A5A00; font-weight: 800; padding: 6px 16px; border-radius: 999px; }

/* options */
.options { display: grid; gap: 18px; margin-top: 10px; }
.options.grid { grid-template-columns: repeat(2, 1fr); }
.options.grid.n3 { grid-template-columns: repeat(3, 1fr); }
.options.list { grid-template-columns: 1fr; }
.options.row { grid-template-columns: repeat(var(--n), 1fr); }
.opt {
  position: relative; background: #fff; border-radius: 26px; padding: 18px; text-align: center;
  border: 5px solid #ECE8F8; box-shadow: 0 8px 0 #ECE8F8; transition: transform .1s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink); min-height: 120px;
}
.options.list .opt { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 90px; }
.opt:hover { border-color: var(--p2); }
.opt:active { transform: translateY(5px); box-shadow: 0 3px 0 #ECE8F8; }
.opt .lab {
  position: absolute; top: -14px; left: -14px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1.3em; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.options.list .opt .lab { position: static; flex: none; }
.opt .otext { font-size: 1.7em; font-weight: 800; line-height: 1.2; word-break: break-word; }
.opt img { max-height: 160px; border-radius: 16px; pointer-events: none; }
.opt .ospeak { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; border-radius: 50%; background: var(--p3); font-size: 1.1em; display: grid; place-items: center; }
.opt .tick { position: absolute; bottom: -16px; right: -12px; width: 50px; height: 50px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 1.6em; display: none; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.opt.sel { border-color: var(--ok); box-shadow: 0 8px 0 #1A8F5A; background: #EFFFF6; animation: wiggle .35s; }
.opt.sel .tick { display: grid; }
.opt.sel .lab { background: var(--ok); }
@keyframes wiggle { 30% { transform: rotate(-2deg) scale(1.03); } 60% { transform: rotate(2deg) scale(1.03); } }
/* sizes */
.size-m .opt { min-height: 96px; } .size-m .opt .otext { font-size: 1.4em; } .size-m .opt img { max-height: 120px; }
.size-xl .opt { min-height: 170px; } .size-xl .opt .otext { font-size: 2.1em; } .size-xl .opt img { max-height: 210px; }
/* bubble style */
.style-bubbles .opt { border-radius: 999px; } .style-bubbles .options.grid .opt, .style-bubbles .options.row .opt { aspect-ratio: 1; border-radius: 50%; }
.no-labels .opt .lab { display: none; }

/* bottom nav */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 14px; align-items: center; justify-content: space-between;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.9); backdrop-filter: blur(8px); box-shadow: 0 -4px 20px rgba(43,35,80,.08);
}
.navbar .mid { display: flex; gap: 10px; align-items: center; font-weight: 700; color: var(--ink-soft); }
.stars { font-size: 1.4em; letter-spacing: 2px; }

/* result */
.result { text-align: center; width: min(620px, 100%); }
.trophy { font-size: 6em; line-height: 1; animation: bob2 2s ease-in-out infinite; }
@keyframes bob2 { 50% { transform: translateY(-10px) rotate(4deg); } }
.score-ring { font-size: 3.4em; font-weight: 800; color: var(--p); }
.result-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.result-stats .pill { font-size: 1.1em; padding: 10px 18px; }
.big-stars { font-size: 3em; letter-spacing: 6px; margin: 8px 0; }

/* modal & toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(43,35,80,.45); display: grid; place-items: center; padding: 20px; }
.modal-card { background: #fff; border-radius: var(--radius); padding: 30px; width: min(520px, 100%); text-align: center; box-shadow: var(--shadow); animation: pop .3s; }
.modal-card .actions { display: flex; gap: 14px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -250%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 999px; font-weight: 700; transition: transform .3s; max-width: 92vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
.self-preview { position: fixed; right: 14px; bottom: 100px; width: 150px; height: 112px; border-radius: 16px; object-fit: cover; transform: scaleX(-1); z-index: 6; border: 4px solid #fff; box-shadow: 0 6px 20px rgba(0,0,0,.2); background: #000; }
.rec-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: pulse 1s infinite; }

/* responsive */
@media (max-width: 760px) {
  body { font-size: calc(15px * var(--fs)); }
  .wait { grid-template-columns: 1fr; }
  .options.grid.n3, .options.row { grid-template-columns: repeat(2, 1fr); }
  .qtext { font-size: 1.7em; }
  .topbar .brand span { display: none; }
  .timer { min-width: 0; font-size: 1.2em; padding: 6px 14px; }
  .self-preview { width: 96px; height: 72px; bottom: 96px; }
  .btn { padding: 12px 20px; }
}
@media (max-width: 420px) { .options.grid, .options.grid.n3, .options.row { grid-template-columns: 1fr; } }

/* ==========================================================
   v2 exam screen (header ring timer, chips, pastel 3D options)
   ========================================================== */
body { background: linear-gradient(180deg, #CDEEFF 0%, #EAF8FF 45%, var(--bg1) 100%); }
.theme-jungle body, body.theme-jungle { background: linear-gradient(180deg, #D9F5C8 0%, #F1FBEA 60%); }
body.theme-candy { background: linear-gradient(180deg, #FBD9EC 0%, #FFF0F7 60%); }
.hill { position: fixed; left: -10%; right: -10%; bottom: -120px; height: 220px; background: radial-gradient(ellipse at 50% 0%, #9BDB6E 0%, #7CC655 55%, #6AB845 100%); border-radius: 50% 50% 0 0; z-index: 0; pointer-events: none; }
.sun { position: fixed; top: 70px; right: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, #FFE36E 0%, #FFD23F 60%, rgba(255,210,63,0) 72%); z-index: 0; pointer-events: none; animation: float 10s ease-in-out infinite; }
.topbar, .exam-body, .navbar { position: relative; z-index: 2; }
.topbar { position: sticky; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar.sm { width: 52px; height: 52px; font-size: 1.6em; border-width: 3px; }
.who-tx { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.who-tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.who-tx small { color: var(--ink-soft); text-transform: uppercase; font-weight: 700; font-size: .7em; letter-spacing: .05em; }
.timer-ring { position: relative; width: 70px; height: 70px; flex: none; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 6; }
.timer-ring .trk { stroke: #EEE9FF; }
.timer-ring .val { stroke: var(--p); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-ring .tt { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: .9em; }
.timer-ring.low .val { stroke: var(--bad); }
.timer-ring.low .tt { color: var(--bad); animation: pulse 1s infinite; }
.cam-thumb { position: relative; width: 96px; height: 72px; border-radius: 12px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); background: #000; flex: none; }
.cam-thumb video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-thumb .rec-dot { position: absolute; top: 5px; right: 5px; }

.chips { display: flex; gap: 12px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.chip { min-width: 110px; padding: 6px 16px 8px; border-radius: 18px; color: #fff; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.15); border: 3px solid rgba(255,255,255,.7); }
.chip small { display: block; font-size: .65em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .95; }
.chip b { font-size: 1.5em; line-height: 1; }
.c-pink { background: linear-gradient(180deg, #FF7EB3, #F0508E); }
.c-orange { background: linear-gradient(180deg, #FFC24B, #FF9A1F); }
.c-green { background: linear-gradient(180deg, #4ADE9B, #1DB46A); }
.progress { height: 14px; background: #fff; border-radius: 99px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.08); border: 2px solid #fff; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22C55E, #4ADE80); border-radius: 99px; transition: width .4s; }
.prog-row { display: flex; justify-content: space-between; align-items: center; margin: 6px 4px 14px; font-weight: 700; color: var(--ink-soft); font-size: .9em; }
.sel-badge { background: #DFF7EA; color: #0E8A4E; padding: 3px 12px; border-radius: 99px; }

.qcard { border: 4px solid #fff; }
.qhead .spacer { flex: 1; }
.qhead .subj { font-weight: 800; }
.qno { background: transparent; color: var(--ink-soft); padding: 0; font-weight: 700; }
.qtext { display: block; text-align: center; color: #2B5BD7; font-size: 2.1em; margin: 6px 0 14px; }
.qimg-wrap { background: #fff; border: 3px solid #EEF0F6; border-radius: 22px; padding: 10px; margin-bottom: 14px; text-align: center; }
.qimg { max-height: 320px; margin: 0 auto; border-radius: 14px; }
.voicebar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-bottom: 10px; }
.vb-btn { background: #E5F1FF; color: #1C6FD6; font-weight: 800; font-size: 1em; padding: 10px 18px; border-radius: 999px; box-shadow: 0 3px 0 #C3DCFA; }
.vb-btn:active { transform: translateY(2px); box-shadow: none; }
.vb-btn.playing { background: #1C6FD6; color: #fff; animation: ring 1s infinite; }
.vb-sel { font-family: inherit; font-weight: 800; font-size: 1em; padding: 9px 12px; border-radius: 999px; border: 2px solid #C3DCFA; background: #fff; color: #1C6FD6; }
.multi-hint { display: table; margin: 0 auto 6px; }

/* pastel 3D options */
.opt { border: 0; border-radius: 24px; box-shadow: 0 8px 0 var(--sh); background: var(--bgc); min-height: 130px; }
.opt.o1 { --bgc: #FFD9E3; --sh: #E9A3B6; } .opt.o2 { --bgc: #D3F4E1; --sh: #8FD3AC; }
.opt.o3 { --bgc: #FFE6C9; --sh: #E9B97F; } .opt.o4 { --bgc: #E2DBFF; --sh: #B3A4F0; }
.opt:hover { filter: brightness(1.03); transform: translateY(-2px); }
.opt:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--sh); }
.opt .otext { color: #2B2350; }
.opt .lab { background: #fff; color: var(--ink); border: 3px solid var(--sh); }
.opt.sel { --bgc: #2FCB76; --sh: #15904F; background: linear-gradient(180deg, #43DB86, #22B866); border: 0; }
.opt.sel .otext { color: #fff; }
.opt.sel .lab { background: #fff; color: #15904F; border-color: #fff; }
.opt.sel .tick { background: #fff; color: #15904F; }
.opt .ospeak { background: rgba(255,255,255,.7); }

.palette-card { margin-top: 18px; padding: 18px 20px; }
.palette-card h3 { margin: 0 0 12px; }
.palette { justify-content: flex-start; margin: 0; }
.palette button { border-radius: 12px; border: 2px solid #E6E1F5; box-shadow: none; }
.palette button.done { border-color: var(--ok); }
.legend { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 700; flex-wrap: wrap; }
.legend .lg { min-width: 30px; height: 30px; border-radius: 8px; color: #fff; display: grid; place-items: center; padding: 0 6px; }
.legend .lg.done { background: var(--ok); } .legend .lg.todo { background: #E76F8A; margin-left: 10px; }
.navbar { justify-content: center; gap: 14px; }

/* settings + instructions */
.set-list { display: grid; gap: 12px; text-align: left; margin-top: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #F7F5FF; border-radius: 16px; padding: 10px 14px; font-weight: 700; }
.set-row .btn { min-height: 46px; padding: 6px 20px; font-size: 1em; }
.set-row .icon-btn { width: 46px; height: 46px; font-size: 1em; }
.instr-card { grid-column: 1 / -1; border-left: 10px solid var(--accent); }
.instr-sec h3 { color: var(--accent); margin: 14px 0 4px; font-size: 1.1em; }
.instr-sec ol { margin: 0; padding-left: 22px; line-height: 1.55; }
.instr-sec li { margin: 3px 0; }
@media (max-width: 760px) {
  .who-tx, .topbar .brand { display: none; }
  .cam-thumb { width: 72px; height: 54px; }
  .timer-ring { width: 58px; height: 58px; }
  .chip { min-width: 0; flex: 1; }
  .qtext { font-size: 1.6em; }
}

/* ---------- self camera view (top-right) ---------- */
.self-preview { display: none; }
.self-wrap { position: fixed; top: 96px; right: 16px; width: 200px; aspect-ratio: 4 / 3; z-index: 30; border-radius: 16px; overflow: hidden; background: #000; border: 4px solid #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.self-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.self-lbl { position: absolute; left: 6px; bottom: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
.self-lbl .rec-dot { width: 9px; height: 9px; flex: none; }
.osub { display: none; }
@media (max-width: 760px) { .self-wrap { width: 110px; top: 84px; right: 8px; border-width: 3px; } .self-lbl { font-size: 9px; padding: 2px 5px; } }

/* ==========================================================
   CLASSIC (plain white) screen style
   ========================================================== */
body.screen-classic { background: #F4F6FA; --p: #2563EB; --p2: #93C5FD; --p3: #EFF4FF; --accent: #2563EB; --ink: #1E2333; --ink-soft: #6B7280; }
.screen-classic .sky, .screen-classic .hill, .screen-classic .sun { display: none; }
.screen-classic .card { box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.05); border: 1px solid #E6E9F0; border-radius: 16px; }
.screen-classic .topbar { background: #fff; box-shadow: none; border-bottom: 1px solid #E6E9F0; }
.screen-classic .btn { box-shadow: none; border-radius: 12px; min-height: 52px; font-size: 1.05em; }
.screen-classic .btn:active { transform: translateY(1px); }
.screen-classic .btn.alt { border: 2px solid #E6E9F0; }
.screen-classic .btn.go { background: #16A34A; }
.screen-classic .chips { justify-content: flex-start; }
.screen-classic .chip { background: #fff; color: var(--ink); border: 1px solid #E6E9F0; box-shadow: none; text-align: left; border-radius: 12px; }
.screen-classic .chip small { color: var(--ink-soft); }
.screen-classic .c-green b { color: #16A34A; } .screen-classic .c-pink b { color: #2563EB; } .screen-classic .c-orange b { color: #D97706; }
.screen-classic .progress { background: #EEF0F4; border: 0; height: 10px; }
.screen-classic .progress i { background: #16A34A; }
.screen-classic .qcard { border: 1px solid #E6E9F0; animation: none; }
.screen-classic .qhead .subj { background: #DCFCE7 !important; color: #15803D !important; }
.screen-classic .qtext { color: #2563EB; font-size: 1.8em; }
.screen-classic .qimg-wrap { border: 1px solid #E6E9F0; }
.screen-classic .vb-btn { background: #EFF6FF; color: #2563EB; box-shadow: none; padding: 7px 14px; font-size: .9em; }
.screen-classic .vb-sel { border-width: 1px; padding: 6px 10px; font-size: .9em; }
.screen-classic .lang-switch { background: #F3F4F6; }
.screen-classic .lang-switch button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.screen-classic .multi-hint { background: #FEF9C3; color: #854D0E; font-size: .85em; }
.screen-classic .opt { --bgc: #fff; --sh: transparent; background: #fff; border: 2px solid #E3E6EC; box-shadow: none; border-radius: 14px; min-height: 96px; }
.screen-classic .opt:hover { border-color: #93C5FD; transform: none; filter: none; }
.screen-classic .opt:active { transform: scale(.99); box-shadow: none; }
.screen-classic .opt .lab, .screen-classic .opt .tick { display: none; }
.screen-classic .opt .otext { font-size: 1.7em; color: #111827; }
.screen-classic .opt .osub { display: block; color: #6B7280; font-size: .85em; font-weight: 600; }
.screen-classic .opt .ospeak { background: #F3F4F6; width: 34px; height: 34px; font-size: .9em; }
.screen-classic .opt.sel { background: #F0FDF4; border-color: #16A34A; box-shadow: none; animation: none; }
.screen-classic .opt.sel .otext { color: #16A34A; }
.screen-classic .opt.sel .osub { color: #16A34A; }
.screen-classic .palette button { border-radius: 8px; width: 42px; height: 42px; font-size: 1em; }
.screen-classic .palette button.done { background: #16A34A; border-color: #16A34A; }
.screen-classic .palette button.cur { outline: 2px solid #2563EB; transform: none; }
.screen-classic .legend .lg.todo { background: #EF4444; }
.screen-classic .navbar { background: #fff; box-shadow: none; border-top: 1px solid #E6E9F0; }
.screen-classic .timer-ring .trk { stroke: #EEF0F4; }
.screen-classic .countdown .unit { background: #2563EB; box-shadow: none; border-radius: 14px; }
.screen-classic .instr-card { border-left-color: #2563EB; }
.screen-classic .instr-sec h3 { color: #2563EB; }
.screen-classic .field input { border-width: 2px; border-radius: 12px; }
.screen-classic .mascot { display: none; }
.screen-classic .login { padding-top: 32px; }
.screen-classic .self-wrap { border-width: 2px; border-color: #E6E9F0; border-radius: 12px; }
@media (min-width: 900px) { .exam-body.with-cam { padding-right: 236px; width: min(1336px, 100%); } }
@media (max-width: 760px) {
  .self-wrap { top: 7px; right: auto; left: 50%; transform: translateX(-50%); width: 88px; z-index: 31; }
  .self-lbl { display: none; }
  .self-wrap::after { content: ''; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: pulse 1s infinite; }
}
