/* Live quiz — student phone screens (exam.khmermath.org/live and khmermath.org/play/live.html) */
.lv { max-width: 560px; margin: 0 auto; padding: 12px; color: var(--ink, #16212e); }
.lv [hidden] { display: none !important; }
.lv-card { background: var(--surface, #fff); border: 1px solid var(--line, #e1e8f0); border-radius: 18px; padding: 18px; box-shadow: 0 6px 20px rgba(22, 33, 46, .07); display: flex; flex-direction: column; gap: 10px; }
.lv h2 { margin: 0; font-size: 22px; text-align: center; }
.lv-card label { font-weight: 700; font-size: 15px; }
.lv input[type="text"] { width: 100%; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line-2, #cfd9e6); font: inherit; font-size: 20px; background: #fff; box-sizing: border-box; }
.lv #lv-code { text-align: center; letter-spacing: .3em; font-size: 26px; font-weight: 800; }
.lv-btn { min-height: 54px; border: 0; border-radius: 14px; background: var(--teal, #1f6f66); color: #fff; font: inherit; font-weight: 800; font-size: 20px; cursor: pointer; padding: 8px 22px; }
.lv-btn:disabled { opacity: .6; }
.lv-msg { margin: 0; color: #c92a2a; text-align: center; min-height: 1.4em; font-weight: 600; }
.lv-sub { margin: 0; text-align: center; color: var(--ink-3, #5f6f81); font-size: 16px; line-height: 1.6; }
.lv-sub.small { font-size: 13px; }

/* ---------- full-screen play: covers the whole phone, nothing of the site shows ---------- */
html.lv-lock, body.lv-lock { overflow: hidden !important; overscroll-behavior: none; }
.lv.lv-full { position: fixed; inset: 0; z-index: 2147483000; max-width: none; margin: 0; padding: 0; color: #fff; background: radial-gradient(circle at 20% 0%, #5b3fd0 0%, #2d1b69 55%, #1a1040 100%); display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); -webkit-user-select: none; user-select: none; }
.lv-play { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lv-hud { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.lv-pill { padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-weight: 700; font-size: 13px; white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
.lv-pill.score b { font-size: 14px; }
.lv-leave { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 14px; cursor: pointer; flex: none; }
.lv-timer { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.lv-timer.off { visibility: hidden; }
.lv-track { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.lv-bar { height: 100%; width: 100%; background: #69db7c; border-radius: 99px; transition: width .25s linear; }
.lv-bar.hot { background: #ff6b6b; }
.lv-time { min-width: 26px; height: 26px; padding: 0 4px; border-radius: 99px; background: #fff; color: #2d1b69; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.lv-net { margin: 0 10px 6px; padding: 5px 10px; border-radius: 10px; background: #fff3bf; color: #7a5a00; font-size: 13px; text-align: center; }
.lv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lv-stage { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px 14px; text-align: center; }
.lv-q { background: #fff; color: #1c1330; border-radius: 16px; padding: 12px 14px; font-size: clamp(17px, 4.8vw, 24px); font-weight: 700; line-height: 1.6; width: 100%; box-sizing: border-box; overflow-wrap: anywhere; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.lv-fig svg { max-width: 100%; height: auto; max-height: 26vh; background: #fff; border-radius: 12px; padding: 3px; }
.lv-fig svg text { font-family: "KaTeX_Math", serif; font-style: italic; } .lv-fig svg text.up { font-style: normal; }
.lv-emoji { font-size: 54px; line-height: 1.1; } .lv-emoji.ok { color: #69db7c; } .lv-emoji.no { color: #ff8787; }
.lv-body h2 { color: #fff; font-size: 22px; }
.lv-body .lv-sub { color: rgba(255, 255, 255, .85); }
.lv-answers { flex: none; display: grid; gap: 8px; padding: 8px 10px 12px; }
.lv-answers.g4 { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(64px, 18vh); }
.lv-answers.g6 { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(56px, 13vh); }
.lv-answers.g2 { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(90px, 26vh); }
.lv-answers.gnum { grid-template-columns: 1fr auto; }
.lv-answers.gone { grid-template-columns: 1fr; }
.lv-opt { border: 0; border-radius: 12px; color: #fff; font: inherit; font-weight: 800; font-size: clamp(15px, 4.2vw, 20px); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 6px 8px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); line-height: 1.3; overflow-wrap: anywhere; text-align: center; touch-action: manipulation; }
.lv-opt i { font-style: normal; font-size: 1.1em; opacity: .85; flex: none; }
.lv-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.lv-opt.c0 { background: #e03131; } .lv-opt.c1 { background: #1c7ed6; } .lv-opt.c2 { background: #f08c00; } .lv-opt.c3 { background: #2f9e44; } .lv-opt.c4 { background: #ae3ec9; } .lv-opt.c5 { background: #0c8599; }
.lv-answers input { min-height: 56px; text-align: center; border-radius: 12px !important; color: #1c1330; }
.lv-send { min-height: 56px; border: 0; border-radius: 12px; background: #2f9e44; color: #fff; font: inherit; font-weight: 800; font-size: 18px; padding: 0 22px; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.lv-send.big { font-size: 20px; }
.lv-ans { text-align: center; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .95); color: #14532d; width: 100%; box-sizing: border-box; }
.lv-ans small { color: #4a5a4d; }
.lv-ansv { font-size: 22px; font-weight: 800; margin-top: 2px; }
.lv-sol { margin-top: 4px; font-size: 14px; color: #3b4a5c; }
.lv-top { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; width: 100%; }
.lv-top li { display: flex; justify-content: space-between; padding: 7px 12px; border-radius: 10px; background: rgba(255, 255, 255, .14); font-size: 16px; }
@media (max-height: 520px) { .lv-answers.g4, .lv-answers.g6 { grid-auto-rows: minmax(44px, 30vh); } .lv-emoji { font-size: 34px; } .lv-q { font-size: 16px; padding: 8px 10px; } }

.lv-av { width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.2); line-height: 0; }
.lv-bigav { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(0,0,0,.35); line-height: 0; flex: none; }
.lv-ed { width: 100%; display: flex; flex-direction: column; gap: 5px; }
.lv-edrow { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); border-radius: 12px; padding: 3px; }
.lv-edmid { flex: 1; min-width: 0; text-align: center; line-height: 1.25; } .lv-edmid small { display: block; opacity: .7; font-size: 11px; } .lv-edmid b { font-size: 14px; }
.lv-arr { width: 42px; height: 38px; border: 0; border-radius: 10px; background: rgba(255,255,255,.22); color: #fff; font-size: 16px; cursor: pointer; touch-action: manipulation; }
.lv-rnd { align-self: center; border: 0; border-radius: 99px; background: #ffd43b; color: #3b2a00; font: inherit; font-weight: 800; padding: 6px 18px; cursor: pointer; }
.lv-top .lv-who { display: inline-flex; align-items: center; gap: 6px; } .lv-top .lv-who svg { border-radius: 50%; flex: none; }
@media (max-height: 700px) { .lv-bigav { width: 84px; height: 84px; } .lv-bigav svg { width: 84px; height: 84px; } }

/* ---- the first screen a student sees: big, friendly, one thing to do ---- */
#lv-join { background: linear-gradient(160deg, #5b3fd0 0%, #2d1b69 100%); color: #fff; border: 0; padding: 26px 20px; gap: 12px; box-shadow: 0 18px 44px rgba(45, 27, 105, .35); }
#lv-join h2 { font-size: 28px; color: #fff; }
#lv-join .lv-sub { color: rgba(255, 255, 255, .85); }
#lv-join label { color: #fff; opacity: .95; }
#lv-join input[type="text"] { border: 0; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
#lv-join .lv-msg { color: #ffd6d6; background: rgba(0, 0, 0, .18); border-radius: 10px; padding: 0 8px; }
#lv-join .lv-btn { background: #ffd43b; color: #2b1d00; font-size: 22px; min-height: 58px; box-shadow: 0 5px 0 #c9a100; }
#lv-join .lv-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c9a100; }
#lv-join .lv-msg:empty { display: none; }
