:root {
  --bg: #050b13;
  --panel: rgba(8, 20, 34, 0.88);
  --line: rgba(236, 190, 111, 0.42);
  --line-cool: rgba(137, 180, 220, 0.22);
  --gold: #f2c371;
  --text: #eef4fb;
  --muted: #93a6b9;
  --green: #33dd72;
  --chest-image: url("/assets/chest-default.png");
  --case-board: url("/assets/case-board.png");
  --case-board-numbers: url("/assets/case-board-numbers.png");
  --case-mystery: url("/assets/case-mystery.png");
  --case-reward-blue: url("/assets/case-reward-blue.png");
  --case-reward-gold: url("/assets/case-reward-gold.png");
  --case-reward-red: url("/assets/case-reward-red.png");
  --case-reward-black: url("/assets/case-reward-black.png");
  --case-reward-custom: url("/assets/case-reward-custom.png");
  --stage-background: url("/assets/stage-background.png");
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg) var(--stage-background) center center / cover no-repeat fixed;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button.case {
  width: 100%;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.stage {
  position: relative;
  min-height: 100vh;
  padding: 26px clamp(16px, 3vw, 56px) 32px;
  overflow: visible;
}

.stage::before,
.stage::after {
  display: none;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1640px, 100%);
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
  margin-bottom: 24px;
}

.side-motto {
  margin-top: 42px;
  color: var(--muted);
  letter-spacing: 0.38em;
  line-height: 1.7;
  font-size: 13px;
  text-transform: uppercase;
}

.side-motto.right {
  text-align: right;
}

.side-motto::after {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.side-motto.right::after {
  margin-left: auto;
  background: linear-gradient(270deg, var(--gold), transparent);
}

.brand {
  display: grid;
  justify-items: center;
  width: clamp(320px, 36vw, 720px);
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.58));
  user-select: none;
}

.logo {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 18px;
  color: #f5f7fb;
  text-transform: uppercase;
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.logo-main {
  font-size: clamp(44px, 6vw, 92px);
}

.logo-main span {
  display: block;
}

.logo-main .gold-word {
  color: var(--gold);
}

.logo-box {
  width: clamp(70px, 8vw, 116px);
  aspect-ratio: 1.15 / 1;
  border: 5px solid var(--gold);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: perspective(180px) rotateY(-18deg);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 0 26px rgba(242, 195, 113, 0.18);
}

.logo-box::before {
  content: "";
  position: absolute;
  inset: 18% 24% auto auto;
  width: 52%;
  height: 42%;
  border-top: 5px solid var(--gold);
  border-right: 5px solid var(--gold);
  transform: translate(18%, -16%) skewY(18deg);
}

.logo-box::after {
  content: "?";
  position: absolute;
  inset: 26% 0 auto;
  text-align: center;
  color: var(--gold);
  font-size: clamp(28px, 3.4vw, 48px);
}

.tagline {
  margin-top: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.8em;
  font-size: 12px;
}

.question-zone {
  display: grid;
  gap: 22px;
  width: min(1040px, 100%);
  margin: 0 auto 34px;
}

.question-card {
  position: relative;
  background: linear-gradient(180deg, rgba(13, 38, 62, 0.94), rgba(6, 20, 34, 0.94));
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: clamp(22px, 3vw, 34px);
  text-align: center;
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 700;
}

.question-card::before,
.question-card::after,
.board-panel::before,
.board-panel::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--gold);
  opacity: 0.86;
}

.question-card::before,
.board-panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.question-card::after,
.board-panel::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

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

.answer {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  min-height: 76px;
  background: linear-gradient(180deg, rgba(10, 36, 60, 0.94), rgba(5, 18, 31, 0.94));
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(242, 195, 113, 0.28);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

button.answer {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

button.answer:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

button.answer:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.answer-letter {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--gold);
  border-right: 1px solid var(--line-cool);
  font-size: 34px;
  font-weight: 900;
}

.answer-text {
  padding: 12px 22px;
  font-size: clamp(17px, 1.4vw, 24px);
  font-weight: 700;
}

.answer.selected {
  border-color: var(--gold);
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(50, 40, 18, 0.94), rgba(17, 29, 39, 0.94));
}

.answer.correct {
  border-color: var(--green);
  box-shadow: inset 0 -1px 0 rgba(51, 221, 114, 0.55), 0 0 22px rgba(51, 221, 114, 0.18);
}

.answer.wrong {
  border-color: rgba(255, 86, 86, 0.8);
  opacity: 0.72;
}

.board-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(9, 25, 40, 0.82), rgba(5, 13, 23, 0.9));
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: clamp(12px, 2vw, 24px);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.44);
}

.box-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(78px, 1fr));
  gap: clamp(8px, 1.15vw, 18px);
}

.case {
  min-width: 0;
  aspect-ratio: 1385 / 1136;
  color: var(--gold);
  background: var(--case-board) center / contain no-repeat;
  border: 0;
  border-radius: 0;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  overflow: visible;
  container-type: inline-size;
}

.case::before {
  display: none;
}

