/* OnlineTest — oyun ekranları: öğrenci (telefon) ve öğretmen (tahta) */

body.play, body.host {
  color: var(--chalk);
  background-color: var(--board);
  background-image: var(--chalk-dust);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  --focus: var(--yellow);
  transition: background-color .5s ease;
}
.sheet { background: var(--paper); color: var(--ink); border-radius: var(--r-l); box-shadow: var(--shadow-paper); --focus: #2f5bea; }

/* ============ ÖĞRENCİ ============ */

.p-screen {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.p-center { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.p-brand { text-align: center; font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; color: var(--chalk); }
.p-brand small { display: block; font-weight: 400; font-size: .9rem; color: var(--chalk-2); letter-spacing: 0; margin-top: 2px; }

.p-sheet { padding: 22px 20px 20px; }
.p-sheet h1 { font-size: 1.35rem; margin-bottom: 4px; }
.p-sheet .lead { color: var(--ink-2); margin-bottom: 18px; }
.p-sheet .btn { margin-top: 16px; }
.p-err { color: var(--bad); font-weight: 500; font-size: .95rem; margin-top: 12px; min-height: 1.2em; }
.p-links { text-align: center; margin-top: 6px; }
.p-links .btn-text { color: var(--chalk-2); font-size: .9rem; }

/* Optik formdaki numara kutuları gibi PIN alanı */
.pin-label { display: flex; justify-content: space-between; align-items: baseline; color: var(--form); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.pin-label span:last-child { font-weight: 400; color: var(--ink-3); font-size: .8rem; }
.pin-field { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.pin-box {
  aspect-ratio: 4 / 5;
  border: 2px solid var(--form);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: clamp(1.6rem, 9vw, 2.3rem);
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  font-variant-numeric: tabular-nums;
  transition: box-shadow .12s, background-color .12s;
}
.pin-box.is-current { box-shadow: 0 0 0 4px var(--form-soft); }
.pin-box.is-done { background: #fff7fa; }
.pin-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; font-size: 16px; border: 0; padding: 0; margin: 0;
  color: transparent; background: transparent; caret-color: transparent;
  cursor: text;
}
.p-sheet .input-name { font-size: 1.25rem; font-weight: 600; padding: .65em .8em; }

/* Bekleme salonu */
.p-lobby { text-align: center; }
.p-lobby .tag {
  display: inline-block;
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  font-weight: 700;
  padding: .25em .7em;
  border: 3px dashed var(--chalk-3);
  border-radius: 18px;
  margin: 10px 0 18px;
  word-break: break-word;
}
.p-lobby p { color: var(--chalk-2); font-size: 1.05rem; max-width: 28ch; margin: 0 auto; }
.dots { display: inline-flex; gap: 7px; margin-top: 22px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--chalk); opacity: .3; animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 40% { opacity: 1; transform: translateY(-4px); } }

/* Üst şerit: soru no, puan, süre */
.p-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.p-bar .qno { color: var(--chalk-2); font-size: .95rem; }
.p-bar .qno b { color: var(--chalk); font-size: 1.05rem; }
.p-pill { background: rgba(0, 0, 0, .2); padding: .3em .75em; border-radius: 999px; font-variant-numeric: tabular-nums; font-size: .95rem; display: inline-flex; gap: .4em; align-items: center; }
.p-pill.is-time { min-width: 3.4em; justify-content: center; }
.p-pill.is-hurry { background: var(--form); }
.p-timer { height: 8px; border-radius: 99px; background: var(--chalk-line); overflow: hidden; margin: 12px 0 14px; }
.p-timer i { display: block; height: 100%; width: 100%; background: var(--yellow); transform-origin: left center; }

.p-q { padding: 16px 18px; font-size: 1.12rem; font-weight: 600; line-height: 1.38; border-radius: var(--r-m); white-space: pre-line; word-break: break-word; }
.p-q .img { display: block; max-width: 100%; max-height: 30vh; margin: 12px auto 0; border-radius: 10px; object-fit: contain; }
.p-q .img:only-child { margin-top: 0; }
.p-points-tag { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 700; color: var(--form); }

/* Şık kutuları */
.p-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; grid-auto-rows: minmax(80px, auto); }
.p-tiles.n2:not(.is-big) { grid-auto-rows: minmax(110px, auto); }
.p-tiles.is-list { grid-template-columns: 1fr; gap: 10px; }
.p-tiles.n3 .tile:last-child, .p-tiles.n5 .tile:last-child { grid-column: 1 / -1; }
.tile {
  appearance: none;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 70px;
  border: 0;
  border-radius: var(--r-m);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  box-shadow: inset 0 0 0 3px var(--cs), 0 5px 0 var(--cd);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, opacity .25s, background-color .2s;
  -webkit-tap-highlight-color: transparent;
  word-break: break-word;
}
.tile .bubble { font-size: 1.05rem; }
.tile:active:not([disabled]) { transform: translateY(4px); box-shadow: inset 0 0 0 3px var(--cs), 0 1px 0 var(--cd); }
.tile[disabled] { cursor: default; }
.tile.is-picked { background: var(--c); color: #fff; box-shadow: 0 5px 0 var(--cd); }
.tile.is-picked .bubble { background: #fff; color: var(--c); border-color: #fff; }
.tile.is-faded { opacity: .38; }

/* Soru telefonda gösterilmiyorsa: büyük harf kutuları */
.p-tiles.is-big { flex: 1; grid-auto-rows: 1fr; margin-top: 4px; }
.p-tiles.is-big .tile { flex-direction: column; justify-content: center; background: var(--c); box-shadow: 0 6px 0 var(--cd); min-height: 0; }
.p-tiles.is-big .tile .bubble { width: auto; height: auto; aspect-ratio: 1; width: min(26vw, 120px); font-size: min(13vw, 60px); border-width: 5px; border-color: #fff; color: #fff; background: transparent; }
.p-tiles.is-big .tile.is-picked .bubble { background: #fff; color: var(--c); }
.p-tiles.is-big.n2 { grid-template-columns: 1fr; }

/* İşaretlendi / hazır ol / sonuç */
.p-state { text-align: center; }
.p-state h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.p-state p { color: var(--chalk-2); font-size: 1.05rem; margin-top: 8px; }
.p-mark {
  width: 116px; height: 116px; border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  font-size: 54px; font-weight: 800;
  background: #fff; color: var(--ink);
}
.p-mark .ic { width: 58px; height: 58px; stroke-width: 3; }
.p-mark.is-ok { background: var(--ok); color: #fff; box-shadow: 0 0 0 8px rgba(255, 255, 255, .12); }
.p-mark.is-bad { background: var(--bad); color: #fff; box-shadow: 0 0 0 8px rgba(255, 255, 255, .12); }
.p-mark.is-none { background: rgba(0, 0, 0, .22); color: var(--chalk); }
.p-mark.is-pick { background: var(--c); color: #fff; box-shadow: 0 0 0 8px rgba(255, 255, 255, .14); animation: fillIn .35s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes fillIn { from { transform: scale(.6); opacity: .4; } }
.p-count { font-size: 76px; font-weight: 800; line-height: 1; }
.p-ready-q { margin-top: 20px; padding: 16px 18px; font-weight: 600; font-size: 1.1rem; text-align: left; border-radius: var(--r-m); white-space: pre-line; word-break: break-word; }

.p-points { display: inline-block; margin-top: 16px; font-size: 1.5rem; font-weight: 800; background: rgba(0, 0, 0, .22); padding: .3em .9em; border-radius: 999px; font-variant-numeric: tabular-nums; }
.p-streak { display: flex; align-items: center; justify-content: center; gap: .4em; margin-top: 12px; color: var(--yellow); font-weight: 600; }
.p-answer { margin: 18px auto 0; padding: 14px 16px; display: flex; gap: 12px; align-items: center; text-align: left; max-width: 420px; border-radius: var(--r-m); font-weight: 600; }
.p-answer small { display: block; color: var(--ink-3); font-weight: 500; font-size: .8rem; }
.p-rank { margin-top: 26px; padding: 16px 18px; border-radius: var(--r-m); text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.p-rank .bubble { font-size: 1.15rem; grid-row: span 2; width: 2.6em; height: 2.6em; }
.p-rank b { font-size: 1.1rem; }
.p-rank span { color: var(--ink-2); font-size: .92rem; }
.p-rank .gap { grid-column: 1 / -1; border-top: 2px dashed var(--form-soft); margin-top: 8px; padding-top: 10px; color: var(--ink-2); font-size: .92rem; }

body.play.is-correct { background-color: #1d6a45; }
body.play.is-wrong { background-color: #5b2b33; }

/* Tahta yok modu: telefonda sıralama ve kürsü */
.p-mark.sm { width: 84px; height: 84px; margin-bottom: 12px; }
.p-mark.sm .p-count { font-size: 50px; }
.p-ready-q .img { display: block; max-width: 100%; max-height: 26vh; margin: 12px auto 0; border-radius: 10px; object-fit: contain; }
.p-ready-q .img:first-child { margin-top: 0; }
.p-tag { display: inline-flex; align-items: center; gap: .45em; font-weight: 700; font-size: 1.05rem; background: rgba(0, 0, 0, .22); padding: .4em .9em; border-radius: 999px; }
.p-tag.ok { background: var(--ok); }
.p-tag.bad { background: var(--bad); }
.p-tag .ic { stroke-width: 3; }
.p-board { margin-top: 18px; padding: 16px 18px 6px; text-align: left; }
.p-board h2 { font-size: 1.15rem; margin-bottom: 6px; }
.p-brow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 2px dashed var(--form-soft); }
.p-brow .bubble { font-size: .8rem; }
.p-brow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.p-brow .d { color: var(--ok); font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.p-brow .s { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.6em; text-align: right; }
.p-brow.is-me { background: #fff5cc; border-top-color: transparent; margin: 0 -10px; padding: 10px; border-radius: 10px; }
.p-brow.is-me + .p-brow { border-top-color: transparent; }
.p-podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: 230px; margin: 10px 0 18px; }
.pp { flex: 1; max-width: 116px; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.pp b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; }
.pp span { color: var(--chalk-2); font-size: .8rem; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.pp .blk { width: 100%; background: #fff; color: var(--ink); border-radius: 12px 12px 0 0; display: flex; justify-content: center; padding-top: 10px; font-weight: 800; font-size: 1.5rem; transform-origin: bottom; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.pp.p1 .blk { height: 124px; background: var(--yellow); color: var(--yellow-ink); animation-delay: .5s; }
.pp.p2 .blk { height: 88px; animation-delay: .25s; }
.pp.p3 .blk { height: 62px; }
.pp.is-me b { color: var(--yellow); }

/* Final */
.p-final .medal {
  width: 150px; height: 150px; border-radius: 50%;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  background: #fff; color: var(--ink);
  font-size: 64px; font-weight: 800; letter-spacing: -.03em;
  border: 8px solid rgba(255, 255, 255, .25);
  background-clip: padding-box;
}
.p-final .medal.m1 { background: var(--yellow); color: var(--yellow-ink); }
.p-final .medal.m2 { background: #dfe5ea; }
.p-final .medal.m3 { background: #e7a46b; color: #3d1f05; }
.p-final .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.p-final .stats div { background: rgba(0, 0, 0, .2); border-radius: var(--r-m); padding: 12px 6px; }
.p-final .stats b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.p-final .stats span { font-size: .8rem; color: var(--chalk-2); }
.p-foot { display: flex; justify-content: space-between; align-items: center; color: var(--chalk-2); font-size: .9rem; padding-top: 16px; gap: 10px; margin-top: auto; }
.p-foot b { color: var(--chalk); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Konfeti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ============ ÖĞRETMEN EKRANI (TAHTA) ============ */

body.host { overflow: hidden; }
.h-stage {
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 2.4vh;
  padding: 3vh 3vw;
}
.h-top { display: flex; align-items: center; justify-content: space-between; gap: 2vw; font-size: clamp(14px, 2.2vh, 26px); min-height: 5vh; }
.h-top .left, .h-top .right { display: flex; align-items: center; gap: 1.2vw; }
.h-title { font-weight: 700; color: var(--chalk); max-width: 50vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-progress { font-weight: 600; color: var(--chalk-2); }
.h-progress b { color: var(--chalk); }
.h-chip { display: inline-flex; align-items: center; gap: .45em; background: rgba(0, 0, 0, .2); border-radius: 999px; padding: .35em .85em; font-weight: 600; font-variant-numeric: tabular-nums; }
.h-tool { background: rgba(0, 0, 0, .18); color: var(--chalk); border: 0; border-radius: 12px; padding: .5em; display: inline-grid; place-items: center; cursor: pointer; font: inherit; }
.h-tool:hover { background: rgba(0, 0, 0, .3); }
.h-tool.txt { padding: .5em .9em; display: inline-flex; gap: .45em; font-weight: 600; font-size: .9em; }
.h-btn { font-size: clamp(16px, 2.5vh, 30px); }
.h-bottom { display: flex; align-items: center; justify-content: space-between; gap: 2vw; font-size: clamp(14px, 2.2vh, 26px); }
.h-bottom .left, .h-bottom .right { display: flex; align-items: center; gap: 1.2vw; }
.h-hint { color: var(--chalk-3); font-size: .85em; }

/* Bekleme salonu */
.h-join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 3vw;
  padding: 2.6vh 2.6vw;
}
.h-join .how { font-size: 2.4vh; color: var(--ink-2); min-width: 0; }
.h-join .how b { display: block; color: var(--ink); font-size: clamp(20px, 4.2vh, 56px); font-weight: 700; letter-spacing: -.01em; word-break: break-all; line-height: 1.15; margin-top: .2vh; }
.h-pin-wrap .lbl { color: var(--form); font-weight: 600; font-size: 2.2vh; margin-bottom: 1vh; }
.h-pin { display: flex; gap: .7vw; }
.h-pin span {
  width: 8.4vh; height: 10.8vh;
  border: .45vh solid var(--form);
  border-radius: 1.4vh;
  display: grid; place-items: center;
  font-size: 7.4vh; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.h-qr { width: 17vh; height: 17vh; padding: .8vh; border-radius: 1.2vh; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.h-qr svg { width: 100%; height: 100%; display: block; }

.h-names { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 1.6vh 1.2vw; padding: 2vh 2vw; overflow: auto; }
.h-name {
  font: inherit;
  font-size: clamp(16px, 3.1vh, 40px);
  font-weight: 600;
  color: var(--chalk);
  padding: .3em .8em;
  border-radius: 999px;
  background: rgba(0, 0, 0, .16);
  border: 2px solid var(--chalk-line);
  cursor: pointer;
  animation: chalkIn .4s cubic-bezier(.2, .9, .3, 1.25) both;
  max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.h-name:hover, .h-name:focus-visible { background: var(--bad); border-color: var(--bad); text-decoration: line-through; }
@keyframes chalkIn { from { opacity: 0; transform: scale(.6) rotate(-4deg); } }
.h-empty { margin: auto; text-align: center; color: var(--chalk-3); font-size: clamp(16px, 3vh, 34px); max-width: 30ch; }
.h-empty b { display: block; color: var(--chalk-2); font-size: 1.25em; margin-bottom: .4em; font-weight: 600; }
.h-count-big { font-size: clamp(20px, 4vh, 48px); font-weight: 800; display: inline-flex; align-items: center; gap: .4em; }
.h-count-big .ic { width: .9em; height: .9em; }

/* Soru */
.h-q { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2.4vh; min-height: 0; }
.h-q.no-media { grid-template-rows: minmax(0, 1fr) auto; }
.h-q.no-media .h-media .h-qtext { width: 100%; max-height: 100%; overflow: auto; padding: 4.4vh 3vw; font-size: clamp(24px, 6vh, 80px); }
.h-q.no-media .h-media .h-qtext.is-long { font-size: clamp(20px, 4.6vh, 60px); }
.h-q.no-media .h-media .h-qtext.is-xlong { font-size: clamp(18px, 3.5vh, 46px); }
.h-qtext { padding: 2.6vh 3vw; font-size: clamp(22px, 4.6vh, 60px); font-weight: 700; line-height: 1.22; text-align: center; letter-spacing: -.01em; word-break: break-word; white-space: pre-line; }
.h-qtext.is-long { font-size: clamp(18px, 3.6vh, 46px); }
.h-qtext.is-xlong { font-size: clamp(16px, 2.9vh, 38px); text-align: left; }
.h-mid { display: grid; grid-template-columns: 1fr minmax(0, 3.2fr) 1fr; align-items: center; gap: 2vw; min-height: 0; }
.h-media { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.h-media img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: var(--r-m); background: #fff; padding: .7vh; box-shadow: var(--shadow-paper); }
.h-media .ph { color: var(--chalk-3); font-size: 2.4vh; }
.h-timer { justify-self: start; width: 17vh; height: 17vh; position: relative; }
.h-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.h-timer .track { fill: rgba(0, 0, 0, .2); stroke: var(--chalk-line); }
.h-timer .ring { fill: none; stroke: var(--yellow); stroke-linecap: round; transition: stroke .3s; }
.h-timer .t { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7vh; font-weight: 800; font-variant-numeric: tabular-nums; }
.h-timer.is-hurry .ring { stroke: #ff7b9c; }
.h-answered { justify-self: end; text-align: center; }
.h-answered b { display: block; font-size: 8vh; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.h-answered span { font-size: 2.3vh; color: var(--chalk-2); }

.h-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8vh 1.2vw; }
.h-tiles.n3 .h-tile:last-child, .h-tiles.n5 .h-tile:last-child { grid-column: 1 / -1; }
.h-tile {
  background: #fff; color: var(--ink);
  border-radius: var(--r-m);
  display: flex; align-items: center; gap: 1.2vw;
  padding: 1.5vh 1.4vw;
  min-height: 9.5vh;
  font-size: clamp(16px, 3.2vh, 42px);
  font-weight: 600;
  line-height: 1.2;
  box-shadow: inset 0 0 0 .5vh var(--cs), 0 .7vh 0 var(--cd);
  transition: opacity .4s, transform .4s;
  word-break: break-word;
}
.h-tile .bubble { font-size: .95em; width: 2.2em; height: 2.2em; border-width: .45vh; }
.h-tile .txt { flex: 1; min-width: 0; }
.h-tile .mark { flex: none; display: none; }
.h-tile .mark .ic { width: 5vh; height: 5vh; stroke-width: 3; }
.h-tiles.is-tight .h-tile { min-height: 7.4vh; font-size: clamp(14px, 2.7vh, 34px); padding: 1.1vh 1.2vw; }
.h-tile.is-right .bubble { background: var(--c); color: #fff; }
.h-tile.is-right .mark { display: block; color: var(--ok); }
.h-tile.is-wrong { background: rgba(255, 255, 255, .06); color: var(--chalk-3); box-shadow: inset 0 0 0 2px var(--chalk-line); }
.h-tile.is-wrong .bubble { background: transparent; border-color: var(--chalk-3); color: var(--chalk-3); }

/* Hazırlık (soru okuma) */
.h-pre { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.4vh; min-height: 0; }
.h-pre .h-qtext { width: min(86vw, 1500px); font-size: clamp(24px, 5.6vh, 76px); padding: 4vh 4vw; }
.h-pre .h-qtext.is-long { font-size: clamp(20px, 4.4vh, 58px); }
.h-pre .h-qtext.is-xlong { font-size: clamp(18px, 3.4vh, 44px); }
.h-pre .h-media { max-height: 38vh; height: auto; }
.h-pre .h-media img { max-height: 38vh; }
.h-pre-bar { width: min(60vw, 900px); height: 1.2vh; border-radius: 99px; background: var(--chalk-line); overflow: hidden; }
.h-pre-bar i { display: block; height: 100%; width: 100%; background: var(--yellow); transform-origin: left center; }
.h-pre-label { color: var(--chalk-2); font-size: 2.6vh; font-weight: 500; }

/* Cevap dağılımı */
.h-bars { height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2.2vw; padding-top: 1vh; }
.h-bar { width: min(10vw, 17vh); height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.h-bar .n { font-size: 4.4vh; font-weight: 800; line-height: 1; margin-bottom: .8vh; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: .3em; }
.h-bar .n .ic { width: 4vh; height: 4vh; stroke-width: 3; color: var(--yellow); }
.h-bar .fill { width: 100%; background: var(--c); border-radius: 1.2vh 1.2vh .4vh .4vh; min-height: 1vh; box-shadow: inset 0 -.6vh 0 var(--cd); animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; transform-origin: bottom; }
.h-bar.is-wrong .fill { opacity: .45; }
@keyframes grow { from { transform: scaleY(0); } }

/* Sıralama */
.h-board-wrap { display: grid; place-items: center; min-height: 0; }
.h-board { width: min(74vw, 1200px); padding: 3.4vh 3vw 2vh; }
.h-board h2 { font-size: clamp(20px, 4.4vh, 56px); margin-bottom: 1.6vh; }
.h-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: 1.8vw;
  padding: 1.7vh 0;
  border-top: 2px dashed var(--form-soft);
  font-size: clamp(16px, 3.8vh, 48px);
  animation: rowIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
.h-row .bubble { font-size: .7em; width: 2.1em; height: 2.1em; }
.h-row.r1 .bubble { background: var(--form); color: #fff; }
.h-row .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-row .delta { color: var(--ok); font-weight: 600; font-size: .62em; font-variant-numeric: tabular-nums; }
.h-row .score { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.5ch; text-align: right; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-3vw); } }

/* Kürsü */
.h-podium { display: flex; align-items: flex-end; justify-content: center; gap: 2vw; height: 100%; padding-top: 2vh; }
.h-pod { width: min(20vw, 360px); display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.h-pod .who { font-size: clamp(18px, 4.2vh, 54px); font-weight: 800; text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: fadeUp .5s ease-out both; }
.h-pod .pts { font-size: clamp(14px, 2.8vh, 34px); color: var(--chalk-2); margin: .6vh 0 1.8vh; font-variant-numeric: tabular-nums; animation: fadeUp .5s ease-out both; }
.h-pod .block {
  width: 100%;
  background: #fff; color: var(--ink);
  border-radius: 1.6vh 1.6vh 0 0;
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 2.4vh;
  box-shadow: inset 0 -1.2vh 0 rgba(29, 43, 83, .06);
  transform-origin: bottom;
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) both;
}
.h-pod .block .bubble { font-size: 6vh; border-width: .6vh; width: 1.9em; height: 1.9em; }
.h-pod.p1 .block { height: 44vh; }
.h-pod.p1 .block .bubble { background: var(--yellow); border-color: var(--yellow-deep); color: var(--yellow-ink); }
.h-pod.p2 .block { height: 32vh; }
.h-pod.p2 .block .bubble { border-color: #9aa6b2; color: var(--ink); }
.h-pod.p3 .block { height: 23vh; }
.h-pod.p3 .block .bubble { border-color: #c7804a; color: #6b3810; }
.h-pod.p3 .block, .h-pod.p3 .who, .h-pod.p3 .pts { animation-delay: .2s; }
.h-pod.p2 .block, .h-pod.p2 .who, .h-pod.p2 .pts { animation-delay: .9s; }
.h-pod.p1 .block, .h-pod.p1 .who, .h-pod.p1 .pts { animation-delay: 1.7s; }
@keyframes rise { from { transform: scaleY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(2vh); } }

.h-msg { margin: auto; text-align: center; max-width: 40ch; }
.h-msg h1 { font-size: clamp(24px, 5vh, 60px); margin-bottom: 2vh; }
.h-msg p { color: var(--chalk-2); font-size: clamp(16px, 2.6vh, 30px); }

/* Öğretmen ekranı telefonda veya dikey ekranda (tahta yokken oyunu telefondan yönetmek için) */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  body.host { overflow: auto; }
  .h-stage { height: auto; min-height: 100vh; min-height: 100dvh; grid-template-rows: auto auto auto; align-content: start; padding: 14px 14px 20px; gap: 14px; }
  .h-top, .h-bottom { font-size: 14px; flex-wrap: wrap; gap: 10px; min-height: 0; }
  .h-top .left, .h-top .right, .h-bottom .left, .h-bottom .right { gap: 8px; flex-wrap: wrap; }
  .h-top .lbl { display: none; }
  .h-tool[data-act="full"] { display: none; }
  .h-title { max-width: 62vw; }
  .h-btn { font-size: 16px; }
  .h-bottom .btn-lg { padding: .8em 1.3em; }
  .h-hint { display: none; }
  .h-join { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 14px; padding: 18px 14px; }
  .h-join .how { font-size: 14px; }
  .h-join .how b { font-size: 21px; }
  .h-pin-wrap .lbl { font-size: 13px; margin-bottom: 6px; }
  .h-pin { gap: 6px; justify-content: center; }
  .h-pin span { width: 12.5vw; height: 15vw; max-width: 66px; max-height: 80px; font-size: min(9vw, 50px); border-width: 3px; border-radius: 10px; }
  .h-qr { width: 132px; height: 132px; }
  .h-names { padding: 4px 0; gap: 8px; }
  .h-name { font-size: 16px; max-width: 80vw; }
  .h-empty { font-size: 16px; padding: 18px 0; }
  .h-count-big { font-size: 20px; }
  .h-q, .h-q.no-media { grid-template-rows: auto; gap: 12px; }
  .h-qtext, .h-qtext.is-long, .h-qtext.is-xlong,
  .h-pre .h-qtext, .h-pre .h-qtext.is-long, .h-pre .h-qtext.is-xlong,
  .h-q.no-media .h-media .h-qtext, .h-q.no-media .h-media .h-qtext.is-long, .h-q.no-media .h-media .h-qtext.is-xlong { font-size: 19px; padding: 14px 16px; text-align: left; width: 100%; }
  .h-mid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .h-mid .h-media { grid-column: 1 / -1; grid-row: 1; }
  .h-mid .h-bars { grid-column: 1 / -1; grid-row: 1; height: 170px; }
  .h-spacer { display: none; }
  .h-media img, .h-pre .h-media img { max-height: 34vh; }
  .h-timer { width: 84px; height: 84px; }
  .h-timer .t { font-size: 30px; }
  .h-answered b { font-size: 34px; }
  .h-answered span { font-size: 13px; }
  .h-tiles, .h-tiles.n3, .h-tiles.n5 { grid-template-columns: 1fr; gap: 10px; }
  .h-tile, .h-tiles.is-tight .h-tile { font-size: 17px; min-height: 56px; padding: 10px 12px; gap: 12px; box-shadow: inset 0 0 0 3px var(--cs), 0 4px 0 var(--cd); }
  .h-tile.is-wrong { box-shadow: inset 0 0 0 2px var(--chalk-line); }
  .h-tile .bubble { border-width: 3px; }
  .h-tile .mark .ic { width: 26px; height: 26px; }
  .h-pre { gap: 16px; padding: 6px 0; }
  .h-pre-bar { width: 100%; height: 8px; }
  .h-pre-label { font-size: 15px; }
  .h-bar .n { font-size: 20px; }
  .h-bar .n .ic { width: 18px; height: 18px; }
  .h-bar .fill { border-radius: 8px 8px 3px 3px; }
  .h-board { width: 100%; padding: 16px 16px 8px; }
  .h-board h2 { font-size: 20px; margin-bottom: 8px; }
  .h-row { font-size: 17px; padding: 10px 0; gap: 10px; }
  .h-podium { height: 54vh; gap: 8px; padding-top: 0; }
  .h-pod { width: 30vw; }
  .h-pod .who { font-size: 16px; }
  .h-pod .pts { font-size: 13px; margin: 2px 0 8px; }
  .h-pod .block .bubble { font-size: 24px; border-width: 4px; }
  .h-pod.p1 .block { height: 30vh; }
  .h-pod.p2 .block { height: 22vh; }
  .h-pod.p3 .block { height: 16vh; }
  .h-msg h1 { font-size: 24px; }
  .h-msg p { font-size: 16px; }
}
