:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #697386;
  --line: #dfe5ee;
  --panel: #ffffff;
  --page: #f5f7fb;
  --brand: #126b63;
  --brand-dark: #0a4d47;
  --accent: #d94f30;
  --pink: #f43d9a;
  --lemon: #ffe01b;
  --blue: #12165f;
  --gold: #d89d18;
  --ok: #168047;
  --danger: #bf2e2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 224, 27, 0.32), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(244, 61, 154, 0.14), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--page) 48%, #eef7f5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.player-only-mode .topbar {
  display: flex;
  margin-bottom: 12px;
}

.player-only-mode .player-layout {
  margin-top: 0;
}

.player-only-mode #playoffPlayerPanel {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(18, 22, 95, 0.18);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.mode-button {
  padding: 9px 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mode-button.active {
  color: white;
  background: var(--brand);
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(220px, 300px) minmax(380px, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}

.home-view {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.home-choice {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-height: 240px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.9));
  box-shadow: 0 18px 48px rgba(24, 32, 42, 0.11);
  position: relative;
  overflow: hidden;
}

.home-choice::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -42px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 224, 27, 0.26);
}

.home-choice h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.home-choice p:not(.eyebrow) {
  color: var(--muted);
}

.admin-workspace {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  width: fit-content;
}

.admin-tab {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.admin-tab.active {
  color: white;
  background: var(--brand);
}

.admin-info-panel {
  max-width: 840px;
}

.admin-info-panel h2 {
  margin-bottom: 8px;
}

.admin-info-panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.flashcards-panel {
  display: grid;
  gap: 16px;
}

.flashcards-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px;
}

.flash-section,
.flash-trainer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.flash-section h3,
.flash-trainer h3 {
  margin: 0 0 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.flash-deck-list,
.flash-card-list {
  display: grid;
  gap: 8px;
}

.flash-deck-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.flash-deck-row.active {
  border-color: var(--brand);
  background: #eef8f6;
}

.flash-deck-row .ghost-button {
  display: grid;
  justify-items: start;
  height: auto;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.flash-deck-row span,
.muted-small {
  color: var(--muted);
  font-size: 0.86rem;
}

.flash-trainer.empty {
  color: var(--muted);
}

.flash-review-card {
  width: 100%;
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: linear-gradient(180deg, #fff7d6, #ffffff);
  text-align: center;
}

.flash-review-image {
  max-width: min(100%, 520px);
  max-height: 230px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}

.flash-review-card.back {
  background: linear-gradient(180deg, #e6f2f0, #ffffff);
}

.flash-review-card span {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 900;
  line-height: 1.2;
}

.flash-review-card small {
  color: var(--muted);
  font-weight: 800;
}

.flash-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.flash-form-actions {
  display: grid;
  gap: 8px;
}

.flash-stage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.flash-stage-filter {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #f8fafc;
  font-weight: 800;
}

.flash-stage-filter strong {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--brand);
  background: #e6f2f0;
  text-align: center;
}

.flash-stage-filter.active {
  border-color: var(--brand);
  color: white;
  background: var(--brand);
}

.flash-stage-filter.active strong {
  color: var(--brand);
  background: white;
}

.flash-card-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.flash-card-row.is-hard {
  border-color: #f4b740;
  background: #fff8e8;
  box-shadow: inset 4px 0 0 #f4b740;
}

.flash-card-row-main {
  display: grid;
  gap: 6px;
}

.flash-hard-badge,
.flash-hard-note {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #8a4b00;
  background: #fff0c7;
  font-size: 12px;
  font-weight: 900;
}

.flash-hard-note {
  margin: 4px 0 10px;
}

.flash-card-thumb {
  max-width: 150px;
  max-height: 90px;
  object-fit: contain;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: white;
}

.flash-card-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.flash-image-edit-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.flash-image-edit-preview img {
  max-width: 220px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: white;
}

.flash-card-row-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.flash-card-row-actions small {
  color: var(--muted);
  font-weight: 900;
}

.flash-card-row-actions > span {
  color: var(--brand);
  font-weight: 900;
  white-space: nowrap;
}

.management-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 16px;
  align-items: start;
}

.management-form {
  display: grid;
  gap: 4px;
}

.management-list {
  display: grid;
  gap: 8px;
}

.management-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.management-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tournament-row {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--line);
}

.bank-question-builder {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.bank-list {
  margin-top: 14px;
}

.tournament-actions {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 82px;
  gap: 8px;
  min-width: 280px;
}

.tournament-actions button {
  grid-column: 1 / -1;
}

.tournament-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tournament-player-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf1f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tournament-player-list span.eliminated {
  opacity: 0.55;
  text-decoration: line-through;
}

.presence-dot {
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  display: inline-block;
  background: #b9c4d3;
}

.presence-dot.online {
  background: #168047;
  box-shadow: 0 0 0 3px rgba(22, 128, 71, .16);
}

.presence-dot.offline {
  background: #bf2e2e;
}

.remove-tournament-player-button {
  width: 20px;
  height: 20px;
  margin-left: 7px;
  border: 0;
  border-radius: 50%;
  background: #f1c9cc;
  color: #901c29;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.reconnect-tournament-player-button {
  min-height: 26px;
  padding: 0 8px;
  margin-left: 7px;
  border: 0;
  border-radius: 999px;
  background: #d9ecf3;
  color: #14516b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.tournament-setup {
  max-width: 540px;
  gap: 12px;
}

.tournament-lobby {
  display: grid;
  gap: 16px;
}

.tournament-lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.tournament-lobby-head h3 {
  margin: 8px 0 5px;
  font-size: 22px;
}

.tournament-lobby-head p {
  margin: 0;
  color: var(--muted);
}

.tournament-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tournament-pin-box {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 17px;
  border-radius: 8px;
  background: #102a43;
  color: white;
}

.tournament-pin-box span {
  color: #d0e2ef;
  font-size: 12px;
  font-weight: 800;
}

.tournament-pin-box strong {
  color: #ffd34d;
  font-size: clamp(33px, 6vw, 48px);
  letter-spacing: 0;
}

.tournament-lobby-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.tournament-lobby-actions .qualifiers-field {
  min-width: 205px;
}

.archived-tournaments {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.archived-tournaments summary {
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.archived-tournament-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #f7f9fc;
}

.bracket-empty {
  margin-top: 14px;
}

.tournament-bracket {
  display: grid;
  gap: 13px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d8e0ed;
  border-radius: 8px;
  background: #f7f9fc;
}

.bracket-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.bracket-heading span {
  color: var(--muted);
  font-size: 13px;
}

.bracket-rounds {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.bracket-round {
  position: relative;
  flex: 0 0 222px;
  display: grid;
  gap: 10px;
}

.bracket-round h4 {
  margin: 0;
  color: #243b57;
  font-size: 13px;
}

.bracket-match {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid #d9e1ed;
  border-radius: 8px;
  background: white;
}

.bracket-match.finished {
  border-color: #b8dbc9;
}

.bracket-match-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bracket-match-top em {
  font-style: normal;
  color: #3c6e69;
}

.bracket-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef3f8;
  color: #213148;
  font-size: 13px;
}

.bracket-player.winner {
  background: #dcf6e8;
  color: #12653c;
  font-weight: 900;
}

.bracket-player.empty {
  color: var(--muted);
}

.bracket-player.eliminated,
.player-bracket-match .eliminated {
  opacity: .58;
  text-decoration: line-through;
}

.bracket-match .ghost-button {
  min-height: 30px;
  margin-top: 3px;
  font-size: 12px;
}

.tournament-finale {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 14px 14px;
  border-radius: 8px;
  background: linear-gradient(145deg, #10283d, #162238);
  color: white;
}

.tournament-crown {
  color: #ffd34d;
  font-size: 48px;
  line-height: 1;
}

.tournament-finale > strong {
  font-size: clamp(24px, 4vw, 46px);
}

.tournament-podium {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  align-items: end;
  margin-top: 8px;
}

.tournament-podium div {
  display: grid;
  gap: 5px;
  justify-items: center;
  width: clamp(108px, 16vw, 154px);
  padding: 10px 5px;
  border-radius: 6px 6px 0 0;
  overflow-wrap: anywhere;
  text-align: center;
  opacity: 0;
  transform: translateY(26px);
  animation: podium-rise .62s cubic-bezier(.22, 1, .36, 1) forwards;
}

.tournament-podium .gold {
  min-height: 178px;
  background: linear-gradient(180deg, #ffd955, #e3a81a);
  color: #221a06;
}

.tournament-podium .silver {
  min-height: 116px;
  color: #172334;
  border: 1px solid rgba(255, 255, 255, .78);
  background: linear-gradient(142deg, #fff 0%, #dfe6ee 26%, #aab7c7 51%, #f1f4f8 76%, #8897a8 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), 0 12px 25px rgba(0, 0, 0, .2);
}

.tournament-podium .bronze {
  min-height: 86px;
  background: #b66c3a;
}

.tournament-podium .podium-third {
  animation-delay: .35s;
}

.tournament-podium .podium-second {
  animation-delay: 1.15s;
}

.tournament-podium .podium-first {
  animation-delay: 1.95s;
}

.tournament-podium .podium-first .tournament-crown {
  font-size: 42px;
  color: #fff4bd;
  filter: drop-shadow(0 3px 5px rgba(79, 52, 0, .35));
}

.tournament-podium .podium-first .winner-trophy {
  font-size: 32px;
}

.finale-label {
  color: #ffdf75;
  background: rgba(255, 211, 77, .13);
}

.tournament-final-ranking {
  display: grid;
  gap: 5px;
  width: min(420px, 100%);
  margin-top: 10px;
  opacity: 0;
  animation: podium-rise .55s ease 2.75s forwards;
}

.tournament-final-ranking div {
  padding: 8px 12px;
  border-radius: 7px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  text-align: left;
  font-weight: 800;
}

.broadcast-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.broadcast-tournament {
  display: grid;
  gap: 10px;
}

.is-live-broadcast {
  border-color: rgba(216, 157, 24, 0.45);
  background: #fff8e7;
  box-shadow: 0 10px 22px rgba(216, 157, 24, 0.12);
}

.match-id-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: #fff;
}

.match-id-box span {
  color: var(--muted);
  font-size: 13px;
}

.match-id-box code {
  color: var(--ink);
  font-weight: 800;
  word-break: break-all;
}

.match-control {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.match-score-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-score-strip span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: white;
  background: #102a43;
  font-size: 12px;
  font-weight: 900;
}

.match-turn-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
  align-items: center;
}

.mini-check {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-check input {
  width: 18px;
  min-height: 18px;
}

.latest-turn-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f5f7fb;
}

.latest-turn-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stage-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: 100dvh;
  padding: 14px;
  border-radius: 0;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 224, 27, 0.16), transparent 23%),
    radial-gradient(circle at 92% 0%, rgba(244, 61, 154, 0.14), transparent 21%),
    #081423;
  overflow: hidden;
}

.stage-presenting {
  overflow: hidden;
  background: #081423;
}

.stage-presenting .app-shell {
  width: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
}

.stage-presenting > .app-shell > .topbar {
  display: none;
}

.stage-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 5px 6px;
}