.case-number {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 36%;
  z-index: 2;
  height: 32%;
  display: grid;
  place-items: center;
  padding-bottom: 2px;
  font-weight: 900;
  line-height: 1;
  color: #ffd889;
  font-size: clamp(24px, 32cqw, 142px);
  text-shadow:
    0 2px 0 rgba(39, 20, 2, 0.75),
    0 0 12px rgba(242, 195, 113, 0.46),
    0 4px 10px rgba(0, 0, 0, 0.8);
}

.case.case-board {
  background-image: var(--case-board);
}

.case.case-board .case-number {
  left: 15%;
  right: 15%;
  top: 36%;
  height: 32%;
  color: #ffd889;
  font-size: clamp(24px, 32cqw, 142px);
  -webkit-text-stroke: max(1px, 0.025em) rgba(59, 35, 8, 0.9);
  text-shadow:
    0 2px 0 rgba(78, 43, 4, 0.86),
    0 0 14px rgba(255, 202, 74, 0.72),
    0 8px 14px rgba(0, 0, 0, 0.9);
}

.case.case-mystery {
  background-image: var(--case-mystery);
}

.case.case-mystery .case-number {
  left: 35%;
  right: 35%;
  top: 11.2%;
  height: 18%;
  font-size: clamp(15px, 14cqw, 64px);
  -webkit-text-stroke: max(1px, 0.02em) rgba(59, 35, 8, 0.88);
}

.case.case-blue {
  background-image: var(--case-reward-blue);
}

.admin-box.case-blue {
  background-image: var(--case-reward-blue);
}

.case.case-gold {
  background-image: var(--case-reward-gold);
}

.admin-box.case-gold {
  background-image: var(--case-reward-gold);
}

.case.case-red {
  background-image: var(--case-reward-red);
}

.admin-box.case-red {
  background-image: var(--case-reward-red);
}

.case.case-black {
  background-image: var(--case-reward-black);
}

.admin-box.case-black {
  background-image: var(--case-reward-black);
}

.case.case-custom {
  background-image: none;
}

.admin-box.case-custom {
  background-image: none;
}

.case.case-custom::before,
.admin-box.case-custom::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--case-reward-custom) center / contain no-repeat;
}

.case.opened {
  color: #f5f7fb;
  animation: reveal 420ms ease both;
}

.case.reward-revealed,
.admin-box.reward-revealed {
  color: #f5f7fb;
}

.case.reward-revealed {
  aspect-ratio: 1385 / 1136;
  container-type: inline-size;
}

.case.reward-revealed::before {
  display: none;
}

.case.reward-revealed::after {
  display: none;
}

.case.case-custom.reward-revealed::before,
.admin-box.case-custom.reward-revealed::before,
.admin-box.case-custom::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--case-reward-custom) center / contain no-repeat;
}

.case.selected {
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.9))
    drop-shadow(0 0 15px rgba(242, 195, 113, 0.62))
    drop-shadow(0 0 28px rgba(242, 195, 113, 0.32))
    brightness(1.08);
}

.case.current,
.admin-box.current {
  transform: translateY(-2px) scale(1.02);
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.9))
    drop-shadow(0 0 16px rgba(246, 207, 133, 0.7))
    drop-shadow(0 0 32px rgba(246, 207, 133, 0.38))
    brightness(1.12);
  animation: currentPulse 1250ms ease-in-out infinite;
}

.case.correct,
.admin-box.correct {
  filter:
    drop-shadow(0 0 5px rgba(83, 235, 137, 0.9))
    drop-shadow(0 0 16px rgba(51, 221, 114, 0.62))
    drop-shadow(0 0 29px rgba(51, 221, 114, 0.36))
    brightness(1.08);
}

.case.incorrect,
.admin-box.incorrect {
  filter:
    drop-shadow(0 0 5px rgba(255, 91, 91, 0.9))
    drop-shadow(0 0 16px rgba(255, 91, 91, 0.58))
    drop-shadow(0 0 29px rgba(255, 91, 91, 0.32))
    brightness(1.08);
}

.case.opened.negative:not(.correct):not(.incorrect):not(.current):not(.selected) {
  filter: saturate(1.08);
}

.box-grid.selected-five .case.current {
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.9))
    drop-shadow(0 0 16px rgba(246, 207, 133, 0.7))
    drop-shadow(0 0 32px rgba(246, 207, 133, 0.38))
    brightness(1.12);
}

.box-grid.selected-five .case.correct,
.box-grid.selected-five .case.opened.correct {
  filter:
    drop-shadow(0 0 5px rgba(83, 235, 137, 0.9))
    drop-shadow(0 0 16px rgba(51, 221, 114, 0.62))
    drop-shadow(0 0 29px rgba(51, 221, 114, 0.36))
    brightness(1.08);
}

.box-grid.selected-five .case.incorrect,
.box-grid.selected-five .case.opened.incorrect {
  filter:
    drop-shadow(0 0 5px rgba(255, 91, 91, 0.9))
    drop-shadow(0 0 16px rgba(255, 91, 91, 0.58))
    drop-shadow(0 0 29px rgba(255, 91, 91, 0.32))
    brightness(1.08);
}

.case-order {
  position: absolute;
  top: 7px;
  right: 9px;
  z-index: 5;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(242, 195, 113, 0.96);
  color: #241806;
  font-size: 12px;
  font-weight: 900;
}

