:root {
  --bg-main-1: #071725;
  --bg-main-2: #0b2844;
  --bg-main-3: #154066;
  --panel: rgba(7, 21, 38, 0.82);
  --panel-soft: rgba(13, 36, 62, 0.78);
  --stroke: rgba(247, 216, 129, 0.25);
  --text: #f7f3e7;
  --text-soft: #d7ddde;
  --chip: rgba(255, 255, 255, 0.08);
  --gold-1: #f7d981;
  --gold-2: #c98f2a;
  --green-1: #33b26c;
  --green-2: #1f7848;
  --night-blue: #0e3256;
  --hex-size: 66px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Tajawal", sans-serif;
  color: var(--text);
  background: #061320;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 12% 18%, rgba(247, 217, 129, 0.14), transparent 36%),
    radial-gradient(circle at 84% 86%, rgba(51, 178, 108, 0.16), transparent 39%),
    linear-gradient(145deg, var(--bg-main-1), var(--bg-main-2) 46%, var(--bg-main-3));
}

.bg-layer::before {
  content: none !important;
}

.bg-layer::after {
  content: "";
  position: absolute;
}

.bg-layer::after {
  inset: 0;
  background-image: radial-gradient(circle at 9% 14%, rgba(255, 245, 203, 0.75) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 26% 8%, rgba(255, 245, 203, 0.62) 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 47% 20%, rgba(255, 245, 203, 0.7) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 63% 10%, rgba(255, 245, 203, 0.6) 0 1.05px, transparent 1.7px),
    radial-gradient(circle at 79% 22%, rgba(255, 245, 203, 0.65) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 92% 15%, rgba(255, 245, 203, 0.75) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 18% 68%, rgba(255, 245, 203, 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 58% 76%, rgba(255, 245, 203, 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 87% 66%, rgba(255, 245, 203, 0.5) 0 1px, transparent 1.6px);
}

.screen {
  position: relative;
  z-index: 1;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 10px 14px 14px;
  animation: screenFadeIn 0.45s ease;
}

.hidden {
  display: none !important;
}

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)) var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  box-shadow: 0 20px 44px rgba(3, 11, 23, 0.5);
  backdrop-filter: blur(8px);
}

.game-topbar {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 11px 14px;
  border: 1px solid rgba(247, 216, 129, 0.38);
  background: linear-gradient(95deg, rgba(11, 43, 74, 0.94), rgba(17, 52, 84, 0.9));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.game-topbar::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(247, 216, 129, 0.86), transparent);
}

.game-topbar::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 20px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: -11px 0 0 rgba(247, 216, 129, 0.9);
  opacity: 0.9;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-chip {
  border: 1px solid rgba(247, 216, 129, 0.32);
  background: var(--chip);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.top-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.18);
}

.top-chip-accent {
  background: linear-gradient(145deg, rgba(51, 178, 108, 0.9), rgba(31, 120, 72, 0.9));
  border-color: rgba(196, 250, 217, 0.44);
}

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

.brand-text {
  text-align: right;
}

.brand-text h1 {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: clamp(1.5rem, 2.3vw, 2.1rem);
  line-height: 1.05;
  color: #fff5d2;
  text-shadow: 0 0 12px rgba(247, 216, 129, 0.34);
}

.brand-text p {
  margin: 2px 0 0;
  color: #ffdca2;
  font-weight: 800;
}

.brand-logo {
  width: 74px;
  height: 74px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(247, 216, 129, 0.4);
  box-shadow: 0 10px 24px rgba(2, 9, 20, 0.46);
}

.game-content {
  margin-top: 12px;
  display: grid;
  direction: ltr;
  grid-template-columns: minmax(0, 1.25fr) clamp(240px, 22vw, 320px);
  grid-template-areas:
    "board question"
    "score score";
  gap: 12px;
}

.board-pane,
.question-pane,
.score-pane {
  padding: 12px;
  direction: rtl;
}