.stage-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.stage-brand img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.stage-brand strong {
  display: block;
  font-size: 22px;
}

.stage-brand span {
  color: #b9cee2;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-toolbar button,
.stage-source-tools summary {
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 7px;
}

.stage-toolbar .ghost-button,
.stage-source-tools summary {
  color: #eaf2fb;
  background: rgba(255, 255, 255, 0.1);
}

.stage-source-tools {
  position: relative;
}

.stage-source-tools summary {
  display: list-item;
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
}

.stage-source-tools[open] .stage-load-box {
  position: absolute;
  z-index: 5;
  top: calc(100% + 7px);
  right: 0;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .25);
}

.stage-load-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stage-load-box input {
  width: min(320px, 54vw);
}

.stage-screen {
  min-height: 0;
  height: 100%;
  border-radius: 8px;
  padding: clamp(12px, 2vh, 20px);
  color: white;
  background:
    linear-gradient(155deg, rgba(16, 42, 67, 0.98), rgba(9, 28, 46, 0.99));
  overflow: hidden;
}

.stage-empty {
  display: grid;
  min-height: 55vh;
  place-items: center;
  text-align: center;
}

.stage-match {
  display: grid;
  grid-template-rows: auto auto minmax(0, auto) minmax(170px, 1fr);
  gap: clamp(8px, 1.4vh, 16px);
  height: 100%;
}

.stage-bracket {
  display: grid;
  gap: 12px;
  padding: 9px 13px;
  border: 1px solid rgba(190, 215, 235, 0.18);
  border-radius: 8px;
  background: rgba(8, 21, 37, 0.5);
  max-height: 15vh;
  overflow: hidden;
}

.stage-bracket h3 {
  margin: 0;
  color: #eaf2fb;
}

.stage-bracket-rounds {
  display: flex;
  gap: 14px;
  overflow: hidden;
}

.stage-bracket-rounds > div {
  flex: 0 0 190px;
  display: grid;
  gap: 7px;
  color: #bfd6ea;
}

.stage-bracket article {
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(190, 215, 235, 0.18);
  border-radius: 6px;
}

.stage-bracket article.active {
  border-color: #ffd34d;
  box-shadow: inset 0 0 0 1px #ffd34d;
}

.stage-bracket article span {
  color: white;
  font-size: 13px;
}

.stage-bracket article .winner {
  color: #63dfa0;
  font-weight: 900;
}

.stage-match-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  font-weight: 900;
}

.stage-match-header span {
  color: #bfd6ea;
}

.stage-inline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-inline-controls button {
  min-height: 38px;
  padding: 8px 12px;
}