.case.reward-revealed .case-order {
  top: 10.5%;
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 20%;
  max-height: none;
  border-radius: 0;
  background: transparent;
  color: #ffd889;
  border: 0;
  box-shadow: none;
  font-size: clamp(18px, 14cqw, 156px);
  text-shadow:
    0 2px 0 #3b2308,
    0 0 11px rgba(255, 202, 74, 0.72),
    0 8px 14px rgba(0, 0, 0, 0.9);
}

.case-reward {
  position: absolute;
  z-index: 2;
  left: 14%;
  right: 14%;
  top: 34.8%;
  display: grid;
  width: auto;
  height: 44%;
  min-height: 0;
  margin: 0;
  place-items: stretch;
}

.case.case-custom .case-reward,
.admin-box.case-custom .case-reward {
  left: 14.35%;
  right: 14.55%;
  top: 33.05%;
  height: 39.9%;
}

.case-reward small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.reward-face {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0 4%;
  border: 0;
  border-radius: 0;
  clip-path: none;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.reward-face.reward-gold {
  background: transparent;
}

.reward-face.reward-red {
  background: transparent;
}

.reward-face.reward-black {
  background: transparent;
}

.reward-face.has-image {
  clip-path: polygon(6% 0, 94% 0, 100% 13%, 100% 87%, 94% 100%, 6% 100%, 0 87%, 0 13%);
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.reward-photo-img {
  position: absolute;
  left: var(--reward-image-x, 50%);
  top: var(--reward-image-y, 50%);
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
  transform: translate(-50%, -50%) scale(var(--reward-image-scale, 1));
  transform-origin: center;
  filter: saturate(1.08) contrast(1.04);
}

.reward-label {
  position: absolute;
  left: var(--reward-label-x, 50%);
  top: var(--reward-label-y, 50%);
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 100%;
  color: #f7fbff;
  font-size: calc(clamp(18px, 13.5cqw, 142px) * var(--reward-label-scale, 1));
  font-weight: 900;
  line-height: 1.05;
  -webkit-text-stroke: max(1px, 0.035em) rgba(1, 8, 16, 0.94);
  text-shadow:
    0 3px 0 rgba(1, 8, 16, 0.96),
    0 8px 13px rgba(0, 0, 0, 0.82),
    0 0 14px rgba(255, 255, 255, 0.28);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  white-space: nowrap;
  text-wrap: balance;
}

.reward-gold .reward-label {
  color: #fff4d1;
}

.reward-red .reward-label {
  color: #ffe8e8;
}

.reward-black .reward-label {
  color: #f7fbff;
}

.reward-face.has-image .reward-label {
  width: 100%;
  padding: 3% 5%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.74));
  font-size: calc(clamp(12px, 6.5cqw, 68px) * var(--reward-label-scale, 1));
}

.reward-face.compact {
  min-height: 0;
  width: min(100%, 92%);
  justify-self: center;
  padding: 0 3%;
}

.reward-face.compact .reward-label {
  font-size: calc(clamp(10px, 10.5cqw, 38px) * var(--reward-label-scale, 1));
}

.case.reward-revealed .reward-label,
.admin-box .reward-label,
.admin-box .reward-face.has-image .reward-label,
.admin-box.reward-revealed .reward-label {
  font-size: calc(clamp(18px, 13.5cqw, 142px) * var(--reward-label-scale, 1));
}

.empty-state {
  min-height: 52vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state.compact {
  min-height: 150px;
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: clamp(24px, 2vw, 34px);
  margin-bottom: 8px;
}

.admin-shell {
  padding: 20px clamp(14px, 2vw, 34px) 32px;
}

.admin-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-title,
.status-box {
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  background: rgba(4, 13, 24, 0.72);
  padding: 16px 18px;
}

.admin-title {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.admin-title small,
.status-box small,
.meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.status-box {
  justify-self: end;
  min-width: 350px;
}

.public-status {
  align-self: center;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  align-items: center;
}

.status-live {
  color: var(--green);
  font-weight: 900;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.room-panel {
  margin-bottom: 18px;
}

.room-panel-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px) auto auto;
  gap: 12px;
  align-items: end;
}

.room-panel h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 16px;
}

.room-entry > div {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.room-join-form,
.reward-set-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: end;
}

.admin-main {
  display: grid;
  gap: 18px;
}

.question-admin-panel,
.selected-boxes-panel {
  width: 100%;
}

.question-admin-grid {
  gap: 16px;
}

.question-picker-row,
.question-action-row,
.question-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.question-action-row {
  align-items: center;
}

.question-admin-panel .question-zone {
  width: 100%;
  margin: 0;
}

.question-admin-panel .answers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.question-admin-panel .answer {
  grid-template-columns: 72px 1fr;
  min-height: 72px;
}

.question-admin-panel .answer-letter {
  font-size: 30px;
}

.question-filter-panel,
.category-filter {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.category-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-filter-option {
  width: auto;
  padding: 8px 10px;
  border: 1px solid rgba(140, 182, 225, 0.26);
  border-radius: 6px;
  background: rgba(7, 28, 48, 0.58);
}

.tool-panel {
  background: rgba(4, 13, 24, 0.78);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: 18px;
}

.tool-panel h2,
.tool-panel h3 {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 16px;
}

.preparation-panel {
  display: grid;
  gap: 18px;
}

.prep-head,
.prep-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.preparation-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.prep-source,
.prep-block,
.prepared-list {
  display: grid;
  gap: 14px;
}

.prep-block,
.prepared-list {
  background: rgba(5, 16, 28, 0.62);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: 14px;
}

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

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.prepared-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(5, 16, 28, 0.76);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.prep-position {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 207, 133, 0.52);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(246, 207, 133, 0.1);
  font-size: 20px;
  font-weight: 900;
}

