:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --danger: #dc2626;
  --board: #dfa46d;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at top, #ffffff 0, var(--bg) 60%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

button.secondary {
  color: var(--text);
  background: #e5e7eb;
}

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 2rem);
}

.hidden {
  display: none !important;
}

.admin-entry {
  display: inline-block;
  margin-top: 1rem;
}

.admin-page {
  background: #f8f9fb;
}

.admin-shell {
  width: min(100%, 1180px);
  padding: 1.5rem 2rem 3rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #dce1e8;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: contain;
}

.admin-brand span {
  font-size: 0.8rem;
}

.admin-header h1 {
  margin: 0.15rem 0 0;
  font-size: 1.3rem;
}

.admin-shell h2 {
  margin: 0;
  font-size: 1.2rem;
}

.admin-shell a,
.admin-entry {
  color: var(--primary);
}

.admin-brand span,
.settings-heading span {
  color: var(--muted);
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 2.5rem;
}

.settings-sidebar {
  display: grid;
  gap: 2rem;
  min-width: 0;
  padding-right: 1.5rem;
  border-right: 1px solid #dce1e8;
}

.settings-nav {
  display: grid;
  gap: 0.4rem;
}

.settings-nav button {
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  overflow-wrap: anywhere;
  transition: background 0.15s ease;
}

.settings-nav button:hover {
  background: #e9edf3;
  transform: none;
}

.settings-nav button[aria-selected="true"] {
  color: #1748a6;
  background: #e8eef9;
  box-shadow: inset 3px 0 var(--primary);
  font-weight: 700;
}

.admin-shell :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

#adminLogout {
  justify-self: start;
  border-radius: 6px;
  font-size: 0.88rem;
}

.settings-content,
.settings-panel {
  min-width: 0;
}

.settings-panel[hidden] {
  display: none;
}

.settings-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #dce1e8;
}

.settings-heading span {
  font-size: 0.85rem;
}

.admin-form {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.admin-auth-form {
  width: min(100%, 420px);
  margin: 2.5rem auto;
}

.admin-auth-form h2 {
  margin-bottom: 0.5rem;
}

.admin-form label {
  display: grid;
  min-width: 0;
  gap: 0.5rem;
}

.admin-form input,
.admin-form textarea,
.account-search input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--card);
}

.admin-form input:focus,
.admin-form textarea:focus,
.account-search input:focus {
  border-color: var(--primary);
}

.admin-form button {
  justify-self: start;
  border-radius: 8px;
}

