.quiz-window-body { min-height: 100vh; background: radial-gradient(circle at 50% 30%, #15221c 0%, var(--bg) 55%); }
.quiz-window-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.quiz-window-meta { display: flex; align-items: center; gap: 10px; }
.standalone-quiz { width: min(1120px, 100%); margin: 0 auto; padding: 12px 20px 40px; }
.standalone-quiz .table-stage { padding-top: 28px; padding-bottom: 52px; }
.standalone-table { width: min(820px, 86%); }
.standalone-question { width: min(720px, 100%); }
.standalone-question h2 { font-size: clamp(22px, 3vw, 32px); margin: 5px 0 18px; }
.standalone-question .quiz-feedback, .standalone-question .next-quiz { display: none; }
.standalone-question { transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease; }
.standalone-question.answer-correct { background: #173b25; border-color: #63d98b; box-shadow: 0 0 0 3px #63d98b24, 0 14px 36px #0005; }
.standalone-question.answer-wrong { background: #421f20; border-color: #f07171; box-shadow: 0 0 0 3px #f0717124, 0 14px 36px #0005; }

.quiz-start { width: min(520px, 100%); margin: 72px auto 0; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 18px 50px #0005; }
.student-quiz-start { width: min(560px, calc(100% - 32px)); margin-top: 12vh; }
.quiz-start h2 { margin: 5px 0 8px; font-size: clamp(24px, 4vw, 34px); }
.quiz-start-copy { margin: 0 0 22px; color: var(--muted); }
.quiz-start-form { display: grid; gap: 9px; }
.quiz-start-form label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.quiz-start-form input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.quiz-start-form input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-start-form .button { margin-top: 5px; }
.quiz-start-error { min-height: 20px; margin: 10px 0 0; color: var(--danger); }
.quiz-waiting {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #3b493e;
  border-radius: 12px;
  background: #101712;
}
.quiz-waiting[hidden] { display: none; }
.quiz-waiting p { margin: 4px 0 0; color: var(--muted); line-height: 1.4; }
.quiz-waiting .button { grid-column: 1 / -1; width: 100%; }
.quiz-waiting-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e7c34b;
  box-shadow: 0 0 0 5px #e7c34b20, 0 0 16px #e7c34b70;
  animation: waiting-pulse 1.4s ease-in-out infinite;
}
.quiz-waiting.is-ready .quiz-waiting-indicator {
  background: #b8f24b;
  box-shadow: 0 0 0 5px #b8f24b20, 0 0 16px #b8f24b70;
  animation: none;
}
@keyframes waiting-pulse {
  50% { opacity: .45; transform: scale(.82); }
}

.standalone-table .poker-seat { width: 132px; min-height: 0; padding: 0; }
.standalone-table .table-slot-0 { left: 50%; top: auto; bottom: -42px; transform: translate(-50%, 0); }
.standalone-table .table-slot-1 { left: 7%; top: 61%; }
.standalone-table .table-slot-2 { left: 27%; top: 1%; }
.standalone-table .table-slot-3 { left: 73%; top: 1%; }
.standalone-table .table-slot-4 { left: 93%; top: 61%; }
.standalone-table .poker-seat.is-folded { opacity: .42; filter: saturate(.45); }
.standalone-table .poker-seat.is-aggressor { border-color: #d9913b; box-shadow: 0 0 0 2px #ffb45422, 0 8px 24px #0009; }
.standalone-table .poker-seat.hero { opacity: 1; filter: none; border-color: var(--accent); }
.standalone-table .seat-action.action-fold { color: #84918b; }
.standalone-table .seat-action.action-call { color: #59b9ff; }
.standalone-table .seat-action.action-raise { color: #ffb454; font-weight: 900; }
.standalone-table .seat-action.action-active { color: var(--accent); font-weight: 900; }
.standalone-table .seat-top { min-height: 42px; display: grid; place-content: center; padding: 6px 9px; border-radius: 12px 12px 0 0; background: #19221e; }
.standalone-table .seat-bottom { padding: 6px 9px 7px; border-top: 1px solid #34443d; border-radius: 0 0 12px 12px; background: #101713; }
.standalone-table .seat-stack { display: block; color: #f3f5f0; font-size: 16px; line-height: 1.1; }
.standalone-table .seat-position { line-height: 1.1; }
.standalone-table .seat-action { margin-top: 3px; line-height: 1.1; }

.mbr-hole-cards { position: absolute; z-index: 4; display: flex; justify-content: center; gap: 4px; min-height: 51px; margin: 0; }
.mbr-card { --playing-card-top: #111419; --playing-card-bottom: #2a2e34; --playing-card-border: #4a4f58; width: 38.4px; height: 48px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--playing-card-border); border-radius: 5px; background: linear-gradient(169deg, var(--playing-card-top) 0 57%, var(--playing-card-bottom) 57% 100%); color: #f4f1e8; box-shadow: inset 0 -1px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.34); font: 700 46px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; text-rendering: geometricPrecision; }
.mbr-card .card-rank-glyph { display: block; color: #f4f1e8; font: inherit; line-height: 1; transform: translate(var(--card-rank-x, 0), 3px); }
.mbr-card.suit-s { --playing-card-top: #111419; --playing-card-bottom: #2a2e34; --playing-card-border: #4a4f58; }
.mbr-card.suit-h { --playing-card-top: #7b1020; --playing-card-bottom: #c51f39; --playing-card-border: #ef4058; }
.mbr-card.suit-d { --playing-card-top: #123c91; --playing-card-bottom: #2464cc; --playing-card-border: #3f7be0; }
.mbr-card.suit-c { --playing-card-top: #07502a; --playing-card-bottom: #13a84f; --playing-card-border: #2bc66c; }

.card-backs { position: absolute; z-index: 4; display: flex; justify-content: center; gap: 3px; min-height: 36px; margin: 0; }
.card-back { width: 27px; height: 35px; border: 2px solid #d7d3c7; border-radius: 4px; background-color: #283d77; background-image: repeating-linear-gradient(45deg, transparent 0 4px, #89a4e326 4px 6px), repeating-linear-gradient(-45deg, transparent 0 4px, #b6c6f126 4px 6px); box-shadow: inset 0 0 0 2px #14234e, 0 2px 6px #0006; }
.table-slot-0 .mbr-hole-cards, .table-slot-0 .card-backs { left: 50%; top: -57px; transform: translateX(-50%); }
.table-slot-1 .mbr-hole-cards, .table-slot-1 .card-backs { right: -68px; top: 50%; transform: translateY(-50%); }
.table-slot-2 .mbr-hole-cards, .table-slot-2 .card-backs { left: 50%; bottom: -51px; transform: translateX(-50%); }
.table-slot-3 .mbr-hole-cards, .table-slot-3 .card-backs { left: 50%; bottom: -51px; transform: translateX(-50%); }
.table-slot-4 .mbr-hole-cards, .table-slot-4 .card-backs { left: -68px; top: 50%; transform: translateY(-50%); }

.seat-wager { position: absolute; z-index: 3; display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 8px; background: #08140fdd; color: #f3f5f0; white-space: nowrap; font-size: 10px; box-shadow: 0 3px 8px #0007; }
.table-slot-0 .seat-wager { left: calc(100% + 8px); top: -14px; }
.table-slot-1 .seat-wager { right: -62px; top: -27px; }
.table-slot-2 .seat-wager { right: -62px; bottom: -22px; }
.table-slot-3 .seat-wager { left: -62px; bottom: -22px; }
.table-slot-4 .seat-wager { left: -62px; top: -27px; }
.chip-stack { position: relative; width: 18px; height: 15px; display: inline-block; }
.poker-chip { position: absolute; left: 1px; width: 16px; height: 7px; border: 1px solid #d9e4df; border-radius: 50%; background: #66736e; box-shadow: inset 0 0 0 2px #3c4742; }
.poker-chip:nth-child(1) { bottom: 0; }
.poker-chip:nth-child(2) { bottom: 4px; }
.poker-chip:nth-child(3) { bottom: 8px; }
.wager-raise .poker-chip { background: #42a86f; box-shadow: inset 0 0 0 2px #1e6340; }
.wager-medium .poker-chip { background: #d68b35; box-shadow: inset 0 0 0 2px #864e18; }
.wager-high .poker-chip { background: #d34c54; box-shadow: inset 0 0 0 2px #7d2027; }
.wager-amount { font-size: 10px; }
.history-raise { color: #ffcf85; border: 1px solid #ffb45440; }

.quiz-results { width: min(760px, 100%); margin: 46px auto 0; }
.quiz-results h2 { margin-bottom: 6px; }
.results-score { color: var(--muted); margin-bottom: 22px; }
.error-list { display: grid; gap: 9px; }
.error-hand { width: 100%; display: grid; grid-template-columns: 70px 1fr; gap: 3px 14px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; }
.error-hand:hover { border-color: var(--danger); background: #241a19; }
.error-hand strong { grid-row: 1 / 3; font-size: 23px; color: var(--danger); }
.error-hand span { font-size: 13px; font-weight: 800; }
.error-hand small { color: var(--muted); font-size: 11px; }
.results-empty { padding: 26px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.results-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

@media (max-width: 720px) {
  .quiz-window-header { padding: 12px; }
  .quiz-window-header .button { display: none; }
  .standalone-quiz { padding-inline: 8px; }
  .standalone-table { width: 92%; }
  .standalone-table .poker-seat { width: 92px; min-height: 58px; }
  .mbr-card { width: 29px; height: 37px; font-size: 35px; }
  .card-back { width: 22px; height: 29px; }
  .seat-wager { font-size: 8px; padding: 2px 4px; }
  .standalone-table .table-slot-1 { left: 4%; }
  .standalone-table .table-slot-4 { left: 96%; }
}