.order-actions .btn {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 11px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.stage-controls {
  margin-bottom: 16px;
}

.selection-counter,
.correct-answer-line {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(246, 207, 133, 0.42);
  border-radius: 8px;
  background: rgba(246, 207, 133, 0.1);
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.correct-answer-line {
  display: grid;
  gap: 6px;
  justify-content: center;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
}

.correct-answer-line strong {
  margin-left: 8px;
  color: var(--gold);
}

.question-comment-line {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.question-comment-line strong {
  color: var(--text);
}

.btn {
  min-height: 44px;
  padding: 0 18px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(14, 37, 59, 0.96), rgba(4, 18, 32, 0.96));
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.btn:hover,
.admin-box:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--gold);
}

.btn.primary {
  color: #241806;
  background: linear-gradient(180deg, #f6cf85, #b97927);
  border-color: rgba(255, 226, 158, 0.78);
}

.btn.danger {
  background: linear-gradient(180deg, #961b1d, #4d070c);
  border-color: rgba(255, 85, 85, 0.62);
}

.btn.ghost {
  background: rgba(8, 20, 34, 0.5);
}

.btn:disabled,
.admin-box:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.6fr);
  gap: 18px;
  align-items: start;
}

.rewards-split {
  grid-template-columns: minmax(380px, 1fr) minmax(0, 1.2fr);
}

.reward-bank-panel,
.reward-editor {
  display: grid;
  gap: 14px;
}

.reward-bank-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.reward-bank-item {
  display: grid;
  grid-template-columns: minmax(88px, 0.58fr) minmax(0, 1fr) 88px minmax(150px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  background: rgba(5, 16, 28, 0.62);
}

.reward-editor {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-cool);
}

.reward-editor.is-editing {
  padding: 14px;
  border: 1px solid rgba(246, 207, 133, 0.5);
  border-radius: 8px;
  background: rgba(38, 27, 8, 0.24);
  box-shadow: 0 0 22px rgba(242, 195, 113, 0.12);
}

.reward-editor-actions {
  justify-content: flex-start;
}

.reward-set-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-cool);
}

.reward-inline-editor {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(71, 134, 190, 0.32);
  border-radius: 8px;
  background: rgba(5, 16, 28, 0.56);
}

.reward-inline-editor summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

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

.reward-preview {
  display: grid;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  background: rgba(3, 10, 18, 0.54);
}

.preview-case {
  width: min(360px, 100%);
}

.field-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(3, 10, 18, 0.8);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
}

.message {
  min-height: 22px;
  color: var(--gold);
  font-weight: 700;
}

.message.error {
  color: #ff7474;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-box {
  width: min(460px, 100%);
  background: rgba(4, 13, 24, 0.88);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.5);
}

.login-box .brand {
  width: min(100%, 390px);
  min-width: 0;
  margin-bottom: 24px;
}

.login-box .logo-main {
  font-size: 46px;
}

.login-box .logo-box {
  width: 58px;
  border-width: 3px;
}

.admin-console-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #f3f6fa;
  color: #172033;
  letter-spacing: 0;
}

.admin-console-centered {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
}

.admin-console-card {
  width: min(520px, 100%);
  padding: 32px;
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(22, 34, 51, 0.14);
}

.admin-console-card h1,
.admin-console-sidebar h1,
.admin-console-topbar h2 {
  margin: 0;
  color: #111827;
  letter-spacing: 0;
  text-transform: none;
}

.admin-console-kicker {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-console-muted {
  color: #526174;
}

.admin-console-actions,
.admin-console-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.admin-console-shell a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.admin-console-sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 28px 22px;
  background: #111827;
  color: #f8fafc;
}

.admin-console-sidebar h1 {
  color: #f8fafc;
  font-size: 26px;
}

.admin-console-sidebar p {
  margin: 8px 0 0;
  color: #9ca3af;
  font-weight: 700;
}

.admin-console-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-console-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background: transparent;
  color: #d1d5db;
  font-weight: 800;
  cursor: pointer;
}

.admin-console-tab.active {
  background: #f8fafc;
  color: #111827;
  border-color: #f8fafc;
}

.admin-console-tab strong {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
}

.admin-console-sidebar .btn {
  color: #e5e7eb;
  background: transparent;
  border-color: rgba(148, 163, 184, 0.32);
}

.admin-console-main {
  min-width: 0;
  padding: 28px;
  overflow: auto;
}

.admin-console-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 20px 22px;
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(22, 34, 51, 0.08);
}

.admin-console-topbar h2 {
  font-size: 24px;
}

.admin-console-content {
  min-width: 0;
}

.admin-console-shell .tool-panel,
.admin-console-shell .prep-block,
.admin-console-shell .prepared-list,
.admin-console-shell .row-card,
.admin-console-shell .history-item {
  background: #ffffff;
  border-color: #d8e0ea;
  color: #172033;
  box-shadow: 0 10px 28px rgba(22, 34, 51, 0.08);
}