.board-pane {
  grid-area: board;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-pane {
  grid-area: question;
}

.score-pane {
  grid-area: score;
}

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

h2 {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: 1.2rem;
}

.pill {
  background: rgba(247, 216, 129, 0.16);
  border: 1px solid rgba(247, 216, 129, 0.34);
  border-radius: 999px;
  font-size: 0.89rem;
  font-weight: 700;
  padding: 5px 12px;
}

.active-turn {
  background: linear-gradient(140deg, rgba(247, 216, 129, 0.58), rgba(201, 143, 42, 0.52));
  color: #fef7df;
}

.board-stage {
  border: 1px solid rgba(255, 242, 183, 0.42);
  border-top: 6px solid #30c873;
  border-bottom: 6px solid #30c873;
  border-left: 6px solid #ff8856;
  border-right: 6px solid #ff8856;
  border-radius: 20px;
  min-height: clamp(430px, 56vh, 540px);
  padding: 10px;
  position: relative;
  overflow: hidden;
  background: #ff7a3a;
  box-shadow: inset 0 0 0 1px rgba(96, 38, 14, 0.22), 0 12px 28px rgba(5, 17, 31, 0.4);
}

.board-stage::before,
.board-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #38bf1e;
  z-index: 0;
}

.board-stage::before {
  clip-path: polygon(0 0, 100% 0, 50% 36%);
}

.board-stage::after {
  clip-path: polygon(0 100%, 100% 100%, 50% 64%);
}

.hex-board {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: clamp(400px, 52vh, 510px);
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
  align-items: center;
}

.hex-row {
  display: flex;
  gap: var(--cell-gap, 0px);
}

.hex-row + .hex-row {
  margin-top: calc(var(--hex-size) * var(--row-overlap, -0.289));
}

.hex-row.offset {
  transform: translateX(calc((var(--hex-size) + var(--cell-gap, 0px)) * 0.5));
}

