/* ===== Orta Qwiz — дизайн жүйесі ===== */
:root {
  --p: #5424A8; --p2: #7044C8; --pl: #EEE9F8;
  --y: #FFB800; --g: #24B47E; --b: #3185F7; --r: #FF665A; --o: #FF9138;
  --bg: #F7F5FC; --card: #FFFFFF; --soft: #EEE9F8;
  --t: #242033; --t2: #777386; --t3: #A5A1B2; --line: #E4DEF3;
  --sh: 0 2px 10px rgba(84, 36, 168, .07); --sh2: 0 12px 30px rgba(84, 36, 168, .16);
  --rad: 20px; --font: "Nunito Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--t); font: 17px/1.55 var(--font); font-weight: 500; }
a { color: var(--p2); text-decoration: none; font-weight: 700; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; color: var(--t); }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 900; }
h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 .7em; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 22px 18px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.narrow { max-width: 540px; }
.muted { color: var(--t2); } .small { font-size: .86rem; } .center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; } .spread { justify-content: space-between; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.ic { width: 20px; height: 20px; flex: none; }

/* ----- логотип ----- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.3rem; color: var(--p); letter-spacing: -.01em; }
.logo .mark { width: 36px; height: 36px; border-radius: 12px; background: var(--p); color: var(--y); display: grid; place-items: center; font-size: 1.25rem; box-shadow: 0 3px 0 #3d1a7a; transform: rotate(-6deg); }

/* ----- бүйір мәзір / қабық ----- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; background: var(--card); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.side nav { display: flex; flex-direction: column; gap: 6px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--t2); font-weight: 700; background: transparent; border: 0; min-height: 46px; justify-content: flex-start; width: 100%; box-shadow: none; transition: background .15s, color .15s, transform .15s; }
.side-link:hover { background: var(--pl); color: var(--p); transform: translateX(2px); filter: none; }
.side-link.on { background: var(--p); color: #fff; box-shadow: 0 4px 12px rgba(84, 36, 168, .3); }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 14px; font-weight: 700; }
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; }
.mtop { display: none; }

/* ----- қоғамдық жоғарғы жол ----- */
.bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar nav { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.bar nav a { color: var(--t); font-size: .95rem; }
.bar nav button.link { color: var(--t2); }

/* ----- батырмалар ----- */
button, .btn { font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 14px; padding: 10px 20px; background: var(--pl); color: var(--p); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; text-align: center; transition: transform .12s, box-shadow .12s, background .15s, filter .15s; }
button:hover, .btn:hover { filter: brightness(.97); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(2px) scale(.98); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(112, 68, 200, .45); outline-offset: 2px; }
button.primary, .btn.primary { background: var(--p); color: #fff; box-shadow: 0 3px 0 #3d1a7a; }
button.primary:active, .btn.primary:active { box-shadow: 0 0 0 #3d1a7a; transform: translateY(3px); }
button.yellow, .btn.yellow { background: var(--y); color: #3b2a00; box-shadow: 0 3px 0 #c58f00; }
button.ok { background: var(--g); color: #fff; box-shadow: 0 3px 0 #178a5f; }
button.bad { background: var(--r); color: #fff; box-shadow: 0 3px 0 #d94a3f; }
button.ghost { background: transparent; border: 2px solid var(--line); color: var(--p); }
button.link { background: none; padding: 0; min-height: 0; font-weight: 700; color: var(--p2); box-shadow: none; }
button.sm, .btn.sm { padding: 5px 12px; min-height: 36px; font-size: .88rem; border-radius: 11px; }
button.big, .btn.big { font-size: 1.15rem; padding: 14px 28px; min-height: 58px; border-radius: 16px; }
button.primary.sm, button.ok.sm, button.bad.sm { box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }

/* ----- форма ----- */
input, textarea, select { font: inherit; font-weight: 600; width: 100%; background: var(--bg); color: var(--t); border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea { resize: vertical; min-height: 76px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--p2); background: #fff; box-shadow: 0 0 0 4px rgba(112, 68, 200, .16); }
input::placeholder, textarea::placeholder { color: var(--t3); font-weight: 600; }
input:disabled, textarea:disabled { opacity: .7; }
label { display: block; font-size: .85rem; color: var(--t2); margin: 12px 0 5px; font-weight: 700; }
.err { color: #D8392B; margin: 8px 0; font-weight: 700; }

/* ----- карталар ----- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); padding: 20px; box-shadow: var(--sh); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid > .card { transition: transform .18s, box-shadow .18s; }
.grid > .card:hover { transform: translateY(-3px); box-shadow: var(--sh2); }
.tag { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: .76rem; font-weight: 800; background: var(--pl); color: var(--p); }
.tag.public { background: #DDF5EC; color: #12754F; } .tag.pending { background: #FFF1CC; color: #8A5A00; }
.tag.rejected { background: #FFE3E0; color: #C0392F; } .tag.tpl { background: var(--y); color: #3b2a00; }

/* ----- декор ----- */
.deco { position: absolute; pointer-events: none; }
.d1 { width: 120px; height: 120px; border-radius: 50%; background: var(--y); right: -30px; top: -34px; opacity: .95; }
.d2 { width: 64px; height: 64px; border-radius: 18px; background: var(--r); right: 90px; bottom: -22px; transform: rotate(18deg); }
.d3 { width: 0; height: 0; border-left: 26px solid transparent; border-right: 26px solid transparent; border-bottom: 46px solid var(--g); right: 190px; top: 14px; opacity: .9; transform: rotate(-12deg); }
.d4 { width: 44px; height: 44px; border-radius: 50%; background: var(--b); left: -14px; bottom: -14px; }

/* ----- басты бет ----- */
.hero { position: relative; overflow: hidden; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 44px 20px 40px; box-shadow: var(--sh); }
.hero h1 { color: var(--p); position: relative; }
.hero p, .hero form { position: relative; }
.hero .join { display: flex; gap: 10px; max-width: 440px; margin: 22px auto 0; }
.hero .join input { text-align: center; font-size: 1.7rem; letter-spacing: .22em; font-weight: 900; min-height: 60px; color: var(--p); }
.feat { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 22px; }
.feat .card h3 { color: var(--p); }
.feat .card:nth-child(1) { border-top: 5px solid var(--r); } .feat .card:nth-child(2) { border-top: 5px solid var(--b); }
.feat .card:nth-child(3) { border-top: 5px solid var(--y); } .feat .card:nth-child(4) { border-top: 5px solid var(--g); }

/* ----- дашборд ----- */
.welcome { position: relative; overflow: hidden; background: var(--p); color: #fff; border-radius: 26px; padding: 28px 30px; margin-bottom: 18px; }
.welcome h1 { color: #fff; margin-bottom: .2em; position: relative; }
.welcome p { color: #E3D9FA; margin: 0; position: relative; font-size: 1.05rem; }
.dash { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); margin-bottom: 26px; }
.cta { background: #FFF4D1; border-color: #FFE18A; }
.joincard form { display: flex; gap: 10px; }
.joincard input { text-align: center; font-weight: 900; letter-spacing: .18em; font-size: 1.2rem; color: var(--p); }
.stats3 { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--pl); border-radius: 16px; padding: 14px 8px; text-align: center; color: var(--t2); font-weight: 700; font-size: .82rem; }
.stat b { display: block; font-size: 1.9rem; color: var(--p); font-weight: 900; line-height: 1.1; }
.stats3 .stat:nth-child(2) { background: #DDF5EC; } .stats3 .stat:nth-child(2) b { color: #12754F; }
.stats3 .stat:nth-child(3) { background: #E3EEFE; } .stats3 .stat:nth-child(3) b { color: #1F5FBF; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rrow:last-child { border: 0; }
.rrow .dotc { width: 10px; height: 10px; border-radius: 50%; background: var(--g); flex: none; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stats .stat { padding: 18px; font-size: .95rem; }
.stats .stat b { font-size: 2.3rem; }

/* ----- табтар ----- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabbtn { background: var(--card); color: var(--t2); border: 1px solid var(--line); }
.tabbtn.on { background: var(--p); color: #fff; border-color: var(--p); }
.badge { background: var(--r); color: #fff; border-radius: 99px; padding: 0 8px; font-size: .78rem; }
.qtext { font-size: 1.1rem; font-weight: 800; }

/* ----- редактор ----- */
.qcard { margin-bottom: 16px; border-left: 8px solid var(--c, var(--r)); }
.qcard:nth-of-type(4n+1) { --c: var(--r); } .qcard:nth-of-type(4n+2) { --c: var(--b); }
.qcard:nth-of-type(4n+3) { --c: var(--y); } .qcard:nth-of-type(4n) { --c: var(--g); }
.qcard .qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.qcard .num { width: 36px; height: 36px; border-radius: 12px; background: var(--c); color: #fff; font-weight: 900; display: grid; place-items: center; flex: none; }
.qcard:nth-of-type(4n+3) .num { color: #3b2a00; }
.two { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.media-box { margin-top: 8px; padding: 10px; border: 2px dashed var(--line); border-radius: 14px; background: var(--bg); }
.media { max-width: 100%; border-radius: 14px; display: block; margin: 8px auto; max-height: 40vh; }
audio.media { width: 100%; }
details summary { cursor: pointer; color: var(--p2); font-weight: 700; margin-top: 12px; }

/* ----- ойын: ұйымдастырушы ----- */
.host-grid { display: grid; gap: 18px; grid-template-columns: 1fr 350px; align-items: start; }
@media (max-width: 900px) { .host-grid { grid-template-columns: 1fr; } }
.qbig { font-size: clamp(1.5rem, 3.4vw, 2.5rem); font-weight: 900; line-height: 1.25; margin: 12px 0; color: var(--t); }
.status { padding: 14px 18px; border-radius: 16px; font-weight: 800; margin: 14px 0; background: var(--pl); color: var(--p); }
.status.open { background: #E3EEFE; color: #1F5FBF; } .status.locked { background: #ECEAF1; color: var(--t2); }
.status.answering { background: #FFF1CC; color: #7A4E00; font-size: 1.3rem; } .status.revealed { background: #DDF5EC; color: #12754F; }
.answer-box { background: #FFF8E0; border: 2px dashed var(--y); border-radius: 16px; padding: 14px 16px; margin: 14px 0; }
.answer-box .a { font-size: 1.35rem; font-weight: 900; color: var(--p); }
.board { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 4), 1fr); }
.board .cat { background: var(--p); color: #fff; border-radius: 14px; padding: 10px 6px; text-align: center; font-weight: 800; font-size: .9rem; display: grid; place-items: center; min-height: 58px; }
.board button.cell { background: var(--b); color: #fff; font-size: 1.5rem; font-weight: 900; min-height: 66px; box-shadow: 0 4px 0 #1F5FBF; border-radius: 16px; }
.board button.cell:hover { background: #4b97fa; }
.board button.cell.used { background: #ECEAF1; color: var(--t3); text-decoration: line-through; box-shadow: none; }
.qlist { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); }
.qlist button { min-height: 50px; font-weight: 900; background: var(--b); color: #fff; box-shadow: 0 3px 0 #1F5FBF; }
.qlist button.used { background: #ECEAF1; color: var(--t3); box-shadow: none; }

/* ----- лобби ----- */
.qr { background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 12px; width: min(100%, 300px); margin: 0 auto; box-shadow: var(--sh); }
.qr svg { width: 100%; height: auto; display: block; }
.pin-label { text-align: center; font-size: .8rem; font-weight: 800; color: var(--t2); text-transform: uppercase; letter-spacing: .12em; margin-top: 14px; }
.code { font-size: 2.7rem; font-weight: 900; letter-spacing: .14em; text-align: center; color: var(--p); background: var(--pl); border-radius: 18px; padding: 4px 0 4px .14em; margin: 6px 0; }
.lobby { position: relative; overflow: hidden; background: var(--p); color: #fff; border-radius: 22px; padding: 26px 22px; text-align: center; margin-bottom: 18px; }
.lobby h2 { color: #fff; position: relative; margin-bottom: .6em; }
.lobby p { color: #E3D9FA; position: relative; margin: 14px 0 0; }
.lobby .d1 { width: 90px; height: 90px; right: -22px; top: -26px; } .lobby .d4 { left: -16px; bottom: -16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 99px; background: var(--y); color: #3b2a00; font-weight: 900; position: relative; }
h3 .pill { font-size: .85rem; vertical-align: middle; margin-left: 4px; }
.av-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; position: relative; }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--c, var(--p2)); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 1rem; flex: none; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.av-row .av { width: 46px; height: 46px; font-size: 1.15rem; border: 3px solid rgba(255, 255, 255, .85); }
.dots i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--y); margin-left: 5px; }

/* ----- ұпай тізімі ----- */
.score { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--bg); margin-bottom: 7px; }
.score .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.score .pt { font-weight: 900; color: var(--p); min-width: 3ch; text-align: right; font-size: 1.1rem; }
.score .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.score.off .nm, .score.off .av { opacity: .45; }
.score .adj { display: none; gap: 4px; }
.score:hover .adj, .score:focus-within .adj { display: flex; }
@media (hover: none) { .score .adj { display: flex; } }
.rank { width: 28px; height: 28px; border-radius: 50%; background: var(--pl); color: var(--p); display: grid; place-items: center; font-weight: 900; font-size: .85rem; flex: none; }
.rank.r1 { background: var(--y); color: #3b2a00; } .rank.r2 { background: #D6D3E0; color: var(--t); } .rank.r3 { background: #FFC9A3; color: #7A3A00; }
.podium .score { font-size: 1.15rem; padding: 12px 14px; }

/* ----- қатысушы экраны ----- */
.pbody { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.pbar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.pbar .pt { margin-left: auto; font-weight: 900; color: var(--p); font-size: 1.25rem; }
.pmain { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 640px; width: 100%; margin: 0 auto; }
.pmain > .qbig { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; margin: 0; box-shadow: var(--sh); font-size: clamp(1.35rem, 6vw, 2rem); }
.buzz { flex: 1; min-height: 38vh; border-radius: 30px; font-size: clamp(2.4rem, 13vw, 4.2rem); font-weight: 900; background: var(--r); color: #fff; box-shadow: 0 10px 0 #D94A3F, 0 20px 34px rgba(255, 102, 90, .35); letter-spacing: .05em; touch-action: manipulation; user-select: none; }
.buzz:hover { filter: none; transform: none; }
.buzz:active { transform: translateY(8px); box-shadow: 0 2px 0 #D94A3F; }
.buzz:disabled { background: #D9D5E6; color: var(--t2); box-shadow: 0 10px 0 #C4BEDA; font-size: 1.6rem; opacity: 1; }
.me-answer { background: var(--g); color: #fff; border-radius: 22px; padding: 26px; text-align: center; font-size: 1.7rem; font-weight: 900; box-shadow: 0 8px 0 #178a5f; }
.teamdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; }
.team-pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.team-pick label { margin: 0; cursor: pointer; }
.team-pick input { display: none; }
.team-pick span { display: block; padding: 14px; border-radius: 14px; border: 3px solid transparent; text-align: center; font-weight: 900; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); transition: transform .12s; }
.team-pick input:checked + span { border-color: var(--t); transform: scale(1.04); box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 99; display: grid; gap: 8px; pointer-events: none; }
#toast div { background: var(--t); color: #fff; padding: 12px 20px; border-radius: 14px; box-shadow: var(--sh2); font-weight: 700; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; width: 100%; height: 100%; }

/* ----- адаптивті ----- */
@media (max-width: 900px) {
  .shell { display: block; }
  .main { padding-bottom: 86px; }
  .mtop { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .side { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; top: auto; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(84, 36, 168, .08); gap: 0; }
  .side > .logo, .side-foot { display: none; }
  .side nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 2px; }
  .side-link { flex-direction: column; gap: 2px; padding: 6px 4px; min-height: 52px; font-size: .68rem; justify-content: center; text-align: center; border-radius: 12px; }
  .side-link:hover { transform: none; }
  .welcome { padding: 22px 20px; border-radius: 22px; }
  .hero { padding: 34px 14px 30px; }
  .stats3 .stat b { font-size: 1.5rem; }
  .wrap { padding: 16px 14px; }
  #toast { bottom: 96px; }
}
@media (max-width: 420px) { .hero .join { flex-direction: column; } .code { font-size: 2.2rem; } }
.hero .join button { flex: none; }

/* ----- анимациялар (reduced-motion сыйланады) ----- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.15); } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.03); } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: no-preference) {
  .wrap { animation: rise .35s ease both; }
  .deco { animation: floaty 6s ease-in-out infinite; }
  .d2 { animation-delay: -2s; } .d3 { animation-delay: -4s; }
  .av-row .av { animation: pop .4s ease both; }
  .me-answer { animation: pulse 1s infinite; }
  .dots i { animation: blink 1.2s infinite; } .dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
  #toast div { animation: rise .25s ease both; }
  .status.answering { animation: pulse 1.4s infinite; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; z-index: 5; }
@media (max-width: 900px) { .sticky-actions { bottom: 78px; } }
.welcome .deco { z-index: 0; } .welcome h1, .welcome p { position: relative; z-index: 2; }
@media (max-width: 900px) {
  .welcome .d3 { display: none; }
  .welcome .d1 { width: 80px; height: 80px; right: -22px; top: -30px; }
  .welcome .d2 { width: 44px; height: 44px; right: 16px; bottom: -22px; }
  .welcome h1, .welcome p { max-width: calc(100% - 60px); }
}

/* ----- таймер ----- */
.timer { position: relative; width: 64px; height: 64px; margin: 10px 0 0 auto; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-bg { fill: none; stroke: var(--pl); stroke-width: 5; }
.tr-fg { fill: none; stroke: var(--g); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset .2s linear, stroke .3s; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 1.4rem; color: var(--t); }
.timer.warn .tr-fg { stroke: var(--y); } .timer.low .tr-fg { stroke: var(--r); } .timer.low span { color: #D8392B; }
.pmain .timer { width: 76px; height: 76px; margin: 0 auto; }
@media (prefers-reduced-motion: no-preference) { .timer.low span { animation: pulse .6s infinite; } }

/* ----- проектор экраны ----- */
.dsp { min-height: 100dvh; padding: 18px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.dsp-top { display: flex; justify-content: space-between; align-items: center; }
.dsp-join { font-size: 1.3rem; color: var(--t2); font-weight: 700; } .dsp-join b { color: var(--p); }
.dsp-grid { display: grid; grid-template-columns: 1fr 380px; gap: 22px; flex: 1; align-items: start; }
@media (max-width: 1000px) { .dsp-grid { grid-template-columns: 1fr; } .dsp { padding: 14px; } }
.dsp-main { min-height: 72vh; padding: 30px; }
.dsp .qbig { font-size: clamp(2rem, 4.2vw, 4.2rem); margin: 18px 0; }
.dsp .timer { width: 110px; height: 110px; margin: 0 0 0 auto; } .dsp .timer span { font-size: 2.6rem; }
.dsp .tag { font-size: 1rem; padding: 5px 16px; }
.dsp .status { font-size: 1.7rem; padding: 20px 24px; }
.dsp .answer-box .a { font-size: 2.6rem; } .dsp .answer-box p { font-size: 1.5rem; }
.dsp .score { font-size: 1.2rem; }
.dsp .lobby { padding: 40px 28px; } .dsp .lobby h2 { font-size: 2.4rem; }
.dsp .av-row .av { width: 62px; height: 62px; font-size: 1.6rem; }
.dsp-buzz { display: flex; align-items: center; gap: 20px; background: #FFF1CC; color: #7A4E00; border-radius: 24px; padding: 24px 28px; font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 900; }
.dsp-buzz .av { width: 76px; height: 76px; font-size: 2.2rem; }
.dcell { background: var(--b); color: #fff; border-radius: 16px; min-height: 80px; display: grid; place-items: center; font-size: 2rem; font-weight: 900; box-shadow: 0 4px 0 #1F5FBF; }
.dcell.used { background: #ECEAF1; color: var(--t3); box-shadow: none; text-decoration: line-through; }
.dsp .board .cat { font-size: 1.05rem; min-height: 70px; }

/* ----- A / B / C / D нұсқалары ----- */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 8px; }
@media (max-width: 560px) { .opts { grid-template-columns: 1fr; } }
.opt { display: flex; align-items: center; gap: 12px; border-radius: 18px; padding: 16px 18px; font: inherit; font-weight: 800; font-size: 1.15rem; color: #fff; text-align: left; min-height: 74px; border: 0; position: relative; box-shadow: 0 5px 0 rgba(0, 0, 0, .2); justify-content: flex-start; }
.opt .ol { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .28); display: grid; place-items: center; font-weight: 900; font-size: 1.2rem; flex: none; }
.opt .ot { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt .oc { background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 2px 12px; font-weight: 900; }
.o-a { background: var(--r); } .o-b { background: var(--b); } .o-c { background: var(--y); color: #3b2a00; } .o-d { background: var(--g); }
.o-c .ol { background: rgba(0, 0, 0, .14); } .o-c .oc { background: rgba(0, 0, 0, .18); }
.opt.dim { opacity: .32; box-shadow: none; }
.opt.correct { outline: 5px solid var(--t); outline-offset: 2px; transform: scale(1.02); }
.opt.correct::after { content: "✓"; position: absolute; right: -10px; top: -14px; width: 34px; height: 34px; border-radius: 50%; background: var(--g); color: #fff; display: grid; place-items: center; font-weight: 900; border: 3px solid #fff; }
.opt.picked:not(.correct) { outline: 4px solid var(--t); outline-offset: 2px; }
button.opt:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.opts.pick .opt { min-height: 96px; font-size: 1.3rem; }
.opts.big .opt { min-height: 110px; font-size: clamp(1.4rem, 2.4vw, 2.2rem); border-radius: 22px; }
.opts.big .opt .ol { width: 54px; height: 54px; font-size: 1.8rem; }
.status.wrong { background: #FFE3E0; color: #C0392F; }
.optrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.optrow .ol { width: 38px; height: 38px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.optrow .o-c { color: #3b2a00; }
.okr { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-weight: 800; color: var(--t); }
.okr input { width: auto; min-height: 0; accent-color: var(--g); }

.chk { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--t); font-weight: 700; font-size: .95rem; }
.chk input { width: auto; min-height: 0; accent-color: var(--p); }

/* ----- проектордағы басқару (тек ұйымдастырушыға) ----- */
.dsp-ctl { position: fixed; right: 18px; bottom: 18px; display: flex; gap: 10px; align-items: center; z-index: 30; opacity: .28; transition: opacity .25s; }
.dsp-ctl:hover, .dsp-ctl.show { opacity: 1; }
.dsp-ctl:empty { display: none; }
.dsp-ctl button { box-shadow: 0 6px 18px rgba(36, 32, 51, .25); }
.dc-hint { background: var(--t); color: #fff; padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: .9rem; }
button.dcell { border: 0; padding: 0; font: inherit; font-size: 2rem; font-weight: 900; cursor: pointer; color: #fff; }
button.dcell:hover { background: #4b97fa; filter: none; }

/* ----- ортақ база: тақырыптар ----- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; scrollbar-width: thin; }
.chip { flex: none; white-space: nowrap; background: var(--card); color: var(--t); border: 1px solid var(--line); min-height: 40px; padding: 6px 16px; }
.chip span { color: var(--t2); font-size: .82rem; }
.chip.on { background: var(--p); color: #fff; border-color: var(--p); } .chip.on span { color: #E3D9FA; }
.tgroup { margin-bottom: 30px; } .tgroup h3 { font-size: 1.3rem; }
.sm-select { width: auto; max-width: 190px; min-height: 36px; padding: 4px 10px; font-size: .88rem; border-radius: 11px; }
.modal { position: fixed; inset: 0; background: rgba(36, 32, 51, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal .card { width: min(440px, 100%); box-shadow: var(--sh2); }

/* ----- аудио чат ----- */
.apanel { display: none; position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(84, 36, 168, .08); z-index: 15; }
.apanel.on { display: block; }
.ap-in { max-width: 640px; margin: 0 auto; display: grid; gap: 8px; }
button.mic { background: var(--pl); color: var(--p); min-height: 44px; }
button.mic.on { background: var(--g); color: #fff; box-shadow: 0 3px 0 #178a5f; }
button.mic:disabled { background: #ECEAF1; color: var(--t2); }
.dotm { width: 12px; height: 12px; border-radius: 50%; background: var(--t3); flex: none; }
.dotm.on { background: var(--g); box-shadow: 0 0 0 3px rgba(36, 180, 126, .3); } .dotm.lock { background: var(--r); }
.mbtns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* аватар таңдау және суретті аватарлар */
.av-img { background: none; padding: 0; overflow: hidden; text-shadow: none; }
.av-img svg { width: 100%; height: 100%; display: block; }
.avpick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.avpick label { margin: 0; cursor: pointer; display: block; }
.avpick input { position: absolute; opacity: 0; pointer-events: none; }
.avpick .av { width: 100%; height: auto; aspect-ratio: 1; border: 3px solid transparent; transition: transform .12s, border-color .12s; }
.avpick label:hover .av { transform: scale(1.06); }
.avpick input:checked + .av { border-color: var(--p, #5424A8); box-shadow: 0 0 0 3px rgba(84, 36, 168, .22); transform: scale(1.06); }
.avpick input:focus-visible + .av { outline: 3px solid var(--p, #5424A8); outline-offset: 2px; }
.pbar .av { width: 32px; height: 32px; }