.admin-console-shell .tool-panel h2,
.admin-console-shell .tool-panel h3 {
  color: #111827;
  letter-spacing: 0.04em;
}

.admin-console-shell .meta,
.admin-console-shell .admin-console-muted {
  color: #64748b;
}

.admin-console-shell label,
.admin-console-shell .checkbox-row {
  color: #172033;
}

.admin-console-shell input,
.admin-console-shell select,
.admin-console-shell textarea {
  color: #111827;
  background: #ffffff;
  border-color: #cbd5e1;
}

.admin-console-shell input:focus,
.admin-console-shell select:focus,
.admin-console-shell textarea:focus {
  outline-color: #2563eb;
  border-color: #2563eb;
}

.admin-console-shell .btn {
  color: #172033;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.admin-console-shell .btn.primary {
  color: #ffffff;
  background: #2563eb;
  border-color: #2563eb;
}

.admin-console-shell .btn.danger {
  color: #ffffff;
  background: #dc2626;
  border-color: #dc2626;
}

.admin-console-shell .btn.ghost {
  color: #172033;
  background: #f8fafc;
}

.admin-console-sidebar .btn.ghost {
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.4);
}

.admin-panel-access-option {
  align-self: end;
}

@media (max-width: 900px) {
  .admin-console-shell {
    grid-template-columns: 1fr;
  }

  .admin-console-sidebar {
    grid-template-rows: auto auto auto;
    gap: 16px;
  }

  .admin-console-nav,
  .admin-console-sidebar-actions,
  .admin-console-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-console-main {
    padding: 18px;
  }

  .history-search-form,
  .history-summary-grid,
  .history-answer-grid,
  .history-case-grid.selected {
    grid-template-columns: 1fr;
  }

  .history-case-grid.final,
  .history-reward-pool {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.admin-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(86px, 1fr));
  gap: 10px;
}

.box-grid.selected-five,
.admin-board.selected-five {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  width: min(920px, 100%);
  margin-inline: auto;
}

.admin-box {
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1385 / 1136;
  padding: 0;
  color: var(--text);
  background: var(--case-reward-blue) center / contain no-repeat;
  border: 0;
  border-radius: 0;
  display: block;
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: visible;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  container-type: inline-size;
}

.admin-box::before {
  display: none;
}

.admin-box > * {
  position: relative;
  z-index: 2;
}

.admin-box.opened {
  filter: brightness(1.06);
}

.admin-box.opened.correct {
  filter:
    drop-shadow(0 0 5px rgba(83, 235, 137, 0.9))
    drop-shadow(0 0 16px rgba(51, 221, 114, 0.62))
    drop-shadow(0 0 29px rgba(51, 221, 114, 0.36))
    brightness(1.08);
}

.admin-box.opened.incorrect {
  filter:
    drop-shadow(0 0 5px rgba(255, 91, 91, 0.9))
    drop-shadow(0 0 16px rgba(255, 91, 91, 0.58))
    drop-shadow(0 0 29px rgba(255, 91, 91, 0.32))
    brightness(1.08);
}

.admin-box.selected {
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.9))
    drop-shadow(0 0 15px rgba(242, 195, 113, 0.62))
    drop-shadow(0 0 28px rgba(242, 195, 113, 0.32))
    brightness(1.08);
}

.admin-box.negative:not(.selected):not(.current):not(.correct):not(.incorrect) {
  filter: saturate(1.08);
}

.box-grid .case.selected,
.admin-board .admin-box.selected {
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.9))
    drop-shadow(0 0 15px rgba(242, 195, 113, 0.62))
    drop-shadow(0 0 28px rgba(242, 195, 113, 0.32))
    brightness(1.08);
}

.admin-box .num {
  position: absolute;
  top: 10.5%;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  width: 32%;
  height: 20%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gold);
  font-size: clamp(15px, 14cqw, 64px);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(39, 20, 2, 0.85),
    0 0 10px rgba(242, 195, 113, 0.54),
    0 6px 10px rgba(0, 0, 0, 0.86);
}

.admin-box .reward {
  justify-self: center;
  width: min(100%, 92%);
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.34);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.admin-box .case-reward {
  position: absolute;
  z-index: 2;
  left: 14%;
  right: 14%;
  top: 34.8%;
  display: grid;
  width: auto;
  height: 44%;
  min-height: 0;
  margin: 0;
  place-items: stretch;
}

.admin-box .reward-face.compact {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 34.8%;
  width: auto;
  height: 44%;
  min-height: 0;
  align-self: auto;
}

.admin-box .state {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 8.5%;
  z-index: 2;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-box.correct .state {
  color: #8cffba;
}

.admin-box.incorrect .state {
  color: #ff9b9b;
}

.negotiation-panel {
  min-height: min(680px, calc(100vh - 260px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.negotiation-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.negotiation-top h2,
.negotiation-column-head h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 16px;
}

.wallet-display {
  min-width: 250px;
  padding: 14px 18px;
  border: 1px solid rgba(246, 207, 133, 0.54);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(13, 35, 55, 0.9), rgba(5, 14, 24, 0.96));
  color: var(--text);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
  box-shadow: inset 0 -1px 0 rgba(242, 195, 113, 0.28), 0 12px 30px rgba(0, 0, 0, 0.32);
}

.wallet-display strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 28px;
  letter-spacing: 0;
}

.negotiation-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 230px) minmax(280px, 1fr) minmax(160px, 230px);
  gap: clamp(18px, 3vw, 48px);
  align-items: start;
  min-height: 440px;
}