.admin-accounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.admin-accounts fieldset {
  display: grid;
  min-width: 0;
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-accounts legend {
  padding: 0 0 1.25rem;
  font-weight: 700;
}

.admin-password-form {
  max-width: 480px;
}

.account-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }
.account-search { display: grid; gap: 0.4rem; flex: 1 1 230px; min-width: 0; font-size: 0.85rem; }
#accountCount { color: var(--muted); font-size: 0.8rem; align-self: center; }
.account-toolbar button { border-radius: 6px; min-height: 44px; }
.account-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.88rem; }
.account-table th { text-align: left; color: var(--muted); background: #eef1f5; font-weight: 500; }
.account-table th, .account-table td { padding: 0.85rem 0.6rem; border-bottom: 1px solid #dce1e8; vertical-align: top; overflow-wrap: anywhere; }
.account-table th:nth-child(1), .account-table th:nth-child(2) { width: 18%; }
.account-table th:last-child { width: 220px; }
.account-table td:nth-child(3) { white-space: pre-wrap; }
.account-row-actions button { padding: 0.5rem; min-height: 40px; margin: 0 0.3rem 0.3rem 0; border-radius: 6px; font-size: 0.8rem; }
.account-delete { background: #fce9e9; color: #a72222; }
.account-empty { text-align: center; color: var(--muted); padding: 2rem 0; }
.account-dialog { width: min(92vw, 500px); max-height: 90dvh; border-radius: 8px; color: var(--text); }
.account-dialog .admin-form { margin: 0; }
.account-dialog h2 { font-size: 1.15rem; }
.account-dialog-message { margin: 0; overflow-wrap: anywhere; font-size: 0.88rem; }
#accountDialogMessage, #deleteAccountMessage { color: var(--danger); }
.account-fields { display: grid; gap: 1rem; min-width: 0; padding: 0; margin: 0; border: 0; }
.account-fields[hidden], .admin-form label[hidden] { display: none; }
#initialPlayerFields { border-top: 1px solid #dce1e8; padding-top: 1rem; }
#initialPlayerFields legend { padding: 0.5rem 0; font-weight: 700; }
.admin-form textarea { font: inherit; resize: vertical; }
.admin-form input[readonly] { background: #f1f3f6; color: var(--muted); }
.account-dialog .dialog-actions { flex-wrap: wrap; margin-top: 0; }
button.danger { background: var(--danger); }

.admin-password-form h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.settings-form-actions {
  padding-top: 1.25rem;
  border-top: 1px solid #dce1e8;
}

#adminMessage {
  min-height: 1.5rem;
  margin: 1rem 0 1.5rem;
  color: #23704c;
  overflow-wrap: anywhere;
}

#adminMessage.is-error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 1rem 1rem 2rem;
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .settings-sidebar {
    gap: 1rem;
    padding: 0 0 1rem;
    border-right: 0;
    border-bottom: 1px solid #dce1e8;
  }

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

  .settings-nav button {
    text-align: center;
  }

  .settings-nav button[aria-selected="true"] {
    box-shadow: inset 0 -3px var(--primary);
  }

  .account-table thead { display: none; }
  .account-table, .account-table tbody, .account-table tr, .account-table td { display: block; width: 100%; }
  .account-table tr { padding: 0.75rem 0; border-bottom: 1px solid #dce1e8; }
  .account-table td { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0.75rem; padding: 0.35rem 0; border: 0; }
  .account-table td::before { content: attr(data-label); color: var(--muted); }
  .account-table .account-row-actions { display: flex; flex-wrap: wrap; align-items: center; }
  .account-row-actions::before { width: 44px; flex: 0 0 44px; }
}

@media (max-width: 560px) {
  .admin-accounts {
    grid-template-columns: minmax(0, 1fr);
  }
}

.login-card {
  width: min(100%, 420px);
  margin: 12vh auto 0;
  padding: 2rem;
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
  margin: 0;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.login-card form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.login-card label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.message,
.toast {
  color: var(--danger);
}

.game-layout {
  display: grid;
  min-width: 0;
  gap: 1rem;
  min-height: calc(100vh - 2rem);
  align-content: center;
}

.top-bar,
.status-card,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 16px;
  padding: 1rem;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.top-identity {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: min-content;
  gap: 0.75rem;
}

.top-bar {
  flex-wrap: wrap;
}

.top-identity > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.session-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  font-size: 0.88rem;
}

.platform-name,
#selfName {
  min-width: 0;
  overflow-wrap: anywhere;
}

#logoutBtn {
  flex-shrink: 0;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
}

.sound-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  color: #ffffff;
  background: #111827;
  font-size: 0.85rem;
}

.board-stage {
  display: grid;
  place-items: center;
}

.color-selection {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
}

.color-selection fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.color-selection legend {
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.color-options {
  display: flex;
  gap: 0.5rem;
}

.color-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}

#confirmColorBtn {
  height: 3rem;
  white-space: nowrap;
}

.color-options label:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
}

.player-card strong,
.clock-card span {
  overflow-wrap: anywhere;
}

.clock-card {
  max-width: 12rem;
}

#boardCanvas {
  width: min(88vw, 72vh, 620px);
  height: min(88vw, 72vh, 620px);
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--board);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
  touch-action: manipulation;
}

.player-card,
.clock-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.player-card.right {
  text-align: right;
}

.player-card span,
.clock-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.black-stone {
  background: #111827;
}

.white-stone {
  border: 1px solid #d1d5db;
  background: #ffffff;
}

.clock-card {
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
}

#timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 2rem;
}

#timer.timer-warning {
  color: #dc2626;
}

.actions {
  justify-content: center;
}

.toast {
  margin: 0;
  text-align: center;
}

dialog {
  width: min(92vw, 380px);
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-body {
  padding: 1.5rem;
}

.dialog-body h2 {
  margin: 0 0 0.75rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.active-turn {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0.75rem;
  }

  .top-bar,
  .status-card,
  .actions {
    padding: 0.8rem;
  }

  .status-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  }

  .player-card {
    flex-wrap: wrap;
  }

  .player-card.right {
    justify-content: flex-end;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #boardCanvas {
    width: min(94vw, 58vh, 100%);
    height: auto;
  }
}

