:root {
  --red:#c51f2c;
  --red-dark:#8f1220;
  --blue:#175a9b;
  --blue-dark:#092f57;
  --green:#13845a;
  --gold:#e2a52a;
  --ink:#142638;
  --muted:#667789;
  --line:#d8e3ed;
  --paper:#fff;
  --shadow:0 18px 52px rgba(7,42,75,.14);
}
* { box-sizing:border-box; }
html,body { width:100%; min-height:100%; }
body { margin:0; overflow:hidden; background:#eaf1f7; color:var(--ink); font-family:Inter,Segoe UI,Arial,sans-serif; }
button,input,select { font:inherit; }
button { cursor:pointer; }
.hidden { display:none!important; }
.eyebrow { margin:0 0 4px; color:var(--red); font-size:10px; font-weight:950; letter-spacing:.13em; text-transform:uppercase; }

.aula-login { min-height:100vh; display:grid; place-items:center; padding:26px; background:radial-gradient(circle at 15% 10%,rgba(23,90,155,.25),transparent 33%),radial-gradient(circle at 90% 80%,rgba(197,31,44,.16),transparent 30%),#edf4fa; }
.aula-login-card { width:min(480px,100%); padding:38px; border:1px solid rgba(23,90,155,.16); border-radius:27px; background:#fff; box-shadow:0 30px 90px rgba(8,45,79,.22); text-align:center; }
.aula-login-card > img { width:165px; height:105px; object-fit:contain; margin-bottom:13px; }
.aula-login-card h1 { margin:3px 0 9px; color:var(--blue-dark); font:800 39px/1.05 Georgia,serif; }
.aula-login-card > p:not(.eyebrow) { margin:0 auto 22px; color:var(--muted); line-height:1.55; }
.aula-login-card label { display:grid; gap:7px; color:#354b60; font-size:11px; font-weight:900; text-align:left; text-transform:uppercase; }
.aula-login-card input { width:100%; height:52px; padding:0 14px; border:2px solid var(--line); border-radius:13px; outline:0; }
.aula-login-card input:focus { border-color:var(--blue); box-shadow:0 0 0 4px rgba(23,90,155,.1); }
.aula-login-card button { width:100%; min-height:52px; margin-top:13px; border:0; border-radius:13px; background:linear-gradient(135deg,var(--red),var(--red-dark)); color:#fff; font-weight:950; }
.aula-message { margin-top:11px; padding:10px 12px; border-radius:10px; font-size:12px; font-weight:850; }
.aula-message.error { background:#fff0f2; color:#a31827; }

.aula-shell { height:100vh; display:grid; grid-template-columns:320px minmax(0,1fr); grid-template-rows:72px minmax(0,1fr); }
.aula-topbar { grid-column:1/-1; position:relative; z-index:30; display:flex; align-items:center; gap:13px; padding:8px 16px; border-bottom:1px solid #cbd8e4; background:#fff; box-shadow:0 5px 18px rgba(7,39,68,.08); }
.aula-brand { display:flex; align-items:center; gap:10px; min-width:270px; }
.aula-brand img { width:63px; height:52px; object-fit:contain; border-radius:9px; }
.aula-brand small,.aula-brand b { display:block; }
.aula-brand small { color:#607388; font-size:8px; font-weight:900; letter-spacing:.1em; }
.aula-brand b { color:var(--blue-dark); font:800 20px/1.1 Georgia,serif; }
.aula-brand b em { color:var(--red); font-style:normal; }
.aula-live-state { display:flex; align-items:center; gap:8px; padding:9px 12px; border:1px solid #b7ddcb; border-radius:12px; background:#edf9f3; color:#0c6846; font-size:11px; font-weight:850; }
.aula-live-state i { width:11px; height:11px; border:2px solid #fff; border-radius:50%; background:#18b474; box-shadow:0 0 0 4px rgba(24,180,116,.18); animation:live-pulse 1.5s ease-in-out infinite; }
.aula-session-state { min-width:112px; padding:7px 11px; border-left:1px solid var(--line); }
.aula-session-state small,.aula-session-state b { display:block; }
.aula-session-state small { color:#82909d; font-size:7px; font-weight:950; letter-spacing:.09em; }
.aula-session-state b { margin-top:2px; color:#25425e; font-size:10px; }
#aulaClock { margin-left:auto; color:var(--blue-dark); font-size:19px; font-weight:950; }
.top-action { min-height:39px; padding:0 11px; border:1px solid #cbd8e4; border-radius:10px; background:#f7fafc; color:#254964; font-size:10px; font-weight:900; }
.top-action:hover { border-color:#8fb1cf; background:#edf6ff; }
.top-action.chat-action { border-color:#f4b08d; background:#fff4ec; color:#a82d15; }
.aula-flame { width:25px; height:25px; display:inline-grid; place-items:center; margin-right:2px; vertical-align:-7px; filter:drop-shadow(0 3px 4px rgba(0,0,0,.28)); }
.aula-flame img { width:28px; height:28px; object-fit:contain; }
.top-action.chat-action b { min-width:20px; display:inline-grid; place-items:center; margin-left:3px; padding:3px 5px; border-radius:999px; background:#ed3b23; color:#fff; font-size:8px; }
.top-action.subtle { color:#6c7884; }

.aula-sidebar { min-height:0; overflow:auto; padding:18px 15px 24px; border-right:1px solid #cbd8e4; background:#f8fbfe; scrollbar-gutter:stable; }
.sidebar-title h2 { margin:0 0 14px; color:var(--blue-dark); font:800 25px/1.05 Georgia,serif; }
.category-list { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:13px; }
.category-list button { min-height:39px; padding:7px 8px; border:1px solid #d1dde7; border-radius:10px; background:#fff; color:#526678; font-size:9px; font-weight:900; }
.category-list button.active { border-color:var(--blue); background:linear-gradient(145deg,#edf6ff,#fff); color:var(--blue-dark); box-shadow:inset 0 0 0 1px var(--blue); }
.sidebar-field { display:grid; gap:5px; margin-top:9px; color:#5d6e7e; font-size:8px; font-weight:950; letter-spacing:.05em; text-transform:uppercase; }
.sidebar-field input,.sidebar-field select { width:100%; height:42px; min-width:0; padding:0 10px; border:1px solid #cbd8e4; border-radius:10px; outline:0; background:#fff; color:#20394f; font-size:11px; font-weight:700; text-transform:none; }
.sidebar-field input:focus,.sidebar-field select:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(23,90,155,.09); }
.random-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:11px; }
.random-actions button { min-height:43px; padding:0 8px; border:1px solid #b9cbdc; border-radius:10px; background:#fff; color:var(--blue-dark); font-size:9px; font-weight:950; }
.random-actions button.primary { border:0; background:linear-gradient(135deg,var(--red),var(--red-dark)); color:#fff; box-shadow:0 7px 16px rgba(197,31,44,.18); }
.catalog-summary { display:flex; align-items:baseline; gap:5px; margin:14px 2px 7px; color:#728191; }
.catalog-summary b { color:var(--blue); font-size:19px; }
.catalog-summary span { font-size:9px; font-weight:850; }
.question-list { display:grid; gap:6px; }
.question-list button { width:100%; display:grid; grid-template-columns:38px 1fr; gap:8px; padding:9px; border:1px solid #d9e3ec; border-radius:10px; background:#fff; color:#263e53; text-align:left; }
.question-list button:hover,.question-list button.selected { border-color:#6c9bc5; background:#eef7ff; }
.question-list button > b { width:36px; height:36px; display:grid; place-items:center; border-radius:9px; background:#e9f0f7; color:#174f83; font-size:9px; }
.question-list button span { min-width:0; }
.question-list button strong,.question-list button small { display:block; }
.question-list button strong { display:-webkit-box; overflow:hidden; color:#263e53; font:700 10px/1.3 Georgia,serif; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.question-list button small { overflow:hidden; margin-top:3px; color:#7b8996; font-size:7px; text-overflow:ellipsis; white-space:nowrap; }
.question-pager { display:flex; justify-content:space-between; align-items:center; gap:6px; margin-top:9px; }
.question-pager button { min-height:31px; padding:0 9px; border:1px solid #cbd8e4; border-radius:8px; background:#fff; color:#25547f; font-size:8px; font-weight:900; }
.question-pager span { color:#748493; font-size:8px; }

.aula-main { min-width:0; min-height:0; padding:12px; background:radial-gradient(circle at 50% 20%,rgba(255,255,255,.92),rgba(229,238,247,.8)),#e8f0f7; }
.aula-stage { position:relative; height:100%; min-height:0; overflow:hidden; border:1px solid #cbd9e5; border-radius:20px; background:linear-gradient(145deg,#f9fcff,#edf4fa); box-shadow:var(--shadow); }
.stage-toolbar { position:relative; z-index:8; min-height:72px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 18px; border-bottom:1px solid #d7e2ec; background:rgba(255,255,255,.92); backdrop-filter:blur(8px); }
.stage-toolbar h1 { margin:0; color:var(--blue-dark); font:800 clamp(22px,2vw,32px)/1.05 Georgia,serif; }
.round-stats { display:flex; align-items:center; gap:7px; }
.round-stats span { min-height:38px; display:grid; place-items:center; padding:5px 10px; border:1px solid #d2dfe9; border-radius:10px; background:#f8fbfd; color:#687a8a; font-size:8px; font-weight:850; }
.round-stats b { color:var(--blue-dark); font-size:15px; }
#roundTimer { min-width:64px; background:#0b315c; color:#fff; font-size:16px; font-weight:950; }

.participant-field { position:absolute; inset:76px 0 70px; z-index:6; pointer-events:none; }
.participant-column { position:absolute; top:10px; bottom:10px; width:102px; display:flex; flex-direction:column; align-items:center; justify-content:space-around; gap:5px; }
.participant-column.left { left:5px; }
.participant-column.right { right:5px; }
.participant-bubble { --bubble-size:66px; position:relative; width:94px; min-height:88px; display:grid; justify-items:center; margin:0; transition:transform .24s ease,filter .24s ease; animation:bubble-dance 3.2s ease-in-out infinite alternate; animation-delay:calc(var(--slot,0) * -.37s); }
.participant-bubble .bubble-photo { position:relative; width:var(--bubble-size); height:var(--bubble-size); display:grid; place-items:center; overflow:hidden; border:4px solid #fff; border-radius:50%; background:linear-gradient(145deg,#dd2637,#174f83); color:#fff; box-shadow:0 7px 18px rgba(11,48,82,.22),0 0 0 3px #b9cad9; font-size:22px; font-weight:950; transition:.25s ease; }
.participant-bubble img { width:100%; height:100%; object-fit:cover; }
.participant-bubble figcaption { position:relative; z-index:2; max-width:94px; overflow:hidden; margin-top:-3px; padding:4px 7px; border-radius:999px; background:#fff; color:#25415a; box-shadow:0 3px 10px rgba(13,49,80,.15); font-size:7px; font-weight:950; text-overflow:ellipsis; white-space:nowrap; }
.participant-bubble.answered .bubble-photo { box-shadow:0 7px 18px rgba(11,48,82,.22),0 0 0 5px #2281d0,0 0 22px rgba(34,129,208,.42); }
.participant-bubble.answered::after { content:"✓"; position:absolute; top:0; right:8px; z-index:3; width:22px; height:22px; display:grid; place-items:center; border:3px solid #fff; border-radius:50%; background:#2084d3; color:#fff; font-size:10px; font-weight:950; }
.participant-bubble.just-answered { z-index:10; animation:bubble-answer-pop 1.25s cubic-bezier(.2,.9,.25,1) both; }
.participant-bubble.correct .bubble-photo { box-shadow:0 7px 18px rgba(11,48,82,.22),0 0 0 6px #19aa6b,0 0 28px rgba(25,170,107,.5); }
.participant-bubble.wrong .bubble-photo { box-shadow:0 7px 18px rgba(11,48,82,.22),0 0 0 6px #d52334,0 0 28px rgba(213,35,52,.48); }
.participant-bubble.correct::after { content:"✓"; background:#16a466; }
.participant-bubble.wrong::after { content:"×"; background:#cf2233; }
.participant-bubble.no-answer { filter:grayscale(.65); opacity:.62; }
@keyframes bubble-answer-pop {
  0% { transform:scale(.82); }
  28% { transform:scale(1.58) translateX(var(--bubble-shift,0)); }
  55% { transform:scale(1.28) translateX(var(--bubble-shift,0)); }
  100% { transform:scale(1); }
}
@keyframes bubble-dance {
  0% { transform:translateY(-5px) rotate(-1.8deg) scale(.96); }
  48% { transform:translateY(4px) rotate(1.2deg) scale(1.05); }
  100% { transform:translateY(-2px) rotate(-.7deg) scale(1); }
}
.participant-column.left .participant-bubble { --bubble-shift:20px; }
.participant-column.right .participant-bubble { --bubble-shift:-20px; }

.question-card { position:absolute; inset:86px 112px 78px; z-index:2; display:grid; overflow:hidden; border:1px solid #d4e0ea; border-radius:19px; background:#fff; box-shadow:0 14px 38px rgba(11,49,88,.12); }
.empty-stage { align-self:center; max-width:660px; margin:auto; padding:30px; text-align:center; }
.empty-mark { width:78px; height:78px; display:grid; place-items:center; margin:0 auto 14px; border-radius:24px; background:linear-gradient(145deg,var(--red),var(--blue-dark)); color:#fff; box-shadow:0 12px 30px rgba(14,52,89,.24); font:900 38px Georgia,serif; }
.empty-stage h2 { margin:0; color:var(--blue-dark); font:800 31px/1.1 Georgia,serif; }
.empty-stage p { max-width:590px; margin:10px auto 18px; color:#687a8a; font-size:13px; line-height:1.55; }
.empty-stage button { min-height:46px; padding:0 18px; border:0; border-radius:12px; background:linear-gradient(135deg,var(--red),var(--red-dark)); color:#fff; font-size:11px; font-weight:950; }
.question-view { min-height:0; display:grid; grid-template-rows:auto 1fr auto; }
.question-meta { display:flex; justify-content:space-between; gap:12px; padding:11px 16px; border-bottom:1px solid #dce5ed; background:#f6f9fc; }
.question-meta span { color:#5d7183; font-size:9px; font-weight:900; text-transform:uppercase; }
.question-meta span:first-child { color:var(--red); }
.question-body { min-height:0; display:grid; align-content:center; gap:17px; overflow:auto; padding:24px clamp(24px,4vw,68px); text-align:center; }
.question-body h2 { max-width:980px; margin:0 auto; color:#172f46; font:800 clamp(24px,3vw,43px)/1.28 Georgia,serif; }
.question-body img { display:block; max-width:min(680px,92%); max-height:42vh; margin:0 auto; border:1px solid #d6e0e8; border-radius:15px; object-fit:contain; background:#fff; }
.question-status { display:inline-flex; justify-self:center; align-items:center; gap:8px; padding:8px 14px; border-radius:999px; background:#edf5fc; color:#1a5a91; font-size:10px; font-weight:950; }
.question-status i { width:9px; height:9px; border-radius:50%; background:#2787d2; animation:live-pulse 1.2s ease-in-out infinite; }
.answer-reveal { display:flex; align-items:center; justify-content:center; gap:16px; padding:13px 18px; border-top:1px solid #d8e3ec; background:#f7fafc; }
.answer-reveal > b { min-width:72px; padding:10px 15px; border-radius:11px; color:#fff; font-size:17px; text-align:center; }
.answer-reveal > b.true { background:#168659; }
.answer-reveal > b.false { background:#c42131; }
.answer-reveal div strong,.answer-reveal div small { display:block; }
.answer-reveal div strong { color:#183850; font-size:14px; }
.answer-reveal div small { margin-top:3px; color:#6c7b89; font-size:9px; }

.round-controls { position:absolute; left:50%; bottom:16px; z-index:9; display:flex; justify-content:center; gap:8px; transform:translateX(-50%); }
.round-controls button { min-height:45px; padding:0 17px; border:1px solid #c9d7e3; border-radius:12px; background:#fff; color:#35526b; box-shadow:0 6px 18px rgba(8,39,67,.1); font-size:10px; font-weight:950; }
.round-controls button.primary { border:0; background:linear-gradient(135deg,#1c67aa,#0d3c6b); color:#fff; }
.round-controls button.danger { border:0; background:linear-gradient(135deg,#d32738,#9f1422); color:#fff; }
.round-controls button.subtle { background:#f3f6f8; color:#6a7885; }
.round-controls button:disabled { opacity:.42; cursor:not-allowed; }

.score-panel { position:absolute; right:12px; bottom:14px; z-index:12; width:270px; max-height:320px; overflow:hidden; border:1px solid #cfdbe5; border-radius:15px; background:rgba(255,255,255,.96); box-shadow:0 15px 38px rgba(8,41,72,.18); transition:.25s ease; }
.score-panel.collapsed { width:150px; max-height:45px; }
.score-panel > div { min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:7px; padding:7px 10px; border-bottom:1px solid #e0e7ed; }
.score-panel > div .eyebrow { margin:0; }
.score-panel > div button { width:28px; height:28px; border:0; border-radius:8px; background:#eaf1f7; color:#294c69; }
.score-panel ol { max-height:262px; overflow:auto; margin:0; padding:7px; list-style:none; }
.score-panel li { display:grid; grid-template-columns:24px 30px 1fr auto; align-items:center; gap:6px; padding:6px; border-radius:9px; }
.score-panel li:nth-child(odd) { background:#f4f8fb; }
.score-panel li > i { width:22px; height:22px; display:grid; place-items:center; border-radius:7px; background:#dfeaf4; color:#244f76; font-size:8px; font-style:normal; font-weight:950; }
.score-avatar { width:29px; height:29px; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:linear-gradient(145deg,var(--red),var(--blue)); color:#fff; font-size:9px; font-weight:950; }
.score-avatar img { width:100%; height:100%; object-fit:cover; }
.score-panel li span { overflow:hidden; color:#345169; font-size:8px; font-weight:850; text-overflow:ellipsis; white-space:nowrap; }
.score-panel li b { color:var(--red); font-size:10px; }

.chat-panel { position:fixed; top:72px; right:0; bottom:0; z-index:40; width:min(420px,100vw); display:grid; grid-template-rows:auto auto 1fr; border-left:1px solid #c9d6e1; background:#fff; box-shadow:-18px 0 45px rgba(6,34,61,.22); transform:translateX(105%); transition:transform .25s ease; }
.chat-panel.open { transform:translateX(0); }
.chat-panel header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:17px; border-bottom:1px solid var(--line); }
.chat-panel h2 { margin:0; color:var(--blue-dark); font:800 23px/1 Georgia,serif; }
.chat-panel header > button { width:38px; height:38px; border:0; border-radius:10px; background:#edf2f6; color:#36516a; font-size:22px; }
.chat-controls { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding:11px 15px; border-bottom:1px solid var(--line); background:#f7fafc; }
.chat-controls button { min-height:38px; border:1px solid #cbd9e4; border-radius:9px; background:#fff; color:#2e587c; font-size:9px; font-weight:900; }
.chat-controls button.danger { border-color:#efb5bb; color:#a81525; }
.chat-messages { min-height:0; overflow:auto; display:grid; align-content:start; gap:8px; padding:14px; }
.chat-messages article { display:grid; grid-template-columns:35px 1fr auto; gap:8px; padding:9px; border:1px solid #dce5ed; border-radius:11px; background:#fbfdff; }
.chat-avatar { width:34px; height:34px; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:linear-gradient(145deg,var(--red),var(--blue)); color:#fff; font-size:10px; font-weight:950; }
.chat-avatar img { width:100%; height:100%; object-fit:cover; }
.chat-messages b,.chat-messages p,.chat-messages time { display:block; }
.chat-messages b { color:#1f4d74; font-size:9px; }
.chat-messages p { margin:3px 0 0; color:#263d52; font-size:12px; line-height:1.35; overflow-wrap:anywhere; }
.chat-messages time { margin-top:4px; color:#89949e; font-size:7px; }
.chat-messages article > button { width:27px; height:27px; border:0; border-radius:8px; background:#fff0f2; color:#ad1a29; font-weight:950; }
.chat-empty { padding:35px 15px; color:#7d8994; text-align:center; font-size:11px; }

.aula-toast { position:fixed; left:50%; bottom:24px; z-index:80; max-width:min(520px,calc(100vw - 30px)); padding:12px 17px; border-radius:12px; background:#0d3459; color:#fff; box-shadow:0 13px 35px rgba(5,31,55,.28); transform:translateX(-50%); font-size:11px; font-weight:850; }
.aula-toast.error { background:#a81726; }
@keyframes live-pulse { 50% { transform:scale(1.22); opacity:.62; } }

@media(max-width:1250px) {
  .aula-shell { grid-template-columns:280px minmax(0,1fr); }
  .aula-brand { min-width:230px; }
  .aula-brand b { font-size:17px; }
  .aula-session-state { display:none; }
  .top-action { padding-inline:8px; }
  .question-card { inset-inline:96px; }
  .participant-column { width:88px; }
  .participant-bubble { --bubble-size:58px; width:82px; min-height:78px; }
  .participant-bubble figcaption { max-width:82px; }
  .score-panel { width:235px; }
}

@media(max-width:900px) {
  body { overflow:auto; }
  .aula-shell { min-height:100vh; height:auto; grid-template-columns:1fr; grid-template-rows:auto auto minmax(760px,1fr); }
  .aula-topbar { position:sticky; top:0; flex-wrap:wrap; min-height:72px; }
  .aula-brand { margin-right:auto; }
  .aula-live-state,#aulaClock,.top-action.subtle { display:none; }
  .aula-sidebar { max-height:390px; border-right:0; border-bottom:1px solid #cbd8e4; }
  .category-list { grid-template-columns:repeat(4,1fr); }
  .aula-main { min-height:760px; }
  .question-card { inset:85px 80px 80px; }
  .question-body h2 { font-size:25px; }
  .participant-column { width:72px; }
  .participant-bubble { --bubble-size:50px; width:68px; min-height:69px; }
  .participant-bubble figcaption { max-width:68px; font-size:6px; }
  .score-panel { display:none; }
  .chat-panel { top:72px; }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}