.stage-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stage-scoreboard.compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stage-player-card {
  display: grid;
  gap: 4px;
  padding: clamp(9px, 1.3vh, 14px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.stage-player-card span {
  font-weight: 900;
}

.stage-player-card strong {
  font-size: clamp(28px, 4.4vh, 42px);
}

.stage-player-card em {
  color: #bfd6ea;
  font-style: normal;
}

.stage-question-zone {
  display: grid;
  gap: 10px;
  min-height: 0;
  align-content: center;
  padding: 20px;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.stage-question-zone h2 {
  font-size: 44px;
  line-height: 1.05;
}

.stage-answer-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 8px;
  background: #eef4fb;
  border: 1px solid var(--line);
}

.stage-answer-card.is-correct {
  background: #e6f7ec;
  border-color: rgba(40, 167, 69, 0.35);
}

.stage-answer-card.is-wrong {
  background: #fdeceb;
  border-color: rgba(191, 46, 46, 0.35);
}

.stage-answer-card strong {
  font-size: clamp(22px, 4vw, 42px);
}

.classic-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(104px, 23vh);
  gap: clamp(8px, 1.6vh, 14px);
  height: 100%;
  min-height: 0;
}

.duel-stage {
  grid-template-rows: auto minmax(0, 1fr) minmax(158px, 30vh);
}

.classic-stage-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.classic-stage-header h2 {
  margin: 4px 0 0;
  font-size: clamp(22px, 3vw, 38px);
}

.stage-pin {
  padding: 7px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
}

.stage-pin strong {
  font-size: clamp(27px, 4.4vh, 44px);
}

.stage-control-stack {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.stage-admin-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.duel-stage .answer-review-panel {
  padding: 8px;
}

.duel-stage .classic-stage-question {
  align-content: start;
  gap: clamp(5px, 1vh, 10px);
  padding: clamp(9px, 1.3vh, 14px);
}

.duel-stage .classic-stage-question h1 {
  font-size: clamp(19px, 2.3vw, 35px);
  line-height: 1.08;
}

.duel-stage .stage-correct-answer {
  padding: clamp(7px, 1vh, 10px) clamp(9px, 1.4vw, 14px);
  font-size: clamp(14px, 1.45vw, 20px);
}

.duel-stage .stage-correct-answer strong {
  font-size: clamp(17px, 1.7vw, 25px);
}

.duel-stage .answer-review-panel {
  max-height: min(20vh, 150px);
  overflow: auto;
}

.duel-stage .stage-answer-history {
  height: 100%;
  max-height: none;
  margin: 0;
}

.duel-stage .stage-answer-history .answer-review-list {
  max-height: calc(30vh - 70px);
  overflow-y: auto;
  padding-right: 4px;
}

.duel-stage .stage-response-column {
  grid-template-columns: minmax(190px, .9fr) minmax(230px, 1.15fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  column-gap: 8px;
}

.duel-stage .stage-response-column > h3 {
  grid-column: 1 / -1;
}

.duel-stage .stage-response-column .answer-review-panel {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.duel-stage .stage-response-column .current-answer-panel .answer-review-list {
  max-height: calc(30vh - 70px);
  overflow-y: auto;
}

.duel-stage .answer-review-row {
  padding: 5px 7px;
  font-size: 13px;
}

.duel-stage .duel-review-tools {
  gap: 5px;
}

.duel-stage .duel-review-tools button,
.duel-stage .duel-points-input {
  min-height: 34px;
  padding: 6px 8px;
}

.stage-screen .score-row {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
}

.stage-topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.stage-topic-list span {
  border: 1px solid rgba(18, 107, 99, 0.24);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
}

.topic-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin: 6px 0 10px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(11, 31, 59, 0.14);
  background: rgba(255, 224, 27, 0.28);
  color: #0b1f3b;
  font-size: 0.82rem;
  font-weight: 800;
}

.classic-stage-question .topic-badge {
  margin-inline: auto;
  font-size: clamp(0.82rem, 1.3vw, 1.05rem);
}

.answer-review-row strong,
.stage-screen .answer-review-row strong {
  color: var(--ink);
}

.answer-review-row em {
  display: block;
  color: #263b37;
  font-style: normal;
  font-size: 13px;
  margin-top: 4px;
}

.duel-review-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.duel-points-field {
  display: inline-grid;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.duel-points-input {
  width: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.duel-result-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 18px;
  border-radius: 8px;
  border: 2px solid rgba(11, 31, 59, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-align: center;
}

.duel-result-card.correct {
  border-color: rgba(22, 128, 71, 0.32);
  background: linear-gradient(135deg, rgba(215, 255, 232, 0.96), rgba(255, 255, 255, 0.94));
}

.duel-result-card.wrong {
  border-color: rgba(191, 46, 46, 0.32);
  background: linear-gradient(135deg, rgba(255, 229, 229, 0.96), rgba(255, 255, 255, 0.94));
}

.duel-result-card .verdict-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 36px;
  font-weight: 950;
  background: #64748b;
}

.duel-result-card.correct .verdict-icon {
  background: #168047;
}

.duel-result-card.wrong .verdict-icon {
  background: #bf2e2e;
}

.duel-result-card strong {
  font-size: 1.45rem;
}

.duel-result-card em {
  font-style: normal;
  font-weight: 950;
  color: #168047;
}

.duel-finale {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 224, 27, 0.48), transparent 25%),
    radial-gradient(circle at 80% 10%, rgba(244, 61, 154, 0.22), transparent 22%),
    linear-gradient(135deg, #fff7d8, #ffffff 46%, #e3fbf6);
  color: var(--ink);
  text-align: center;
}

.grand-finale {
  animation: finaleGlow 1.8s ease-in-out infinite alternate;
}

.winner-crown {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4c430;
  color: #3b2700;
  font-size: 44px;
  box-shadow: 0 14px 36px rgba(143, 91, 0, 0.24);
}

.winner-trophy {
  font-size: clamp(48px, 8vw, 104px);
  filter: drop-shadow(0 14px 22px rgba(143, 91, 0, 0.22));
  animation: trophyPop .9s cubic-bezier(.2, 1.5, .35, 1) both;
}

.duel-finale > strong {
  font-size: clamp(28px, 5vw, 64px);
  font-weight: 900;
}

.final-ranking {
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
}

.final-ranking div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.topic-set-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.topic-set-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.topic-set-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-bank-row {
  align-items: center;
}

.bank-expand-tools {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.bank-question-list {
  display: grid;
  gap: 8px;
  margin: -6px 0 12px 28px;
  padding: 10px;
  border-left: 3px solid rgba(18, 107, 99, 0.22);
}

.bank-question-line {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.bank-question-line strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.bank-question-line span {
  color: var(--muted);
  font-size: 0.8rem;
}

.quick-question-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quick-question-box h3 {
  margin: 0;
  font-size: 16px;
}

.quick-question-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  margin-bottom: 10px;
}

.question-image {
  width: min(100%, 720px);
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  justify-self: center;
}

.fireworks span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e94f37;
  animation: pop 1.7s ease-in-out infinite;
}

.fireworks span:nth-child(1) { top: 18%; left: 18%; }
.fireworks span:nth-child(2) { top: 22%; right: 18%; background: #126b63; animation-delay: .35s; }
.fireworks span:nth-child(3) { bottom: 20%; left: 50%; background: #f4c430; animation-delay: .7s; }
.fireworks span:nth-child(4) { bottom: 18%; right: 22%; background: var(--pink); animation-delay: .95s; }
.fireworks span:nth-child(5) { top: 42%; left: 8%; background: var(--blue); animation-delay: 1.15s; }

@keyframes pop {
  0%, 100% { transform: scale(.5); opacity: .35; box-shadow: 0 0 0 0 currentColor; }
  50% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 18px transparent; }
}

@keyframes finaleGlow {
  from { box-shadow: 0 18px 48px rgba(216, 157, 24, 0.18); }
  to { box-shadow: 0 22px 80px rgba(244, 61, 154, 0.24); }
}

@keyframes trophyPop {
  0% { transform: scale(.65) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.classic-stage-question {
  display: grid;
  gap: clamp(7px, 1.3vh, 12px);
  min-height: 0;
  align-content: center;
  overflow: hidden;
  padding: clamp(12px, 2vh, 19px);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.94)),
    #ffffff;
  color: var(--ink);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
}

.classic-stage-question h1 {
  margin: 0;
  font-size: clamp(25px, 3.2vw, 48px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.classic-stage-question .stage-slide-note {
  justify-self: center;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  color: #ffdf75;
  background: rgba(255, 211, 77, .16);
  font-weight: 900;
}

.question-display.is-slide {
  text-align: center;
}

.classic-stage-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
  min-height: 0;
}

.classic-stage-grid.is-slide-grid {
  grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr);
}

.duel-stage .classic-stage-grid {
  grid-template-columns: minmax(175px, .62fr) minmax(430px, 1.7fr);
}

.classic-stage-grid section {
  display: grid;
  gap: 7px;
  min-height: 0;
  overflow: hidden;
  align-content: start;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.stage-choice-list,
.stage-answer-list,
.stage-player-columns {
  display: grid;
  gap: 5px;
  min-height: 0;
}

.stage-choice-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stage-choice-list div,
.stage-answer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(16, 42, 67, 0.08);
}

.stage-choice-list strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
}

.stage-player-columns {
  grid-template-columns: 1fr 1fr;
}

.stage-player-columns > div {
  display: grid;
  gap: 6px;
}

.stage-name {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 900;
}

.stage-name.ok {
  background: rgba(22, 128, 71, 0.35);
}

.stage-name.waiting {
  background: rgba(221, 129, 24, 0.28);
}

.stage-answer-row.correct {
  background: rgba(22, 128, 71, 0.25);
}

.stage-answer-row.wrong {
  background: rgba(191, 46, 46, 0.24);
}

.stage-answer-row.partial {
  background: rgba(221, 129, 24, 0.28);
}

.stage-correct-answer {
  padding: 9px 12px;
  border-radius: 8px;
  background: #e8f8ef;
  color: var(--ok);
  font-weight: 900;
}

.question-fun-fact {
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.82));
  color: #78350f;
  box-shadow: 0 10px 22px rgba(146, 64, 14, 0.12);
}

.question-fun-fact span {
  display: inline-flex;
  margin-bottom: 5px;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-fun-fact p {
  margin: 0;
  font-weight: 800;
  line-height: 1.35;
}

.ai-live-fact-button {
  justify-self: start;
  margin-top: 4px;
}

.ai-live-fact-slot {
  display: grid;
}

.ai-live-fact-slot .question-fun-fact {
  animation: pop-in 0.22s ease both;
}

.stage-ranking .score-row {
  padding: 5px 9px;
}

.stage-overflow-count {
  margin: 4px 0 0;
  color: #d0e2f0;
  font-size: 12px;
  font-weight: 800;
}

.classic-stage-grid h3 {
  margin-bottom: 3px;
  font-size: 14px;
  color: #e3effa;
}

.classic-stage-grid .answer-stats {
  padding: 5px 10px;
}

.stage-screen .question-image {
  max-height: min(27vh, 220px);
}

.duel-admin-game,
.duel-player-game,
.duel-topic-grid,
.duel-wager-box {
  display: grid;
  gap: 12px;
}

.duel-head {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7fb;
}

.duel-head strong {
  font-size: 24px;
}

.duel-head em {
  color: var(--muted);
  font-style: normal;
}

.duel-leave-button {
  justify-self: start;
  margin-top: 6px;
}

.duel-topic-grid > div,
.duel-wager-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.duel-topic-button,
.duel-wager-button {
  min-height: 64px;
  border: 1px solid color-mix(in srgb, var(--topic, var(--brand)) 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--topic, var(--brand)) 12%, white);
  color: var(--ink);
  font-weight: 950;
}

.duel-wager-button {
  --topic: var(--gold);
  font-size: 24px;
}

.duel-dont-know-button {
  justify-self: start;
  margin-top: 18px;
}

.playoff-card {
  display: grid;
  gap: 12px;
}

.wager-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 8px;
}