#platformPanel > .top-bar { border-radius: 0; border-bottom: 1px solid #dce1e8; box-shadow: none; background: transparent; padding: 0 0 1rem; }
#connectionStatus { color: var(--muted); font-size: 0.82rem; }
.lobby-heading, .room-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1.5rem 0; }
.lobby-heading h1, .room-heading h1 { margin: 0; font-size: 1.5rem; }
.lobby-heading > span { margin-left: auto; color: var(--muted); font-size: 0.88rem; }
.room-heading { padding: 0.5rem 0; }
.room-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-left: auto; }
.room-tools .sound-toggle { min-height: 44px; }
.room-tools .sound-toggle input { accent-color: var(--primary); }
.room-tools button { white-space: nowrap; }
.room-list { border-top: 1px solid #dce1e8; }
.room-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 70px 120px; align-items: center; gap: 1.5rem; padding: 1.75rem 0; border-bottom: 1px solid #dce1e8; }
.room-name { min-width: 0; }
.room-name h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.room-name span, .room-members { font-size: 0.88rem; color: var(--muted); }
.occupancy { font-variant-numeric: tabular-nums; text-align: center; }
.room-row button { min-height: 44px; border-radius: 6px; }
.room-row.unavailable button { grid-column: 4; }
.room-art { width: 72px; height: 64px; display: flex; align-items: center; justify-content: center; }
.gomoku-art { gap: 4px; background-color: #e4c79d; background-image: linear-gradient(#a38b6c 1px, transparent 1px), linear-gradient(90deg, #a38b6c 1px, transparent 1px); background-size: 14px 14px; border: 5px solid #e4c79d; }
.xiangqi-piece { display: grid; place-items: center; width: 58px; height: 58px; border: 3px solid #b77a43; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #fff0d1, #e9bf83); box-shadow: inset 0 0 0 3px #f5d9a6, inset 0 0 0 5px #b83a45, 0 3px 0 #996235; color: #b12832; font-family: "KaiTi", "STKaiti", serif; font-size: 2rem; line-height: 1; }
.tile-art { width: 42px; margin: 0 auto; border: 1px solid #9db6ab; border-bottom: 5px solid #35846c; border-radius: 5px; background: #fff; color: #b83a45; font-family: serif; font-size: 2rem; }
.card-art { position: relative; }
.playing-card { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: space-between; width: 34px; height: 48px; padding: 3px; border: 1px solid #aeb7c6; border-radius: 4px; background: #fff; box-shadow: 0 2px 3px #1720331a; font-family: Georgia, serif; font-size: 1.1rem; line-height: 1; }
.playing-card > span:first-child { align-self: flex-start; }
.playing-card > span:last-child { font-size: 1.5rem; }
.spade-card { color: #202938; transform: translate(-11px, -2px) rotate(-14deg); }
.heart-card { color: #b83a45; transform: translate(10px, 3px) rotate(12deg); }
.game-layout { min-height: 0; padding-top: 1rem; }
.game-layout .status-card, .game-layout .actions { border-radius: 0; box-shadow: none; background: transparent; padding: 0.75rem 0; }
.game-layout button, .dialog-actions button { border-radius: 6px; }
.game-layout .actions { border-top: 1px solid #dce1e8; }
.room-members, .room-result { margin: 0; text-align: center; overflow-wrap: anywhere; }
.room-result { font-size: 0.95rem; color: var(--text); min-height: 1.4rem; }
#toast { position: fixed; z-index: 5; left: 50%; bottom: 1.25rem; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); border: 1px solid #dce1e8; border-radius: 6px; padding: 0.75rem 1rem; background: #fff; box-shadow: 0 4px 20px #0001; }
dialog { border-radius: 8px; }
@media (max-width: 560px) {
  .room-row { grid-template-columns: 52px minmax(0, 1fr) 70px; gap: 0.75rem; padding: 1.25rem 0; }
  .room-art { width: 52px; height: 56px; }
  .room-row button, .room-row.unavailable button { grid-column: 2 / 4; justify-self: stretch; }
  .tile-art { width: 38px; }
  .xiangqi-piece { width: 48px; height: 48px; font-size: 1.7rem; }
  .playing-card { width: 29px; height: 42px; font-size: 0.95rem; }
  .playing-card > span:last-child { font-size: 1.3rem; }
  .spade-card { transform: translate(-8px, -2px) rotate(-12deg); }
  .heart-card { transform: translate(7px, 3px) rotate(10deg); }
  .actions button { font-size: 0.85rem; padding: 0.7rem 0.3rem; }
  #timer { font-size: 1.5rem; }
}

@media (max-width: 420px) {
  .color-selection fieldset {
    flex-basis: 100%;
  }

  .color-options label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
  }

  #confirmColorBtn {
    width: 100%;
  }
}

.immersive-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
}
.immersive-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.immersive-collapse, .immersive-active .immersive-expand { display: none; }
.immersive-active .immersive-collapse { display: block; }
.immersive-active, .immersive-active body { overflow: hidden; overscroll-behavior: none; }
.immersive-active .app-shell {
  position: fixed;
  top: var(--immersive-top, 0px);
  left: var(--immersive-left, 0px);
  width: var(--immersive-width, 100%);
  height: var(--immersive-height, 100dvh);
  min-height: 0;
  padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  overflow: auto;
  background: var(--bg);
}
.immersive-active #platformPanel { display: flex; flex-direction: column; height: 100%; }
.immersive-active #platformPanel > .top-bar { display: none; }
.immersive-active #platformPanel > .top-bar:has(#reconnectBtn:not(.hidden)) { display: flex; padding: 0 0 4px; }
.immersive-active .top-identity, .immersive-active #logoutBtn { display: none; }
.immersive-active .game-layout { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: min-content; padding: 0; }
.immersive-active .room-heading { position: sticky; top: 0; z-index: 3; flex: 0 0 auto; gap: 6px; padding: 0; background: var(--bg); }
.immersive-active .room-heading h1 { font-size: 1.1rem; }
.immersive-active .room-tools { gap: 6px; }
.immersive-active .room-tools button { min-height: 44px; padding: 0.5rem; }
.immersive-active .board-stage { flex: 1 0 120px; min-height: 120px; container-type: size; }
.immersive-active #boardCanvas { width: min(100cqw, 100cqh, 620px); height: min(100cqw, 100cqh, 620px); box-shadow: 0 2px 10px #0002; }
.immersive-active .status-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 6px; }
.immersive-active .clock-card { justify-self: center; }
.immersive-active .game-layout .status-card, .immersive-active .game-layout .actions { flex: 0 0 auto; padding: 4px; }
.immersive-active .player-card { gap: 4px; flex-wrap: wrap; }
.immersive-active .player-card.right { justify-content: flex-end; }
.immersive-active .player-card > div:not(.avatar) { min-width: 0; }
.immersive-active .player-card strong { display: block; font-size: 0.88rem; }
.immersive-active #timer { font-size: 1.35rem; }
.immersive-active .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.immersive-active .actions button { min-height: 44px; padding: 0.4rem 0.2rem; font-size: 0.85rem; }
.immersive-active .color-selection { flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; }
.immersive-active .color-selection fieldset { flex-basis: auto; flex: 1; }
.immersive-active .color-selection legend { margin-bottom: 2px; }
.immersive-active .color-options { gap: 4px; }
.immersive-active .color-options label { flex: 1; gap: 4px; height: 44px; padding: 4px; font-size: 0.85rem; }
.immersive-active #confirmColorBtn { width: auto; height: 44px; padding: 0.5rem; font-size: 0.85rem; }
.immersive-active .room-members { font-size: 0.75rem; }
.immersive-active .room-result { min-height: 0; font-size: 0.85rem; }
.immersive-active .room-members:empty, .immersive-active .room-result:empty { display: none; }
.immersive-active #toast { bottom: max(12px, env(safe-area-inset-bottom)); }

@media (max-width: 380px) {
  .immersive-active .room-heading h1 { font-size: 1rem; }
  .immersive-active .room-tools { margin-left: 0; }
  .immersive-active .room-heading { justify-content: space-between; }
  .immersive-active .room-tools .sound-toggle { font-size: 0.8rem; gap: 3px; }
  .immersive-active .pill { padding: 0.2rem 0.4rem; font-size: 0.75rem; }
}

@media (orientation: landscape) and (min-width: 600px) and (max-height: 600px) {
  .immersive-active .game-layout {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(230px, 0.7fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "heading heading" "board colors" "board status" "board actions" "board members" "board result";
  }
  .immersive-active .room-heading { grid-area: heading; }
  .immersive-active .board-stage { grid-area: board; }
  .immersive-active .color-selection { grid-area: colors; }
  .immersive-active .status-card { grid-area: status; align-self: center; }
  .immersive-active .actions { grid-area: actions; }
  .immersive-active .room-members { grid-area: members; }
  .immersive-active .room-result { grid-area: result; }
}