.negotiation-center {
  min-height: 100%;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(25, 91, 152, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(4, 13, 24, 0.18), rgba(4, 13, 24, 0.02));
  border: 1px solid rgba(137, 180, 220, 0.08);
}

.negotiation-column {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 14px;
  border: 1px solid rgba(71, 134, 190, 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(7, 20, 34, 0.92), rgba(3, 9, 16, 0.72));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.negotiation-column-head {
  display: flex;
  justify-content: center;
  text-align: center;
}

.negotiation-board {
  display: grid;
  gap: 14px;
}

.trade-box {
  width: 100%;
  transition: transform 240ms ease, border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button.trade-box:not(.locked) {
  cursor: pointer;
}

.trade-box:hover:not(.locked) {
  filter: brightness(1.08);
}

.left-side .trade-box.proposed {
  transform: translateX(clamp(32px, 6vw, 94px));
}

.right-side .trade-box.proposed {
  transform: translateX(clamp(-94px, -6vw, -32px));
}

.trade-box.proposed {
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.86))
    drop-shadow(0 0 16px rgba(246, 207, 133, 0.66))
    drop-shadow(0 0 31px rgba(246, 207, 133, 0.38))
    brightness(1.1);
}

.trade-box.locked {
  cursor: default;
}

.trade-box.reward-revealed {
  filter:
    drop-shadow(0 0 5px rgba(83, 235, 137, 0.92))
    drop-shadow(0 0 15px rgba(51, 221, 114, 0.58))
    drop-shadow(0 0 26px rgba(51, 221, 114, 0.32))
    brightness(1.08);
}

.admin-box.final-clickable {
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.84))
    drop-shadow(0 0 16px rgba(242, 195, 113, 0.5))
    brightness(1.08);
}

.admin-box.final-clickable .state {
  color: var(--gold);
}

.side-offer-field {
  margin-top: 2px;
}

.side-offer-field input {
  min-height: 56px;
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
}

.open-box-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  background: rgba(5, 16, 28, 0.7);
}