.wager-button-grid button {
  min-height: 58px;
  font-size: 20px;
  font-weight: 900;
  border-color: rgba(238, 172, 29, 0.48);
  background: rgba(255, 224, 27, 0.24);
}

.tournament-result-card {
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(140deg, #fff7d9, #ffffff 72%);
  border: 1px solid rgba(238, 172, 29, 0.38);
}

.qualification-lobby {
  display: grid;
  gap: 14px;
}

.qualification-lobby-card,
.qualification-board {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qualification-lobby-card h3 {
  margin: 0;
  font-size: 22px;
}

.qualification-lobby-card p {
  margin: 0;
  color: var(--muted);
}

.qualification-me {
  padding: 9px 11px;
  border-radius: 7px;
  color: #123428;
  background: #e3f5eb;
}

.tournament-player-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.tournament-player-head h3 {
  margin: 8px 0 0;
  font-size: 23px;
}

.tournament-hall {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.hall-title h3 {
  margin: 8px 0 0;
  font-size: 20px;
}

.round-two-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #bfe1e3;
  border-radius: 8px;
  color: #103a43;
  background: #e9f7f8;
}

.round-two-notice strong {
  flex: none;
  color: #087f83;
}

.player-bracket {
  display: flex;
  gap: 12px;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.player-bracket-round {
  position: relative;
  flex: 1 0 190px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.player-bracket-round h4 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.player-bracket-match {
  position: relative;
  padding: 9px;
  border: 1px solid #dae3ec;
  border-radius: 8px;
  background: #fff;
}

.player-bracket-match small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.player-bracket-match div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 5px;
  border-radius: 5px;
}

.player-bracket-match .winner {
  color: #116832;
  background: #dff3e5;
  font-weight: 800;
}

.tournament-chat {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chat-heading,
.chat-compose {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-heading {
  justify-content: space-between;
}

.chat-heading span {
  color: var(--muted);
  font-size: 12px;
}

.chat-messages {
  display: grid;
  align-content: end;
  gap: 6px;
  min-height: 80px;
  max-height: 190px;
  padding: 10px;
  overflow-y: auto;
  border-radius: 7px;
  background: #f5f7fa;
}

.chat-messages p {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.chat-messages .admin-message {
  padding: 6px 8px;
  border-radius: 6px;
  color: #8b3c00;
  background: #fff0e4;
}

.chat-compose input {
  flex: 1;
  min-width: 0;
}

.tournament-duel-game {
  margin-top: 16px;
}

.tournament-duel-game.final-match {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(216, 157, 24, .46);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 246, 202, .82), rgba(255, 255, 255, .96)),
    #fff;
  box-shadow: 0 18px 46px rgba(216, 157, 24, .14);
}

.final-match-banner {
  width: fit-content;
  padding: 7px 18px;
  border-radius: 999px;
  color: #fff;
  background: #102a43;
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.eliminated-notice {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.spectator-hall {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.spectator-match-list {
  display: grid;
  gap: 8px;
}

.spectate-match-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f7fafc;
  text-align: left;
  font-weight: 900;
}

.spectate-match-button small {
  color: var(--muted);
  font-weight: 700;
}

.spectate-match-button strong {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 11px;
  color: #536779;
  background: #e9eff5;
}

.spectate-match-button.active {
  border-color: #2ea667;
  background: #ecf8f0;
}

.spectate-match-button.active strong {
  color: #116832;
  background: #cff0dc;
}

.spectate-match-button.finished {
  opacity: .75;
}

.spectate-match-button.selected {
  box-shadow: inset 0 0 0 2px #f0b321;
}

.spectator-stage {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 16px;
  border-radius: 8px;
  background: #102a43;
  color: #fff;
}

.spectator-stage .score-row {
  color: var(--ink);
}

.spectator-privacy {
  margin: 0;
  color: #c8daea;
  font-size: 13px;
}

.tournament-control-stage {
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  gap: 12px;
  height: 100%;
}

.tournament-match-switcher {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(190, 215, 235, .18);
  border-radius: 8px;
  background: rgba(8, 21, 37, .7);
}

.tournament-match-switcher h2 {
  color: #fff;
  font-size: 19px;
}

.tournament-match-switcher section {
  display: grid;
  gap: 6px;
}

.tournament-match-switcher section > strong {
  color: #bfd6ea;
  font-size: 12px;
}

.stage-tournament-tools {
  display: grid;
  gap: 7px;
}

.stage-tournament-tools button {
  width: 100%;
}

.compact-stage-field {
  gap: 4px;
}

.compact-stage-field span {
  color: #bfd6ea;
  font-size: 12px;
}

.stage-qualification-lobby {
  display: grid;
  gap: 16px;
  min-height: 100%;
  padding: 18px;
}

.stage-qualification-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.stage-qualification-grid .qualification-lobby-card,
.stage-qualification-grid .qualification-board {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .92);
}

.stage-presence-list {
  padding-top: 10px;
  border-top: 1px solid rgba(190, 215, 235, .18);
}

.stage-presence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.stage-presence-row span {
  color: #eaf2fb;
  font-size: 12px;
}

.stage-presence-row span::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #8291a1;
  content: "";
}

.stage-presence-row span.online::before {
  background: #52d58b;
  box-shadow: 0 0 0 3px rgba(82, 213, 139, .18);
}

.stage-presence-row .danger-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
}

.stage-player-tools {
  display: flex;
  gap: 5px;
}

.stage-player-tools .secondary-button {
  min-height: 28px;
  padding: 0 9px;
}

.stage-presence-row.eliminated {
  opacity: .62;
}

.stage-switch-match-button {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(190, 215, 235, .18);
  border-radius: 7px;
  color: white;
  background: rgba(255, 255, 255, .07);
  text-align: left;
}

.stage-switch-match-button.active {
  border-color: #ffd34d;
  background: rgba(255, 211, 77, .14);
}

.stage-switch-match-button.finished {
  border-color: rgba(77, 191, 124, .38);
}

.stage-switch-match-button em {
  color: #71d69d;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.stage-switch-match-button small {
  color: #bfd6ea;
}

.stage-bracket-overview {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  color: white;
  background: rgba(8, 21, 37, .7);
}

.stage-bracket-overview .bracket-heading span {
  color: #bfd6ea;
}

.stage-bracket-flow {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.stage-flow-round {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  flex: 0 0 220px;
}

.stage-flow-round h3 {
  margin: 0;
  color: #bfd6ea;
  font-size: 15px;
}

.stage-flow-round article {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(190, 215, 235, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
}

.stage-flow-round article.selected {
  border-color: #ffd34d;
}

.stage-flow-round article div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stage-flow-round article .winner,
.stage-flow-round article em {
  color: #71d69d;
  font-style: normal;
}

.bracket-rounds,
.player-bracket,
.stage-bracket-flow,
.stage-bracket-rounds {
  position: relative;
}

.bracket-round,
.player-bracket-round,
.stage-flow-round,
.stage-bracket-round {
  z-index: 1;
}

.bracket-connector-space {
  flex: 0 0 72px;
  min-height: 1px;
}

.bracket-lines {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.bracket-lines path {
  fill: none;
  stroke: var(--bracket-line-color, #8ba3bc);
  stroke-width: 3;
  stroke-opacity: var(--bracket-line-opacity, .88);
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, .18));
}

.stage-bracket-flow .bracket-lines path,
.stage-bracket-rounds .bracket-lines path {
  stroke-width: 3.5;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, .3));
}

.stage-tournament-chat {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(190, 215, 235, .18);
  color: #fff;
}

.stage-tournament-chat .chat-heading span {
  color: #bfd6ea;
}

.stage-tournament-chat .chat-messages {
  min-height: 74px;
  max-height: 152px;
  color: #13283d;
  background: rgba(255, 255, 255, .95);
}

.stage-tournament-chat .chat-compose {
  display: grid;
  grid-template-columns: 1fr;
}

.stage-tournament-chat input,
.stage-tournament-chat button {
  width: 100%;
}

.tournament-selected-stage {
  min-width: 0;
  min-height: 0;
}

.tournament-selected-stage > .classic-stage {
  height: 100%;
}

.tournament-control-stage.is-final .tournament-selected-stage {
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255, 211, 77, .38);
}

.stage-tournament-finale {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(460px, 1fr) minmax(300px, 0.7fr);
  align-items: center;
  gap: 24px;
}

.stage-tournament-finale .tournament-finale {
  min-height: min(70vh, 640px);
  align-content: center;
}

.stage-tournament-finale.full-finale {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

.stage-tournament-finale.full-finale.with-chat {
  grid-template-columns: minmax(430px, 1fr) minmax(230px, 290px);
  align-items: stretch;
}

.stage-tournament-finale.full-finale .tournament-finale {
  width: min(820px, 100%);
  min-height: min(82vh, 760px);
}

.stage-tournament-finale.full-finale.with-chat .stage-tournament-chat {
  align-self: end;
  padding: 14px;
  border: 1px solid rgba(190, 215, 235, .18);
  border-radius: 8px;
  background: rgba(8, 21, 37, .7);
}

.bye-stage strong {
  color: #ebae20;
}

.bracket-advance {
  margin-top: 5px;
  color: #116832;
  font-size: 12px;
}

.bank-question-preview {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}

.bank-question-preview span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.bank-question-preview p {
  margin: 0;
  color: var(--muted);
}

.mini-pin-image {
  min-height: 110px;
  border-radius: 8px;
  background: #edf1f7 center / cover no-repeat;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 28px rgba(19, 35, 52, 0.06);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(18, 107, 99, 0.18);
}

.primary-button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--brand);
  background: #e6f2f0;
}

.secondary-button:hover,
.ghost-button:hover,
.answer-button:hover,
.duel-topic-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--ink);
  background: #edf1f7;
}

