:root {
  color-scheme: light;
  --ink: #20242a;
  --muted: #68707d;
  --line: #d7dde5;
  --panel: #f7f3ec;
  --surface: #fffdf8;
  --accent: #a43f2f;
  --accent-strong: #7f2e24;
  --teal: #276f73;
  --gold: #c0922e;
  --shadow: 0 18px 50px rgb(32 36 42 / 16%);
  --ui-bg: #f3ebdd;
  --ui-bg-strong: #e9ddca;
  --ui-border: #cbb89c;
  --ui-text: #3f2e1f;
  --ui-text-muted: #7c6854;
  --ui-button: linear-gradient(180deg, #f5ecda 0%, #dccbad 100%);
  --ui-button-hover: linear-gradient(180deg, #fbf4e6 0%, #e2d0af 100%);
  --ui-button-active: linear-gradient(180deg, #d2bea0 0%, #f0e4d2 100%);
  --ui-button-secondary: linear-gradient(180deg, #efe5d3 0%, #cfbea2 100%);
  --ui-button-secondary-hover: linear-gradient(180deg, #f6eddd 0%, #d8c6a8 100%);
  --ui-button-secondary-active: linear-gradient(180deg, #c7b396 0%, #ebdfcd 100%);
  --ui-danger: linear-gradient(180deg, #9a664d 0%, #7b4b35 100%);
  --ui-danger-hover: linear-gradient(180deg, #aa7256 0%, #86523a 100%);
  --ui-danger-active: linear-gradient(180deg, #6f422f 0%, #925f48 100%);
  --ui-button-border: #a8874c;
  --ui-button-secondary-border: rgb(130 101 62 / 65%);
  --ui-button-danger-border: #b9935b;
  --page-wallpaper: url("./assets/backgrounds/marble-wallpaper.png");
  --page-wallpaper-mobile: url("./assets/backgrounds/marble-wallpaper-mobile.png");
  --pards-arena-ivory: #f6efe0;
  --pards-arena-ivory-soft: #fbf6ea;
  --pards-arena-stone: #e8dcc5;
  --pards-arena-gold-light: #d8bd7a;
  --pards-arena-gold: #b89249;
  --pards-arena-gold-dark: #7a5628;
  --pards-arena-bronze: #8a6540;
  --pards-arena-text-dark: #3b2719;
  --pards-arena-text-soft: #6f5a45;
  --pards-arena-panel-shadow: rgb(61 39 21 / 22%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--surface);
  background-image: var(--page-wallpaper);
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--ui-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body.is-landing-view {
  background-image: url("./assets/images/pards-landing-wallpaper-desktop.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow-x: hidden;
}

body.is-online-setup-view:not(.is-landing-view) {
  background-image: url("./assets/images/pards-landing-wallpaper-desktop.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow-x: hidden;
}

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

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 88px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 760px) minmax(260px, 340px);
  gap: 28px;
  align-items: center;
  padding: 32px 0;
}

body.is-online-setup-view .app-shell {
  width: 100%;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: clamp(28px, 5vh, 56px) 0;
}

body.is-online-setup-view:not(.is-landing-view) .app-shell {
  padding: clamp(100px, 17vh, 170px) 0 clamp(84px, 13vh, 140px);
}

body.is-landing-view .app-shell {
  width: 100%;
  min-height: 100vh;
  padding: clamp(110px, 18vh, 180px) 0 clamp(90px, 14vh, 150px);
  align-items: center;
  justify-items: center;
}

body.is-online-setup-view .game-surface {
  display: none;
}

body.is-online-setup-view .side-panel {
  display: grid;
  gap: 22px;
  width: min(36vw, 460px);
  max-width: calc(100vw - 48px);
  margin-left: clamp(24px, 6vw, 96px);
  justify-self: start;
  align-content: center;
}

body.is-online-setup-view:not(.is-landing-view) .side-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-self: center;
  justify-items: center;
  align-content: center;
}

body.is-landing-view .side-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-self: center;
  justify-items: center;
  align-content: center;
}

body.is-online-setup-view .status-grid,
body.is-online-setup-view .brand-block,
body.is-online-setup-view .dice-setup-panel,
body.is-online-setup-view .reset-request-panel,
body.is-online-setup-view .action-request-panel,
body.is-online-setup-view .controls,
body.is-online-setup-view .move-log-panel,
body.is-online-setup-view .review-setup-panel {
  display: none;
}

body.is-online-setup-view .online-room-panel,
body.is-online-setup-view .review-practice-entry-panel {
  padding: 18px;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel {
  box-sizing: border-box;
  position: relative;
  width: min(960px, calc(100vw - 48px));
  max-width: 960px;
  margin: 0 auto;
  gap: 14px;
  border-color: rgb(184 146 73 / 75%);
  background:
    linear-gradient(145deg, rgb(255 250 238 / 72%) 0%, rgb(246 239 224 / 68%) 42%, rgb(232 219 194 / 64%) 100%),
    radial-gradient(circle at 18% 0%, rgb(255 255 255 / 18%), transparent 44%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    0 18px 42px rgb(61 39 21 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 75%),
    inset 0 -1px 0 rgb(122 86 40 / 16%);
  padding: clamp(18px, 2vw, 28px) clamp(24px, 2.6vw, 42px);
  overflow: hidden;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgb(184 146 73 / 28%);
  pointer-events: none;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel {
  display: grid;
}

body.is-landing-view .back-home-button,
body.is-online-lobby-view .back-home-button,
body.is-online-game-view .back-home-button {
  display: none;
}

body.is-landing-view .brand-block,
body.is-landing-view .online-room-panel,
body.is-landing-view .review-practice-entry-panel {
  display: none;
}

body.is-landing-view .landing-panel {
  display: grid;
}

body.is-online-setup-view:not(.is-landing-view) .landing-panel,
body.is-online-setup-view:not(.is-landing-view) .review-practice-entry-panel {
  display: none;
}

body.is-review-practice-view .online-room-panel,
body.is-review-practice-view .review-practice-entry-panel,
body.is-review-practice-view .reset-request-panel,
body.is-review-practice-view .action-request-panel,
body.is-review-practice-view .board-clock,
body.is-review-practice-view .setup-countdown,
body.is-review-practice-view .under-board-action-row,
body.is-review-practice-view .mobile-board-actions {
  display: none;
}

body.is-review-practice-view .review-setup-panel {
  display: block;
  order: 3;
}

body.is-review-practice-view .move-log-panel {
  order: 4;
}

body.is-review-practice-view.is-computer-challenge-view .move-log-panel {
  display: none;
}

body.is-review-practice-view.is-computer-challenge-view .review-setup-panel {
  order: 4;
}

body.is-review-practice-view.is-computer-challenge-view .review-setup-panel > summary {
  display: none;
}

body:not(.is-computer-practice) .computer-mode-panel,
body:not(.is-computer-challenge-view) .computer-start-panel {
  display: none !important;
}

body.is-computer-challenge-view .review-mode-intro,
body.is-computer-challenge-view .practice-start-panel,
body.is-computer-challenge-view .review-import-panel {
  display: none !important;
}

body.is-computer-challenge-view .computer-start-panel,
body.is-computer-practice .computer-mode-panel {
  display: grid;
}

body.is-review-practice-view.is-computer-challenge-view .brand-block {
  order: 1;
}

body.is-review-practice-view.is-computer-challenge-view .status-grid {
  order: 2;
}

body.is-review-practice-view.is-computer-challenge-view .review-setup-panel,
body.is-review-practice-view.is-computer-challenge-view .computer-mode-panel {
  order: 3;
}

body.is-review-practice-view.is-computer-challenge-view .controls {
  order: 4;
}

body.is-computer-challenge-view:not(.is-computer-match-active) #resetButton {
  display: none;
}

body.is-review-practice-view.is-computer-challenge-view.is-computer-match-active .review-setup-panel {
  display: none;
}

body.is-review-practice-view.is-computer-challenge-view:not(.is-computer-reviewing) .review-board-controls,
body.is-review-practice-view.is-computer-challenge-view:not(.is-computer-reviewing) .review-board-status {
  display: none;
}

body.is-review-practice-view.is-computer-challenge-view.is-computer-reviewing .review-board-controls {
  display: flex;
}

body.is-review-practice-view.is-computer-challenge-view.is-computer-reviewing .review-board-status {
  display: block;
}

body.is-review-practice-view:not(.is-local-practice) .dice-setup-panel {
  display: none;
}

body.is-review-practice-view.is-local-practice .dice-setup-panel {
  display: block;
  order: 2;
}

body.is-review-practice-view.is-local-practice .dice-setup-panel.is-local-practice-dice-summary {
  gap: 4px;
  padding-block: 8px;
}

body.is-review-practice-view.is-local-practice .dice-setup-panel.is-local-practice-dice-summary .dice-setup-row {
  display: inline-flex;
  margin-right: 14px;
}

body.is-review-practice-view.is-local-practice .dice-setup-panel.is-local-practice-dice-summary .dice-setup-actions {
  display: none;
}

body.is-review-practice-view.is-local-practice .dice-setup-panel.is-local-practice-dice-summary .dice-setup-message {
  font-size: 0.76rem;
  min-height: 0;
  text-transform: uppercase;
}

body.is-review-practice-view .app-shell {
  align-items: start;
}

body.is-review-practice-view .review-board-controls {
  display: flex;
}

body.is-review-practice-view .review-board-status {
  display: block;
}

body.is-review-practice-view .review-setup-panel .replay-actions,
body.is-review-practice-view:not(.is-local-practice) #undoButton,
body.is-review-practice-view:not(.is-local-practice) #redoButton {
  display: none;
}

body.is-review-practice-view.is-local-practice .review-board-controls,
body.is-review-practice-view.is-local-practice .review-board-status {
  display: none;
}

body.is-review-practice-view.is-local-practice .practice-board-controls {
  display: flex;
}

body.is-review-practice-view .move-log-list {
  height: clamp(180px, 28vh, 260px);
  max-height: clamp(180px, 28vh, 260px);
  overflow-y: auto;
}

body.is-online-lobby-view .online-room-panel,
body.is-online-game-view .online-room-panel {
  gap: 7px;
  padding: 10px 12px;
}

body.is-online-game-view .online-room-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

body.is-online-game-view .online-room-header {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

body.is-online-game-view .online-room-code-field {
  display: none;
}

body.is-online-game-view .online-room-seat {
  margin: 0;
  font-size: 0.78rem;
}

body.is-online-game-view .online-room-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

body.is-online-game-view .online-room-actions button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 0.72rem;
}

body.is-online-setup-view .online-room-header h2 {
  color: #4b3522;
  font-family: "Cinzel", "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.is-online-setup-view .online-room-seat,
body.is-online-setup-view .online-lobby-panel {
  display: none;
}

body.is-online-setup-view #copyInviteButton,
body.is-online-setup-view #leaveRoomButton {
  display: none;
}

body.is-online-setup-view .online-room-actions {
  grid-template-columns: 1fr 1fr;
}

body.is-online-lobby-view #createRoomButton,
body.is-online-lobby-view #joinRoomButton,
body.is-online-game-view #createRoomButton,
body.is-online-game-view #joinRoomButton {
  display: none;
}

body.is-online-lobby-view .online-room-actions,
body.is-online-game-view .online-room-actions {
  grid-template-columns: 1fr 1fr;
}

body.is-online-lobby-view .online-lobby-panel {
  gap: 8px;
  padding-top: 8px;
}

body.is-online-lobby-view .online-lobby-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

body.is-online-lobby-view .online-lobby-grid > div {
  padding: 6px;
}

body.is-online-lobby-view .online-lobby-grid strong {
  min-height: 1rem;
  font-size: 0.78rem;
}

body.is-online-lobby-view .online-lobby-message {
  font-size: 0.78rem;
}

body.is-online-lobby-view .status-grid,
body.is-online-lobby-view .dice-setup-panel,
body.is-online-lobby-view .reset-request-panel,
body.is-online-lobby-view .action-request-panel,
body.is-online-lobby-view .controls,
body.is-online-lobby-view .move-log-panel,
body.is-online-lobby-view .review-setup-panel,
body.is-online-lobby-view .review-practice-entry-panel {
  display: none;
}

body.is-online-game-view .review-setup-panel,
body.is-online-game-view .review-practice-entry-panel {
  display: none;
}

body.is-online-game-view.is-room-dice-setup .dice-setup-panel {
  order: 2;
}

body.is-online-game-view.is-room-dice-setup .online-room-panel {
  order: 3;
}

body.is-online-game-view.is-room-dice-setup .status-grid {
  order: 4;
}

body.is-online-game-view.is-room-dice-setup .controls {
  order: 5;
}

body.is-online-game-view.is-room-dice-setup .move-log-panel {
  order: 6;
}

body.is-online-game-view.is-room-playing .status-grid,
body.is-online-game-view.is-room-game-over .status-grid {
  order: 2;
}

body.is-online-game-view.is-room-playing .controls,
body.is-online-game-view.is-room-game-over .controls {
  order: 3;
}

body.is-online-game-view.is-room-playing .move-log-panel,
body.is-online-game-view.is-room-game-over .move-log-panel {
  order: 4;
}

body.is-online-game-view.is-room-playing .online-room-panel,
body.is-online-game-view.is-room-game-over .online-room-panel,
body.is-online-game-view.is-room-aborted .online-room-panel {
  order: 7;
}

.game-surface {
  width: 100%;
  display: grid;
  gap: 12px;
}

.board-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(58px, 8vw, 82px);
  gap: 12px;
  align-items: center;
}

.board-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  box-shadow: 0 20px 50px rgb(0 0 0 / 50%);
  grid-column: 1;
}

.board-timing-row {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-height: 0;
  margin-top: 0;
}

.under-board-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.under-board-action-row .board-clock-bottom {
  margin-left: auto;
}

.review-board-controls {
  display: none;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.practice-board-controls {
  display: none;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.practice-board-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 118px;
  min-height: 36px;
  padding: 8px 14px;
}

.review-board-controls button {
  width: 44px;
  min-width: 44px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.review-board-controls span {
  display: block;
  font-size: 1.1rem;
  line-height: 1;
}

.review-board-status {
  display: none;
  margin: -2px 0 0;
  color: var(--ui-text-muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.mobile-board-actions {
  display: none;
}

.mobile-board-actions.is-hidden {
  display: none;
}

.off-board-piece {
  grid-column: 2;
  grid-row: 2;
  width: clamp(58px, 8vw, 82px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.off-board-piece.is-hidden {
  visibility: hidden;
}

.off-board-piece img {
  width: var(--off-board-piece-image-size, 86%);
  height: var(--off-board-piece-image-size, 86%);
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgb(32 36 42 / 18%));
}

.off-board-piece.is-return-required img {
  animation: return-piece-pulse 1.45s ease-in-out infinite;
  filter:
    brightness(1.08)
    drop-shadow(0 0 7px rgb(255 255 245 / 74%))
    drop-shadow(0 0 16px rgb(255 245 215 / 42%))
    drop-shadow(0 4px 7px rgb(32 36 42 / 18%));
}

@keyframes return-piece-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.95;
  }

  50% {
    transform: scale(1.035);
    opacity: 1;
  }
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

#gameCanvas.is-adjusting-dice {
  cursor: pointer;
}

.board-clock {
  grid-column: 1;
  justify-self: end;
  min-width: 116px;
  padding: 7px 14px;
  border: 1px solid rgb(58 42 26 / 28%);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgb(0 0 0 / 12%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.9rem, 1.75vw, 1.05rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  opacity: 0.82;
  transition: opacity 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.board-clock.is-hidden {
  display: none;
}

.board-clock-top {
  align-self: end;
  margin-bottom: 2px;
}

.board-clock-bottom {
  align-self: flex-end;
  flex: 0 0 auto;
  margin-top: 0;
}

.board-clock.is-white-clock {
  background: linear-gradient(180deg, rgb(252 247 237 / 96%), rgb(231 220 202 / 96%));
  color: #3f2e1f;
  border-color: rgb(122 81 48 / 30%);
}

.board-clock.is-black-clock {
  background: linear-gradient(180deg, rgb(50 43 37 / 96%), rgb(30 27 25 / 96%));
  color: #f6ecda;
  border-color: rgb(210 183 139 / 24%);
}

.board-clock.is-active {
  opacity: 1;
  border-color: rgb(164 63 47 / 56%);
  box-shadow: 0 9px 24px rgb(164 63 47 / 20%);
}

.board-clock.is-low-time.is-white-clock {
  color: var(--accent-strong);
}

.board-clock.is-low-time.is-black-clock {
  color: #ffd7bd;
}

.victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgb(32 36 42 / 34%);
  backdrop-filter: saturate(88%) brightness(0.92);
}

.victory-overlay.is-hidden {
  display: none;
}

.board-warning-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5%, 42px);
  background: rgb(30 25 18 / 38%);
  backdrop-filter: saturate(88%) brightness(0.9);
}

.board-warning-overlay.is-hidden,
.board-warning-overlay[hidden] {
  display: none;
}

.board-warning-content {
  position: relative;
  width: min(82%, 360px);
  padding: clamp(22px, 5vw, 34px) clamp(22px, 5vw, 36px);
  border: 2px solid rgb(168 121 36 / 84%);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgb(255 248 226 / 98%), rgb(238 214 154 / 94%));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 74%),
    0 14px 34px rgb(44 28 12 / 32%);
  color: #3b2719;
  text-align: center;
}

.board-warning-content h2 {
  margin: 0 0 10px;
  color: #3b2719;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 4vw, 1.85rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgb(255 255 255 / 54%);
}

.board-warning-content p {
  margin: 0;
  color: #4f3924;
  font-size: clamp(0.95rem, 2.6vw, 1.08rem);
  font-weight: 700;
  line-height: 1.35;
}

.board-warning-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgb(139 86 24 / 42%);
  border-radius: 999px;
  background: rgb(255 249 232 / 70%);
  color: #3b2719;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgb(61 39 21 / 16%);
}

.board-warning-close:hover,
.board-warning-close:focus-visible {
  border-color: rgb(139 86 24 / 82%);
  background: rgb(255 249 232 / 92%);
  outline: none;
}

.victory-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.victory-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.victory-content h2 {
  margin: 0;
  color: #fff8df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 8vw, 5.8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-shadow:
    0 2px 0 rgb(86 59 14 / 72%),
    0 12px 32px rgb(16 18 20 / 44%),
    0 0 26px rgb(192 146 46 / 48%);
}

.victory-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.victory-actions .is-hidden {
  display: none;
}

.victory-actions button {
  min-width: 112px;
  padding: 0 18px;
}

.side-panel {
  display: grid;
  gap: 22px;
  align-content: center;
}

.brand-block {
  border-bottom: 1px solid rgb(203 184 156 / 42%);
  padding-bottom: 14px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
}

.brand-title {
  display: inline-flex;
  align-items: flex-start;
  color: #fff3dc;
  font-family: "Cinzel", "Trajan Pro", "Times New Roman", Georgia, serif;
  font-size: clamp(3rem, 8vw, 5.35rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow:
    0 2px 4px rgb(45 30 18 / 75%),
    0 0 14px rgb(70 45 25 / 35%);
}

.title-mark {
  position: relative;
  top: -0.1em;
  right: auto;
  margin: 0 0 -0.02em 0.035em;
  color: inherit;
  font-family: "Cinzel", "Trajan Pro", "Times New Roman", Georgia, serif;
  font-size: 0.28em;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: inherit;
}

.brand-subtitle {
  margin: 9px 0 0 0.12em;
  color: #fff3dc;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.02rem, 2.15vw, 1.28rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-shadow:
    0 1px 2px rgb(45 30 18 / 75%),
    0 0 8px rgb(70 45 25 / 30%);
}

h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-grid > div,
.landing-panel,
.online-room-panel,
.review-practice-entry-panel,
.dice-setup-panel,
.reset-request-panel,
.action-request-panel,
.move-log-panel,
.review-setup-panel,
.notes {
  border: 1px solid var(--ui-border);
  background: var(--ui-bg);
  color: var(--ui-text);
  padding: 14px;
}

.status-grid strong {
  display: block;
  min-height: 1.6rem;
  margin-top: 4px;
  font-size: 1.15rem;
}

.online-room-panel {
  display: grid;
  gap: 10px;
}

.landing-panel {
  display: none;
  box-sizing: border-box;
  position: relative;
  width: min(780px, 82vw);
  max-width: calc(100vw - 48px);
  margin: 0 auto;
  gap: 12px;
  border-color: rgb(184 146 73 / 75%);
  background:
    linear-gradient(145deg, rgb(255 250 238 / 72%) 0%, rgb(246 239 224 / 68%) 42%, rgb(232 219 194 / 64%) 100%),
    radial-gradient(circle at 18% 0%, rgb(255 255 255 / 18%), transparent 44%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    0 18px 42px rgb(61 39 21 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 75%),
    inset 0 -1px 0 rgb(122 86 40 / 16%);
  padding: clamp(15px, 1.65vw, 22px) clamp(22px, 2.3vw, 38px);
  overflow-x: hidden;
  overflow-y: visible;
  text-align: left;
}

.landing-panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgb(184 146 73 / 28%);
  pointer-events: none;
}

.landing-hero {
  box-sizing: border-box;
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  justify-items: center;
  text-align: center;
}

.landing-hero h1 {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  color: #f8ead0;
  font-family: "Cinzel Decorative", "Cinzel", "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 3.15vw, 3.35rem);
  line-height: 0.95;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  object-fit: contain;
  text-shadow:
    0 2px 2px rgb(70 45 20 / 55%),
    0 0 12px rgb(190 145 65 / 35%);
  white-space: nowrap;
}

.landing-bolt-tagline {
  box-sizing: border-box;
  max-width: 100%;
  margin: 6px 0 0;
  color: #4b3522;
  font-family: "Cinzel", "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: clamp(0.9rem, 1.25vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
}

.landing-ornament {
  position: relative;
  display: block;
  width: min(220px, 62%);
  height: 1px;
  margin: 11px 0 6px;
  background: linear-gradient(90deg, transparent, rgb(164 118 45 / 72%), transparent);
}

.landing-ornament::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 1px solid rgb(164 118 45 / 74%);
  background: rgb(245 236 218 / 76%);
  transform: translate(-50%, -50%) rotate(45deg);
}

.landing-tagline,
.landing-support,
.landing-brand-line,
.landing-libre-line {
  margin: 0;
  color: var(--ui-text-muted);
  line-height: 1.45;
}

.landing-tagline {
  color: var(--pards-arena-text-dark);
  font-family: "Cinzel", "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: clamp(1.08rem, 1.9vw, 1.32rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgb(255 255 255 / 65%);
}

.landing-support {
  color: var(--pards-arena-text-soft);
  font-size: 0.9rem;
}

.landing-beta-notice {
  justify-self: center;
  margin: -2px 0 0;
  border: 1px solid rgb(184 146 73 / 34%);
  background: linear-gradient(180deg, rgb(255 249 235 / 64%), rgb(235 222 198 / 48%));
  color: var(--pards-arena-text-dark);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 560;
  line-height: 1.35;
  text-align: center;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%);
}

.landing-actions {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 10px;
}

.landing-card {
  box-sizing: border-box;
  display: grid;
  gap: 6px;
  align-content: start;
  width: 100%;
  max-width: 100%;
  min-height: 76px;
  border: 1px solid rgb(184 146 73 / 62%);
  background: linear-gradient(180deg, rgb(255 249 235 / 97%) 0%, rgb(239 226 199 / 94%) 100%);
  color: var(--ui-text);
  padding: 14px 16px;
  text-align: left;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 70%),
    inset 0 -1px 0 rgb(122 86 40 / 10%),
    0 5px 12px rgb(61 39 21 / 12%);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    transform 160ms ease;
}

.landing-card:hover,
.landing-card:focus-visible {
  border-color: rgb(184 146 73 / 90%);
  background: linear-gradient(180deg, rgb(255 252 241 / 98%) 0%, rgb(237 225 203 / 94%) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 78%),
    0 8px 18px rgb(61 39 21 / 18%),
    0 0 0 2px rgb(216 189 122 / 30%);
  filter: brightness(1.012);
  transform: translateY(-1px);
}

.landing-card:active {
  background: linear-gradient(180deg, rgb(225 207 176 / 90%) 0%, rgb(246 235 215 / 90%) 100%);
  box-shadow: inset 0 2px 4px rgb(45 32 20 / 22%);
  transform: translateY(1px);
}

.landing-card-primary {
  border-color: rgb(122 86 40 / 90%);
  background: linear-gradient(180deg, var(--pards-arena-gold-light) 0%, var(--pards-arena-gold) 48%, var(--pards-arena-bronze) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 246 210 / 55%),
    inset 0 -1px 0 rgb(72 45 22 / 25%),
    0 7px 16px rgb(61 39 21 / 20%);
  cursor: pointer;
}

.landing-card-primary:hover,
.landing-card-primary:focus-visible {
  border-color: rgb(122 86 40 / 95%);
  background: linear-gradient(180deg, #e0c681 0%, #bd9850 50%, #8f6840 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 246 210 / 62%),
    inset 0 -1px 0 rgb(72 45 22 / 28%),
    0 9px 18px rgb(61 39 21 / 22%),
    0 0 0 2px rgb(216 189 122 / 34%);
  filter: brightness(1.01);
  transform: translateY(-1px);
}

.landing-card strong {
  min-width: 0;
  color: var(--pards-arena-text-dark);
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
}

.landing-card-primary strong {
  font-weight: 720;
}

.landing-card span {
  min-width: 0;
  color: rgb(59 39 25 / 60%);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
}

.landing-brand-line,
.landing-libre-line {
  color: rgb(88 68 49 / 66%);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}

.back-home-button {
  justify-self: start;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ui-text-muted);
  padding: 0;
  box-shadow: none;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: none;
}

.back-home-button:hover,
.back-home-button:focus-visible {
  background: transparent;
  color: var(--ui-text);
  filter: none;
  text-decoration: underline;
}

.back-home-button:active {
  transform: none;
  box-shadow: none;
}

.review-practice-entry-panel {
  display: none;
  gap: 10px;
}

.review-practice-entry-panel p {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.online-setup-controls {
  display: grid;
  gap: 10px;
}

body.is-online-setup-view:not(.is-landing-view) .online-setup-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.online-setup-controls.is-hidden {
  display: none;
}

.online-room-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.online-room-header h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-header h2 {
  color: var(--pards-arena-text-dark);
  font-family: "Cinzel", "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 rgb(255 255 255 / 65%);
}

.online-room-status {
  color: var(--ui-text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: right;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-status {
  color: var(--pards-arena-text-soft);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.online-room-status.is-connected {
  color: var(--teal);
}

.online-room-status.is-error {
  color: var(--accent-strong);
}

body.is-online-setup-view:not(.is-landing-view) .online-room-status.is-connected {
  color: var(--pards-arena-bronze);
}

body.is-online-setup-view:not(.is-landing-view) .online-room-status.is-error {
  color: #8b3325;
}

.online-room-panel label {
  display: grid;
  gap: 5px;
  color: var(--ui-text);
  font-size: 0.82rem;
  font-weight: 800;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel label {
  color: var(--pards-arena-text-dark);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.015em;
}

.online-room-panel input {
  min-height: 34px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: rgb(255 250 239 / 92%);
  color: var(--ui-text);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#onlineDisplayNameInput {
  letter-spacing: 0.01em;
  text-transform: none;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel input,
body.is-online-setup-view:not(.is-landing-view) .online-room-panel select {
  min-height: 38px;
  border: 1px solid rgb(184 146 73 / 65%);
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(255 249 235 / 96%) 0%, rgb(238 225 199 / 92%) 100%);
  color: var(--pards-arena-text-dark);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 65%),
    0 2px 6px rgb(61 39 21 / 8%);
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel input:focus,
body.is-online-setup-view:not(.is-landing-view) .online-room-panel select:focus {
  outline: none;
  border-color: rgb(184 146 73 / 95%);
  box-shadow:
    0 0 0 3px rgb(184 146 73 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 70%);
}

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

body.is-online-setup-view:not(.is-landing-view) .online-room-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.online-room-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel button:not(.back-home-button) {
  min-height: 38px;
  border: 1px solid rgb(184 146 73 / 72%);
  background: linear-gradient(180deg, rgb(255 249 235 / 96%) 0%, rgb(226 211 180 / 94%) 100%);
  color: var(--pards-arena-text-dark);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 65%),
    0 5px 12px rgb(61 39 21 / 13%);
}

body.is-online-setup-view:not(.is-landing-view) .online-room-panel button:not(.back-home-button):hover,
body.is-online-setup-view:not(.is-landing-view) .online-room-panel button:not(.back-home-button):focus-visible {
  border-color: rgb(184 146 73 / 95%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 75%),
    0 8px 18px rgb(61 39 21 / 18%),
    0 0 0 2px rgb(216 189 122 / 28%);
  filter: brightness(1.012);
  transform: translateY(-1px);
}

body.is-online-setup-view:not(.is-landing-view) #createRoomButton {
  border-color: rgb(122 86 40 / 90%);
  background: linear-gradient(180deg, var(--pards-arena-gold-light) 0%, var(--pards-arena-gold) 48%, var(--pards-arena-bronze) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 246 210 / 55%),
    inset 0 -1px 0 rgb(72 45 22 / 25%),
    0 7px 16px rgb(61 39 21 / 20%);
}

body.is-online-setup-view:not(.is-landing-view) #createRoomButton:hover,
body.is-online-setup-view:not(.is-landing-view) #createRoomButton:focus-visible {
  background: linear-gradient(180deg, #e0c681 0%, #bd9850 50%, #8f6840 100%);
}

body.is-online-setup-view.is-invite-join-view:not(.is-landing-view) #joinRoomButton {
  order: -1;
  border-color: rgb(122 86 40 / 90%);
  background: linear-gradient(180deg, var(--pards-arena-gold-light) 0%, var(--pards-arena-gold) 48%, var(--pards-arena-bronze) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 246 210 / 55%),
    inset 0 -1px 0 rgb(72 45 22 / 25%),
    0 7px 16px rgb(61 39 21 / 20%);
}

body.is-online-setup-view.is-invite-join-view:not(.is-landing-view) #joinRoomButton:hover,
body.is-online-setup-view.is-invite-join-view:not(.is-landing-view) #joinRoomButton:focus-visible {
  background: linear-gradient(180deg, #e0c681 0%, #bd9850 50%, #8f6840 100%);
}

body.is-online-setup-view.is-invite-join-view:not(.is-landing-view) #createRoomButton {
  order: 0;
  border-color: rgb(184 146 73 / 72%);
  background: linear-gradient(180deg, rgb(255 249 235 / 96%) 0%, rgb(226 211 180 / 94%) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 65%),
    0 5px 12px rgb(61 39 21 / 13%);
}

body.is-online-setup-view.is-invite-join-view:not(.is-landing-view) #createRoomButton:hover,
body.is-online-setup-view.is-invite-join-view:not(.is-landing-view) #createRoomButton:focus-visible {
  background: linear-gradient(180deg, rgb(255 249 235 / 96%) 0%, rgb(226 211 180 / 94%) 100%);
}

.online-room-seat {
  min-height: 1.2em;
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.online-room-seat strong {
  color: var(--ui-text);
}

.online-spectator-count {
  min-height: 1.2em;
  margin: -4px 0 0;
  color: var(--ui-text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.online-spectator-count.is-hidden {
  display: none;
}

.online-lobby-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgb(130 101 62 / 26%);
  padding-top: 10px;
}

.online-lobby-panel.is-hidden {
  display: none;
}

.online-lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.online-lobby-grid > div {
  border: 1px solid rgb(130 101 62 / 28%);
  background: rgb(255 250 239 / 45%);
  padding: 8px;
}

.online-lobby-grid strong {
  display: block;
  min-height: 1.25rem;
  margin-top: 2px;
  color: var(--ui-text);
  font-size: 0.9rem;
}

.online-lobby-message {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

#readyRoomButton {
  justify-self: start;
  min-width: 118px;
}

.dice-setup-panel {
  display: grid;
  gap: 10px;
}

.dice-setup-panel.is-hidden {
  display: none;
}

body.is-review-practice-view:not(.is-analysis-review-active) .review-import-tools {
  display: none;
}

body.is-review-practice-view.is-analysis-practice-active .practice-start-panel > .review-helper,
body.is-review-practice-view.is-analysis-practice-active #startPracticeGameButton {
  display: none;
}

body.is-review-practice-view.is-analysis-practice-active .practice-start-panel::after {
  content: "Practice game active. Use Reset Game to start again.";
  color: var(--ui-text-muted);
  font-size: 0.86rem;
}

body.is-review-practice-view.is-analysis-practice-active .review-import-panel {
  padding-block: 8px;
}

body.is-review-practice-view.is-analysis-practice-active .review-import-panel h3::before {
  content: "▸ ";
}

body.is-review-practice-view.is-analysis-review-active .practice-start-panel > .review-helper {
  display: none;
}

body.is-review-practice-view.is-analysis-review-active .practice-start-panel h3::before {
  content: "▸ ";
}

.dice-setup-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dice-setup-row strong {
  font-size: 0.95rem;
  text-align: right;
}

.dice-setup-message {
  min-height: 1.25em;
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.dice-setup-message.is-error {
  color: var(--accent-strong);
}

.dice-setup-message.is-success {
  color: var(--teal);
}

.setup-countdown {
  --setup-countdown-progress: 1;
  position: relative;
  flex: 0 1 auto;
  width: auto;
  max-width: none;
  min-height: 34px;
  overflow: hidden;
  padding: 8px 12px;
  border: 1px solid rgb(50 94 50 / 48%);
  border-radius: 7px;
  background: rgb(255 250 239 / 82%);
  color: var(--ui-text);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 42%),
    0 8px 18px rgb(0 0 0 / 10%);
}

.setup-countdown::before {
  content: "";
  position: absolute;
  inset: 0;
  width: calc(var(--setup-countdown-progress) * 100%);
  background: linear-gradient(90deg, rgb(62 132 74 / 52%), rgb(94 166 91 / 46%));
  box-shadow: 0 0 16px rgb(65 145 77 / 18%);
  transition: width 240ms linear, background 160ms ease, box-shadow 160ms ease;
}

.setup-countdown span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 1px rgb(255 255 255 / 55%);
}

.setup-countdown.is-hidden {
  display: none;
}

.setup-countdown.is-warning {
  border-color: rgb(164 63 47 / 72%);
  color: var(--accent-strong);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 38%),
    0 0 14px rgb(164 63 47 / 18%);
}

.setup-countdown.is-warning::before {
  background: linear-gradient(90deg, rgb(181 42 42 / 58%), rgb(219 74 55 / 50%));
  box-shadow: 0 0 18px rgb(164 63 47 / 26%);
}

.setup-countdown.is-aborted {
  border-color: rgb(164 63 47 / 72%);
  background: rgb(255 236 226 / 88%);
  color: var(--accent-strong);
}

.setup-countdown.is-aborted::before {
  width: 0;
}

.time-control-panel,
.takeback-setup-panel {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.time-control-panel label,
.takeback-setup-panel label {
  display: grid;
  gap: 5px;
  color: var(--ui-text);
  font-size: 0.82rem;
  font-weight: 800;
}

.time-control-panel select,
.time-control-panel input,
.takeback-setup-panel select {
  min-height: 34px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: rgb(255 250 239 / 92%);
  color: var(--ui-text);
  font: inherit;
  font-weight: 700;
}

.custom-time-control-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.custom-time-control-fields.is-hidden {
  display: none;
}

.time-control-helper {
  min-height: 1.2em;
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

body.is-online-setup-view:not(.is-landing-view) .time-control-helper,
body.is-online-setup-view:not(.is-landing-view) .online-room-seat,
body.is-online-setup-view:not(.is-landing-view) .online-lobby-message {
  color: var(--pards-arena-text-soft);
}

.time-control-helper.is-error {
  color: var(--accent-strong);
  font-weight: 800;
}

body.is-online-setup-view:not(.is-landing-view) .time-control-helper.is-error {
  color: #8b3325;
}

.dice-setup-actions {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.dice-setup-actions button {
  width: clamp(132px, 56%, 168px);
  min-height: 38px;
  padding: 0 12px;
  background: linear-gradient(180deg, #f1e3ca 0%, #cda66d 100%);
  color: #3a2a1d;
  border: 1px solid #a8874c;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 48%),
    0 3px 7px rgb(45 32 20 / 22%);
  font-size: 0.86rem;
}

.dice-setup-actions button:hover,
.dice-setup-actions button:focus-visible {
  background: linear-gradient(180deg, #faeed7 0%, #d7b374 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 55%),
    0 4px 9px rgb(45 32 20 / 24%);
}

.dice-setup-actions button:active {
  background: linear-gradient(180deg, #c59a62 0%, #eadcc7 100%);
  box-shadow: inset 0 2px 4px rgb(45 32 20 / 25%);
}

.dice-setup-actions button[hidden] {
  display: none;
}

.reset-request-panel,
.action-request-panel {
  display: grid;
  gap: 10px;
}

.reset-request-panel.is-hidden,
.action-request-panel.is-hidden {
  display: none;
}

.reset-request-message,
.action-request-message {
  margin: 0;
  color: var(--ui-text);
  font-size: 0.92rem;
  line-height: 1.35;
}

.reset-request-actions,
.action-request-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.controls {
  display: grid;
  gap: 10px;
}

.controls button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.review-home-control {
  display: none;
}

body.is-review-practice-view .review-home-control {
  display: block;
}

.die-adjustment-panel {
  position: absolute;
  left: 50%;
  top: 88%;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 20px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.die-adjustment-panel.is-hidden {
  display: none;
}

.die-adjustment-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.die-adjustment-panel button {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid rgb(248 243 234 / 46%);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgb(32 24 16 / 25%);
  font-size: 0.85rem;
}

button {
  min-height: 44px;
  border: 1px solid var(--ui-button-border);
  background: var(--ui-button);
  color: #3a2a1d;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 55%),
    0 2px 4px rgb(45 32 20 / 22%);
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: var(--ui-button-hover);
  filter: brightness(1.025);
}

button:active:not(:disabled) {
  background: var(--ui-button-active);
  box-shadow: inset 0 2px 4px rgb(45 32 20 / 25%);
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.18);
  opacity: 0.48;
  transform: none;
}

.secondary-button,
.die-adjustment-panel button {
  border-color: var(--ui-button-secondary-border);
  background: var(--ui-button-secondary);
  color: #4a3a2b;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%);
}

.secondary-button.is-off {
  background: var(--ui-button-secondary);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.die-adjustment-panel button:hover,
.die-adjustment-panel button:focus-visible {
  background: var(--ui-button-secondary-hover);
}

.secondary-button:active:not(:disabled),
.die-adjustment-panel button:active:not(:disabled) {
  background: var(--ui-button-secondary-active);
}

.secondary-button.is-off:hover,
.secondary-button.is-off:focus-visible {
  background: var(--ui-button-secondary-hover);
}

#resetButton {
  border-color: var(--ui-button-danger-border);
  background: var(--ui-danger);
  color: #fff4df;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 18%),
    0 2px 4px rgb(45 32 20 / 25%);
}

#resetButton:hover,
#resetButton:focus-visible {
  background: var(--ui-danger-hover);
}

#resetButton:active:not(:disabled) {
  background: var(--ui-danger-active);
}

.move-log-panel {
  display: grid;
  gap: 12px;
}

.computer-mode-panel {
  gap: 12px;
  border: 2px solid rgb(146 104 42 / 62%);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(255 249 232 / 96%), rgb(241 224 180 / 92%));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 72%),
    0 12px 26px rgb(49 33 14 / 22%);
  color: var(--ui-text);
  padding: 14px;
}

.computer-mode-header,
.computer-mode-log-shell,
.computer-start-panel {
  display: grid;
  gap: 9px;
}

.computer-mode-header h2,
.computer-mode-log-shell h3,
.computer-start-panel h3 {
  margin: 0;
}

.computer-mode-header {
  border-bottom: 1px solid rgb(130 101 62 / 24%);
  padding-bottom: 10px;
}

.computer-mode-header span,
.computer-match-status {
  color: rgb(80 56 31);
  font-size: 0.94rem;
  line-height: 1.36;
  white-space: pre-line;
}

.computer-match-status {
  margin: 0;
}

.computer-result-panel {
  display: grid;
  gap: 9px;
  border: 2px solid rgb(168 121 36 / 85%);
  background:
    linear-gradient(180deg, rgb(255 248 226 / 98%), rgb(238 214 154 / 90%));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 75%),
    inset 0 -1px 0 rgb(122 86 40 / 18%),
    0 6px 16px rgb(80 55 25 / 18%);
  padding: 13px;
  color: var(--ui-text);
}

.computer-result-panel.is-hidden {
  display: none;
}

.computer-result-eyebrow {
  color: rgb(82 55 28);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.computer-result-panel h3,
.computer-result-panel p {
  margin: 0;
}

.computer-result-panel h3 {
  color: rgb(55 36 20);
  font-size: 1.08rem;
  line-height: 1.25;
}

.computer-result-panel p {
  color: rgb(73 50 29);
  font-size: 0.94rem;
  line-height: 1.35;
}

.computer-result-actions,
.computer-mode-actions,
.computer-review-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.computer-mode-actions {
  display: none;
}

.computer-review-controls {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 4px;
}

body.is-computer-challenge-view .computer-review-controls {
  display: none;
}

body.is-computer-challenge-view.is-computer-reviewing .computer-review-controls {
  display: grid;
}

.computer-result-details {
  display: grid;
  gap: 5px;
}

.computer-result-detail-row {
  display: grid;
  grid-template-columns: minmax(72px, max-content) 1fr;
  gap: 8px;
  align-items: baseline;
  color: rgb(73 50 29);
  font-size: 0.94rem;
  line-height: 1.35;
}

.computer-result-detail-row span {
  font-weight: 850;
}

.computer-result-detail-row strong {
  color: rgb(55 36 20);
  font-weight: 800;
}

.computer-start-panel {
  gap: 14px;
}

.computer-start-panel label {
  display: grid;
  gap: 7px;
}

.computer-start-panel .alaric-level-selector + label {
  margin-top: 4px;
}

.alaric-level-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.alaric-level-selector legend {
  grid-column: 1 / -1;
  padding: 0;
  color: #684216;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.alaric-level-option {
  position: relative;
  display: grid;
  min-height: 66px;
  cursor: pointer;
}

.alaric-level-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.alaric-level-option span {
  display: grid;
  gap: 3px;
  align-content: center;
  border: 1px solid rgb(130 101 62 / 36%);
  border-radius: 6px;
  background: rgb(248 243 234 / 74%);
  color: var(--ui-text);
  padding: 10px 11px;
  line-height: 1.2;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.alaric-level-option strong {
  font-size: 0.94rem;
  font-weight: 850;
}

.alaric-level-option small {
  color: var(--ui-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.alaric-level-option input:checked + span {
  border-color: rgb(164 113 36 / 74%);
  background: rgb(255 245 218 / 86%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 70%),
    0 5px 13px rgb(118 76 25 / 16%);
}

.alaric-level-option input:focus-visible + span {
  outline: 2px solid rgb(164 113 36 / 78%);
  outline-offset: 2px;
}

.alaric-level-option input:disabled + span,
.alaric-level-option.is-disabled span {
  cursor: not-allowed;
  opacity: 0.64;
}

.computer-move-log {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgb(130 101 62 / 34%);
  border-radius: 6px;
  background: rgb(255 252 244 / 82%);
  padding: 10px;
}

.computer-move-log-entry {
  color: var(--ui-text);
  font-size: 0.9rem;
  line-height: 1.35;
}

body.is-computer-challenge-view.is-computer-reviewing .computer-move-log-entry.is-current-review-action {
  background: rgb(220 179 83 / 26%);
  border-left: 3px solid rgb(145 98 27 / 90%);
  box-shadow: inset 0 0 0 1px rgb(145 98 27 / 30%);
  color: rgb(64 40 15);
  font-weight: 700;
  margin-inline: -4px;
  padding: 3px 5px;
}

.computer-dice-log-header {
  display: grid;
  gap: 2px;
  color: var(--ui-muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.move-log-header {
  display: grid;
  gap: 10px;
}

.move-log-header h2 {
  margin: 0;
}

.move-log-actions {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 8px;
  justify-content: start;
}

.move-log-actions button {
  min-height: 38px;
  font-size: 0.82rem;
}

.move-log-actions .icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.move-log-actions .icon-button svg,
.mobile-board-actions .icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.move-log-actions button[hidden] {
  display: none;
}

.match-result-panel {
  display: grid;
  gap: 5px;
  border: 2px solid rgb(168 121 36 / 85%);
  background:
    linear-gradient(180deg, rgb(255 248 226 / 98%), rgb(238 214 154 / 90%));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 75%),
    inset 0 -1px 0 rgb(122 86 40 / 18%),
    0 6px 16px rgb(80 55 25 / 18%);
  padding: 11px 13px;
  color: var(--ui-text);
}

.match-result-panel.is-hidden {
  display: none;
}

.match-result-panel strong {
  color: rgb(82 55 28);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.match-result-panel span {
  color: rgb(55 36 20);
  font-size: 1.04rem;
  font-weight: 900;
  line-height: 1.3;
}


.move-log-list {
  min-height: 96px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--ui-border);
  background: rgb(248 243 234 / 92%);
  padding: 10px;
  color: var(--ui-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.move-log-entry {
  white-space: nowrap;
}

.move-log-section + .move-log-section {
  margin-top: 0.8rem;
}

.move-log-section-title {
  margin: 0 0 0.25rem;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--ui-text);
}

.move-log-dice-header {
  margin-bottom: 0.75rem;
  white-space: pre-line;
  color: var(--ui-text);
}

.move-log-result {
  margin-top: 0.75rem;
  color: var(--ui-text);
  font-weight: 700;
}

.move-log-empty,
.move-log-status {
  margin: 0;
  color: var(--ui-text-muted);
}

.move-log-status {
  min-height: 1.2rem;
  font-size: 0.86rem;
}

.review-setup-panel summary {
  cursor: pointer;
  color: var(--ui-text);
  font-weight: 900;
}

.review-setup-content {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.practice-start-panel,
.review-import-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgb(130 101 62 / 32%);
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(248 240 222 / 54%) 0%, rgb(222 207 181 / 44%) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 38%),
    0 5px 14px rgb(45 32 20 / 10%);
}

.practice-start-panel h3,
.review-import-panel h3 {
  margin: 0;
  color: var(--ui-text);
  font-size: 0.92rem;
}

.review-mode-intro {
  margin: 0;
  color: var(--ui-text);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.38;
}

.review-helper,
.review-status {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.review-status.is-error {
  color: var(--ui-danger-hover);
  font-weight: 800;
}

.review-status.is-success {
  color: var(--ui-button-hover);
  font-weight: 800;
}

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

.review-dice-grid[hidden] {
  display: none;
}

.review-actions,
.replay-actions {
  display: grid;
  gap: 8px;
}

.review-actions button,
#startPracticeGameButton,
#openReviewToolsButton,
.replay-actions button {
  min-height: 38px;
  font-size: 0.82rem;
  width: 100%;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--ui-text-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ui-border);
  background: rgb(248 243 234 / 92%);
  color: var(--ui-text);
  padding: 8px;
  cursor: pointer;
}

input[type="number"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ui-border);
  background: rgb(248 243 234 / 92%);
  color: var(--ui-text);
  padding: 8px 10px;
}

textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--ui-border);
  background: rgb(248 243 234 / 92%);
  color: var(--ui-text);
  padding: 8px 10px;
  line-height: 1.4;
}

.notes p {
  margin: 0;
  color: var(--ui-text-muted);
  line-height: 1.55;
}

.build-footer {
  box-sizing: border-box;
  display: grid;
  gap: 6px;
  width: min(1180px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  margin: 8px auto 0;
  color: #3b2a1f;
  padding: 0 0 calc(22px + env(safe-area-inset-bottom, 0px));
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
  text-shadow:
    0 1px 2px rgb(255 255 255 / 45%);
}

.footer-feedback-link {
  justify-self: center;
  color: #3b2a1f;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration-color: rgb(122 86 40 / 45%);
  text-underline-offset: 3px;
}

.footer-feedback-link:hover,
.footer-feedback-link:focus-visible {
  color: #2d1d12;
  text-decoration-color: rgb(122 86 40 / 80%);
}

.room-chat-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}

.room-chat-root.is-hidden {
  display: none;
}

.room-chat-toggle,
.room-chat-panel {
  pointer-events: auto;
}

.room-chat-toggle {
  position: relative;
  min-height: 38px;
  border-color: rgb(130 101 62 / 65%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(238 226 205 / 94%) 0%, rgb(206 188 158 / 94%) 100%);
  color: var(--ui-text);
  padding: 0 18px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 48%),
    0 4px 12px rgb(45 32 20 / 24%);
  font-size: 0.82rem;
}

.room-chat-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border: 1px solid rgb(255 245 220 / 86%);
  border-radius: 999px;
  background: #9a3f2e;
  color: #fff4df;
  padding: 0 5px;
  font-size: 0.68rem;
  line-height: 16px;
  text-align: center;
}

.room-chat-unread.is-hidden {
  display: none;
}

.room-chat-panel {
  width: min(340px, calc(100vw - 32px));
  border: 1px solid rgb(145 105 45 / 38%);
  background: rgb(245 236 218 / 88%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgb(255 248 235 / 48%),
    0 18px 42px rgb(34 24 14 / 28%);
  padding: 12px;
}

.room-chat-panel.is-hidden {
  display: none;
}

.room-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.room-chat-header h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.room-chat-header .icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  font-size: 1.05rem;
}

.room-chat-messages {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 210px;
  overflow-y: auto;
  border: 1px solid rgb(130 101 62 / 24%);
  background: rgb(255 250 239 / 93%);
  padding: 10px;
}

.room-chat-empty {
  color: var(--ui-text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.room-chat-message {
  display: grid;
  gap: 2px;
}

.room-chat-message-meta {
  color: rgb(93 72 53 / 78%);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.room-chat-message-text {
  color: var(--ui-text);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
  word-wrap: break-word;
}

.room-chat-form {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.room-chat-form label {
  font-size: 0.76rem;
}

.room-chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.room-chat-compose button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.76rem;
}

.room-chat-status {
  min-height: 1.1em;
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.74rem;
  line-height: 1.3;
}


@media (max-width: 768px) {
  body {
    background-image: var(--page-wallpaper-mobile);
    background-attachment: scroll;
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
  }

  body.is-landing-view {
    background-image: url("./assets/images/pards-landing-wallpaper-mobile.png");
    background-position: center top;
    background-size: cover;
  }

  body.is-online-setup-view:not(.is-landing-view) {
    background-image: url("./assets/images/pards-landing-wallpaper-mobile.png");
    background-position: center 18%;
    background-size: cover;
  }
}

@media (max-width: 820px) {
  body {
    background-attachment: scroll;
  }

  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px 0 28px;
  }

  body.is-landing-view .app-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: clamp(120px, 18vh, 190px) 0 clamp(48px, 9vh, 110px);
  }

  body.is-landing-view .side-panel {
    width: min(100%, calc(100vw - 24px));
    margin: 0 auto;
    justify-self: center;
    justify-items: center;
  }

  body.is-landing-view .landing-panel {
    width: 100%;
    margin: 0 auto;
    gap: 12px;
    background:
      linear-gradient(145deg, rgb(255 250 238 / 78%) 0%, rgb(246 239 224 / 74%) 42%, rgb(232 219 194 / 70%) 100%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 15px;
    overflow-x: visible;
  }

  body.is-landing-view .landing-actions {
    grid-template-columns: 1fr;
  }

  body.is-landing-view .landing-panel,
  body.is-landing-view .landing-panel *,
  body.is-landing-view .landing-card {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  body.is-landing-view .landing-hero h1 {
    font-size: clamp(1.75rem, 8.6vw, 2.8rem);
    letter-spacing: 0.035em;
    overflow: visible;
  }

  body.is-landing-view .landing-bolt-tagline {
    font-size: clamp(0.92rem, 4vw, 1.2rem);
    letter-spacing: 0.1em;
  }

  body.is-landing-view .landing-card strong,
  body.is-landing-view .landing-card span,
  body.is-landing-view .landing-brand-line,
  body.is-landing-view .landing-libre-line {
    overflow-wrap: break-word;
    word-break: normal;
    word-wrap: break-word;
  }

  .side-panel {
    display: contents;
  }

  body.is-online-setup-view .side-panel {
    display: grid;
    width: min(82vw, 380px);
    max-width: 380px;
    margin: 0 auto;
    justify-self: center;
  }

  body.is-online-setup-view:not(.is-landing-view) .app-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: clamp(144px, 21vh, 230px) 0 clamp(48px, 9vh, 110px);
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 24px;
    overflow-x: visible;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-panel::before {
    inset: 5px;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-panel *,
  body.is-online-setup-view:not(.is-landing-view) .online-room-panel input,
  body.is-online-setup-view:not(.is-landing-view) .online-room-panel select,
  body.is-online-setup-view:not(.is-landing-view) .online-room-panel button {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-header {
    display: grid;
    gap: 6px;
    align-items: start;
    justify-content: stretch;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-header h2 {
    white-space: nowrap;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-status {
    text-align: left;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-panel input,
  body.is-online-setup-view:not(.is-landing-view) .online-room-panel select {
    width: 100%;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-setup-controls,
  body.is-online-setup-view:not(.is-landing-view) .online-room-actions {
    grid-template-columns: 1fr;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-panel label,
  body.is-online-setup-view:not(.is-landing-view) .online-room-panel p,
  body.is-online-setup-view:not(.is-landing-view) .online-room-panel span,
  body.is-online-setup-view:not(.is-landing-view) .online-room-panel strong {
    overflow-wrap: break-word;
    word-break: normal;
    word-wrap: break-word;
  }

  .room-chat-root {
    inset: 0;
    z-index: 45;
    display: block;
    pointer-events: none;
  }

  .room-chat-root.is-hidden {
    display: none;
  }

  .room-chat-toggle {
    position: fixed;
    right: 14px;
    bottom: 14px;
    pointer-events: auto;
  }

  .room-chat-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: min(72vh, 520px);
    padding: 14px;
    pointer-events: auto;
  }

  .room-chat-messages {
    height: min(42vh, 280px);
  }

  .room-chat-compose {
    grid-template-columns: 1fr;
  }

  body.is-landing-view .landing-panel {
    order: 1;
  }

  body.is-online-setup-view .brand-block {
    order: 1;
  }

  body.is-online-setup-view .online-room-panel {
    order: 2;
  }

  body.is-online-setup-view .review-practice-entry-panel {
    order: 3;
  }

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

  .landing-card {
    min-height: auto;
    text-align: center;
  }
  body.is-online-lobby-view .online-lobby-grid {
    grid-template-columns: 1fr 1fr;
  }

  body.is-online-game-view .online-room-panel {
    grid-template-columns: 1fr;
  }

  body.is-online-game-view .online-room-actions {
    justify-content: stretch;
  }

  body.is-online-game-view .online-room-actions button {
    flex: 1;
  }

  body.is-online-game-view.is-room-dice-setup .dice-setup-panel {
    order: 3;
  }

  body.is-online-game-view.is-room-dice-setup .online-room-panel {
    order: 4;
  }

  body.is-online-game-view.is-room-dice-setup .status-grid {
    order: 5;
  }

  body.is-online-game-view.is-room-dice-setup .controls {
    order: 6;
  }

  body.is-online-game-view.is-room-dice-setup .move-log-panel {
    order: 7;
  }

  body.is-online-game-view.is-room-playing .online-room-panel,
  body.is-online-game-view.is-room-game-over .online-room-panel,
  body.is-online-game-view.is-room-aborted .online-room-panel {
    order: 8;
  }

  body.is-review-practice-view.is-computer-challenge-view .app-shell {
    align-items: center;
    gap: 18px;
  }

  .brand-block {
    order: 1;
  }

  .game-surface {
    order: 2;
  }

  body.is-review-practice-view.is-computer-challenge-view .brand-block {
    order: 1;
  }

  body.is-review-practice-view.is-computer-challenge-view .game-surface {
    order: 2;
  }

  body.is-review-practice-view.is-computer-challenge-view .status-grid {
    order: 3;
  }

  body.is-review-practice-view.is-computer-challenge-view .review-setup-panel,
  body.is-review-practice-view.is-computer-challenge-view .computer-mode-panel {
    order: 4;
  }

  body.is-review-practice-view.is-computer-challenge-view .controls {
    order: 5;
  }

  body.is-review-practice-view.is-computer-challenge-view .computer-mode-panel,
  body.is-review-practice-view.is-computer-challenge-view .review-setup-panel {
    width: 100%;
    box-sizing: border-box;
  }

  body.is-review-practice-view.is-computer-challenge-view .computer-result-panel {
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  body.is-review-practice-view.is-computer-challenge-view .move-log-panel {
    order: 7;
  }

  .mobile-board-actions:not(.is-hidden) {
    display: flex;
    justify-content: flex-start;
    margin: 0;
  }

  .under-board-action-row {
    --under-board-control-width: 116px;
    --under-board-control-height: 34px;
    --under-board-control-radius: 6px;
    justify-content: space-between;
    min-height: var(--under-board-control-height);
    margin-top: -3px;
  }

  .mobile-board-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: var(--under-board-control-width);
    min-width: var(--under-board-control-width);
    height: var(--under-board-control-height);
    min-height: var(--under-board-control-height);
    padding: 0 8px;
    border-radius: var(--under-board-control-radius);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 38%),
      0 8px 18px rgb(0 0 0 / 12%);
    font-size: 0.78rem;
  }

  .under-board-action-row .board-clock-bottom {
    width: var(--under-board-control-width);
    min-width: var(--under-board-control-width);
    height: var(--under-board-control-height);
    min-height: var(--under-board-control-height);
    padding: 0 8px;
    border-radius: var(--under-board-control-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .online-room-panel {
    order: 4;
  }

  .dice-setup-panel {
    order: 5;
  }

  .status-grid {
    order: 6;
  }

  .controls {
    order: 7;
  }

  .move-log-panel {
    order: 8;
  }

  .review-setup-panel {
    order: 9;
  }

  .board-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .board-stage {
    width: 100%;
  }

  .off-board-piece {
    grid-column: 1;
    grid-row: auto;
    width: clamp(58px, 18vw, 78px);
    justify-self: center;
  }

  .off-board-piece.is-hidden {
    display: none;
  }

  .move-log-actions {
    grid-template-columns: repeat(3, 42px);
  }

  .brand-block,
  .online-room-panel,
  .review-practice-entry-panel,
  .dice-setup-panel,
  .status-grid,
  .controls,
  .move-log-panel,
  .review-setup-panel {
    width: 100%;
  }

  body.is-online-setup-view:not(.is-landing-view) .side-panel {
    flex: 0 0 auto;
    align-self: center;
    justify-self: center;
    width: min(78vw, 360px);
    max-width: 360px;
  }

  body.is-online-setup-view:not(.is-landing-view) .online-room-panel {
    justify-self: center;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 820px) and (max-height: 750px) {
  body.is-review-practice-view.is-computer-challenge-view .computer-result-panel {
    gap: 7px;
    padding: 10px;
  }

  body.is-review-practice-view.is-computer-challenge-view .computer-result-eyebrow {
    font-size: 0.72rem;
  }

  body.is-review-practice-view.is-computer-challenge-view .computer-result-panel h3 {
    font-size: 0.98rem;
    line-height: 1.2;
  }

  body.is-review-practice-view.is-computer-challenge-view .computer-result-panel p,
  body.is-review-practice-view.is-computer-challenge-view .computer-result-detail-row {
    font-size: 0.84rem;
    line-height: 1.25;
  }

  body.is-review-practice-view.is-computer-challenge-view .computer-result-details {
    gap: 4px;
  }

  body.is-review-practice-view.is-computer-challenge-view .computer-result-actions {
    gap: 6px;
  }
}

@media (min-width: 821px) {
  body.is-review-practice-view .game-surface {
    position: sticky;
    top: clamp(24px, 6vh, 72px);
    align-self: start;
  }

  body.is-review-practice-view .side-panel {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    align-content: start;
    padding-right: 4px;
  }

  body.is-review-practice-view.is-computer-challenge-view .side-panel {
    max-height: none;
    overflow: visible;
    align-content: start;
  }
}

@media (min-width: 821px) and (max-width: 1080px) {
  body.is-landing-view .landing-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