.trade-panel {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  background: rgba(5, 16, 28, 0.78);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.trade-actions {
  justify-content: center;
}

.final-panel,
.final-board-panel {
  display: grid;
  gap: 20px;
  justify-items: center;
}

.final-head {
  width: min(760px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.final-head h2 {
  margin: 0;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(26px, 3vw, 44px);
}

.final-prizes {
  width: min(920px, 100%);
}

.final-prizes .trade-box,
.final-prizes .trade-box.proposed,
.final-prizes .trade-box.final-clickable,
.final-prizes .admin-box.final-clickable {
  filter: none;
  transform: none;
}

.final-board-grid .case.owner-player {
  filter:
    drop-shadow(0 0 6px rgba(83, 235, 137, 0.96))
    drop-shadow(0 0 18px rgba(51, 221, 114, 0.7))
    drop-shadow(0 0 34px rgba(51, 221, 114, 0.44))
    brightness(1.1);
}

.final-actions {
  justify-content: center;
}

.final-board-grid {
  width: 100%;
  grid-template-columns: repeat(10, minmax(78px, 1fr));
}

.final-board-grid .case.owner-host {
  filter:
    drop-shadow(0 0 5px rgba(255, 91, 91, 0.9))
    drop-shadow(0 0 16px rgba(255, 91, 91, 0.56))
    drop-shadow(0 0 28px rgba(255, 91, 91, 0.3))
    brightness(1.08);
}

.final-board-grid .case.selected {
  filter:
    drop-shadow(0 0 5px rgba(255, 216, 137, 0.9))
    drop-shadow(0 0 16px rgba(242, 195, 113, 0.62))
    drop-shadow(0 0 29px rgba(242, 195, 113, 0.36))
    brightness(1.1);
}

@media (max-height: 820px) and (min-width: 900px) {
  .stage {
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .topbar,
  .admin-head {
    gap: 12px;
    margin-bottom: 10px;
  }

  .admin-shell {
    padding-top: 10px;
    padding-bottom: 14px;
  }

  .admin-title,
  .status-box {
    padding: 10px 12px;
  }

  .admin-tabs {
    gap: 8px;
    margin-bottom: 10px;
  }

  .admin-main {
    gap: 10px;
  }

  .brand {
    width: clamp(260px, 31vw, 560px);
  }

  .logo {
    column-gap: 12px;
  }

  .logo-main {
    font-size: clamp(36px, 4.8vw, 64px);
  }

  .logo-box {
    width: clamp(56px, 6vw, 82px);
    border-width: 4px;
  }

  .tagline {
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 0.52em;
  }

  .side-motto {
    margin-top: 20px;
    font-size: 11px;
    line-height: 1.45;
  }

  .tool-panel,
  .prep-block,
  .prepared-list {
    padding: 12px;
  }

  .tool-panel h2,
  .tool-panel h3 {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .controls,
  .preparation-panel,
  .preparation-grid,
  .prepared-list,
  .table-list {
    gap: 8px;
  }

  .btn {
    min-height: 38px;
    padding-inline: 14px;
    font-size: 11px;
  }

  input,
  select,
  textarea {
    padding: 8px 10px;
  }

  textarea {
    min-height: 62px;
  }

  .question-zone {
    gap: 12px;
    margin-bottom: 14px;
  }

  .question-card {
    padding: 16px;
    font-size: clamp(18px, 1.7vw, 26px);
  }

  .answers {
    gap: 10px 16px;
  }

  .answer {
    grid-template-columns: 72px 1fr;
    min-height: 60px;
  }

  .answer-letter {
    font-size: 26px;
  }

  .answer-text {
    padding: 8px 14px;
    font-size: 16px;
  }

  .board-panel {
    padding: 12px;
  }

  .box-grid,
  .admin-board,
  .final-board-grid {
    grid-template-columns: repeat(10, minmax(62px, 1fr));
    gap: 8px;
  }

  .box-grid.selected-five,
  .admin-board.selected-five {
    width: min(780px, 100%);
  }

  .admin-box {
    min-height: 0;
    padding: 0;
  }

  .admin-box .num {
    font-size: 18px;
  }

  .admin-box .reward {
    font-size: 11px;
  }

  .admin-box .state,
  .case-reward small {
    font-size: 9px;
  }

  .case-number {
    font-size: clamp(20px, 30cqw, 120px);
  }

  .case-order {
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .negotiation-panel {
    min-height: 0;
    gap: 10px;
  }

  .negotiation-layout {
    min-height: 0;
    grid-template-columns: minmax(140px, 190px) minmax(220px, 1fr) minmax(140px, 190px);
    gap: clamp(16px, 2.2vw, 30px);
  }

  .negotiation-column {
    gap: 8px;
    padding: 10px;
  }

  .negotiation-board {
    gap: 8px;
  }

  .wallet-display {
    min-width: 210px;
    padding: 8px 12px;
  }

  .wallet-display strong {
    margin-top: 2px;
    font-size: 22px;
  }

  .open-box-panel,
  .trade-panel {
    padding: 8px;
  }

  .side-offer-field input {
    min-height: 48px;
    font-size: 19px;
  }

  .final-panel,
  .final-board-panel {
    gap: 12px;
  }

  .final-head {
    gap: 8px;
  }

  .final-head h2 {
    font-size: clamp(22px, 2.4vw, 34px);
  }
}

@media (max-height: 700px) and (min-width: 900px) {
  .stage {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .side-motto {
    display: none;
  }

  .admin-title small,
  .status-box small,
  .meta {
    letter-spacing: 0.14em;
  }

  .logo-main {
    font-size: clamp(32px, 4.1vw, 54px);
  }

  .logo-box {
    width: clamp(48px, 5.2vw, 68px);
  }

  .tagline {
    font-size: 9px;
  }

  .admin-box {
    min-height: 0;
  }

  .question-admin-panel .answer,
  .answer {
    min-height: 54px;
  }

  .selection-counter,
  .correct-answer-line {
    min-height: 36px;
  }
}

.table-list {
  display: grid;
  gap: 10px;
}

.row-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(5, 16, 28, 0.76);
  border: 1px solid var(--line-cool);
  border-radius: 8px;
}

.reward-pool-item {
  grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr) 96px auto;
}

.reward-pool-item.is-editing {
  border-color: rgba(246, 207, 133, 0.68);
  box-shadow: 0 0 18px rgba(242, 195, 113, 0.16);
}

.row-card strong {
  display: block;
  margin-bottom: 4px;
}

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

.history-item {
  border: 1px solid var(--line-cool);
  border-radius: 8px;
  background: rgba(4, 13, 24, 0.74);
  padding: 14px;
}

.history-boxes {
  display: grid;
  grid-template-columns: repeat(10, minmax(36px, 1fr));
  gap: 5px;
  margin-top: 12px;
}

.history-boxes span {
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(13, 31, 48, 0.92);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
}

.history-boxes span.opened {
  color: #ffffff;
  background: rgba(7, 75, 151, 0.9);
}

.history-search-form {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 12px;
  align-items: end;
}

.history-report {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.history-summary-grid > div {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.history-summary-grid strong {
  color: #111827;
  font-size: 18px;
}

.history-case-grid {
  display: grid;
  gap: 14px;
}

.history-case-grid.selected {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.history-case-grid.final {
  grid-template-columns: repeat(auto-fit, minmax(120px, 180px));
}

.history-selected-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.history-case {
  width: 100%;
  max-width: 190px;
  margin-inline: auto;
}

.history-case.compact {
  width: 118px;
}

.history-case.owner-player {
  filter:
    drop-shadow(0 0 6px rgba(51, 221, 114, 0.55))
    drop-shadow(0 0 18px rgba(51, 221, 114, 0.28));
}

.history-case.owner-host {
  filter:
    drop-shadow(0 0 6px rgba(255, 87, 87, 0.55))
    drop-shadow(0 0 18px rgba(255, 87, 87, 0.26));
}

.history-final-grid {
  display: grid;
  gap: 18px;
}

.history-question-list {
  display: grid;
  gap: 14px;
}

.history-question {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.history-question.correct {
  border-color: rgba(22, 163, 74, 0.35);
}

.history-question.incorrect {
  border-color: rgba(220, 38, 38, 0.32);
}

.history-question-head,
.history-question-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
}

.history-question-head span,
.history-question-summary span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.history-question-head strong {
  color: #111827;
}

.history-question-summary strong {
  color: #111827;
}

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

.history-answer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #ffffff;
}

.history-answer span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 900;
}

.history-answer strong {
  min-width: 0;
  color: #111827;
  font-size: 13px;
}

.history-answer.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.history-answer.correct span {
  background: #16a34a;
  color: #ffffff;
}

.history-reward-pool {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.history-reward-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-wide {
  grid-column: 1 / -1;
}

.category-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.38fr) auto;
}

.user-admin-card {
  grid-template-columns: 1fr;
}

.user-account-form,
.user-password-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.34fr) minmax(170px, 0.28fr) auto;
  gap: 12px;
  align-items: end;
}

.user-password-form {
  grid-template-columns: minmax(220px, 0.5fr) auto;
  justify-content: end;
  padding-top: 10px;
  border-top: 1px solid rgba(140, 182, 225, 0.18);
}

.pending-question {
  grid-template-columns: minmax(0, 1fr) auto;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(25, 91, 152, 0.18), transparent 42%),
    rgba(1, 6, 12, 0.74);
  backdrop-filter: blur(8px);
}

.confirm-dialog {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(246, 207, 133, 0.56);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 31, 50, 0.98), rgba(4, 13, 24, 0.98));
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.62),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.prompt-dialog {
  width: min(720px, 100%);
  grid-template-columns: 1fr;
}