.danger-button {
  color: white;
  background: var(--danger);
}

.wide {
  width: 100%;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  background: white;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(18, 107, 99, 0.18);
  border-color: var(--brand);
}

.quiz-list {
  display: grid;
  gap: 8px;
}

.quiz-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  align-items: center;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  color: var(--ink);
}

.quiz-item.active {
  border-color: var(--brand);
  background: #edf8f6;
}

.quiz-item strong {
  font-size: 14px;
}

.quiz-item span {
  display: grid;
  gap: 3px;
}

.quiz-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.start-quiz-item-button {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.question-editor {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.editor-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-add-actions button {
  flex: 1 1 160px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.question-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.question-options-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(100px, 0.8fr) minmax(100px, 0.7fr);
  gap: 10px;
  margin-bottom: 10px;
}

.generator-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 180px);
}

.field-help {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.category-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.category-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--category-color) 14%, white), #fff);
  font-weight: 800;
}

.category-check input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--category-color);
}

.pin-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.pin-preview {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf1f7 center / cover no-repeat;
}

.pin-target {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(191, 46, 46, 0.35), 0 10px 18px rgba(24, 32, 42, 0.22);
  transform: translate(-50%, -50%);
}

.player-pin-preview {
  cursor: crosshair;
}

.pin-player-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--brand-strong);
  box-shadow: 0 0 0 3px rgba(18, 107, 99, 0.35);
  transform: translate(-50%, -50%);
}

.player-category-grid,
.player-answer-grid,
.playoff-checks {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.playoff-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.answer-good {
  color: var(--success);
  font-weight: 900;
}

.answer-bad {
  color: var(--danger);
  font-weight: 900;
}

.choice-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.choice-row input[type="radio"] {
  width: 18px;
  min-height: 18px;
}

.choice-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.choice-order-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 900;
}

.game-box {
  min-height: 280px;
}

.muted-box {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.pin-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: #102a43;
  color: white;
  text-align: center;
  margin-bottom: 14px;
}

.pin-box span {
  color: #bfd6ea;
  font-weight: 800;
  font-size: 13px;
}

.pin-box strong {
  font-size: 42px;
  letter-spacing: 3px;
}

.player-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.player-share-text {
  display: grid;
  gap: 8px;
}

.player-qr-code {
  width: 132px;
  height: 132px;
  border-radius: 6px;
  background: white;
}

.player-link-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.player-link-box a {
  overflow-wrap: anywhere;
  color: var(--brand-dark);
  font-weight: 800;
}

.player-link-box p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.score-list,
.player-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.final-list {
  animation: reveal-list 0.42s ease both 3.3s;
}

.score-row,
.player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: #f4f7fb;
  border-radius: 7px;
}