.hex-cell {
  width: var(--hex-size);
  height: calc(var(--hex-size) * 1.1547);
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  font-family: "Changa", sans-serif;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.hex-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hex-poly {
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.hex-text {
  font-family: "Changa", sans-serif;
  font-weight: 700;
}

.hex-cell:hover {
  transform: translateY(-1px);
}

.hex-cell.selected {
  filter: brightness(1.03);
}

.hex-cell.claimed-team-0 {
  cursor: default;
  box-shadow: none;
}

.hex-cell.claimed-team-1 {
  cursor: default;
  box-shadow: none;
}

.answer-box {
  margin-top: 10px;
  background: rgba(8, 21, 38, 0.66);
  border: 1px solid rgba(247, 216, 129, 0.23);
  border-radius: 14px;
  padding: 9px;
}

.answer-box label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-weight: 700;
}

.answer-output {
  min-height: 48px;
  border-radius: 10px;
  border: 1px dashed rgba(247, 216, 129, 0.4);
  background: rgba(5, 14, 26, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Changa", sans-serif;
  font-size: 1.25rem;
}

.answer-actions {
  margin-top: 7px;
  display: flex;
  gap: 7px;
}

.action-btn {
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 11px 12px;
  width: 100%;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.action-btn.success {
  background: linear-gradient(145deg, #3ec87b, #1f7f4d);
  box-shadow: 0 10px 22px rgba(39, 167, 102, 0.32);
}

.action-btn.secondary {
  background: linear-gradient(145deg, #2c8cb8, #1f688c);
}

.action-btn.warning {
  background: linear-gradient(145deg, #f4c052, #c98f2a);
  color: #11263f;
}

.action-btn.team2-award {
  background: linear-gradient(145deg, #31b56a, #1e8049);
}

.action-btn.muted {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding-block: 8px;
  width: auto;
  min-width: 95px;
}

.action-btn.violet {
  background: linear-gradient(145deg, #2c8cb8, #216f95);
}

.action-btn.pink {
  background: linear-gradient(145deg, #c98f2a, #b4781b);
}

.action-btn.blue {
  background: linear-gradient(145deg, #2f9dcd, #236f99);
}

.question-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: clamp(430px, 56vh, 540px);
}

.question-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.timer-holder {
  text-align: center;
  background: rgba(9, 28, 50, 0.62);
  border: 1px solid rgba(247, 216, 129, 0.24);
  border-radius: 16px;
  padding: 8px 8px 10px;
}

.timer-ring {
  width: 110px;
  margin: 0 auto 4px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--gold-1) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.2) 0);
}

.timer-ring::before {
  content: "";
  width: 84%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(6, 19, 34, 0.95);
  position: absolute;
}

.timer-ring span {
  position: relative;
  z-index: 1;
  font-family: "Changa", sans-serif;
  font-size: 2rem;
}

.timer-holder p {
  margin: 0;
  color: var(--text-soft);
}

.timer-manual-actions {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.action-btn.timer-btn {
  padding: 8px 10px;
  font-size: 0.94rem;
  background: linear-gradient(145deg, #2c8cb8, #1f6a8f);
}

.action-btn.timer-btn.muted-timer {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.question-card {
  flex: 1;
  border-radius: 20px;
  border: 1px solid rgba(247, 216, 129, 0.24);
  background: linear-gradient(165deg, #113457, #0b263f);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
}

.question-title {
  display: block;
  text-align: center;
  font-weight: 800;
  margin-bottom: 9px;
  opacity: 0.95;
}

.question-card p {
  margin: 0;
  text-align: center;
  font-family: "Changa", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1.65;
  color: #fff9e6;
}

.board-pane .question-card {
  flex: 0 0 auto;
  min-height: 128px;
  margin-top: 2px;
  background: linear-gradient(160deg, rgba(18, 61, 100, 0.85), rgba(10, 36, 61, 0.84));
  border-color: rgba(247, 216, 129, 0.24);
  box-shadow: 0 8px 20px rgba(4, 13, 25, 0.38);
}

.board-pane .question-card .question-title {
  margin-bottom: 5px;
  color: #f7df9a;
}

.board-pane .question-card p {
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.45;
  color: #f2f7ff;
}

.question-pane .answer-box {
  margin-top: 0;
  border-radius: 18px;
  border-color: rgba(247, 216, 129, 0.26);
  background: linear-gradient(165deg, rgba(24, 71, 112, 0.5), rgba(9, 29, 49, 0.74));
  padding: 12px;
}

.question-pane .answer-box label {
  text-align: center;
  margin-bottom: 6px;
  color: #e6defc;
}

.question-pane .answer-output {
  min-height: 62px;
  border-radius: 12px;
  border: 1px solid rgba(247, 216, 129, 0.28);
  background: rgba(4, 14, 25, 0.9);
  font-size: clamp(1.2rem, 1.7vw, 1.45rem);
}

.question-pane .answer-actions {
  margin-top: 8px;
}

.question-pane .answer-actions .action-btn.muted {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(247, 216, 129, 0.24), rgba(247, 216, 129, 0.12));
  border: 1px solid rgba(247, 216, 129, 0.32);
  color: #fef9eb;
}

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

.status-message {
  margin: 0;
  min-height: 28px;
  text-align: center;
  font-weight: 700;
}

.status-message.success {
  color: #a8ffc8;
}

.status-message.error {
  color: #ffc2c2;
}

.status-message.warning {
  color: #ffe9a1;
}

.status-message.info {
  color: #d6e7ff;
}

.status-message.answer {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 13px;
  border: 1px solid rgba(247, 216, 129, 0.5);
  background: linear-gradient(145deg, rgba(20, 64, 103, 0.84), rgba(11, 34, 57, 0.84));
  box-shadow: 0 8px 20px rgba(2, 11, 21, 0.4);
  color: #fff6d8;
}

.status-message.answer .status-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(247, 216, 129, 0.2);
  border: 1px solid rgba(247, 216, 129, 0.34);
  color: #f4e0a6;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.1px;
}

.status-message.answer .status-separator {
  opacity: 0.9;
  font-size: 1.05rem;
}

.status-message.answer .status-value {
  font-family: "Changa", sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(247, 216, 129, 0.22);
}

.score-pane {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(260px, 1.15fr);
  gap: 10px;
  align-items: start;
}

.score-pane .pane-head {
  grid-column: 1 / -1;
}

.team-score {
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px;
  margin: 0;
}

.team-score h3 {
  margin: 0 0 6px;
  font-family: "Changa", sans-serif;
  font-size: 1.25rem;
}

.score-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-line span {
  font-size: 1.2rem;
  font-weight: 700;
}

.score-line strong {
  font-family: "Changa", sans-serif;
  font-size: 2.25rem;
  line-height: 1;
}

.team-0 {
  background: linear-gradient(145deg, rgba(201, 143, 42, 0.9), rgba(157, 108, 27, 0.92));
}

.team-1 {
  background: linear-gradient(145deg, rgba(45, 175, 102, 0.9), rgba(25, 120, 70, 0.92));
}

.team-score.active {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.27) inset;
}

.side-actions {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.winner-banner {
  margin: 0;
  border-radius: 12px;
  padding: 8px;
  background: rgba(8, 24, 43, 0.76);
  border: 1px solid rgba(247, 216, 129, 0.28);
  color: #ffeab3;
  font-weight: 800;
  text-align: center;
  grid-column: 1 / -1;
}

.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(247, 216, 129, 0.25), rgba(5, 17, 31, 0.84) 55%);
  backdrop-filter: blur(3px);
}

.winner-overlay.show {
  animation: winnerOverlayFade 0.4s ease;
}

.winner-overlay-content {
  width: min(560px, 92vw);
  padding: 26px 22px;
  border-radius: 24px;
  text-align: center;
  border: 1px solid rgba(247, 216, 129, 0.34);
  background: linear-gradient(150deg, rgba(11, 45, 77, 0.96), rgba(7, 24, 42, 0.97));
  box-shadow: 0 24px 55px rgba(1, 7, 14, 0.68);
  animation: winnerCardRise 0.6s cubic-bezier(0.24, 0.7, 0.2, 1);
}

.winner-overlay-content h3 {
  margin: 0 0 8px;
  font-family: "Changa", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #ffe7ab;
}

.winner-overlay-name {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: clamp(2rem, 6vw, 3.3rem);
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(247, 216, 129, 0.35);
}

.winner-overlay-meta {
  margin: 8px 0 0;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: #dbf5e5;
}

.winner-overlay-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.winner-restart-btn {
  width: min(320px, 90%);
  font-size: clamp(1.1rem, 2.8vw, 1.5rem);
  padding: 12px 14px;
  border-radius: 16px;
}

@keyframes winnerOverlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes winnerCardRise {
  0% {
    transform: translateY(22px) scale(0.94);
    opacity: 0.1;
  }
  60% {
    transform: translateY(-4px) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-screen {
  min-height: 100vh;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 12px;
}

.settings-header h2 {
  font-family: "Changa", sans-serif;
  font-size: 2rem;
  margin: 0;
}

.back-btn {
  position: absolute;
  left: 0;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.27);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

.settings-layout {
  display: grid;
  gap: 12px;
}

.network-card {
  padding: 15px;
}

.network-title {
  text-align: center;
  font-family: "Changa", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 10px;
}

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

.size-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  padding: 12px 8px;
  display: grid;
  place-items: center;
  gap: 8px;
}

.size-card.active {
  border-color: rgba(247, 216, 129, 0.76);
  box-shadow: 0 0 0 2px rgba(247, 216, 129, 0.3) inset;
  background: rgba(247, 216, 129, 0.18);
}

.size-card strong {
  font-size: 1.3rem;
  font-family: "Changa", sans-serif;
}

.mini-grid {
  width: 86px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.mini-grid span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(214, 191, 255, 0.78);
}

.mini-grid.mini-6 {
  grid-template-columns: repeat(6, 1fr);
  width: 74px;
}

.mini-grid.mini-5 {
  grid-template-columns: repeat(5, 1fr);
  width: 62px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 10px;
}

.rules-card,
.team-config {
  padding: 14px;
}

.rules-card h3,
.team-config h3 {
  margin: 0 0 8px;
  font-family: "Changa", sans-serif;
  font-size: 1.4rem;
}

.rules-card label,
.team-config label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  color: var(--text-soft);
}

.rules-card input,
.team-config input {
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 7, 30, 0.7);
  color: #fff;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  padding: 10px;
}

.rules-card input:focus,
.team-config input:focus {
  outline: none;
  border-color: rgba(153, 201, 255, 0.85);
}

.settings-footer {
  display: flex;
  justify-content: center;
}

.return-btn {
  border: 0;
  border-radius: 24px;
  background: linear-gradient(145deg, #3fc87a, #1f7f4d);
  color: #fff;
  font-family: "Changa", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  padding: 12px 54px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(35, 141, 85, 0.4);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(8, 5, 22, 0.72);
  display: grid;
  place-items: center;
  padding: 14px;
}

.modal-content {
  width: min(460px, 100%);
  padding: 16px;
}

.modal-content h3 {
  margin: 0 0 8px;
  font-family: "Changa", sans-serif;
}

.help-list {
  margin: 0 0 14px;
  padding-right: 16px;
  display: grid;
  gap: 6px;
}

.admin-modal-content {
  width: min(920px, 100%);
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.admin-form label {
  color: var(--text-soft);
  font-weight: 700;
}

.admin-form textarea,
.admin-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 7, 30, 0.75);
  color: #fff;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  padding: 10px;
}

.admin-form textarea {
  resize: vertical;
  min-height: 86px;
  max-height: 180px;
}

.admin-form textarea:focus,
.admin-form input:focus {
  outline: none;
  border-color: rgba(153, 201, 255, 0.85);
}

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

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-list-head strong {
  font-family: "Changa", sans-serif;
  font-size: 1.08rem;
}

.admin-questions-list {
  flex: 1;
  min-height: 180px;
  max-height: 380px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-left: 2px;
}

.admin-question-item {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 10, 48, 0.72);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.admin-question-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-question-text {
  margin: 0;
  font-weight: 800;
  color: #f6f0ff;
  line-height: 1.45;
}

.admin-question-answer {
  margin: 0;
  color: #dcd4f5;
  font-size: 0.95rem;
  line-height: 1.4;
}

.admin-delete-btn {
  width: auto;
  min-width: 86px;
  padding: 7px 11px;
  border-radius: 10px;
  background: linear-gradient(145deg, #ff5f8a, #f04c6b);
  font-size: 0.89rem;
}

.admin-empty {
  margin: 0;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background: rgba(11, 7, 30, 0.46);
  padding: 12px;
  text-align: center;
  color: #ded5f8;
}

@media (max-width: 1250px) {
  .score-pane {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1180px) {
  .game-content {
    grid-template-columns: 1fr;
    grid-template-areas:
      "question"
      "board"
      "score";
  }

  .question-pane,
  .board-stage,
  .hex-board {
    min-height: 450px;
  }
}

@media (max-height: 900px) and (min-width: 1181px) {
  .game-topbar {
    padding: 8px 10px;
  }

  .game-content {
    gap: 9px;
    margin-top: 8px;
  }

  .board-stage {
    min-height: 430px;
  }

  .hex-board {
    min-height: 395px;
  }

  .question-pane {
    min-height: 430px;
  }

  .team-score {
    padding: 8px;
  }

  .score-line strong {
    font-size: 1.95rem;
  }

  .action-btn {
    padding: 9px 10px;
    font-size: 0.92rem;
  }
}

@media (max-width: 920px) {
  :root {
    --hex-size: 54px;
  }

  .game-topbar::after {
    top: 6px;
    left: 10px;
    width: 14px;
    height: 14px;
    box-shadow: -8px 0 0 rgba(247, 216, 129, 0.84);
  }

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

  .brand-wrap {
    justify-content: space-between;
  }

  .settings-header h2 {
    font-size: 1.6rem;
  }

  .size-options {
    grid-template-columns: 1fr;
  }

  .return-btn {
    font-size: 1.5rem;
    padding-inline: 34px;
  }

  .admin-form-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  :root {
    --hex-size: 44px;
  }

  .game-topbar::after {
    display: none;
  }

  .screen {
    padding: 10px;
  }

  .board-stage {
    min-height: 340px;
  }

  .hex-board {
    min-height: 310px;
    gap: 0;
  }

  .hex-row {
    gap: var(--cell-gap, 0px);
  }

  .hex-row.offset {
    transform: translateX(calc((var(--hex-size) + var(--cell-gap, 0px)) * 0.5));
  }

  .action-btn {
    font-size: 0.93rem;
    padding: 9px 10px;
  }
}