.prompt-dialog input {
  min-height: 54px;
  font-size: 18px;
}

.confirm-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 207, 133, 0.62);
  border-radius: 8px;
  background: rgba(246, 207, 133, 0.12);
  box-shadow: 0 0 24px rgba(246, 207, 133, 0.16);
}

.confirm-mark::before {
  content: "!";
  color: var(--gold);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 16px rgba(246, 207, 133, 0.5);
}

.confirm-mark.danger {
  border-color: rgba(255, 91, 91, 0.72);
  background: rgba(130, 18, 25, 0.32);
  box-shadow: 0 0 24px rgba(255, 91, 91, 0.18);
}

.confirm-mark.danger::before {
  color: #ff7c7c;
  text-shadow: 0 0 16px rgba(255, 91, 91, 0.5);
}

.confirm-copy h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.confirm-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.reward-preview-dialog {
  width: min(780px, 100%);
  grid-template-columns: 1fr;
}

.reward-preview-dialog .confirm-copy {
  text-align: center;
}

.reward-preview-large {
  display: grid;
  justify-items: center;
  padding: 8px 0 2px;
}

.preview-case-large {
  width: min(620px, 100%);
}

.reward-bank-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  width: min(440px, calc(100vw - 36px));
  padding: 14px 16px;
  background: rgba(4, 13, 24, 0.96);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  font-weight: 700;
}

.toast.error {
  border-color: rgba(255, 93, 93, 0.8);
}

@keyframes reveal {
  0% {
    opacity: 0.72;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes currentPulse {
  0%,
  100% {
    opacity: 0.98;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .room-panel-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .admin-head {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .side-motto {
    display: none;
  }

  .status-box,
  .admin-title {
    justify-self: stretch;
    min-width: 0;
  }

  .box-grid,
  .admin-board {
    grid-template-columns: repeat(5, minmax(76px, 1fr));
  }

  .box-grid.selected-five,
  .admin-board.selected-five {
    grid-template-columns: repeat(5, minmax(76px, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }

  .preparation-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .category-row,
  .user-account-form,
  .user-password-form,
  .pending-question {
    grid-template-columns: 1fr;
  }

  .question-picker-row,
  .question-action-row,
  .question-bottom-row {
    grid-template-columns: 1fr;
  }

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

  .negotiation-center {
    display: none;
  }

  .negotiation-top {
    display: grid;
  }

  .wallet-display {
    min-width: 0;
  }

  .left-side .trade-box.proposed,
  .right-side .trade-box.proposed {
    transform: translateY(-6px);
  }

  .open-box-panel {
    grid-template-columns: 1fr;
  }

  .trade-actions {
    justify-content: stretch;
  }

  .question-admin-panel .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .stage {
    padding-inline: 12px;
  }

  .brand {
    width: min(100%, 360px);
  }

  .logo {
    column-gap: 10px;
  }

  .tagline {
    letter-spacing: 0.34em;
  }

  .answers {
    grid-template-columns: 1fr;
  }

  .question-admin-panel .answers {
    grid-template-columns: 1fr;
  }

  .answer {
    grid-template-columns: 70px 1fr;
  }

  .box-grid,
  .admin-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .negotiation-board {
    grid-template-columns: 1fr;
  }

  .box-grid.selected-five,
  .admin-board.selected-five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-tabs,
  .controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

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

  .prep-head,
  .prep-list-head {
    display: grid;
  }

  .answers-form-grid,
  .prepared-item {
    grid-template-columns: 1fr;
  }

  .prep-position {
    width: 100%;
  }
}