.score-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.score-delta {
  color: var(--ok);
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.answer-stats {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff7e8;
  color: #8a5200;
  font-weight: 900;
}

.answer-stats.complete {
  background: #e8f8ef;
  border-color: rgba(22, 128, 71, 0.28);
  color: var(--ok);
}

.answer-stats span {
  color: inherit;
  opacity: 0.85;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.universal-join-panel {
  grid-column: 1 / -1;
  width: min(440px, 100%);
  justify-self: center;
}

.join-guidance {
  margin: 0 0 14px;
  color: var(--muted);
}

.reconnect-entry {
  margin: 4px 0 14px;
  color: var(--muted);
}

.reconnect-entry summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.reconnect-entry .field {
  margin: 10px 0 0;
}

.player-account-panel {
  grid-column: 1 / -1;
}

.player-auth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.player-lobby-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(360px, 1.6fr) minmax(240px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.player-lobby-chat,
.player-lobby-main,
.player-lobby-rooms {
  min-width: 0;
}

.player-lobby-title,
.player-profile-card,
.lobby-player-row,
.leaderboard-row,
.player-room-card,
.scheduled-player-tournament,
.competitive-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.player-chat-log {
  height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
}

.player-chat-message {
  display: grid;
  gap: 2px;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
}

.player-chat-compose,
.player-room-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.player-profile-card,
.competitive-card,
.leaderboard-box,
.scheduled-player-tournament,
.player-room-card,
.lobby-player-row,
.competitive-result {
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.player-profile-card h3,
.competitive-card h3,
.player-lobby-main h3,
.player-lobby-rooms h3 {
  margin: 0 0 6px;
}

.daily-icons {
  display: grid;
  gap: 4px;
  text-align: right;
  font-weight: 800;
}

.stars-line {
  color: #d97706;
  letter-spacing: 1px;
}

.skulls-line {
  color: #7f1d1d;
}

.player-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.lobby-player-row,
.player-room-card,
.scheduled-player-tournament {
  align-items: flex-start;
}

.lobby-player-row span,
.player-room-card span,
.scheduled-player-tournament span,
.player-room-card small,
.scheduled-player-tournament small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.leaderboard-box {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.scheduled-tournaments {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.scheduled-admin-box {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
}

.scheduled-admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.scheduled-description-field {
  grid-column: span 2;
}

.scheduled-admin-list {
  display: grid;
  gap: 8px;
}

.scheduled-admin-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.scheduled-admin-row span,
.scheduled-admin-row small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.competitive-result.won {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(220, 252, 231, 0.85);
}

.competitive-result.lost {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(254, 226, 226, 0.85);
}

.player-layout:not(.classic-session-active):not(.duel-session-active):not(.tournament-session-active) #joinPanel,
.player-layout:not(.classic-session-active):not(.duel-session-active):not(.tournament-session-active) #playerGame,
.player-layout:not(.classic-session-active):not(.duel-session-active):not(.tournament-session-active) #playoffPlayerPanel,
.player-layout:not(.classic-session-active):not(.duel-session-active):not(.tournament-session-active) .duel-player-panel,
.player-layout:not(.classic-session-active):not(.duel-session-active):not(.tournament-session-active) .tournament-player-panel {
  display: none;
}

.player-layout.classic-session-active {
  grid-template-columns: minmax(320px, 760px);
  justify-content: center;
}

.player-layout.classic-session-active .universal-join-panel,
.player-layout.classic-session-active #joinPanel,
.player-layout.classic-session-active #playoffPlayerPanel,
.player-layout.classic-session-active .duel-player-panel,
.player-layout.classic-session-active .tournament-player-panel,
.player-layout.duel-session-active .universal-join-panel,
.player-layout.tournament-session-active .universal-join-panel {
  display: none;
}

.player-layout.duel-session-active {
  grid-template-columns: minmax(320px, 760px);
  justify-content: center;
}

.player-layout.duel-session-active #joinPanel,
.player-layout.duel-session-active #playerGame,
.player-layout.duel-session-active #playoffPlayerPanel,
.player-layout.duel-session-active .duel-player-panel > .panel-header,
.player-layout.duel-session-active .duel-player-panel > .join-grid,
.player-layout.duel-session-active #joinDuelButton {
  display: none;
}

.player-layout.tournament-session-active {
  grid-template-columns: minmax(320px, 820px);
  justify-content: center;
}

.player-layout.tournament-session-active #joinPanel,
.player-layout.tournament-session-active #playerGame,
.player-layout.tournament-session-active #playoffPlayerPanel,
.player-layout.tournament-session-active .duel-player-panel,
.player-layout.tournament-session-active .tournament-player-panel > .panel-header,
.player-layout.tournament-session-active .tournament-player-panel > .join-grid,
.player-layout.tournament-session-active #joinTournamentButton {
  display: none;
}

.player-layout.tournament-session-active .tournament-player-panel {
  grid-column: 1;
}

.player-layout.tournament-session-active.tournament-qualification-active #playerGame {
  display: block;
  grid-column: 1;
}

.player-layout.tournament-session-active.tournament-qualification-active .tournament-player-panel {
  grid-row: 1;
}

.player-layout.tournament-session-active.tournament-qualification-active #playerGame {
  grid-row: 2;
}

.player-champion-message {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 18px;
  border-radius: 8px;
  color: #392600;
  background: linear-gradient(135deg, #ffd34d, #fff0aa);
  text-align: center;
}

.player-champion-message strong {
  font-size: 24px;
}

.tournament-live-match,
.tournament-result-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.join-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.play-panel {
  min-height: 360px;
  overflow: hidden;
}

.playoff-player-panel {
  grid-column: 1 / -1;
}

.question-display {
  display: grid;
  gap: 16px;
  min-height: 420px;
  align-content: start;
  position: relative;
  padding: 6px;
}

.question-title {
  font-size: 30px;
  line-height: 1.18;
}

.question-topline,
.host-question-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 44px;
  border-radius: 8px;
  background: #102a43;
  color: white;
  font-size: 20px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(16, 42, 67, 0.18);
}

.timer-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe5ee;
}

.timer-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #168047, #d89d18, #d94f30);
  transition: width 0.45s ease;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.answer-button {
  min-height: 104px;
  border-radius: 8px;
  padding: 16px;
  color: white;
  font-weight: 900;
  text-align: left;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.16);
  transform: translateY(0) scale(1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.answer-button span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.answer-button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 30px rgba(24, 32, 42, 0.2);
  filter: saturate(1.08);
}

.answer-button:nth-child(1) {
  background: #b93246;
}

.answer-button:nth-child(2) {
  background: #1f6aa5;
}

.answer-button:nth-child(3) {
  background: #c98413;
}

.answer-button:nth-child(4) {
  background: #168047;
}

.answer-button:disabled {
  opacity: 0.62;
  cursor: default;
}

.text-answer-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.text-answer-input {
  min-height: 58px;
  font-size: 22px;
  font-weight: 800;
}

.multi-select-grid {
  margin-bottom: 12px;
}

.multi-answer-option {
  display: grid;
  grid-template-columns: 26px 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 84px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfe;
  font-weight: 900;
}

.multi-answer-option input {
  width: 20px;
  min-height: 20px;
}

.multi-answer-option span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  background: var(--brand);
}

.ordering-choice-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ordering-choice-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.ordering-choice-item strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
}

.waiting-card,
.answer-verdict-card,
.host-question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 18px;
}

.waiting-card {
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(18, 107, 99, 0.12), transparent 32%),
    #fbfcfe;
}

.waiting-card h3 {
  margin: 12px 0 6px;
  font-size: 24px;
}

.waiting-card p {
  margin: 0;
  color: var(--muted);
}

.waiting-orbit {
  width: 72px;
  height: 72px;
  border: 6px solid #dfe5ee;
  border-top-color: var(--brand);
  border-right-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.result-display {
  display: grid;
  gap: 14px;
}

.answer-verdict-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  animation: pop-in 0.28s ease both;
}

.answer-verdict-card.correct {
  border-color: rgba(22, 128, 71, 0.35);
  background: linear-gradient(135deg, #eef8f2, #ffffff);
}

.answer-verdict-card.wrong {
  border-color: rgba(191, 46, 46, 0.35);
  background: linear-gradient(135deg, #fff0ef, #ffffff);
}

.answer-verdict-card.partial {
  border-color: rgba(221, 129, 24, 0.4);
  background: linear-gradient(135deg, #fff5df, #ffffff);
}

.verdict-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: white;
  font-size: 38px;
  font-weight: 950;
}

.answer-verdict-card.correct .verdict-icon {
  background: var(--ok);
  box-shadow: 0 12px 24px rgba(22, 128, 71, 0.24);
}

.answer-verdict-card.wrong .verdict-icon {
  background: var(--danger);
  box-shadow: 0 12px 24px rgba(191, 46, 46, 0.22);
}

.answer-verdict-card.partial .verdict-icon {
  background: #dd8118;
  box-shadow: 0 12px 24px rgba(221, 129, 24, 0.22);
}

.answer-verdict-card span {
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
}

.answer-verdict-card.correct span {
  color: var(--ok);
}

.answer-verdict-card.wrong span {
  color: var(--danger);
}

.answer-verdict-card.partial span {
  color: #bb6408;
}

.answer-verdict-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.answer-verdict-card strong {
  color: var(--ink);
}

.podium-wrap {
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #102a43;
  color: white;
}

.podium-wrap h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}

.podium {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
}

.podium-place {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 138px;
  padding: 14px 10px;
  border-radius: 8px;
  text-align: center;
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  animation: podium-rise 0.55s cubic-bezier(.2,.8,.2,1) forwards;
}

.podium-place.bronze {
  min-height: 118px;
  background: linear-gradient(180deg, #c7773f, #7b421f);
  animation-delay: 0.2s;
}

.podium-place.silver {
  min-height: 148px;
  background: linear-gradient(180deg, #e7edf5, #8d9aaa);
  color: #132334;
  animation-delay: 1.2s;
}

.podium-place.gold {
  min-height: 178px;
  background: linear-gradient(180deg, #ffd86a, #c58a10);
  color: #1d1607;
  animation-delay: 2.2s;
}

.podium-place strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.podium-place em {
  font-style: normal;
  font-weight: 900;
}

.medal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 22px;
  font-weight: 950;
}

.fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fireworks span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd86a;
  opacity: 0;
  animation: firework 1.15s ease-out forwards;
}

.fireworks span:nth-child(1) { left: 15%; top: 22%; animation-delay: 2.25s; }
.fireworks span:nth-child(2) { left: 28%; top: 14%; animation-delay: 2.45s; background: #ffffff; }
.fireworks span:nth-child(3) { right: 22%; top: 18%; animation-delay: 2.65s; background: #d94f30; }
.fireworks span:nth-child(4) { right: 12%; top: 34%; animation-delay: 2.8s; background: #168047; }
.fireworks span:nth-child(5) { left: 52%; top: 10%; animation-delay: 2.95s; background: #1f6aa5; }
}

.host-question-card {
  margin: 12px 0;
}

.host-question-card.is-result {
  border-color: rgba(22, 128, 71, 0.25);
  background: #eef8f2;
}

.answer-review-panel {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.answer-review-panel h3 {
  margin-bottom: 10px;
}

.answer-review-list {
  display: grid;
  gap: 8px;
}

.answer-review-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}

.answer-review-row.correct {
  border-color: rgba(22, 128, 71, 0.3);
  background: #f1faf5;
}

.answer-review-row.wrong {
  border-color: rgba(191, 46, 46, 0.28);
  background: #fff4f2;
}

.answer-review-row.partial {
  border-color: rgba(221, 129, 24, 0.3);
  background: #fff8e8;
}

.answer-review-row div:first-child {
  display: grid;
  gap: 3px;
}

.answer-review-row span,
.answer-review-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.answer-review-actions {
  display: flex;
  gap: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes podium-rise {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes firework {
  0% {
    opacity: 0;
    box-shadow: 0 0 0 0 currentColor;
    transform: scale(0.4);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    box-shadow:
      0 -38px 0 2px currentColor,
      34px -18px 0 1px currentColor,
      32px 22px 0 2px currentColor,
      0 38px 0 1px currentColor,
      -34px 20px 0 2px currentColor,
      -34px -18px 0 1px currentColor;
    transform: scale(1.05);
  }
}

@keyframes reveal-list {
  from {
    opacity: 0.2;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand);
  background: #e6f2f0;
  font-weight: 900;
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px;
  border-radius: 8px;
  background: #102a43;
  color: white;
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.22);
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .view-grid,
  .home-view,
  .player-layout {
    grid-template-columns: 1fr;
  }

  .flashcards-layout {
    grid-template-columns: 1fr;
  }

  .stage-tournament-finale {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stage-tournament-finale .tournament-finale {
    min-height: min(58vh, 480px);
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 25px;
  }

  .join-grid,
  .answers-grid,
  .admin-actions,
  .podium,
  .question-options-grid,
  .management-grid,
  .inline-form,
  .flash-card-row,
  .tournament-row,
  .tournament-actions,
  .match-turn-actions,
  .stage-scoreboard {
    grid-template-columns: 1fr;
  }

  .podium-place,
  .podium-place.bronze,
  .podium-place.silver,
  .podium-place.gold {
    min-height: 110px;
  }

  .answer-verdict-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .tournament-lobby-head,
  .tournament-lobby-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tournament-player-head {
    flex-direction: column;
  }

  .tournament-control-stage {
    grid-template-columns: 1fr;
  }

  .stage-tournament-finale.full-finale.with-chat {
    grid-template-columns: 1fr;
  }

  .archived-tournament-row {
    grid-template-columns: 1fr 1fr;
  }

  .archived-tournament-row span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .player-auth-grid,
  .player-lobby-shell,
  .player-columns,
  .scheduled-admin-form {
    grid-template-columns: 1fr;
  }

  .scheduled-description-field {
    grid-column: auto;
  }

  .player-chat-log {
    height: 240px;
  }

  .player-profile-card,
  .lobby-player-row,
  .player-room-card,
  .scheduled-player-tournament,
  .competitive-result {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-icons,
  .mini-actions {
    text-align: left;
    justify-content: flex-start;
  }
}

/* Player account duel room polish */
.player-game-room {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  min-height: min(760px, 82vh);
  padding: 18px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 215, 98, 0.2), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(255, 74, 125, 0.18), transparent 30%),
    linear-gradient(135deg, #071426, #101a33 48%, #071f22);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 24px 70px rgba(2, 6, 23, 0.28);
}

.player-game-room-topbar,
.active-player-game-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.player-game-room-topbar {
  position: relative;
  z-index: 1;
}

.player-room-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-room-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}

.player-game-room-topbar strong,
.active-player-game-card strong {
  display: block;
  font-size: 18px;
}

.player-game-room-topbar .ghost-button {
  border-color: rgba(255,255,255,0.25);
  color: #f8fafc;
  background: rgba(255,255,255,0.08);
}

.active-player-game-card {
  margin: 10px 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(19, 134, 127, 0.25);
  background: linear-gradient(135deg, rgba(19, 134, 127, 0.12), rgba(255, 255, 255, 0.92));
}

.active-player-game-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.player-account-duel-game {
  position: relative;
  z-index: 1;
}

.player-game-room .duel-player-game {
  align-content: start;
  min-height: 620px;
}

.player-game-room .duel-head,
.player-game-room .question-display,
.player-game-room .duel-wager-box,
.player-game-room .waiting-card,
.player-game-room .result-display {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.1);
  color: #f8fafc;
  box-shadow: 0 22px 50px rgba(0,0,0,0.24);
}

.player-game-room .duel-head strong,
.player-game-room .question-title,
.player-game-room .waiting-card h3,
.player-game-room .result-display h2 {
  color: #f8fafc;
}

.player-game-room .duel-head em,
.player-game-room .waiting-card p,
.player-game-room .field-help {
  color: #cbd5e1;
}

.steal-question-preview {
  margin: 10px 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(15, 23, 42, 0.28);
  font-size: 1.08rem;
  font-weight: 850;
  color: inherit;
}

.player-game-room .score-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.player-game-room .score-row {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.1);
  color: #f8fafc;
}

.player-game-room .score-row span {
  color: #dbeafe;
}

.player-game-room .score-row strong {
  color: #fde68a;
  font-size: 1.55rem;
}

.player-game-room .duel-topic-button,
.player-game-room .duel-wager-button {
  min-height: 76px;
  border-color: rgba(255,255,255,0.16);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--topic, var(--brand)) 38%, #111827), rgba(255,255,255,0.08));
  color: #f8fafc;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.player-game-room .answer-button {
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}

.player-game-room .text-answer-input {
  background: rgba(255,255,255,0.94);
}

.duel-action-context {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(253, 230, 138, 0.28);
  background: rgba(120, 53, 15, 0.45);
  color: #fde68a;
  font-size: 1.02rem;
}

.duel-return-button {
  margin: 12px auto 0;
  max-width: 360px;
}

@media (max-width: 760px) {
  .player-game-room {
    min-height: 70vh;
    padding: 12px;
  }

  .player-game-room-topbar,
  .player-room-brand,
  .active-player-game-card {
    align-items: stretch;
    flex-direction: column;
  }

  .player-room-brand img {
    width: 48px;
    height: 48px;
  }
}

/* Admin player league control */
.player-control-panel {
  display: grid;
  gap: 16px;
}

.player-control-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.player-control-stats div,
.control-card {
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.player-control-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.player-control-stats strong {
  font-size: 2rem;
}

.player-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.control-card.wide {
  grid-column: 1 / -1;
}

.control-card h3 {
  margin: 0 0 10px;
}

.admin-player-table {
  display: grid;
  gap: 8px;
}

.admin-player-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.8fr) 90px 90px 90px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-player-main span,
.control-row span,
.admin-player-row label span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-player-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.admin-player-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.control-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.control-actions,
.duel-admin-player-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.duel-admin-player-row {
  grid-template-columns: minmax(120px, 1fr) auto minmax(260px, auto);
  align-items: center;
}

.duel-admin-player-tools input {
  width: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .player-control-stats,
  .player-control-grid,
  .admin-player-row {
    grid-template-columns: 1fr;
  }

  .control-row,
  .duel-admin-player-row {
    align-items: stretch;
    flex-direction: column;
  }

  .control-actions,
  .duel-admin-player-tools {
    justify-content: flex-start;
  }
}

/* Player lobby game skin */
.player-account-panel {
  background:
    radial-gradient(circle at 72% 12%, rgba(255, 191, 0, 0.22), transparent 30%),
    radial-gradient(circle at 12% 92%, rgba(126, 58, 16, 0.28), transparent 36%),
    linear-gradient(135deg, #2b150b 0%, #6b3a16 44%, #1f120b 100%);
  border-color: rgba(255, 214, 102, 0.28);
  color: #fff8dc;
}

.player-account-panel .panel-header h2 {
  color: #ffe8a3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.player-lobby-shell {
  grid-template-columns: minmax(260px, 0.95fr) minmax(360px, 1.25fr) minmax(270px, 0.9fr);
  gap: 16px;
}

.player-lobby-chat,
.player-lobby-main,
.player-lobby-rooms,
.featured-tournament-card,
.player-profile-card,
.competitive-card,
.lobby-action-card,
.leaderboard-box,
.player-room-card,
.scheduled-player-tournament,
.lobby-player-row {
  border: 1px solid rgba(255, 207, 89, 0.32);
  background:
    linear-gradient(180deg, rgba(103, 55, 23, 0.94), rgba(48, 25, 15, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 42px rgba(0, 0, 0, 0.26);
  color: #fff3c4;
}

.player-lobby-chat,
.player-lobby-main,
.player-lobby-rooms {
  padding: 14px;
  border-radius: 8px;
}

.player-lobby-title {
  padding: 0 0 10px;
  color: #ffd76f;
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.player-chat-log {
  height: 430px;
  background: rgba(20, 11, 7, 0.74);
  border-color: rgba(255, 214, 102, 0.22);
  scrollbar-color: #d99d2b rgba(30, 16, 10, 0.7);
}

.player-chat-message {
  background: rgba(48, 24, 13, 0.88);
  border: 1px solid rgba(255, 214, 102, 0.13);
  color: #fcefc7;
}

.player-chat-message strong {
  color: #ffd76f;
}

.featured-tournament-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
  background:
    radial-gradient(circle at 85% 18%, rgba(255, 218, 112, 0.38), transparent 34%),
    linear-gradient(135deg, rgba(67, 31, 14, 0.98), rgba(107, 56, 19, 0.96));
}

.featured-tournament-card h3 {
  margin: 4px 0;
  color: #ffe8a3;
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.featured-tournament-card p,
.featured-tournament-card small {
  color: #f8dfaa;
}

.trophy-badge {
  min-width: 88px;
  min-height: 88px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff2a8 0%, #e5a91f 45%, #7c3f11 100%);
  box-shadow: 0 0 34px rgba(255, 208, 79, 0.48);
  font-size: 3rem;
}

.player-profile-card {
  align-items: stretch;
  background:
    radial-gradient(circle at 72% 50%, rgba(255, 214, 70, 0.18), transparent 26%),
    linear-gradient(180deg, #5b3219, #34190d);
}

.player-profile-card h3 {
  color: #ffe18a;
  font-family: Georgia, serif;
  font-size: 1.75rem;
}

.player-profile-card p,
.player-profile-card span,
.lobby-player-row span,
.player-room-card span,
.player-room-card small,
.scheduled-player-tournament span,
.scheduled-player-tournament small,
.leaderboard-row span,
.quick-game-card small {
  color: #edd7aa;
}

.lobby-player-card {
  display: grid;
  gap: 8px;
}

.lobby-player-card.expanded .lobby-player-row {
  border-color: rgba(255, 214, 102, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(255, 214, 102, 0.16),
    0 18px 42px rgba(0, 0, 0, 0.26);
}

.lobby-player-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.lobby-player-identity:hover strong {
  color: #ffe082;
}

.player-profile-detail {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 214, 102, 0.28);
  background:
    linear-gradient(135deg, rgba(47, 23, 9, 0.96), rgba(86, 43, 13, 0.9));
  color: #fff4cf;
}

.player-profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 10, 6, 0.58);
  backdrop-filter: blur(5px);
}

.player-profile-modal {
  width: min(440px, 96vw);
  max-height: min(620px, 88vh);
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 102, 0.42);
  background:
    linear-gradient(145deg, rgba(35, 18, 9, 0.98), rgba(93, 48, 16, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.player-profile-modal > .ghost-button {
  width: 100%;
  margin-bottom: 10px;
}

.player-profile-modal .player-profile-detail {
  border-color: rgba(255, 214, 102, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.profile-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-detail-head span {
  color: #edd7aa;
  font-size: 0.88rem;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-stat-grid span {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.profile-stat-grid b {
  color: #ffe082;
}

.profile-stat-grid small {
  color: #e8d3a6;
}

.player-chat-compose input,
.player-room-form input,
.player-room-form select {
  border: 1px solid rgba(255, 214, 102, 0.3);
  background: rgba(20, 11, 7, 0.72);
  color: #fff8dc;
}

.daily-icons {
  align-content: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(20, 11, 7, 0.38);
}

.stars-line {
  color: #ffe082;
}

.skulls-line {
  color: #ffb4a2;
}

.coin-line,
.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffe082;
  font-size: 1.18rem;
  font-weight: 950;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.quick-game-card h3,
.player-lobby-rooms h3,
.player-lobby-main h3 {
  color: #ffd76f;
  font-family: Georgia, serif;
}

.player-account-panel .primary-button,
.player-account-panel .secondary-button {
  border: 1px solid rgba(92, 49, 12, 0.7);
  background: linear-gradient(180deg, #ffe27b, #d99916 52%, #a6610e);
  color: #321707;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 8px 22px rgba(0,0,0,0.28);
}

.player-account-panel .ghost-button {
  border-color: rgba(255, 218, 120, 0.38);
  color: #ffe8a3;
  background: rgba(36, 18, 10, 0.55);
}

.leaderboard-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 214, 102, 0.16);
}

.leaderboard-row b {
  color: #ffe082;
}

.duel-hints-panel {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff1bd;
}

.duel-hints-head {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.duel-hints-head { font-size: 0.8rem; }
.duel-hint-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(112px, 100%), 1fr));
  gap: 6px;
  max-width: 480px;
}

.duel-hint-button {
  min-width: 0;
  min-height: 56px;
  padding: 8px;
  border: 1px solid rgba(255, 214, 102, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 210, 86, 0.92), rgba(166, 97, 14, 0.92));
  color: #321707;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
}

.duel-hint-button strong,
.duel-hint-button small {
  display: block;
}

.duel-hint-button small {
  margin-top: 3px;
  font-size: 0.68rem;
  line-height: 1.1;
}

.duel-hint-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.72);
  opacity: 1;
  background: #ded8ca;
  color: #443b2f;
}

.hint-result-box {
  padding: 10px;
  border-radius: 8px;
  background: rgba(20, 11, 7, 0.5);
  border: 1px solid rgba(255, 214, 102, 0.18);
}

.crowd-hint-list {
  margin: 6px 0 0 22px;
  columns: 2;
}

.hint-hidden-choice {
  opacity: 0.48;
  filter: grayscale(1);
}

@media (max-width: 920px) {
  .player-lobby-shell,
  .player-columns {
    grid-template-columns: 1fr;
  }

  .featured-tournament-card,
  .player-profile-card {
    flex-direction: column;
    align-items: stretch;
  }

  .player-chat-log {
    height: 260px;
  }
}
