:root {
  --cell-gap: 2px;
  --board-pad: 6px;
  --screen-pad: 12px;
  --radius: 6px;
  --min-cell: 28px;
  --tray-scale: 0.5;
  --cell-size: 64px;
  --board-size: 670px;
  --tray-cell-size: 28px;
  --tray-slot-size: 168px;
  --anim-duration: 0.18s;
  --anim-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
  --color-bg: #0f172a;
  --color-board: #1e293b;
  --color-cell-empty: #334155;
  --color-text: #f1f5f9;
  --color-piece-single: #38bdf8;
  --color-piece-line: #4ade80;
  --color-piece-sq2: #f97316;
  --color-piece-sq3: #a78bfa;
  --color-piece-l2: #facc15;
  --color-piece-l3: #f472b6;
  --color-piece-tetro-t: #9333ea;
  --color-piece-tetro-l: #d97706;
  --color-piece-tetro-j: #2563eb;
  --color-piece-tetro-s: #16a34a;
  --color-piece-tetro-z: #ef4444;
  --color-piece-rect-23: #14b8a6;
  --color-preview-ok: rgba(74, 222, 128, 0.35);
  --color-preview-bad: rgba(244, 63, 94, 0.35);
  --z-ghost: 1000;
  --ghost-opacity: 0.85;
  --z-overlay: 900;
  --color-overlay-backdrop: rgba(15, 23, 42, 0.85);
  --z-start-gate: 1100;
  --z-version: 1200;
}
html,
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, ui-sans-serif, system-ui, sans-serif;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
#app,
.board,
.tray,
.ghost {
  touch-action: none;
}
body {
  display: grid;
  place-items: center;
}
#app {
  display: grid;
  gap: var(--screen-pad);
  place-items: center;
  box-sizing: border-box;
  padding-top: max(var(--screen-pad), env(safe-area-inset-top));
  padding-right: max(var(--screen-pad), env(safe-area-inset-right));
  padding-bottom: max(var(--screen-pad), env(safe-area-inset-bottom));
  padding-left: max(var(--screen-pad), env(safe-area-inset-left));
}
#app[data-orientation="portrait"] {
  grid-template-areas: "hud" "board" "tray";
  grid-template-columns: min-content;
}
#app[data-orientation="landscape"] {
  grid-template-areas: "board hud" "board tray";
  grid-template-columns: min-content min-content;
  grid-template-rows: min-content min-content;
  align-items: center;
}
.hud {
  grid-area: hud;
}
.tray {
  grid-area: tray;
}
#app[data-orientation="portrait"] .tray,
#app[data-orientation="portrait"] .hud {
  width: var(--board-size);
  box-sizing: border-box;
}
#app[data-orientation="landscape"] .tray {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, auto);
}
.board {
  grid-area: board;
  display: grid;
  grid-template-columns: repeat(10, var(--cell-size));
  grid-template-rows: repeat(10, var(--cell-size));
  gap: var(--cell-gap);
  padding: var(--board-pad);
  background: var(--color-board);
  border-radius: var(--radius);
}
.board__cell {
  background: var(--color-cell-empty);
  border-radius: var(--radius);
  transform-origin: center;
}
.board__cell[data-state="filled"] {
  background: var(--piece-color, var(--color-piece-single));
  animation: cellAppear var(--anim-duration) var(--anim-easing) both;
}
@keyframes cellAppear {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.board__cell[data-state="preview-ok"] {
  background: var(--color-preview-ok);
}
.board__cell[data-state="preview-bad"] {
  background: var(--color-preview-bad);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}
.tray {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--cell-gap);
  padding: var(--board-pad);
  background: var(--color-board);
  border-radius: var(--radius);
}
.tray__slot {
  min-height: var(--tray-slot-size);
  display: grid;
  place-items: center;
}
.tray__piece {
  display: grid;
  grid-template-columns: repeat(var(--bbox-w), var(--tray-cell-size));
  grid-template-rows: repeat(var(--bbox-h), var(--tray-cell-size));
  gap: var(--cell-gap);
}
.tray__piece-cell {
  background: var(--piece-color, var(--color-piece-single));
  border-radius: var(--radius);
}
.ghost {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-ghost);
  display: grid;
  grid-template-columns: repeat(var(--bbox-w), var(--cell-size));
  grid-template-rows: repeat(var(--bbox-h), var(--cell-size));
  gap: var(--cell-gap);
  opacity: var(--ghost-opacity);
  will-change: transform;
}
.ghost__cell {
  background: var(--piece-color, var(--color-piece-single));
  border-radius: var(--radius);
}
.tray__slot[data-picked="true"] .tray__piece {
  opacity: 0;
}
.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--screen-pad);
  padding: var(--screen-pad);
  color: var(--color-text);
  box-sizing: border-box;
  min-width: 0;
}
.hud__mute {
  justify-self: end;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: var(--cell-gap) var(--screen-pad);
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-cell-empty);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0.7;
}
.hud__mute:hover {
  opacity: 1;
}
.hud__pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  align-items: baseline;
  min-width: 0;
}
.hud__label {
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}
.hud__score {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
  min-width: 0;
}
.hud__pair--best .hud__score {
  opacity: 0.7;
}
.overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-overlay);
  display: grid;
  grid-auto-flow: row;
  place-items: center;
  align-content: center;
  gap: var(--screen-pad);
  background: var(--color-overlay-backdrop);
  color: var(--color-text);
  transition: opacity var(--anim-duration) var(--anim-easing);
}
.overlay[data-visible="false"] {
  display: none;
}
.overlay__heading {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.overlay__score {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.85;
}
.overlay__button {
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  padding: var(--cell-gap) var(--screen-pad);
  background: var(--color-piece-line);
  color: var(--color-bg);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.combo-callout {
  position: fixed;
  top: max(var(--screen-pad), env(safe-area-inset-top));
  left: calc(
    50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2
  );
  z-index: var(--z-overlay);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-piece-line);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%);
}
.combo-callout[data-visible="true"] {
  animation: comboPulse 0.9s var(--anim-easing) forwards;
}
@keyframes comboPulse {
  0% {
    opacity: 0;
    transform: translate(-50%) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translate(-50%) scale(1.15);
  }
  30% {
    opacity: 1;
    transform: translate(-50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%) scale(1);
  }
}
.start-gate {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-start-gate);
  display: grid;
  place-items: center;
  background: var(--color-overlay-backdrop);
  color: var(--color-text);
}
.start-gate__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--screen-pad);
}
.start-gate[data-visible="false"] {
  display: none;
}
.start-gate__button {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: var(--screen-pad) calc(var(--screen-pad) * 2);
  background: var(--color-piece-line);
  color: var(--color-bg);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.start-gate__rules {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text);
  opacity: 0.7;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.start-gate__rules:hover {
  opacity: 1;
}
.version {
  position: fixed;
  bottom: max(var(--screen-pad), env(safe-area-inset-bottom));
  right: max(var(--screen-pad), env(safe-area-inset-right));
  z-index: var(--z-version);
  padding: 2px 6px;
  border-radius: var(--radius);
  background: var(--color-overlay-backdrop);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: var(--color-text);
  opacity: 0.6;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
:root {
  --color-bg: #f6f7fb;
  --color-text: #26324c;
  --color-board: #eef0f7;
  --color-cell-empty: #dce2ee;
  --color-preview-ok: #b9e8d1;
  --color-piece-single: #2aaad6;
  --color-piece-line: #38b989;
  --color-piece-sq2: #f5a340;
  --color-piece-sq3: #8971da;
  --color-piece-l2: #e8b535;
  --color-piece-l3: #eb749e;
  --color-piece-tetro-t: #9874e4;
  --color-piece-tetro-l: #f1a554;
  --color-piece-tetro-j: #5d97e8;
  --color-piece-tetro-s: #53b991;
  --color-piece-tetro-z: #e97878;
  --color-piece-rect-23: #46b4b3;
  --radius: 5px;
  --cell-size: 30px;
  --board-size: 330px;
  --purple: #6654d9;
  --muted: #737e94;
  --line: #e9ecf3;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  display: block;
  user-select: auto;
  -webkit-user-select: auto;
  overscroll-behavior: auto;
}
body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    Segoe UI,
    sans-serif;
}
#app {
  display: block;
  padding: 0;
  touch-action: auto;
  place-items: normal;
  width: 100%;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #aaa0ef;
  outline-offset: 3px;
}
button svg,
a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
a {
  color: inherit;
}
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.header-inner {
  max-width: 1440px;
  margin: auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.header-brand,
.header-nav,
.brand {
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  text-decoration: none;
  gap: 10px;
  white-space: nowrap;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}
.brand__name {
  font-weight: 850;
  font-size: 24px;
  letter-spacing: -1px;
}
.brand__name span {
  color: var(--purple);
}
.brand-tagline {
  padding-left: 24px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.header-nav {
  gap: 26px;
}
.header-nav > a {
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.icon-button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--color-text);
}
.icon-button:hover {
  background: #f5f4fd;
}
.install-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: #269769;
  color: #fff;
  min-height: 42px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
}
.install-button:hover {
  background: #20845c;
}
.page-main {
  margin: auto;
  max-width: 1440px;
  padding: 24px 24px 0;
}
.intro {
  grid-area: intro;
  width: 100%;
  max-width: 954px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.eyebrow span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
}
h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -1px;
  line-height: 1.25;
}
.intro-copy {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.6;
}
.intro-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  flex-shrink: 0;
}
.intro-badge svg {
  width: 34px;
  height: 34px;
  color: #d5aa54;
  padding: 6px;
  background: #fff4dc;
  border-radius: 10px;
}
.intro-badge strong {
  color: var(--color-text);
  font-weight: 650;
}
.content-layout {
  display: grid;
  justify-content: center;
}
.play-workspace {
  display: grid;
  grid-template-columns: minmax(0, 660px) 274px;
  grid-template-areas: "intro intro" "game controls" "game install" "game tip";
  grid-template-rows: auto auto auto 1fr;
  gap: 20px;
  width: 954px;
  max-width: 100%;
  align-items: start;
}
#app[data-installed="true"] .play-workspace {
  grid-template-areas: "intro intro" "game controls" "game tip";
  grid-template-rows: auto auto 1fr;
}
.control-card {
  grid-area: controls;
}
.install-card {
  grid-area: install;
}
.tip-card {
  grid-area: tip;
}
.play-card,
.control-card,
.install-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 20px #26324c04;
}
.play-card {
  grid-area: game;
  min-width: 0;
  padding: 18px 20px 12px;
}
.play-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1px;
}
.game-mode-label {
  color: var(--purple);
}
.combo-label {
  color: #929baf;
}
.combo-label strong {
  color: #e9a447;
  font-size: 12px;
  margin-left: 4px;
}
.game-mount {
  position: relative;
  display: grid;
  grid-template-areas: "hud" "board" "tray" "rotation";
  justify-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 8px;
}
.hud {
  width: var(--board-size);
  padding: 5px 2px 9px;
  gap: 8px;
}
.hud__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--muted);
}
.hud__score {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 760;
  line-height: 1.25;
  letter-spacing: -0.7px;
  overflow-wrap: anywhere;
}
.hud__pair--best .hud__score {
  opacity: 1;
  color: var(--purple);
}
.hud__mute {
  font-size: 11px;
  letter-spacing: 0;
  border-color: var(--line);
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  opacity: 1;
  color: var(--muted);
}
.board {
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #e7eaf3;
}
.board,
.tray {
  user-select: none;
  -webkit-user-select: none;
}
.board__cell[data-state="filled"],
.tray__piece-cell,
.ghost__cell {
  box-shadow:
    inset 0 2px #ffffff20,
    inset 0 -2px #00000009;
}
.board__cell[data-hint="true"] {
  background: #d0c7fa;
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}
.tray {
  width: var(--board-size);
  padding: 4px;
  background: transparent;
  gap: 10px;
}
.tray__slot {
  min-width: 0;
  border-radius: 10px;
  background: #f8f9fc;
  cursor: grab;
}
.tray__slot[data-hint="true"] {
  outline: 2px solid #a595ef;
}
.rotation-bar {
  grid-area: rotation;
  display: grid;
  width: var(--board-size);
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rotation-bar button {
  border: 1px solid #e7e2fc;
  border-radius: 8px;
  color: var(--purple);
  background: #f7f5ff;
  min-height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
}
.rotation-bar svg {
  width: 15px;
  height: 15px;
}
.board-instruction {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin: 13px 0 0;
}
.game-status {
  font-size: 11px;
  color: var(--purple);
  text-align: center;
  line-height: 1.6;
}
.game-status:empty {
  display: none;
}
.ghost {
  position: fixed;
}
.control-card {
  padding: 22px 18px 14px;
}
.card-eyebrow {
  font-size: 9px;
  color: var(--muted);
  font-weight: 750;
  letter-spacing: 1.1px;
}
.control-card h2 {
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -0.5px;
  margin: 9px 0 20px;
}
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  background: #f2f3f8;
  border-radius: 10px;
}
.mode-switch button {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  padding: 9px 4px;
  font-size: 12px;
  font-weight: 750;
}
.mode-switch button[aria-pressed="true"] {
  color: var(--purple);
  background: #fff;
  border-color: #e9e5fb;
  box-shadow: 0 2px 5px #26324c07;
}
.mode-switch span {
  display: block;
  font-size: 9px;
  font-weight: 500;
  margin-top: 4px;
}
.mode-switch svg {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
}
.mode-note {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  margin: 12px 2px 18px;
  min-height: 38px;
}
.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 14px;
}
.tool-button {
  display: grid;
  grid-template-columns: 20px auto;
  justify-content: center;
  align-content: center;
  column-gap: 6px;
  row-gap: 5px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--color-text);
  border-radius: 10px;
  min-height: 65px;
  font-size: 12px;
  font-weight: 650;
}
.tool-button svg {
  color: var(--purple);
}
.tool-button small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.primary-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 700;
}
.primary-button {
  background: var(--purple);
  color: #fff;
}
.primary-button:hover {
  background: #5846c7;
}
.secondary-button {
  background: #f3f1fc;
  color: var(--purple);
}
.secondary-button:hover {
  background: #eae6fa;
}
.new-game-button {
  width: 100%;
  justify-content: space-between;
}
.shuffle-button {
  margin-top: 10px;
  width: 100%;
  font-size: 11px;
  padding: 10px 5px;
}
.session-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #99a1b2;
  font-size: 9px;
  margin: 16px 0 0;
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6bbb99;
}
.install-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  background: #eff8f3;
  border-color: #dceee3;
}
.install-card__icon {
  background: #daeee2;
  width: 34px;
  height: 34px;
  color: #269769;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.install-card__icon svg {
  width: 18px;
  height: 18px;
}
.install-card h3 {
  font-size: 12px;
  margin: 2px 0 7px;
}
.install-card p {
  font-size: 10px;
  color: #6b8476;
  line-height: 1.7;
  margin: 0;
}
.install-button--card {
  grid-column: 1 / -1;
  font-size: 11px;
  min-height: 36px;
  margin-top: 3px;
}
.tip-card {
  padding: 8px 12px;
  display: flex;
  gap: 12px;
}
.tip-card h3 {
  font-size: 11px;
  margin: 0 0 5px;
  font-weight: 650;
}
.tip-card p {
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}
.tip-decoration {
  width: 29px;
  height: 29px;
  display: grid;
  grid-template-columns: 12px 12px;
  gap: 3px;
  flex-shrink: 0;
  margin-top: 4px;
  transform: rotate(-10deg);
}
.tip-decoration i {
  background: #c2b8ee;
  border-radius: 3px;
}
.tip-decoration i:nth-child(3) {
  opacity: 0.4;
}
.howto-strip {
  max-width: 954px;
  min-height: 180px;
  margin: 0 auto;
  padding: 34px 12px 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.step-number {
  color: #b3aacd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}
.howto-strip h3 {
  font-size: 12px;
  margin: 8px 0 6px;
}
.howto-strip p {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}
.site-footer {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 10px;
  color: #949cb0;
}
.site-footer > span:first-child {
  font-weight: 800;
  color: #68728b;
  font-size: 14px;
}
.site-footer p {
  flex: 1;
  margin: 0;
}
.start-gate {
  position: absolute;
  top: 64px;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 12px;
  background: #f8f9fcda;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.start-gate__inner {
  padding: 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 45px #26324c12;
  gap: 15px;
}
.start-gate__button {
  background: var(--purple);
  color: #fff;
  font-size: 20px;
  min-height: 52px;
  border-radius: 10px;
  padding: 12px 25px;
  letter-spacing: -0.4px;
}
.start-gate__rules {
  font-size: 12px;
  color: var(--muted);
}
.overlay {
  position: absolute;
  top: 64px;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 12px;
  background: #f8f9fce8;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  padding: 20px;
}
.overlay__heading {
  font-size: 26px;
  letter-spacing: -0.5px;
}
.overlay__score {
  color: var(--purple);
  font-size: 40px;
}
.overlay__button {
  background: var(--purple);
  color: #fff;
  border-radius: 10px;
  min-height: 44px;
  padding: 12px 26px;
}
.revive-button {
  font-size: 11px;
  margin-top: 3px;
}
.combo-callout {
  position: absolute;
  top: 110px;
  left: 50%;
  font-size: 27px;
  color: var(--purple);
  text-shadow: 0 2px 0 #fff;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  color: var(--color-text);
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 90px #17254435;
}
dialog::backdrop {
  background: #1b254c70;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.dialog-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
}
.dialog-symbol {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f0edfe;
  color: var(--purple);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}
.dialog-symbol svg {
  width: 23px;
  height: 23px;
}
dialog h2 {
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin: 0 0 13px;
}
dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}
.install-benefits {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  font-size: 12px;
}
.install-benefits span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.install-benefits svg {
  width: 17px;
  height: 17px;
  color: #269769;
}
.install-dialog > .primary-button {
  width: 100%;
}
.menu-dialog {
  width: min(340px, calc(100vw - 32px));
  padding: 24px;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.menu-subtitle {
  margin: 16px 0 22px;
  font-size: 11px;
}
.menu-dialog nav {
  display: grid;
  gap: 6px;
}
.menu-dialog nav button,
.menu-dialog nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-decoration: none;
  padding: 12px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
}
.menu-dialog nav button:hover,
.menu-dialog nav a:hover {
  background: #f5f3fd;
}
.menu-dialog nav svg {
  color: var(--purple);
}
.menu-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin: 24px 0 0;
  font-size: 10px;
}
.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 12px);
  padding: 12px 20px;
  max-width: calc(100vw - 32px);
  width: max-content;
  background: #26324c;
  color: #fff;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  pointer-events: none;
  z-index: 1300;
}
.toast[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%);
}
.version {
  color: #98a1b2;
  font-size: 9px;
}
.ad-rail {
  display: none;
  width: var(--ad-rail-width, 160px);
  align-self: start;
  padding-top: 120px;
}
.ad-rail--left {
  width: 160px;
}
.ad-label {
  display: block;
  font-size: 9px;
  color: #a2a9b7;
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.ad-slot__body {
  min-height: 250px;
}
.ad-footer {
  max-width: 970px;
  margin: 0 auto 28px;
}
.ad-footer .ad-slot__body {
  min-height: 90px;
}
@media (min-width: 1360px) {
  #app[data-ads-right="true"] .content-layout {
    grid-template-columns: 954px var(--ad-rail-width, 160px);
    gap: 150px;
  }
  #app[data-ads-right="true"] .ad-rail--right {
    display: block;
  }
}
@media (min-width: 1440px) {
  #app {
    --ad-rail-width: 250px;
  }
}
@media (min-width: 1536px) {
  #app {
    --ad-rail-width: 300px;
  }
  .page-main {
    max-width: 1500px;
  }
}
@media (min-width: 1900px) {
  #app[data-ads-left="true"] .content-layout {
    grid-template-columns: 160px 954px;
    gap: 150px;
  }
  #app[data-ads-left="true"][data-ads-right="true"] .content-layout {
    grid-template-columns: 160px 954px 300px;
    gap: 150px;
  }
  #app[data-ads-left="true"] .ad-rail--left {
    display: block;
  }
  #app[data-ads-left="true"] .page-main {
    max-width: 1820px;
  }
}
@media (max-width: 900px) {
  .play-workspace {
    width: 100%;
    max-width: 620px;
    margin: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "controls" "game" "install" "intro" "tip";
    grid-template-rows: auto;
    gap: 16px;
  }
  #app[data-installed="true"] .play-workspace {
    grid-template-areas: "controls" "game" "intro" "tip";
    grid-template-rows: auto;
  }
  .content-layout {
    display: block;
  }
  .intro-badge,
  .brand-tagline {
    display: none;
  }
  .play-card {
    padding: 18px 14px 12px;
  }
  .control-card {
    padding: 12px;
    display: grid;
    gap: 10px;
  }
  .control-card h2,
  .card-eyebrow,
  .mode-note,
  .session-note {
    display: none;
  }
  .tools {
    margin: 0;
  }
  .tool-button {
    min-height: 50px;
  }
  .new-game-button {
    justify-content: center;
  }
  .shuffle-button {
    margin: 0;
  }
  .intro {
    padding: 14px 8px 0;
  }
  .howto-strip {
    max-width: 620px;
  }
}
@media (max-width: 700px) {
  .header-inner {
    min-height: 68px;
    padding: max(12px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right)) 12px
      max(14px, env(safe-area-inset-left));
    gap: 10px;
  }
  .header-brand {
    gap: 10px;
  }
  .brand {
    gap: 7px;
  }
  .brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  .brand__name {
    font-size: 21px;
  }
  .icon-button {
    width: 36px;
    height: 40px;
  }
  .header-nav > a {
    display: none;
  }
  .header-nav {
    gap: 0;
  }
  .header-nav .install-button {
    padding: 10px;
    font-size: 11px;
    min-height: 40px;
  }
  .header-nav .install-button svg {
    width: 16px;
    height: 16px;
  }
  .page-main {
    padding: 23px max(14px, env(safe-area-inset-right)) 0
      max(14px, env(safe-area-inset-left));
  }
  .intro {
    margin-bottom: 0;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.3px;
    margin-bottom: 8px;
  }
  h1 {
    font-size: 25px;
    max-width: 310px;
    letter-spacing: -0.7px;
  }
  .intro-copy {
    font-size: 11px;
    margin-top: 7px;
  }
  .play-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
    margin: auto;
    gap: 16px;
  }
  .play-card {
    padding: 16px 12px 13px;
    border-radius: 16px;
  }
  .play-card__top {
    font-size: 9px;
  }
  .game-mount {
    gap: 8px;
  }
  .hud__mute {
    min-height: 40px;
  }
  .hud__score {
    font-size: 29px;
  }
  .board-instruction {
    font-size: 10px;
  }
  .control-card {
    padding: 12px;
  }
  .mode-switch button {
    min-height: 48px;
    font-size: 13px;
  }
  .mode-switch span {
    font-size: 10px;
  }
  .mode-note {
    min-height: 0;
    margin-bottom: 14px;
  }
  .rotation-bar button {
    min-height: 44px;
  }
  .tool-button {
    min-height: 50px;
  }
  .primary-button,
  .secondary-button {
    min-height: 46px;
  }
  .install-card {
    padding: 20px;
    grid-template-columns: 36px 1fr;
  }
  .install-card h3 {
    font-size: 13px;
  }
  .install-card p {
    font-size: 11px;
  }
  .install-button--card {
    min-height: 44px;
  }
  .tip-card {
    padding: 8px 16px;
  }
  .tip-card h3 {
    font-size: 12px;
  }
  .tip-card p {
    font-size: 11px;
  }
  .howto-strip {
    max-width: 520px;
    grid-template-columns: 1fr;
    padding: 28px 10px;
    gap: 20px;
  }
  .howto-strip > div {
    padding-left: 32px;
    position: relative;
  }
  .step-number {
    position: absolute;
    left: 0;
    top: 8px;
  }
  .howto-strip h3 {
    margin-top: 6px;
  }
  .site-footer {
    padding: 22px 24px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .footer-mode {
    display: none;
  }
  .site-footer p {
    font-size: 9px;
  }
  .start-gate__inner {
    padding: 26px;
  }
  .start-gate__button {
    font-size: 18px;
  }
  .ad-footer .ad-slot__body {
    min-height: 250px;
  }
}
@media (max-width: 350px) {
  .brand__name {
    font-size: 19px;
  }
  .header-brand {
    gap: 7px;
  }
  .brand img {
    width: 27px;
    height: 27px;
  }
  .header-nav .install-button {
    padding: 10px 8px;
    font-size: 10px;
  }
  .header-inner {
    padding-left: 10px;
    padding-right: 10px;
  }
  h1 {
    font-size: 23px;
  }
  .page-main {
    padding-left: 10px;
    padding-right: 10px;
  }
}
.round-summary {
  max-width: 954px;
  margin: 0 auto 28px;
  padding: 26px 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  scroll-margin-top: 24px;
}
.round-summary h2 {
  font-size: 23px;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.round-summary__copy,
.round-tip {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.round-stats {
  display: flex;
  gap: 42px;
  margin: 24px 0;
}
.round-stats div {
  display: grid;
  gap: 8px;
}
.round-stats span {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
}
.round-stats strong {
  font-size: 32px;
  color: var(--purple);
}
.round-tip {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
}
.summary-button {
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 10px;
}

/* Block Puzzle accessible controls and language expansion. Original theme: 10Block, MIT. */
html,
body {
  touch-action: pan-y;
  overscroll-behavior: auto;
}
#app {
  touch-action: pan-y;
}
.board {
  touch-action: manipulation;
}
.tray,
.ghost {
  touch-action: none;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #6751c5;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
.board__cell {
  padding: 0;
  border: 0;
  min-width: 0;
  min-height: 0;
}
.board__cell:focus-visible {
  outline: 2px solid #6751c5;
  outline-offset: -2px;
  z-index: 1;
}
.board__cell:disabled {
  opacity: 1;
}
.tray__slot {
  border: 2px solid transparent;
  background: transparent;
  border-radius: 12px;
  cursor: grab;
  padding: 4px;
}
.tray__slot[data-selected="true"] {
  border-color: #c5b6f1;
  background: #f3efff;
}
.tray__slot:disabled {
  cursor: default;
  opacity: 0.45;
}
.tray__slot[data-hint="true"] {
  outline: 2px dashed #7258cf;
}
.language-control {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.language-control select {
  font: inherit;
  min-height: 40px;
  max-width: 130px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px;
  background: #fff;
  color: var(--color-text);
}
.brand__name {
  font-size: 24px;
}
.header-nav {
  gap: 14px;
}
.mode-switch button > span {
  display: inline;
  font-size: 14px;
}
.mode-switch small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
}
.mode-switch button svg {
  vertical-align: middle;
  margin-right: 4px;
}
.play-workspace {
  grid-template-areas: "intro intro" "game controls" "game tip";
  grid-template-rows: auto auto 1fr;
}
.game-mount {
  isolation: isolate;
}
.rotation-bar {
  gap: 8px;
}
.overlay {
  z-index: 5;
  gap: 14px;
}
.overlay p {
  font-size: 14px;
  max-width: 280px;
  text-align: center;
  color: var(--muted);
}
.overlay .secondary-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--purple);
}
.game-status {
  min-height: 24px;
  font-size: 12px;
  color: var(--purple);
  line-height: 1.7;
}
.session-note.save-warning {
  display: block !important;
  color: #964a1c;
  font-size: 12px;
  line-height: 1.5;
}
.rules-page {
  max-width: 760px;
  margin: 30px auto;
  padding: 24px;
  line-height: 1.9;
  user-select: text;
}
.rules-page h1 {
  max-width: none;
}
.rules-page .language-control {
  margin: 24px 0;
}
.rules-page p,
.rules-content p {
  font-size: 15px;
}
.rules-page .primary-button {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  padding: 12px 24px;
  margin-top: 20px;
}
.boot {
  padding: 40px;
  text-align: center;
}
.boot button {
  padding: 12px 20px;
}
.site-footer {
  margin-top: 28px;
}
.control-card h2 {
  line-height: 1.45;
}
.board-instruction {
  line-height: 1.8;
}
@media (max-width: 900px) {
  .play-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "controls" "game" "intro" "tip";
    grid-template-rows: auto;
  }
  .control-card {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .mode-switch {
    grid-column: 1/-1;
    margin: 0;
  }
  .tools {
    grid-column: 1;
    gap: 6px;
  }
  .tool-button {
    padding: 7px 5px;
    font-size: 12px;
  }
  .tool-button small {
    font-size: 10px;
  }
  .new-game-button {
    grid-column: 2;
    margin: 0;
  }
  .brand__name {
    font-size: 21px;
  }
  .header-nav {
    gap: 8px;
  }
  .header-nav .install-button {
    display: none;
  }
  .header-nav > a {
    display: none;
  }
  .language-control select {
    max-width: 115px;
  }
  .page-main {
    padding-top: 16px;
  }
  .rules-page {
    margin-top: 0;
  }
  .intro {
    padding-bottom: 8px;
  }
  .overlay__heading {
    font-size: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Native platform: lobby, community, competition and CMS. */
#portal {
  width: 100%;
  min-height: 100vh;
}
#portal button,
#portal input,
#portal select,
#portal textarea,
.cms button,
.cms input,
.cms select,
.cms textarea {
  font: inherit;
}
#portal button:not(.board__cell):not(.tray__slot),
.cms button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--color-text);
  cursor: pointer;
}
#portal button:disabled:not(.board__cell):not(.tray__slot),
.cms button:disabled {
  opacity: 0.5;
  cursor: default;
}
#portal .primary-button,
.cms .primary-button {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}
.portal-header {
  min-height: 76px;
  padding: 14px max(20px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.portal-header .language-control {
  margin-left: auto;
}
.profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-menu small {
  display: block;
  text-align: left;
  color: var(--muted);
}
#portal-content {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 24px 20px 120px;
}
.portal-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 5px;
}
.portal-nav button {
  white-space: nowrap;
}
.portal-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  min-height: 300px;
}
.portal-panel h1 {
  font-size: 26px;
  max-width: none;
  margin: 0;
}
.portal-panel h2 {
  font-size: 19px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
}
.portal-panel p {
  line-height: 1.8;
}
.portal-panel .selected,
.tabs .selected,
#portal .selected {
  background: #eee9ff;
  border-color: #b9a8ed;
  color: #6347ce;
}
.lobby-actions,
.room-toolbar,
.row-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.portal-panel label,
dialog label,
.cms label {
  display: grid;
  gap: 7px;
  color: #56627d;
  font-size: 14px;
  margin: 12px 0;
}
.portal-panel input,
.portal-panel select,
dialog input,
dialog select,
.cms input,
.cms select,
.cms textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  color: var(--color-text);
  background: #fff;
}
.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 22px 0;
}
.inline-form label {
  margin: 0;
  flex: 1;
}
.inline-form input {
  max-width: 320px;
}
.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 20px 0;
  padding-bottom: 6px;
}
.tabs button {
  white-space: nowrap;
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.room-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  overflow: hidden;
}
.room-card h2 {
  margin: 10px 0;
}
.room-card p {
  font-size: 13px;
  color: var(--muted);
}
.room-card .room-art {
  width: 100%;
  height: 120px;
}
.room-art {
  background: linear-gradient(135deg, #e9e5ff, #d5e6f7) !important;
  display: grid;
  place-items: center;
  border: 0 !important;
  overflow: hidden;
}
.room-art.space-2,
.room-art.space-7 {
  background: linear-gradient(135deg, #e1f4e9, #c3e2d0) !important;
}
.room-art.space-3,
.room-art.space-8 {
  background: linear-gradient(135deg, #fff1da, #efd1aa) !important;
}
.room-art.space-4,
.room-art.space-9 {
  background: linear-gradient(135deg, #f4def4, #e7bfdc) !important;
}
.room-art.space-5,
.room-art.space-10 {
  background: linear-gradient(135deg, #ddebf8, #b9d4ef) !important;
}
.room-art.space-6,
.room-art.space-11 {
  background: linear-gradient(135deg, #e7edf2, #cad6e3) !important;
}
.block-art {
  display: grid;
  grid-template-columns: 20px 20px;
  gap: 4px;
  transform: rotate(-8deg);
}
.block-art i {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #8b73dc;
}
.block-art i:nth-child(3) {
  opacity: 0.4;
}
.full-room {
  color: #b72c49 !important;
}
.pager {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
}
.empty-state {
  padding: 24px;
  color: var(--muted);
}
.text-link {
  border: 0 !important;
  background: transparent !important;
  color: var(--purple) !important;
  padding: 0 !important;
  min-height: 30px !important;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.top-five {
  padding: 14px;
  background: #f8f5ff;
  border-radius: 10px;
  margin-bottom: 20px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 500;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #e9e2ff;
  color: #6750c8;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.avatar[data-avatar$="2"],
.avatar[data-avatar$="6"] {
  background: #d9f4e7;
  color: #237b56;
}
.avatar[data-avatar$="3"],
.avatar[data-avatar$="7"] {
  background: #fff0d1;
  color: #a56623;
}
.avatar[data-avatar$="4"],
.avatar[data-avatar$="8"] {
  background: #f7dfee;
  color: #a24279;
}
.frame-1 {
  outline: 3px solid #b6a1e6;
}
.frame-2 {
  outline: 3px dashed #54a77d;
}
.frame-3 {
  outline: 3px solid #dfa44d;
}
.frame-4 {
  outline: 3px dotted #c86bb0;
}
.frame-5 {
  outline: 3px double #5b9cca;
}
.frame-6 {
  outline: 4px double #cfad45;
  box-shadow: 0 0 0 3px #f7edcc;
}
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.person > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.person p,
.person small {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0;
}
.member-list {
  margin: 20px 0;
}
.share-room {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.share-room code {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.icon-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.icon-picker .room-art {
  height: 60px;
}
.icon-picker .selected {
  outline: 3px solid var(--purple);
}
.checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
}
.checkbox input {
  width: 20px;
  height: 20px;
  min-height: 20px;
}
.practice-choices {
  display: grid;
  gap: 16px;
  max-width: 450px;
  margin: 25px auto;
}
.practice-choices a {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.competition-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin: 14px 0;
}
.competition-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #269b66;
  margin-right: 7px;
}
.competition-dot.SCHEDULED {
  background: #dcab42;
}
.competition-dot.CLOSED {
  background: #bf4b60;
}
.filter-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.filter-form label {
  flex: 1;
  min-width: 140px;
}
.filter-form button {
  margin-bottom: 12px;
}
.wallet {
  padding: 18px;
  background: #f6f3ff;
  border-radius: 12px;
  margin: 16px 0;
}
.mission {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.mission > span {
  min-width: 230px;
}
.mission progress {
  accent-color: var(--purple);
}
.achievement-grid,
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.achievement,
.cosmetic {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.achievement {
  opacity: 0.5;
}
.achievement.earned {
  opacity: 1;
  background: #f4f0ff;
}
.achievement > span {
  font-size: 40px;
  color: #ad87df;
}
.cosmetic-preview {
  padding: 30px;
  background: #f7f5fd;
  border-radius: 10px;
}
.cosmetic h3,
.achievement h3 {
  font-size: 14px;
}
.cosmetic .avatar {
  width: 70px;
  height: 70px;
  font-size: 30px;
}
.portal-footer {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.portal-footer a {
  color: var(--purple);
}
.bootstrap-form {
  max-width: 440px;
  margin: 30px auto;
}
.notice {
  padding: 18px;
  background: #fff3db;
  border-radius: 12px;
}
.menu-list {
  display: grid;
  gap: 8px;
}
.tutorial-frame {
  width: 100%;
  height: 700px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.remote-game {
  max-width: 720px;
  margin: auto;
}
.game-top {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}
.game-top > div {
  flex: 1;
  display: grid;
  gap: 5px;
}
.game-top strong {
  font-size: 28px;
}
.game-top small {
  font-size: 12px;
  color: var(--muted);
}
.run-timer {
  color: var(--purple);
}
.remote-game .board {
  margin: auto;
}
.remote-game .game-mount {
  grid-template-areas: "board" "tray";
}
.remote-game #remote-result {
  text-align: center;
  padding: 20px;
}
.replay-board {
  --cell-size: min(5vw, 32px);
  width: max-content;
  margin: 20px auto;
}
.share-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 20px 0;
}
#portal-dialog {
  width: min(640px, calc(100vw - 24px));
  padding-top: 48px;
}
#modal-error {
  color: #ae3150;
  font-size: 14px;
}
.chat-toggle {
  background: #6850d8 !important;
  color: white !important;
}
.chat-dot {
  color: #f0a5a5;
}
.chat-dot.connected {
  color: #8aefbd;
}
#chat-widget {
  position: fixed;
  right: 20px;
  bottom: 16px;
  width: 350px;
  z-index: 80;
  font-size: 13px;
}
.chat-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 40px #26324c25;
  padding: 10px;
}
.chat-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.chat-tab {
  display: flex;
  flex-shrink: 0;
  background: #f5f3fb;
  border-radius: 8px;
}
.chat-tab.selected {
  background: #e6ddfc;
}
.chat-tab button {
  border: 0 !important;
  padding: 6px !important;
  min-height: 32px !important;
  background: transparent !important;
}
.chat-history {
  height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.chat-message {
  background: #f3f1f8;
  border-radius: 9px;
  padding: 8px 10px;
  margin: 8px 4px;
}
.chat-message.mine {
  background: #eae4fc;
}
.chat-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 5px 0;
  line-height: 1.5;
}
#chat-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
#chat-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
#chat-form button {
  padding: 6px 9px;
}
.chat-error {
  color: #aa3451;
  font-size: 12px;
}
.portal-ad {
  margin: 20px auto;
  max-width: 970px;
  min-height: 90px;
}
.cms {
  width: min(1200px, 100%);
  padding: 24px;
  margin: auto;
  user-select: text;
}
.cms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cms textarea {
  font-family: monospace;
  min-height: 450px;
  white-space: pre;
}
.cms pre {
  overflow: auto;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  font-size: 13px;
  max-height: 600px;
}
.cms nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 24px 0;
}
@media (max-width: 900px) {
  .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-header {
    padding: 12px 16px;
    gap: 10px;
  }
  .profile-menu > span:not(.avatar) {
    display: none;
  }
  .achievement-grid,
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-panel {
    padding: 16px;
  }
  .game-top {
    gap: 10px;
  }
  .game-top strong {
    font-size: 24px;
  }
}
@media (max-width: 600px) {
  .portal-header .brand__name {
    font-size: 19px;
  }
  .portal-header .brand img {
    width: 28px;
    height: 28px;
  }
  .portal-header {
    gap: 8px;
  }
  .portal-header .language-control select {
    width: 100px;
    font-size: 12px;
  }
  .profile-menu {
    padding: 3px !important;
  }
  .profile-menu .avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  #portal-content {
    padding: 16px 10px 90px;
  }
  .portal-panel h1 {
    font-size: 22px;
  }
  .room-grid {
    grid-template-columns: 1fr;
  }
  .room-card {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 5px 14px;
  }
  .room-card .room-art {
    height: 110px;
    grid-row: 1/5;
  }
  .room-card h2,
  .room-card p {
    margin: 0;
  }
  .room-card small {
    grid-column: 2;
  }
  .room-card > button:last-child {
    grid-column: 2;
  }
  .room-card .room-art {
    grid-column: 1;
  }
  .person {
    flex-wrap: wrap;
  }
  .person .row-actions {
    width: 100%;
    margin: 5px 0;
  }
  .collection-grid,
  .achievement-grid {
    gap: 8px;
  }
  .cosmetic,
  .achievement {
    padding: 12px;
  }
  .cosmetic-preview {
    padding: 16px;
  }
  .panel-title {
    align-items: start;
  }
  .panel-title button {
    font-size: 11px !important;
    padding: 8px !important;
  }
  .portal-nav button {
    padding: 8px 11px !important;
    font-size: 13px !important;
  }
  .game-top button {
    font-size: 12px !important;
  }
  .remote-game .board-instruction {
    font-size: 12px;
  }
  .mission > span {
    min-width: 0;
    width: 100%;
  }
  #chat-widget {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(350px, calc(100vw - 16px));
  }
  .chat-history {
    height: min(260px, 35dvh);
  }
  .chat-box {
    max-height: 75dvh;
  }
  #portal-dialog {
    padding: 48px 18px 22px;
  }
  .icon-picker {
    grid-template-columns: repeat(4, 1fr);
  }
  .portal-panel .inline-form {
    flex-wrap: wrap;
  }
  .inline-form label {
    min-width: 140px;
  }
  .inline-form input {
    max-width: none;
  }
  .cms {
    padding: 14px;
  }
  .cms nav {
    overflow: auto;
    flex-wrap: nowrap;
  }
  .cms nav button {
    white-space: nowrap;
  }
  .cms textarea {
    font-size: 12px;
  }
}
@media (min-width: 1200px) {
  body.chat-open #portal-content {
    width: calc(100% - 400px);
    max-width: 1120px;
    margin-left: max(20px, calc((100vw - 1560px) / 2));
    margin-right: 380px;
  }
  .public-share {
    text-align: center;
  }
  .share-score {
    display: block;
    font-size: 80px;
    color: var(--purple);
    margin: 30px;
  }
}
.remote-game .game-top {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 4;
  padding: 12px 0;
}
.remote-game .run-timer {
  text-align: right;
}
html[data-theme="theme-1"] {
  --color-bg: #f0f7f4;
  --purple: #368567;
}
html[data-theme="theme-2"] {
  --color-bg: #fff8ef;
  --purple: #a26d34;
}
html[data-theme="theme-3"] {
  --color-bg: #f4f0fa;
  --purple: #7752a6;
}
.avatar[data-avatar="avatar-5"] {
  background: linear-gradient(45deg, #dce7ff, #eacdf9);
  border-radius: 50%;
}
.avatar[data-avatar="avatar-6"] {
  border-radius: 50% 12%;
}
.avatar[data-avatar="avatar-7"] {
  border-radius: 12% 50%;
}
.avatar[data-avatar="avatar-8"] {
  border-radius: 50%;
  outline: 2px dashed currentColor;
  outline-offset: -5px;
}
.tutorial-mode .site-header,
.tutorial-mode .intro,
.tutorial-mode .tip-card,
.tutorial-mode .site-footer {
  display: none;
}
.tutorial-mode .page-main {
  padding: 10px;
}
.tutorial-mode .play-workspace {
  grid-template-areas: "controls" "game";
  grid-template-columns: 1fr;
  max-width: 500px;
}
.tutorial-steps {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}
.tutorial-steps li {
  padding: 12px;
  background: #f1eff8;
  border-radius: 8px;
}
.tutorial-steps .completed {
  background: #d9f4e7;
  color: #22714e;
}
.tutorial-steps .completed::after {
  content: " ✓";
}
.cms-switches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

/* Block Puzzle arcade: consistent entry, lobby, community and game surfaces. */
body:has(#portal) {
  background: #0c1425;
}
#portal {
  --color-bg: #0c1425;
  --color-text: #edf3ff;
  --muted: #98a9c4;
  --line: #2a3952;
  --purple: #9b8fff;
  --color-board: #20314b;
  --color-cell-empty: #304461;
  color: var(--color-text);
  background: radial-gradient(ellipse at 5% 0%, #16414a80, transparent 50%),
    radial-gradient(ellipse at 100% 45%, #3d2b5940, transparent 50%), #0c1425;
  min-height: 100dvh;
}
#portal .portal-header {
  background: #111d30ee;
  border-bottom: 1px solid #ffffff0d;
  min-height: 76px;
  padding: 14px max(24px, calc((100vw - 1340px) / 2));
  gap: 18px;
}
#portal .brand {
  color: #f3f6ff;
  font-size: 23px;
  letter-spacing: -0.8px;
}
#portal .brand__name > span {
  color: #77e2c0;
}
#portal .portal-header .language-control select {
  background: #1b2a40;
  color: #b3c3da;
  border: 1px solid #33445e;
  border-radius: 9px;
  padding: 9px;
}
#portal .profile-menu {
  background: #1c2b42;
  border-color: #34445d;
  color: #e8f0ff;
  min-height: 46px;
}
#portal .profile-menu small {
  color: #91a3bd;
  font-size: 11px;
}
#portal .profile-menu .avatar {
  width: 35px;
  height: 35px;
}
#portal-content,
#initial-landing {
  width: min(1340px, 100%);
  margin: auto;
  padding: 24px 24px 60px;
}
#portal-content[data-page="welcome"],
#initial-landing {
  max-width: 1190px;
  padding-top: 42px;
}
#portal .ui-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
#portal a {
  color: #a99bff;
  text-decoration: none;
}
#portal button:not(.board__cell):not(.tray__slot) {
  background: #23334c;
  color: #d9e4f7;
  border: 1px solid #35465f;
  border-radius: 10px;
  min-height: 42px;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
#portal button:not(.board__cell):not(.tray__slot):hover {
  background: #2e405d;
  border-color: #5e7292;
}
#portal button.primary-button:not(.board__cell):not(.tray__slot),
#portal a.primary-button {
  background: #ffd36d;
  color: #342810;
  border-color: #ffda82;
  box-shadow: 0 3px 0 #b98a37;
  font-weight: 800;
}
#portal button.primary-button:not(.board__cell):not(.tray__slot):hover,
#portal a.primary-button:hover {
  background: #ffe095;
  border-color: #ffe095;
  transform: translateY(-1px);
}
#portal button:disabled:not(.board__cell):not(.tray__slot) {
  opacity: 0.42;
  transform: none;
  box-shadow: none;
  cursor: default;
}
#portal a.primary-button,
#portal a.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}
#portal a.secondary-button {
  background: #25354e;
  color: #d4e0f5;
  border: 1px solid #3b4c67;
}
#portal button:focus-visible,
#portal a:focus-visible,
#portal input:focus-visible,
#portal select:focus-visible {
  outline: 3px solid #79dec1;
  outline-offset: 3px;
}
#portal .portal-panel {
  background: #142136;
  border: 1px solid #2b3a53;
  border-radius: 18px;
  padding: 26px;
  min-height: 300px;
  box-shadow: 0 12px 45px #00000012;
}
#portal .portal-panel p {
  color: #a4b4cf;
  line-height: 1.75;
}
#portal .portal-panel h1 {
  color: #edf3ff;
  font-size: 25px;
  letter-spacing: -0.7px;
}
#portal .panel-title {
  margin-bottom: 25px;
}
#portal-content[data-page="lobby"] > .portal-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#portal-content[data-page="lobby"] > .portal-panel > .panel-title {
  display: none;
}
#portal .portal-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #28364e;
  padding-bottom: 16px;
  margin-bottom: 26px;
}
#portal .portal-nav button:not(.board__cell):not(.tray__slot) {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  color: #9fb0cb;
  border: 1px solid transparent;
  padding: 11px 18px;
  white-space: nowrap;
}
#portal .portal-nav button.selected:not(.board__cell):not(.tray__slot) {
  background: #26433f;
  border-color: #416b60;
  color: #98efcf;
}
#portal .portal-nav .ui-icon {
  width: 18px;
  height: 18px;
}
#portal label,
#portal legend {
  color: #b1bfd5;
  font-size: 13px;
}
#portal input:not([type="radio"]):not([type="checkbox"]),
#portal select,
#portal textarea {
  background: #101c30;
  color: #e9f1ff;
  border: 1px solid #3a4d6b;
  border-radius: 9px;
  padding: 11px 12px;
  min-height: 44px;
  font: inherit;
}
#portal input::placeholder,
#portal textarea::placeholder {
  color: #7086a5;
}
#portal input:focus,
#portal select:focus,
#portal textarea:focus {
  border-color: #8adfc5;
}
#portal option {
  background: #192b43;
  color: #e5efff;
}
#portal .text-link {
  color: #c6b8ff;
}
#portal button.text-link:not(.board__cell):not(.tray__slot) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 28px;
  text-align: left;
  font-weight: 600;
  color: #dce7fa;
}
#portal .selected:not(.tray__slot),
#portal .tabs button.selected:not(.board__cell):not(.tray__slot) {
  background: #343252;
  color: #d0c5ff;
  border-color: #706398;
}
.eyebrow {
  display: block;
  color: #73d8bf;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.8;
}
.entry-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #17263c;
  border: 1px solid #ffffff15;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 90px #02081540;
}
.entry-art {
  position: relative;
  overflow: hidden;
  min-height: 645px;
  padding: 35px;
  background: radial-gradient(circle at 45% 35%, #39918860, transparent 55%),
    linear-gradient(145deg, #1d3e4d, #1b2a46 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
}
.entry-art::before,
.entry-art::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  border: 1px solid #ffffff0a;
  border-radius: 50%;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: -1;
}
.entry-art::after {
  width: 380px;
  height: 380px;
}
.entry-art > .eyebrow {
  align-self: start;
  font-size: 9px;
  color: #9dcfc9;
}
.entry-art-caption {
  text-align: center;
  position: relative;
  margin-top: 20px;
}
.entry-art-caption h2 {
  font-size: 28px;
  color: #e6f3f1;
  margin: 16px 0 9px;
  letter-spacing: -0.8px;
}
.entry-art-caption p {
  max-width: 310px;
  line-height: 1.8;
  color: #a5c4ca;
  font-size: 13px;
  margin: 0 auto;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #f4d482;
  border: 1px solid #f4d48240;
  border-radius: 40px;
  padding: 6px 12px;
  background: #f4d4820c;
}
#portal .live-pill .ui-icon {
  width: 13px;
  height: 13px;
}
.hero-art {
  position: relative;
  width: min(100%, 350px);
  aspect-ratio: 1;
  margin: 20px auto 0;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.hero-board {
  width: 83%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  padding: 13px;
  background: #152940;
  border: 2px solid #6da99c;
  border-radius: 18px;
  transform: rotate(-10deg);
  box-shadow:
    0 14px 0 #0b1b2d,
    0 24px 45px #050e2680;
}
.art-cell {
  background: #294257;
  border-radius: 3px;
}
.art-color-1 {
  background: #a78aea;
  box-shadow: inset 0 -3px 0 #7957b0;
}
.art-color-2 {
  background: #f7bd56;
  box-shadow: inset 0 -3px 0 #bd8634;
}
.art-color-3 {
  background: #72d3b6;
  box-shadow: inset 0 -3px 0 #42a88c;
}
.art-color-4 {
  background: #7daeea;
  box-shadow: inset 0 -3px 0 #4d7cb4;
}
.art-color-5 {
  background: #ee8ba6;
  box-shadow: inset 0 -3px 0 #b65476;
}
.art-color-6 {
  background: #aa9bdc;
  box-shadow: inset 0 -3px 0 #7f6fad;
}
.art-color-7 {
  background: #92cca0;
  box-shadow: inset 0 -3px 0 #5c9b6c;
}
.art-label {
  position: absolute;
  top: 14%;
  right: 0;
  background: #f6d079;
  color: #423417;
  border: 3px solid #ffe4a9;
  font-size: 13px;
  font-weight: 900;
  padding: 9px 13px;
  border-radius: 11px;
  transform: rotate(12deg);
  box-shadow: 0 8px 20px #0003;
}
.art-spark {
  position: absolute;
  bottom: 9%;
  left: -2%;
  font-size: 45px;
  color: #f8d57e;
}
.art-orbit {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #68d6be;
  top: 8%;
  left: 14%;
  border-radius: 5px;
  transform: rotate(18deg);
}
.orbit-two {
  width: 17px;
  height: 17px;
  top: auto;
  left: auto;
  right: 17%;
  bottom: 5%;
  background: #bb97ee;
}
.scene-spark {
  position: absolute;
  color: #ffe29b;
  font-size: 33px;
}
.scene-spark--one {
  right: 8%;
  top: 19%;
}
.scene-spark--two {
  left: 7%;
  bottom: 25%;
}
.entry-form {
  padding: 34px 38px 25px;
}
.entry-form h1 {
  font-size: 49px;
  line-height: 1.06;
  letter-spacing: -2px;
  margin: 12px 0 15px;
  color: #f4f7ff;
  max-width: none;
}
.entry-form h1 > span {
  color: #ffd36d;
}
.entry-description {
  line-height: 1.8;
  color: #a4b6d1;
  font-size: 14px;
  margin: 0 0 22px;
}
#portal .bootstrap-form {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
#portal .bootstrap-form > label {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #c9d7ec;
}
#portal .bootstrap-form input[name="name"] {
  width: 100%;
  height: 48px;
  font-size: 15px;
}
.input-hint {
  font-size: 10px;
  color: #8196b4;
  margin: 7px 0 18px;
}
#portal .avatar-picker {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
#portal .avatar-picker legend {
  margin-bottom: 9px;
  font-weight: 700;
  font-size: 12px;
}
#portal .avatar-picker > label {
  position: relative;
  margin: 0;
  cursor: pointer;
  display: block;
}
.avatar-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.avatar-picker label > span:not(.sr-only) {
  display: grid;
  place-items: center;
  min-height: 53px;
  border: 1px solid #3a4d66;
  background: #223750;
  border-radius: 12px;
  transition:
    border 0.15s,
    background 0.15s;
  position: relative;
}
.avatar-picker label .avatar {
  width: 44px;
  height: 44px;
  background: transparent;
}
.avatar-picker label b {
  display: none;
  position: absolute;
  right: -4px;
  bottom: -3px;
  background: #ffd36d;
  color: #34310e;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  text-align: center;
}
.avatar-picker input:checked + span {
  border: 2px solid #ffd978;
  background: #45513f;
}
.avatar-picker input:checked + span b {
  display: block;
}
.avatar-picker input:focus-visible + span {
  outline: 3px solid #77dfc2;
  outline-offset: 3px;
}
.avatar svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}
#portal button.entry-submit:not(.board__cell):not(.tray__slot) {
  width: 100%;
  min-height: 49px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 11px;
  padding: 12px 19px;
  font-size: 16px;
}
.entry-note {
  text-align: center;
  font-size: 10px;
  line-height: 1.6;
  color: #8396b3;
  margin: 10px 0 0;
}
.entry-solo {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ffffff10;
}
.entry-solo > span {
  color: #849ab8;
  font-size: 11px;
}
.entry-solo .text-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 10px;
}
.entry-features {
  display: flex;
  gap: 35px;
  align-items: center;
  justify-content: center;
  padding: 26px 0 0;
  color: #8298b7;
  font-size: 11px;
}
.entry-features > span {
  display: flex;
  gap: 7px;
  align-items: center;
}
#portal .entry-features .ui-icon {
  width: 15px;
  height: 15px;
  color: #5f9f9e;
}
#portal .mode-picker {
  display: flex;
  min-width: 0;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  border: 0;
}
#portal .mode-picker legend {
  font-size: 10px;
  color: #8ca2bf;
  margin-bottom: 7px;
}
#portal .mode-picker label {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  cursor: pointer;
  position: relative;
}
.mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.mode-option > span {
  display: grid;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid #3b4c69;
  border-radius: 9px;
  background: #1b2c44;
}
.mode-option b {
  font-size: 11px;
  color: #b6c7e0;
  font-weight: 700;
}
.mode-option small {
  font-size: 10px;
  color: #7c93b4;
}
.mode-option input:checked + span {
  border-color: #8bcfb9;
  background: #29483f;
  box-shadow: 0 0 0 1px #8bcfb930;
}
.mode-option input:checked + span b {
  color: #b0edcf;
}
.mode-option input:focus-visible + span {
  outline: 3px solid #ffd978;
  outline-offset: 3px;
}
.entry-solo .mode-picker {
  margin-top: 8px;
  margin-bottom: 0;
}
.entry-solo .mode-picker legend,
.entry-solo .mode-option small {
  display: none;
}
.hub-welcome {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.hub-welcome h2 {
  color: #edf4ff;
  font-size: 29px;
  letter-spacing: -1px;
  line-height: 1.3;
  margin: 7px 0;
}
#portal .hub-welcome p {
  font-size: 13px;
  margin: 0;
  color: #8fa4c4;
}
.hub-live {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 11px;
  color: #8fbaa9;
  border: 1px solid #3a5a4b;
  background: #1b332c;
  border-radius: 30px;
  padding: 9px 12px;
}
.hub-live i,
.room-state i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #83d6ae;
}
.hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 24px;
}
.hub-main {
  min-width: 0;
}
.hub-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.hub-actions > article {
  display: flex;
  flex-direction: column;
  align-items: start;
  border: 1px solid #33415b;
  border-radius: 16px;
  padding: 20px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.quick-card {
  background: linear-gradient(145deg, #23473e, #1b332e);
  border-color: #3e6c59 !important;
}
.create-card {
  background: linear-gradient(145deg, #2d2d4f, #212940);
}
.solo-card {
  background: linear-gradient(145deg, #263b51, #1c2a40);
}
.quick-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}
.action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #ffffff0b;
  color: #9de6c7;
  border: 1px solid #ffffff10;
  border-radius: 10px;
}
.create-card .action-icon {
  color: #bea1f1;
}
.solo-card .action-icon {
  color: #8ec6f8;
}
.card-tag {
  color: #86b9a2;
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
#portal .hub-actions h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  color: #e8f2fc;
  margin: 14px 0 8px;
}
#portal .hub-actions p {
  font-size: 11px;
  color: #8fa9c3;
  margin: 0 0 12px;
  line-height: 1.7;
}
.hub-actions .mode-picker {
  width: 100%;
}
.hub-actions .mode-option small {
  display: none;
}
#portal .hub-actions .mode-option b {
  font-size: 10px;
}
.hub-actions .mode-option > span {
  padding: 8px;
}
#portal .hub-actions button:not(.board__cell):not(.tray__slot) {
  width: 100%;
  margin-top: auto;
  font-size: 12px;
}
.quick-settings {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
#portal .quick-settings label {
  font-size: 10px;
  margin: 0;
  flex: 1;
}
#portal .quick-settings select {
  min-height: 33px;
  font-size: 11px;
  width: 87px;
  padding: 5px 8px;
}
.mini-avatars {
  display: flex;
  align-items: center;
  margin: 10px 0 25px;
}
.mini-avatars > .avatar {
  width: 35px;
  height: 35px;
  margin-right: -8px;
  border: 2px solid #292e4c;
}
.mini-avatars > span:last-child {
  margin-left: 13px;
  font-size: 11px;
  color: #a69eca;
}
.infinity-mark {
  font-size: 80px;
  font-weight: 200;
  line-height: 0.8;
  margin: 12px auto 25px;
  color: #668bad;
}
.rooms-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}
.rooms-heading h2 {
  color: #e6effe;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  font-size: 22px;
  letter-spacing: -0.5px;
}
.count-badge {
  font-size: 10px;
  color: #8da5c6;
  background: #25344c;
  border: 1px solid #35445e;
  padding: 3px 8px;
  border-radius: 6px;
}
#portal .join-strip {
  margin: 0;
  align-items: end;
  gap: 6px;
  max-width: 275px;
}
#portal .join-strip label {
  margin: 0;
  color: #859bb9;
  font-size: 10px;
}
#portal .join-strip input {
  min-height: 37px;
  padding: 8px 10px;
  width: 100%;
  max-width: none;
  font-size: 12px;
}
#portal .join-strip button {
  min-height: 37px;
  padding: 7px 10px;
}
#portal .room-filters {
  align-items: center;
  margin: 0 0 20px;
  gap: 7px;
  border-bottom: 1px solid #29384e;
  padding-bottom: 16px;
}
#portal .room-filters button:not(.board__cell):not(.tray__slot) {
  font-size: 11px;
  border-color: transparent;
  background: transparent;
  min-height: 34px;
  padding: 7px 12px;
}
#portal .room-filters button.selected:not(.board__cell):not(.tray__slot) {
  background: #293a54;
  border-color: #405474;
  color: #ecf3ff;
}
.bot-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #6f85a4;
  font-size: 9px;
  white-space: nowrap;
}
#portal .bot-legend .ui-icon {
  width: 14px;
  height: 14px;
}
#portal .room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
#portal .room-card {
  padding: 0;
  border: 1px solid #2e3d56;
  border-radius: 14px;
  background: #17263d;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px #0000000d;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
#portal .room-card:hover {
  border-color: #65759a;
  transform: translateY(-2px);
}
#portal .room-card button.room-art:not(.board__cell):not(.tray__slot) {
  padding: 0;
  min-height: 0;
  height: auto;
  aspect-ratio: 360/190;
  width: 100%;
  border: 0;
  border-radius: 0;
  position: relative;
  display: block;
  background: #1d3449 !important;
}
.room-picture {
  display: block;
  width: 100%;
  height: 100%;
}
.room-art-label {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  background: #101e30ce;
  color: #c1ddd9;
  border: 1px solid #ffffff15;
  border-radius: 6px;
  padding: 5px 7px;
}
#portal .room-art-label .ui-icon {
  width: 11px;
  height: 11px;
}
.room-card-content {
  padding: 14px;
}
.room-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  color: #7b93b5;
  font-size: 9px;
}
.room-state {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8cd4b6;
}
.room-state.is-playing {
  color: #ffd681;
}
.room-state.is-playing i {
  background: #ffd681;
}
.room-card h3 {
  margin: 12px 0 7px;
  line-height: 1.3;
  font-size: 14px;
}
#portal .room-card h3 button.text-link:not(.board__cell):not(.tray__slot) {
  font-size: 14px;
  font-weight: 750;
  color: #e4eeff;
  min-height: 0;
}
#portal .room-card .room-host {
  font-size: 10px;
  color: #8198b8;
  margin: 0 0 10px;
}
.room-rule-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.room-rule-badges > span {
  display: flex;
  gap: 4px;
  align-items: center;
  background: #24354e;
  color: #9cb2d0;
  font-size: 9px;
  border-radius: 5px;
  padding: 4px 6px;
}
#portal .room-rule-badges .ui-icon {
  width: 11px;
  height: 11px;
}
.room-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid #2b3a52;
  margin-top: 14px;
  padding-top: 12px;
}
.room-card-bottom > span {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #8ca3c4;
  font-size: 11px;
}
#portal .room-card-bottom > span .ui-icon {
  width: 15px;
  height: 15px;
  margin-right: 4px;
}
#portal button.join-room-button:not(.board__cell):not(.tray__slot) {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #2e4e45;
  border: 1px solid #4b7b67;
  color: #b6f0cf;
  font-size: 10px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
}
#portal button.join-room-button .ui-icon {
  width: 13px;
  height: 13px;
}
#portal button.full-room:not(.board__cell):not(.tray__slot) {
  color: #ff9ca5;
  border-color: #7b4653;
  font-size: 10px;
}
.hub-sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}
.sidebar-card {
  border: 1px solid #33415b;
  background: #19283e;
  border-radius: 15px;
  padding: 20px;
}
.sidebar-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: #c9c1ed;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sidebar-card h3 {
  font-size: 18px;
  color: #e9f1fd;
  letter-spacing: -0.5px;
  margin: 14px 0 10px;
}
#portal .sidebar-card p {
  font-size: 11px;
  color: #839bbc;
  line-height: 1.8;
}
#portal .sidebar-button {
  width: 100%;
  font-size: 11px;
  margin-top: 12px;
}
.sidebar-wallet {
  border-top: 1px solid #33415c;
  margin-top: 18px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b9a786;
  font-size: 10px;
}
.sidebar-wallet strong {
  color: #f2d18e;
  font-size: 16px;
}
.goal-progress {
  height: 5px;
  background: #2b3b54;
  border-radius: 20px;
  margin: 16px 0 8px;
  overflow: hidden;
}
.goal-progress > span {
  height: 100%;
  background: #a3d5b4;
  display: block;
}
.sidebar-card > small {
  color: #7c92b3;
  font-size: 10px;
}
.guide-card {
  background: linear-gradient(145deg, #253c3c, #182b35);
  border-color: #355b52;
}
.guide-card .sidebar-kicker {
  color: #84bda8;
}
.guide-card ul {
  padding-left: 16px;
  color: #8eaaa9;
  font-size: 11px;
  line-height: 2;
}
.sidebar-help {
  font-size: 12px;
  color: #8295b7 !important;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#portal .empty-rooms {
  grid-column: 1/-1;
  text-align: center;
  border: 1px dashed #3e4e69;
  border-radius: 14px;
  padding: 30px;
  background: #17253a;
  color: #728eae;
}
#portal .empty-rooms > .ui-icon {
  width: 35px;
  height: 35px;
}
#portal .empty-rooms h2 {
  font-size: 18px;
  color: #b5c7e1;
}
#portal .empty-rooms p {
  font-size: 12px;
  margin: 0 auto;
  max-width: 450px;
}
#portal .top-five {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  margin-bottom: 18px;
  color: #e9cc83;
  font-size: 11px;
  background: #3c34272e;
  border-radius: 8px;
  overflow: hidden;
}
#portal .top-five button {
  white-space: nowrap;
}
#portal .notice {
  background: #30324c;
  border-color: #645a86;
  color: #ded0ff;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin: 20px 0;
}
#portal .pager {
  color: #8fa4c5;
  font-size: 12px;
  margin-top: 22px;
}
#portal .pager button {
  font-size: 11px;
  min-height: 34px;
}
#portal .portal-footer {
  color: #607898;
  font-size: 10px;
  border-top: 1px solid #ffffff0a;
  margin: 0 max(24px, calc((100vw - 1340px) / 2));
  padding: 22px 0;
  text-align: center;
}
#portal .portal-footer a {
  color: #8d9ab9;
}
#portal-dialog {
  background: #182940;
  color: #e7f0ff;
  border: 1px solid #40526d;
  border-radius: 18px;
  max-height: calc(100dvh - 32px);
}
#portal-dialog::backdrop {
  background: #030a17c9;
  backdrop-filter: blur(5px);
}
#portal-dialog .dialog-close {
  color: #b7c7e1;
  background: #253952;
  border-color: #3d536f;
}
#portal-dialog input,
#portal-dialog select,
#portal-dialog textarea {
  width: 100%;
}
#portal-dialog label {
  color: #a2b4d2;
}
#portal .icon-picker .room-art {
  padding: 0;
  border-radius: 9px;
  overflow: hidden;
  height: auto;
  aspect-ratio: 360/190;
}
#portal .member-list .person {
  border-color: #34465f;
  background: #1c2d44;
  border-radius: 13px;
  padding: 15px;
}
#portal .person .avatar {
  background: transparent;
  width: 46px;
  height: 46px;
}
#portal .person p {
  color: #8da4c6;
  font-size: 11px;
}
#portal .person small {
  color: #7890b1;
}
.waiting-overview {
  display: flex;
  align-items: center;
  gap: 26px;
  background: linear-gradient(120deg, #233d44, #242b48);
  border: 1px solid #3b5365;
  border-radius: 17px;
  padding: 22px;
  margin-bottom: 24px;
}
.waiting-illustration {
  width: 210px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #ffffff15;
}
#portal .waiting-overview p {
  font-size: 12px;
  max-width: 580px;
  line-height: 1.8;
  margin: 8px 0;
}
#portal .waiting-overview .room-duration {
  display: inline-flex;
  color: #9fd7c3;
  padding: 6px 10px;
  border: 1px solid #52816d;
  border-radius: 7px;
  font-size: 11px;
}
.waiting-code {
  font-size: 10px;
  color: #93a6c4;
  margin-top: 12px;
}
.waiting-code strong {
  color: #f1d28a;
  margin-left: 8px;
  font-size: 16px;
  letter-spacing: 1px;
}
#portal .room-toolbar {
  gap: 9px;
  margin-bottom: 24px;
}
#portal .room-toolbar button {
  font-size: 12px;
}
#portal .share-room {
  padding: 15px;
  border: 1px dashed #3e5272;
  border-radius: 10px;
  color: #8da5c7;
  background: #15263d;
}
#portal .share-room code {
  overflow-wrap: anywhere;
  font-size: 11px;
}
.practice-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0 40px;
  padding: 20px;
}
.practice-art {
  grid-column: 1;
  grid-row: 1/4;
}
.practice-intro {
  grid-column: 2;
}
#portal .practice-intro h2 {
  color: #edf3ff;
  font-size: 31px;
  letter-spacing: -1px;
  line-height: 1.3;
  margin: 12px 0;
}
#portal .practice-intro p {
  color: #91a9ca;
  font-size: 13px;
  line-height: 1.9;
}
.practice-choices {
  grid-column: 2;
  display: grid;
  gap: 12px;
  padding-bottom: 15px;
}
#portal .practice-choices a {
  width: 100%;
  font-size: 12px;
}
.practice-layout > [data-action="practice-rank"] {
  grid-column: 2;
  width: 100%;
}
#portal .competition-card,
#portal .result-card,
#portal .mission,
#portal .achievement,
#portal .cosmetic {
  background: #1b2d46;
  border: 1px solid #374a66;
  border-radius: 12px;
  padding: 18px;
}
#portal .competition-card h2,
#portal .result-card h2 {
  color: #e7efff;
}
#portal .table-scroll {
  border: 1px solid #30445f;
  border-radius: 12px;
  overflow: auto;
}
#portal table {
  width: 100%;
  font-size: 12px;
  background: #14263d;
}
#portal th {
  color: #8fa9ca;
  background: #20334c;
  border-color: #344a68;
  padding: 13px 10px;
  font-size: 10px;
  text-transform: uppercase;
}
#portal td {
  color: #c5d5ec;
  border-color: #2e415e;
  padding: 12px 10px;
}
#portal table tbody tr:nth-child(even) {
  background: #1b2d44;
}
#portal .wallet {
  background: #3b352d;
  color: #e4cb8f;
  border-color: #67563a;
  border-radius: 10px;
  padding: 12px;
}
#portal .game-top {
  background: #142136;
  color: #e4edff;
  border-bottom: 1px solid #2a3d56;
  margin-bottom: 20px;
}
#portal .game-top small {
  color: #8fa7c9;
}
.remote-game #remote-score {
  color: #f0d58f;
}
.remote-game #remote-time {
  color: #9ddebf;
  white-space: nowrap;
}
#portal .board {
  background: #20314b;
  border: 1px solid #40526f;
  border-radius: 12px;
  padding: 6px;
}
#portal .tray__slot {
  background: transparent;
  border-color: transparent;
}
#portal .tray__slot[data-selected="true"] {
  background: #2d3a56;
  border-color: #ab95ed;
}
.remote-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.mode-badge {
  display: inline-block;
  color: #a2d8c4;
  background: #28463e;
  border: 1px solid #466958;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 10px;
}
#portal button.rotate-control:not(.board__cell):not(.tray__slot) {
  background: #353153;
  border-color: #74619d;
  color: #d0bdff;
}
#portal .board-instruction {
  color: #8097ba;
  font-size: 12px;
}
.ranking-layout-control {
  display: flex;
  justify-content: end;
  gap: 12px;
  align-items: center;
  color: #839fc3;
  font-size: 11px;
  margin-bottom: 14px;
}
#portal .ranking-layout-control select {
  width: auto;
  font-size: 11px;
  min-height: 33px;
  padding: 6px;
}
#portal .game-layout {
  display: grid;
  gap: 24px;
}
.game-layout > #live-ranking {
  min-width: 0;
}
#portal #live-ranking h2 {
  font-size: 16px;
  margin: 10px 0 15px;
}
#portal #remote-result {
  margin-top: 24px;
  border-radius: 12px;
}
.game-layout #remote-result:empty {
  margin: 0;
}
#chat-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
.chat-box,
.chat-toggle {
  pointer-events: auto;
}
#portal .chat-box {
  width: 100%;
  background: #192b42;
  border-color: #3a4c68;
  color: #bdcde4;
  box-shadow: 0 15px 45px #03091a66;
}
#portal .chat-toggle {
  background: #294a45 !important;
  color: #b7edda !important;
  border-color: #426c60 !important;
  font-size: 11px;
  min-height: 36px;
}
#portal .chat-tabs button {
  background: transparent;
  color: #a3b7d5;
  min-height: 30px;
  font-size: 10px;
  padding: 6px 10px;
  border-color: transparent;
}
#portal .chat-tab.selected {
  background: #35465f;
  border-color: #607c96;
}
#portal .chat-tab.selected button {
  color: #e0edff;
}
#portal .chat-history {
  height: 230px;
}
#portal .chat-message {
  color: #c0d3e9;
  border-color: #314760;
}
#portal .chat-message p {
  background: #233b52;
  color: #c0d3e9;
  font-size: 12px;
}
#portal #chat-form input {
  min-width: 0;
  font-size: 12px;
  padding: 10px;
  background: #112139;
}
#portal #chat-form button {
  font-size: 11px;
  padding: 8px 12px;
}
#portal .toast {
  background: #2a3f58;
  border: 1px solid #526b8b;
  color: #e7f2ff;
  box-shadow: 0 8px 30px #0004;
}
@media (min-width: 1280px) {
  .game-layout[data-position="beside"] {
    grid-template-columns: minmax(480px, 1fr) 280px;
    align-items: start;
  }
}
@media (min-width: 1200px) {
  body.chat-open #portal-content {
    width: calc(100% - 390px);
    max-width: 1280px;
    margin-left: 24px;
    margin-right: 366px;
  }
  body.chat-open .hub-sidebar {
    display: none;
  }
  body.chat-open .hub-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1100px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .hub-sidebar {
    display: none;
  }
  .hub-actions {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
  .entry-form {
    padding: 30px;
  }
  .entry-form h1 {
    font-size: 43px;
  }
}
@media (max-width: 760px) {
  #portal-content,
  #initial-landing {
    padding: 18px 16px 50px;
  }
  #portal-content[data-page="welcome"],
  #initial-landing {
    padding-top: 20px;
  }
  .entry-card {
    grid-template-columns: 1fr;
    max-width: 470px;
    margin: auto;
    border-radius: 22px;
  }
  .entry-art {
    min-height: 0;
    height: 145px;
    padding: 0;
    background: radial-gradient(ellipse at 50% 70%, #478b8e70, transparent 70%),
      #21394b;
  }
  .entry-art > .eyebrow,
  .entry-art-caption,
  .scene-spark {
    display: none;
  }
  .entry-art .hero-art {
    width: 215px;
    margin-top: -10px;
  }
  .entry-art .hero-board {
    box-shadow: 0 8px 0 #0b1b2d;
  }
  .entry-art .art-spark {
    display: none;
  }
  .entry-art .art-label {
    font-size: 10px;
    padding: 6px 9px;
    right: 0;
  }
  .entry-form {
    padding: 24px;
  }
  .entry-form > .eyebrow {
    display: none;
  }
  .entry-form h1 {
    font-size: 38px;
    letter-spacing: -1.5px;
    margin: 0 0 12px;
  }
  .entry-description {
    font-size: 12px;
    margin-bottom: 20px;
  }
  .entry-features {
    flex-wrap: wrap;
    gap: 13px 20px;
    font-size: 9px;
    padding-top: 22px;
  }
  .entry-solo {
    padding-top: 13px;
    margin-top: 15px;
  }
  .entry-solo .mode-picker {
    margin-top: 8px;
  }
  .entry-solo .text-link {
    font-size: 11px;
  }
  .hub-welcome {
    align-items: start;
  }
  .hub-welcome h2 {
    font-size: 25px;
  }
  .hub-live {
    display: none;
  }
  #portal .portal-nav {
    gap: 5px;
    padding-bottom: 12px;
    margin-bottom: 21px;
  }
  #portal .portal-nav button:not(.board__cell):not(.tray__slot) {
    font-size: 11px;
    padding: 10px 12px;
    gap: 7px;
  }
  .hub-actions {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .hub-actions > .quick-card {
    grid-column: 1/-1;
  }
  .hub-actions > article {
    padding: 18px;
  }
  #portal .hub-actions h2 {
    font-size: 19px;
  }
  .quick-card .mode-picker {
    max-width: none;
  }
  .rooms-heading {
    align-items: start;
    flex-direction: column;
    gap: 15px;
  }
  #portal .join-strip {
    max-width: none;
    width: 100%;
  }
  .rooms-heading h2 {
    font-size: 23px;
  }
  #portal .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .room-card-content {
    padding: 12px;
  }
  .bot-legend {
    display: none;
  }
  .hub-actions .infinity-mark {
    font-size: 65px;
    margin: 12px auto 22px;
  }
  .waiting-overview {
    gap: 18px;
    padding: 18px;
  }
  .waiting-illustration {
    width: 120px;
    height: 90px;
  }
  .practice-layout {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }
  .practice-art {
    display: none;
  }
  .practice-intro,
  .practice-choices,
  .practice-layout > [data-action="practice-rank"] {
    grid-column: 1;
  }
  .practice-intro {
    padding: 15px 0;
  }
  #portal .portal-panel {
    padding: 20px;
    border-radius: 16px;
  }
  .ranking-layout-control {
    display: none;
  }
  .remote-game .game-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    align-items: center;
    padding: 10px 0 14px;
  }
  .remote-game .game-top > div {
    min-width: 0;
  }
  .remote-game .run-timer small {
    white-space: nowrap;
  }
  .remote-game #remote-time {
    font-size: 18px;
    line-height: 1.4;
  }
  .remote-game .game-top > button {
    width: 100%;
  }
}
@media (max-width: 450px) {
  #portal .portal-header {
    min-height: 64px;
    padding: 12px 16px;
    gap: 10px;
  }
  #portal .brand {
    font-size: 20px;
  }
  #portal .portal-header .language-control select {
    font-size: 11px;
    padding: 9px 5px;
  }
  .entry-form {
    padding: 20px;
  }
  .entry-art {
    height: 112px;
  }
  .entry-art .hero-art {
    width: 190px;
    margin-top: -14px;
  }
  .entry-form h1 {
    font-size: 34px;
  }
  #portal .avatar-picker {
    gap: 6px;
  }
  .avatar-picker label > span:not(.sr-only) {
    min-height: 46px;
  }
  .avatar-picker label .avatar {
    width: 39px;
    height: 39px;
  }
  .input-hint {
    margin-bottom: 14px;
  }
  .entry-description {
    font-size: 11px;
    margin-bottom: 15px;
  }
  .entry-solo > span {
    font-size: 10px;
  }
  .mode-option > span {
    padding: 8px;
  }
  .mode-option b {
    font-size: 10px;
  }
  .entry-features {
    display: none;
  }
  .entry-note {
    font-size: 9px;
  }
  #portal .portal-footer {
    font-size: 9px;
    padding: 20px 0;
  }
  .hub-welcome h2 {
    font-size: 25px;
    max-width: 280px;
  }
  .hub-welcome .eyebrow {
    font-size: 9px;
  }
  #portal .hub-welcome p {
    font-size: 11px;
  }
  #portal .hub-actions h2 {
    font-size: 18px;
  }
  .hub-actions > article {
    padding: 16px;
  }
  #portal .hub-actions p {
    font-size: 10px;
  }
  .room-card h3 {
    margin-top: 10px;
  }
  #portal .room-card h3 button.text-link:not(.board__cell):not(.tray__slot) {
    font-size: 12px;
  }
  .room-card-meta {
    font-size: 8px;
  }
  .room-card .room-host {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .room-card-content {
    padding: 10px;
  }
  .room-art-label {
    left: 7px;
    top: 7px;
    font-size: 7px;
    padding: 4px 5px;
  }
  .room-art-label .ui-icon {
    display: none;
  }
  .room-card-bottom {
    flex-wrap: wrap;
    gap: 8px;
  }
  #portal button.join-room-button:not(.board__cell):not(.tray__slot) {
    font-size: 10px;
    padding: 6px 8px;
    width: 100%;
    justify-content: space-between;
  }
  .room-rule-badges {
    gap: 4px;
  }
  .room-rule-badges > span {
    font-size: 8px;
    padding: 3px 5px;
  }
  .waiting-overview {
    display: block;
  }
  .waiting-illustration {
    display: none;
  }
  #portal .room-toolbar button {
    font-size: 11px;
  }
  .mini-avatars > .avatar {
    width: 31px;
    height: 31px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #portal *,
  #portal *::before,
  #portal *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto;
  }
}
.cms-bot-panel {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid #d7e4e0;
  background: #f2f8f5;
  border-radius: 16px;
}
.cms-bot-panel > p {
  font-size: 13px;
  max-width: 850px;
  line-height: 1.8;
  color: #60776e;
}
.cms-bot-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}
.cms-bot-stats > span {
  background: white;
  border: 1px solid #d6e6df;
  border-radius: 10px;
  padding: 15px;
  font-size: 11px;
  color: #6a8075;
  min-width: 125px;
}
.cms-bot-stats strong {
  display: block;
  font-size: 27px;
  color: #367460;
  margin-bottom: 5px;
}
.cms-bot-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 16px;
}
.cms-bot-panel textarea {
  min-height: 100px;
  font-size: 13px;
}
@media (max-width: 760px) {
  .cms-bot-fields {
    grid-template-columns: 1fr 1fr;
  }
  .cms-bot-panel {
    padding: 16px;
  }
}
#portal .avatar-picker input,
#portal .mode-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 2;
  cursor: pointer;
  margin: 0;
}
@media (max-width: 760px) {
  .hub-actions > .create-card,
  .hub-actions > .solo-card {
    min-height: 130px;
    padding: 16px;
  }
  .hub-actions > .create-card .action-icon,
  .hub-actions > .solo-card .action-icon {
    position: absolute;
    right: 12px;
    top: 14px;
    width: 25px;
    height: 25px;
    opacity: 0.7;
  }
  .hub-actions > .create-card p,
  .hub-actions > .solo-card p,
  .hub-actions .mini-avatars,
  .hub-actions .infinity-mark {
    display: none;
  }
  #portal .hub-actions > .create-card h2,
  #portal .hub-actions > .solo-card h2 {
    font-size: 15px;
    margin: 0 24px 15px 0;
    line-height: 1.4;
  }
  .hub-actions > .quick-card {
    padding: 16px;
  }
  #portal .hub-actions > .quick-card h2 {
    margin: 10px 0 6px;
  }
  #portal .hub-actions > .quick-card p {
    font-size: 11px;
    margin-bottom: 5px;
  }
}
@media (max-width: 450px) {
  #portal button.join-room-button:not(.board__cell):not(.tray__slot) {
    min-height: 40px;
  }
}
/* Solo practice and rules share the platform's arcade identity. */
body:has(#app),
body:has(.rules-page) {
  --color-bg: #0c1425;
  --color-text: #e5efff;
  --line: #2d415e;
  --muted: #91a7c7;
  --purple: #b49af3;
  --color-board: #20314b;
  --color-cell-empty: #304461;
  background: radial-gradient(ellipse at 0 0, #17434a66, transparent 55%),
    #0c1425;
}
#app .site-header {
  background: #122036;
  border-color: #2a3d56;
}
#app .brand__name > span {
  color: #7bdfbe;
}
#app .control-card,
#app .play-card,
#app .tip-card {
  background: #17283e;
  border-color: #344963;
  color: #e6efff;
}
#app .mode-switch {
  background: #112139;
  border-color: #344963;
}
#app .mode-switch button {
  color: #93aaca;
}
#app .mode-switch button[aria-pressed="true"] {
  background: #2a4d42;
  border-color: #69a78d;
  color: #bcf1d7;
}
#app .mode-note,
#app .intro-copy,
#app .tip-card p,
#app .board-instruction {
  color: #91a8c8;
}
#app .hud {
  color: #a3b5ce;
  background: transparent;
  border-color: #334861;
}
#app .hud__score {
  color: #edd38f;
}
#app .board {
  background: #20314b;
  border: 1px solid #40526f;
}
#app .tray__slot[data-selected="true"] {
  background: #2b3b57;
  border-color: #a591db;
}
#app .icon-button,
#app .tool-button,
#app .hud__mute,
#app .rotation-bar > button,
#app .language-control select {
  background: #233a53;
  color: #b7cbe5;
  border-color: #3c536f;
}
#app .primary-button,
#app .overlay__button {
  background: #ffd36d;
  color: #342810;
  border-color: #ffdf91;
}
#app .primary-button:hover {
  background: #ffe19b;
}
#app .overlay {
  background: #122036ed;
  color: #e8f1ff;
}
#app dialog {
  background: #172b43;
  color: #e3efff;
  border: 1px solid #435b7a;
}
#app dialog .secondary-button {
  background: #294057;
  color: #c9def3;
  border-color: #49617e;
}
#app .site-footer {
  color: #5f789b;
}
.rules-redesign {
  width: min(100%, 980px);
  max-width: 980px;
  padding: 30px 24px 70px;
}
.rules-redesign .brand {
  display: inline-flex;
  gap: 10px;
  text-decoration: none;
}
.rules-redesign .language-control {
  float: right;
  margin: 0;
}
.rules-redesign select {
  background: #20344f;
  color: #cadbf2;
  border-color: #415775;
}
.rules-redesign > .eyebrow {
  margin-top: 55px;
  color: #7bd9bd;
}
.rules-redesign h1 {
  font-size: clamp(30px, 4vw, 47px);
  letter-spacing: -1.2px;
  line-height: 1.2;
  margin: 15px 0 35px;
}
.rules-redesign #rules {
  counter-reset: rule;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.rules-redesign #rules > p {
  counter-increment: rule;
  margin: 0;
  padding: 22px;
  border: 1px solid #344b69;
  background: #192c44;
  border-radius: 13px;
  color: #9db5d3;
  font-size: 13px;
  line-height: 1.9;
}
.rules-redesign #rules > p::before {
  content: "0" counter(rule);
  display: block;
  color: #e9ca7f;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 10px;
}
.rules-play-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  align-items: center;
}
.rules-play-actions > a {
  padding: 12px 22px;
  border-radius: 10px;
  margin: 0;
  text-decoration: none;
  font-weight: 700;
}
.rules-play-actions > .primary-button {
  background: #ffd36d;
  color: #342810;
}
.rules-play-actions > .secondary-button {
  background: #243b56;
  color: #cbdff5;
  border: 1px solid #3e5573;
}
@media (max-width: 600px) {
  .rules-redesign #rules {
    grid-template-columns: 1fr;
  }
  .rules-redesign .language-control > span {
    display: none;
  }
  .rules-redesign .brand {
    font-size: 19px;
  }
  .rules-redesign .language-control {
    width: 105px;
  }
  .rules-play-actions {
    flex-wrap: wrap;
  }
}
#portal .game-layout {
  grid-template-columns: minmax(0, 1fr);
}
#portal #remote-mount,
#portal .remote-game {
  min-width: 0;
  width: 100%;
}
#portal .remote-game .game-mount {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1280px) {
  #portal .game-layout[data-position="beside"] {
    grid-template-columns: minmax(480px, 1fr) 280px;
  }
}
#portal .avatar {
  position: relative;
}
#portal .avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #2d4562;
  color: #c4dcf4;
  border-radius: inherit;
  font-size: 14px;
}
#portal .avatar > svg {
  position: relative;
  z-index: 1;
}

/* Restore layouts at narrow widths and browser zoom without hiding overflow. */
#portal {
  width: 100%;
  min-width: 0;
}
#portal .room-card {
  display: block;
}
#portal .room-card-content,
#portal .panel-title > *,
#portal .hub-welcome > *,
#portal .inline-form > *,
#portal .mode-picker,
#portal .portal-nav {
  min-width: 0;
}
#portal .room-card h3,
#portal .panel-title h1,
#portal .share-room code {
  overflow-wrap: anywhere;
}
#portal .room-card h3 button {
  text-align: start;
  white-space: normal;
  max-width: 100%;
}
#portal .room-card .room-art {
  grid-row: auto;
  grid-column: auto;
}
#portal .portal-header {
  flex-wrap: wrap;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
#portal .portal-header .brand {
  min-width: 0;
}
#portal button.install-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #a7e9d3;
  border-color: #436d62;
  background: #203b37;
  min-height: 42px;
}
#portal button.install-app[hidden],
#portal [data-action="install"][hidden] {
  display: none;
}
#portal .install-app > span:first-child {
  font-size: 22px;
  line-height: 1;
}
#portal-loading {
  display: none;
  min-height: 60dvh;
  align-content: center;
  justify-items: center;
  gap: 14px;
  color: #b7d8db;
  font-size: 20px;
}
#portal-content #portal-loading,
.portal-restoring #portal-loading {
  display: grid;
}
.portal-restoring #initial-landing {
  display: none;
}
#portal-loading > span:last-child {
  font-size: 14px;
  color: #91a7c7;
}
.boot-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #334963;
  border-top-color: #83ddbd;
  border-radius: 50%;
  animation: boot-spin 1s linear infinite;
}
@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}
#portal-dialog {
  width: min(520px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}
.run-summary,
.install-guide {
  text-align: center;
  line-height: 1.7;
}
.result-symbol {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 14px auto;
  border: 1px solid #627f7a;
  border-radius: 18px;
  background: #2a4a43;
  color: #9aebca;
  font-size: 30px;
}
.result-score {
  display: block;
  font-size: clamp(32px, 8vw, 52px);
  line-height: 1.3;
  color: #ffdb8f;
}
.result-note {
  color: #a1b8d1;
  font-size: 14px;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 10px;
}
#portal .result-view-board {
  display: block;
  margin: 16px auto 0;
}
@media (max-width: 760px) {
  /* 16px prevents Safari input-focus zoom while pinch zoom stays available. */
  #portal input:not([type="radio"]):not([type="checkbox"]),
  #portal select,
  #portal textarea,
  #portal .portal-header .language-control select {
    font-size: 16px;
  }
  #portal .portal-header .language-control select {
    width: 108px;
    max-width: 100%;
    min-height: 42px;
  }
  #portal .portal-header {
    gap: 8px;
  }
  #portal .install-app .install-label {
    display: none;
  }
  #portal button.install-app {
    width: 38px;
    padding: 7px;
    flex: 0 0 38px;
  }
  #portal .portal-nav {
    width: 100%;
    max-width: 100%;
  }
  #portal .room-filters {
    max-width: 100%;
  }
  #portal .room-card .room-host {
    overflow-wrap: anywhere;
  }
  #portal .panel-title {
    flex-wrap: wrap;
  }
}
@media (max-width: 380px) {
  #portal .portal-header .brand__name {
    font-size: 16px;
  }
  #portal .portal-header .brand img {
    width: 24px;
    height: 24px;
  }
  #portal .portal-header .language-control select {
    width: 100px;
    padding: 8px 2px;
  }
  #portal .room-grid,
  #portal .hub-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  #portal .hub-actions > article {
    grid-column: auto;
  }
  #portal .room-card-meta,
  #portal .room-host,
  #portal .room-rule-badges > span {
    font-size: 11px;
  }
  #portal .room-card h3 button.text-link:not(.board__cell):not(.tray__slot) {
    font-size: 16px;
  }
  #portal .room-card-content {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .boot-spinner {
    animation: none;
  }
}
@media (max-width: 900px), (pointer: coarse) {
  #portal input:not([type="radio"]):not([type="checkbox"]),
  #portal select,
  #portal textarea,
  #portal .portal-header .language-control select {
    font-size: 16px;
  }
}
@media (max-width: 380px) {
  #portal .portal-header:has(.profile-menu:not([hidden])) .brand__name {
    display: none;
  }
  #portal .portal-header:has(.profile-menu:not([hidden])) .brand img {
    width: 32px;
    height: 32px;
  }
}
.pwa-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid #34594f;
  background: #18332e;
  border-radius: 12px;
  font-size: 12px;
  color: #b4d6ca;
}
.pwa-shortcut > span {
  flex: 1;
  min-width: 0;
}
#portal .pwa-shortcut > button:not(.board__cell):not(.tray__slot) {
  flex: 0 0 auto;
  background: #2b5548;
  border-color: #547e6d;
  color: #c5f0df;
}
.pwa-shortcut[hidden] {
  display: none;
}
@media (max-width: 380px) {
  .pwa-shortcut {
    flex-wrap: wrap;
  }
  .pwa-shortcut > span {
    flex-basis: 100%;
  }
}

/* Approved club design, applied to the live platform. Game cell colours stay in
   the shared engine stylesheet; every surface override is scoped to the portal. */
body:has(#portal) {
  display: block;
  background: #f3f5f9;
  color: #20314a;
  color-scheme: light;
}
#portal {
  --color-bg: #f3f5f9;
  --color-text: #20314a;
  --muted: #53637b;
  --line: #d5deeb;
  --purple: #285489;
  background: #f3f5f9;
  color: #20314a;
  font-size: 14px;
}
#portal *,
#portal *::before,
#portal *::after {
  box-sizing: border-box;
}
#portal [hidden],
.pwa-installed #portal [data-install-offer],
.pwa-installed #portal [data-action="install"],
.pwa-installed #install,
.pwa-installed #menu-install {
  display: none !important;
}
#portal h1,
#portal h2,
#portal h3 {
  color: #20314a;
  letter-spacing: -0.035em;
}
#portal p,
#portal small,
#portal label,
#portal legend {
  color: #53637b;
}
#portal .eyebrow {
  color: #63738a;
  font-size: 10px;
  letter-spacing: 0.12em;
}
#portal a {
  color: #285489;
}
#portal button:not(.board__cell):not(.tray__slot) {
  color: #294b76;
  background: #fff;
  border-color: #cbd6e5;
  border-radius: 10px;
  box-shadow: none;
  font-weight: 650;
}
#portal button:not(.board__cell):not(.tray__slot):hover {
  background: #edf2fa;
  border-color: #8ca4c7;
}
#portal button.primary-button:not(.board__cell):not(.tray__slot),
#portal a.primary-button {
  color: #fff;
  background: #de5e31;
  border-color: #de5e31;
  box-shadow: 0 3px 8px #de5e3118;
}
#portal button.primary-button:not(.board__cell):not(.tray__slot):hover,
#portal a.primary-button:hover {
  background: #bd471f;
  border-color: #bd471f;
}
#portal button.text-link:not(.board__cell):not(.tray__slot) {
  background: transparent;
  border: 0;
  color: #294b76;
  box-shadow: none;
}
#portal input:not([type="radio"]):not([type="checkbox"]),
#portal select,
#portal textarea,
#portal option {
  background: #fff;
  color: #20314a;
  border-color: #c3d0e2;
}
#portal input::placeholder,
#portal textarea::placeholder {
  color: #687b96;
}
#portal button:focus-visible,
#portal a:focus-visible,
#portal input:focus-visible,
#portal select:focus-visible {
  outline: 3px solid #de8059;
  outline-offset: 3px;
}
#portal .selected:not(.tray__slot),
#portal .tabs button.selected:not(.board__cell):not(.tray__slot) {
  color: #223f6b;
  background: #e8effa;
  border-color: #9db3d6;
}
#portal .club-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 218px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 30px 20px 22px;
  background: #fff;
  border-right: 1px solid #dbe2ee;
  z-index: 70;
}
#portal .brand {
  color: #223655;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
#portal .club-mark {
  display: grid;
  grid-template-columns: repeat(2, 13px);
  gap: 3px;
  transform: rotate(-8deg);
  flex: none;
}
#portal .club-mark i {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: #de5e31;
}
#portal .club-mark i:nth-child(2) {
  transform: translateY(-4px);
  background: #94ae8a;
}
#portal .club-mark i:nth-child(3) {
  background: #eaaa79;
}
#portal .club-mark i:nth-child(4) {
  background: #3c5f54;
}
#portal .club-wordmark {
  font-size: 22px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -1px;
}
#portal .club-wordmark > span {
  display: block;
  font-weight: 500;
  color: #647187;
}
#portal .club-workspace {
  margin-left: 218px;
  padding: 0 30px;
  min-width: 0;
}
#portal .portal-header {
  padding: 19px 0;
  min-height: 88px;
  gap: 12px;
  background: transparent;
  border-bottom: 1px solid #d5deeb;
  flex-wrap: nowrap;
}
#portal .portal-header .brand {
  margin-right: auto;
}
#portal .portal-header .club-wordmark {
  font-size: 18px;
}
#portal .portal-header .club-mark {
  grid-template-columns: repeat(2, 10px);
}
#portal .portal-header .club-mark i {
  width: 10px;
  height: 10px;
}
#portal .portal-header .language-control {
  margin: 0;
}
#portal .portal-header .language-control select {
  background: #fff;
  color: #2b4366;
  border-color: #cbd6e5;
  font-size: 13px;
  padding: 8px;
}
#portal button.install-app {
  background: #223d68;
  color: #fff;
  border-color: #223d68;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 14px;
}
#portal .profile-menu {
  color: #20314a;
  background: transparent;
  border-color: transparent;
  padding: 3px;
}
#portal .profile-menu small {
  color: #65738a;
}
#portal .profile-menu .avatar {
  width: 36px;
  height: 36px;
}
#portal .header-chat {
  display: flex;
  gap: 7px;
  align-items: center;
}
#portal .portal-nav {
  display: flex;
  flex-direction: column;
  border: 0;
  padding: 0;
  margin: 12px 0 0;
  gap: 8px;
  overflow: visible;
}
#portal .portal-nav button:not(.board__cell):not(.tray__slot) {
  color: #53617b;
  padding: 12px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  white-space: normal;
  text-align: left;
}
#portal .portal-nav button.selected:not(.board__cell):not(.tray__slot) {
  color: #223c67;
  background: #e9effa;
}
#portal .club-sidebar-bottom {
  margin-top: auto;
}
#portal .club-sidebar-bottom .pwa-shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #eaf0fb;
  padding: 16px;
  gap: 10px;
  margin: 0;
}
#portal .club-sidebar-bottom .pwa-shortcut > img {
  width: 38px;
  height: 38px;
}
#portal .club-sidebar-bottom .pwa-shortcut h2 {
  font-size: 16px;
  line-height: 1.4;
}
#portal .club-sidebar-bottom .pwa-shortcut p {
  font-size: 12px;
  margin: 5px 0;
}
#portal .club-sidebar-bottom .pwa-shortcut button {
  width: 100%;
  font-size: 13px;
  padding: 9px;
}
#portal .club-help {
  font-size: 12px;
  color: #526580;
}
#portal-content {
  width: 100%;
  max-width: 1420px;
  padding: 25px 0 36px;
  margin: 0 auto;
  min-width: 0;
}
#portal .portal-panel {
  background: #fff;
  border: 1px solid #d5deeb;
  box-shadow: 0 5px 20px #29466c05;
  border-radius: 16px;
  padding: 25px;
}
#portal .portal-panel p {
  color: #53637b;
}
#portal .portal-panel h1 {
  color: #233c60;
}
#portal .portal-footer {
  background: transparent;
  color: #63738a;
  text-align: left;
  padding: 15px 0 28px;
  border-color: #d5deeb;
}
#portal .portal-footer a {
  color: #285489;
}
#portal[data-page="welcome"] .club-sidebar {
  display: none;
}
#portal[data-page="welcome"] .club-workspace {
  margin: 0 auto;
  max-width: 1240px;
}
#portal-content[data-page="welcome"],
#portal #initial-landing {
  max-width: 1160px;
  padding: 35px 0;
}
#portal .entry-card {
  border: 1px solid #d5deeb;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 48px #203c6808;
}
#portal .entry-art {
  background: #e8eef7;
  color: #233c60;
  border: 0;
}
#portal .entry-art-caption h2 {
  color: #233c60;
}
#portal .entry-art-caption p {
  color: #53637b;
}
#portal .entry-art > .eyebrow {
  color: #63738a;
}
#portal .live-pill {
  background: #dae6f4;
  border-color: #b3c7e2;
  color: #33567c;
}
#portal .entry-form {
  background: #fff;
}
#portal .entry-form h1 {
  color: #20314a;
}
#portal .entry-form h1 > span {
  color: #de5e31;
}
#portal .entry-note,
#portal .entry-description,
#portal .entry-solo > span,
#portal .input-hint {
  color: #63738a;
}
#portal .entry-solo {
  border-color: #d5deeb;
}
#portal .avatar-picker > label > span {
  background: #edf2fa;
  border-color: #d5deeb;
}
#portal .avatar-picker input:checked + span {
  border-color: #de5e31;
  background: #fff3e9;
}
#portal .mode-option > span {
  background: #fff;
  color: #53637b;
  border-color: #cbd6e5;
  box-shadow: none;
}
#portal .mode-option b {
  color: #294b76;
}
#portal .mode-option input:checked + span {
  background: #e9effa;
  border-color: #7192c0;
  box-shadow: none;
}
#portal .mode-option input:checked + span b {
  color: #233f6a;
}
#portal .entry-features {
  color: #53637b;
}
#portal .pwa-shortcut {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  margin: 0 0 22px;
  background: linear-gradient(110deg, #edf3ff, #fff);
  border: 1px solid #b7cbed;
  border-radius: 15px;
  box-shadow: 0 4px 15px #274a8006;
}
#portal .pwa-shortcut > img {
  border-radius: 13px;
  flex: none;
}
#portal .pwa-shortcut > div {
  flex: 1;
  min-width: 0;
}
#portal .pwa-shortcut h2 {
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
}
#portal .pwa-shortcut p {
  font-size: 13px;
  margin: 4px 0 0;
  line-height: 1.6;
}
#portal .pwa-shortcut > button {
  white-space: nowrap;
  flex: none;
}
#portal .hub-welcome {
  align-items: center;
  margin-bottom: 20px;
  padding: 0;
}
#portal .hub-welcome h2 {
  font-size: 30px;
  margin: 5px 0;
  line-height: 1.25;
}
#portal .hub-welcome p {
  font-size: 14px;
}
#portal .hub-live {
  color: #526580;
  background: transparent;
  border: 0;
  font-size: 11px;
}
#portal .hub-live i,
#portal .room-state i {
  background: #468a6e;
}
#portal .hub-grid {
  display: block;
}
#portal .lobby-play-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px 24px;
  background: #fff;
  border: 1px solid #d5deeb;
  border-radius: 15px;
  padding: 18px;
  margin-bottom: 26px;
}
#portal .lobby-rules {
  display: flex;
  gap: 16px;
  align-items: end;
}
#portal .lobby-rules .mode-picker {
  flex: 1;
  margin: 0;
  max-width: 380px;
}
#portal .lobby-rules .mode-picker legend {
  margin-bottom: 6px;
}
#portal .lobby-rules .mode-option > span {
  padding: 9px 12px;
  min-height: 44px;
}
#portal .lobby-rules .mode-option small {
  display: none;
}
#portal .quick-settings {
  display: flex;
  flex-direction: column;
  margin: 0;
  gap: 6px;
}
#portal .quick-settings label {
  color: #53637b;
  font-size: 12px;
}
#portal .quick-settings select {
  color: #294b76;
  min-height: 44px;
  padding: 9px;
}
#portal .lobby-play-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#portal .lobby-match-help {
  grid-column: 1/-1;
  margin: 0 !important;
  font-size: 12px;
  line-height: 1.5 !important;
}
#portal .rooms-heading {
  margin: 12px 0 16px;
}
#portal .rooms-heading h2 {
  color: #233c60;
  font-size: 24px;
}
#portal .count-badge {
  color: #2d527e;
  background: #e2eaf7;
  border-color: #c6d5e9;
}
#portal .join-strip input {
  width: 130px;
  background: #fff;
}
#portal .room-filters {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #d5deeb;
  padding-bottom: 13px;
  margin-bottom: 18px;
  gap: 8px;
}
#portal .room-filters button:not(.board__cell):not(.tray__slot) {
  color: #53637b;
  background: transparent;
  border-color: transparent;
}
#portal .room-filters button.selected:not(.board__cell):not(.tray__slot) {
  background: #e8effa;
  color: #223f6b;
  border-color: #c3d2e9;
}
#portal .bot-legend {
  font-size: 11px;
  color: #63738a;
  margin-left: auto;
}
#portal .bot-legend .ui-icon {
  display: none;
}
#portal .top-five {
  background: #fff;
  color: #53637b;
  border-color: #d5deeb;
}
#portal .room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
#portal .room-card {
  display: block;
  border: 1px solid #d4deeb;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  min-width: 0;
  box-shadow: 0 4px 15px #233c6006;
}
#portal .room-card:hover {
  border-color: #93abce;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px #233c600e;
}
#portal .room-card button.room-art:not(.board__cell):not(.tray__slot) {
  width: 100%;
  height: auto;
  aspect-ratio: 360/150;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: block;
  background: #192c46;
  position: relative;
  overflow: hidden;
}
#portal .room-picture {
  width: 100%;
  height: 100%;
  display: block;
}
#portal .room-art-label {
  top: 11px;
  bottom: auto;
  left: 11px;
  font-size: 10px;
  color: #fff;
  background: #12253dc9;
  border: 1px solid #ffffff26;
  padding: 5px 8px;
  max-width: calc(100% - 22px);
}
#portal .room-card-content {
  padding: 15px;
}
#portal .room-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #63738a;
}
#portal .room-state {
  color: #43765f;
  font-size: 10px;
}
#portal .room-state.is-playing {
  color: #a76b26;
}
#portal .room-state.is-playing i {
  background: #c5893a;
}
#portal .room-card h3 {
  margin: 11px 0 4px;
  font-size: 18px;
  line-height: 1.35;
  min-height: 0;
}
#portal .room-card h3 button.text-link:not(.board__cell):not(.tray__slot) {
  display: block;
  font-size: inherit;
  font-weight: 750;
  color: #233c60;
  min-height: 0;
  line-height: inherit;
}
#portal .room-card .room-host {
  color: #63738a;
  font-size: 12px;
  margin: 0 0 11px;
  overflow-wrap: anywhere;
}
.room-live-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #b9d4ee;
  border-left: 4px solid #3278bd;
  border-radius: 12px;
  padding: 18px;
  margin: 20px 0;
  background: #edf5ff;
}
.room-live-notice > div {
  min-width: 0;
}
#portal .room-live-notice p {
  margin: 6px 0 0;
}
.room-match-time {
  flex: none;
  text-align: right;
}
.room-match-time span {
  display: block;
  font-size: 12px;
}
.room-match-time strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.room-round-complete {
  padding: 14px 18px;
  border-radius: 10px;
  background: #e8f5ee;
  color: #2a6248;
}
.room-share-panel {
  border: 1px solid #d5deeb;
  background: #f6f9fd;
  border-radius: 14px;
  padding: 22px;
  margin-top: 24px;
}
.room-share-code {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.room-share-code > strong {
  font-size: 36px;
  font-weight: 750;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  color: #23436b;
  overflow-wrap: anywhere;
}
.room-share-link {
  min-width: 0;
}
.ranking-person {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 150px;
}
.ranking-person > .avatar {
  width: 30px;
  height: 30px;
  flex: none;
}
.ranking-social {
  gap: 6px;
  margin-top: 8px;
}
#portal .ranking-social button {
  padding: 5px 9px;
  min-height: 30px;
  font-size: 12px;
}
.friend-status {
  color: #28634b;
  font-size: 12px;
  align-self: center;
  padding: 5px 0;
}
#portal .person[data-state="finished"] {
  border-color: #c6d9d0;
}
@media (max-width: 480px) {
  .room-live-notice {
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }
  .room-match-time strong {
    font-size: 23px;
  }
  .room-share-panel {
    padding: 16px;
  }
}
#portal .room-rule-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
#portal .room-rule-badges > span {
  color: #456080;
  background: #edf2fa;
  border: 0;
  font-size: 11px;
  padding: 5px 7px;
}
#portal .room-card-bottom {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  border-top: 1px solid #e2e8f2;
  margin-top: 13px;
  padding-top: 13px;
}
#portal .room-card-bottom > span {
  display: flex;
  align-items: center;
  color: #63738a;
  gap: 5px;
  font-size: 12px;
}
#portal .room-card-bottom > span b {
  color: #2b486f;
}
#portal button.join-room-button:not(.board__cell):not(.tray__slot) {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: #285489;
  border-color: #285489;
  min-height: 41px;
  padding: 10px 12px;
  font-size: 13px;
}
#portal button.join-room-button:not(.board__cell):not(.tray__slot):hover {
  background: #193f70;
}
#portal button.full-room:not(.board__cell):not(.tray__slot) {
  color: #63738a;
  background: #edf1f6;
  border-color: #d5deeb;
}
#portal .empty-rooms {
  background: #fff;
  color: #53637b;
  border-color: #d5deeb;
  grid-column: 1/-1;
}
#portal .empty-rooms h2,
#portal .empty-rooms p {
  color: #53637b;
}
#portal .pager button {
  background: #fff;
  color: #294b76;
}
#portal .notice {
  background: #fff6e9;
  color: #75502a;
  border-color: #e7d0ae;
}
#portal .member-list .person,
#portal .competition-card,
#portal .result-card,
#portal .mission,
#portal .achievement,
#portal .cosmetic {
  background: #f7f9fc;
  border-color: #d5deeb;
}
#portal .waiting-overview {
  background: #edf2fa;
  border-color: #d5deeb;
}
#portal .waiting-overview h2,
#portal .waiting-overview .room-duration {
  color: #233c60;
}
#portal .waiting-overview p,
#portal .person p,
#portal .person small {
  color: #63738a;
}
#portal .room-toolbar button {
  color: #294b76;
  background: #fff;
}
#portal .share-room {
  background: #edf2fa;
  border-color: #d5deeb;
}
#portal .share-room code {
  color: #233c60;
}
#portal .practice-intro {
  background: #e9eff8;
  border-color: #cbd6e5;
}
#portal .practice-intro h2,
#portal .practice-intro p {
  color: #294b76;
}
#portal .practice-choices a.secondary-button {
  background: #fff;
  color: #294b76;
  border-color: #cbd6e5;
}
#portal .table-scroll {
  background: #fff;
  border-color: #d5deeb;
}
#portal table {
  color: #294b76;
}
#portal th {
  background: #edf2fa;
  color: #53637b;
}
#portal td {
  border-color: #dbe3ef;
}
#portal table tbody tr:nth-child(even) {
  background: #f7f9fc;
}
#portal .wallet {
  color: #233c60;
  background: #edf2fa;
  border-color: #cbd6e5;
}
#portal .game-top {
  background: #edf2fa;
  border-color: #cbd6e5;
  color: #294b76;
}
#portal .game-top small,
#portal .board-instruction {
  color: #53637b;
}
#portal #remote-result {
  background: #eaf1fb;
  border-color: #b7cbed;
  color: #233c60;
}
#portal #live-ranking h2 {
  color: #233c60;
}
#portal .board {
  --color-board: #20314b;
  --color-cell-empty: #304461;
}
#portal-dialog {
  background: #fff;
  color: #20314a;
  border: 1px solid #cad6e7;
  box-shadow: 0 25px 100px #20314a30;
}
#portal-dialog p,
#portal-dialog label {
  color: #53637b;
}
#portal-dialog .dialog-close {
  color: #294b76;
  background: #edf2fa;
  border-color: #cbd6e5;
}
#portal-dialog input,
#portal-dialog select,
#portal-dialog textarea {
  color: #20314a;
  background: #fff;
  border-color: #c3d0e2;
}
#portal-dialog::backdrop {
  background: #17283b80;
  backdrop-filter: blur(3px);
}
#portal .toast {
  background: #223d68;
  color: #fff;
  border-color: #395a89;
  bottom: 110px;
  z-index: 200;
}
/* Chat is a full-height desktop dock and a native modal sheet on mobile. */
#portal #chat-widget {
  position: fixed;
  top: 110px;
  right: 20px;
  bottom: 20px;
  width: 320px;
  font-size: 13px;
  z-index: 90;
  display: flex;
  align-items: stretch;
  pointer-events: none;
}
#portal #chat-widget .chat-toggle {
  pointer-events: auto;
  margin-top: auto;
  width: 100%;
  background: #223d68 !important;
  color: #fff !important;
  border-color: #223d68 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 8px 26px #233c6020;
}
#portal .chat-toggle > span:nth-child(2) {
  flex: 1;
  text-align: left;
}
#portal .chat-toggle strong {
  font-size: 14px;
  display: block;
}
#portal .chat-toggle small {
  display: block;
  color: #d2dfef;
  font-size: 11px;
  margin-top: 2px;
}
#portal .chat-toggle .ui-icon {
  color: #fff;
}
#portal.chat-expanded .chat-toggle {
  display: none !important;
}
#portal .chat-box {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #20314a;
  border: 1px solid #c5d3e6;
  border-radius: 14px;
  box-shadow: 0 8px 28px #233c6012;
  overflow: hidden;
}
#portal .chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #223d68;
  padding: 15px;
  flex: none;
}
#portal .chat-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
#portal .chat-heading h2 {
  color: #fff;
  font-size: 16px;
  margin: 0;
}
#portal .chat-heading button.chat-close {
  color: #fff;
  background: #ffffff12;
  border: 0;
  min-height: 32px;
  width: 32px;
  padding: 0;
  font-size: 24px;
}
#portal .chat-tabs {
  display: flex;
  flex: none;
  gap: 5px;
  padding: 10px;
  background: #f2f5fa;
  border-bottom: 1px solid #dbe3ef;
  overflow-x: auto;
}
#portal .chat-tab {
  color: #53637b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
}
#portal .chat-tab.selected {
  color: #223f6b;
  background: #e1eaf8;
  border-color: #bccfe9;
}
#portal .chat-tabs button {
  color: inherit;
  background: transparent;
  font-size: 12px;
}
#portal .chat-tab.selected button {
  color: #223f6b;
}
#portal #chat-older {
  margin: 5px auto;
  min-height: 28px;
  font-size: 11px;
  padding: 4px 10px;
  flex: none;
}
#portal .chat-history {
  height: auto;
  flex: 1;
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#portal .chat-message {
  display: flex;
  gap: 8px;
  background: transparent;
  color: #20314a;
  padding: 4px 0;
  margin: 6px 0;
  border: 0;
  align-items: flex-start;
}
#portal .chat-message .avatar {
  width: 29px;
  height: 29px;
  flex: none;
}
#portal .chat-message > div {
  flex: 1;
  min-width: 0;
}
#portal .chat-message-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #526580;
}
#portal .chat-message-meta button.text-link:not(.board__cell):not(.tray__slot) {
  font-size: 11px;
  min-height: 20px;
}
#portal .chat-message p {
  color: #334e70;
  background: #edf2fa;
  border-radius: 0 9px 9px 9px;
  font-size: 13px;
  padding: 9px 11px;
  margin: 3px 0;
  line-height: 1.5;
}
#portal .chat-message.mine p {
  background: #e4edfb;
  color: #233f6b;
}
#portal #chat-form {
  flex: none;
  margin: 0;
  padding: 12px 10px;
  gap: 6px;
  border-top: 1px solid #dbe3ef;
  background: #fff;
}
#portal #chat-form input {
  font-size: 16px;
  min-height: 44px;
  background: #f6f8fc;
  color: #20314a;
  border-color: #cbd6e5;
  padding: 10px;
}
#portal #chat-form button {
  background: #285489;
  color: #fff;
  border-color: #285489;
  font-size: 12px;
  padding: 8px 11px;
}
#portal .chat-error {
  flex: none;
  margin: 0;
  padding: 0 10px;
  color: #a43d44;
  font-size: 11px;
  background: #fff;
}
#portal .chat-error:not(:empty) {
  padding-bottom: 9px;
}
@media (min-width: 1024px) {
  body.chat-open #portal .club-workspace {
    padding-right: 370px;
  }
  body.chat-open #portal #chat-widget .chat-toggle {
    display: none;
  }
  #portal #chat-widget:has(.chat-box[hidden]) {
    top: auto;
    width: 280px;
  }
  #portal .lobby-play-controls {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  #portal .club-sidebar {
    width: 86px;
    padding: 27px 12px;
    align-items: center;
  }
  #portal .club-sidebar .club-wordmark,
  #portal .club-sidebar-bottom,
  #portal .club-help,
  #portal .club-sidebar .portal-nav span {
    display: none;
  }
  #portal .club-workspace {
    margin-left: 86px;
    padding-left: 22px;
    padding-right: 22px;
  }
  #portal .portal-nav button:not(.board__cell):not(.tray__slot) {
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
  }
  body.chat-open #portal .club-workspace {
    padding-right: 304px;
  }
  #portal #chat-widget {
    width: 264px;
    right: 18px;
  }
  #portal .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #portal .header-chat > span {
    display: none;
  }
  #portal .profile-menu > span:last-child {
    display: none;
  }
}
@media (max-width: 1023px) {
  #portal .club-sidebar {
    width: 175px;
    padding: 27px 14px;
  }
  #portal .club-workspace {
    margin-left: 175px;
    padding: 0 22px;
  }
  #portal .club-sidebar .club-wordmark {
    font-size: 20px;
  }
  #portal .club-sidebar-bottom .pwa-shortcut h2 {
    font-size: 14px;
  }
  #portal .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #portal .lobby-play-controls {
    grid-template-columns: 1fr;
  }
  #portal .portal-header .brand {
    margin-right: auto;
  }
  #portal .portal-header .club-wordmark {
    display: none;
  }
  #portal .profile-menu > span:last-child {
    display: none;
  }
  #portal .header-chat > span {
    display: none;
  }
  #portal .hub-live {
    display: none;
  }
  #portal #chat-widget {
    top: auto;
    bottom: 22px;
    right: 22px;
    left: 197px;
    width: auto;
  }
  #portal #chat-widget .chat-toggle {
    max-width: 330px;
    margin-left: auto;
  }
  #portal #chat-widget:has(dialog[open]) .chat-toggle {
    visibility: hidden;
  }
  #portal dialog.chat-box {
    position: fixed;
    top: calc(
      var(--chat-viewport-top, 0px) + var(--chat-viewport-height, 100dvh) -
        min(690px, var(--chat-viewport-height, 100dvh) - 16px)
    );
    left: max(8px, calc((100vw - 560px) / 2));
    right: auto;
    bottom: auto;
    margin: 0;
    width: calc(100vw - 16px);
    max-width: 560px;
    height: min(690px, calc(var(--chat-viewport-height, 100dvh) - 16px));
    max-height: none;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #portal dialog.chat-box::backdrop {
    background: #17283b80;
    backdrop-filter: blur(3px);
  }
  body.chat-open:has(#portal dialog[open]) {
    overflow: hidden;
  }
}
@media (max-width: 760px) {
  #portal .club-sidebar {
    position: fixed;
    inset: auto 0 0;
    height: calc(65px + env(safe-area-inset-bottom));
    width: 100%;
    padding: 5px 8px env(safe-area-inset-bottom);
    border: 0;
    border-top: 1px solid #d5deeb;
    gap: 0;
    z-index: 80;
  }
  #portal .club-sidebar > .brand,
  #portal .club-sidebar-bottom,
  #portal .club-help {
    display: none;
  }
  #portal #club-navigation {
    width: 100%;
  }
  #portal .portal-nav {
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    margin: 0;
  }
  #portal .portal-nav button:not(.board__cell):not(.tray__slot) {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 6px 2px;
    min-height: 52px;
    min-width: 0;
    white-space: normal;
    font-size: 10px;
    text-align: center;
  }
  #portal .portal-nav .ui-icon {
    width: 20px;
    height: 20px;
  }
  #portal .club-workspace {
    margin: 0;
    padding: 0 15px;
  }
  #portal .portal-header {
    min-height: 73px;
    padding: 13px 0;
    gap: 7px;
    flex-wrap: nowrap;
  }
  #portal .portal-header .club-wordmark {
    display: block;
    font-size: 16px;
  }
  #portal .portal-header .brand {
    gap: 7px;
  }
  #portal .portal-header .language-control select {
    width: 52px;
    padding: 7px 3px;
    min-height: 38px;
    font-size: 11px;
  }
  #portal .portal-header .profile-menu {
    min-height: 38px;
  }
  #portal .portal-header .profile-menu .avatar {
    width: 30px;
    height: 30px;
  }
  #portal button.install-app {
    font-size: 11px;
    min-height: 38px;
    padding: 8px;
    gap: 3px;
  }
  #portal button.install-app > span:first-child {
    font-size: 15px;
  }
  #portal .header-chat {
    min-height: 38px;
    padding: 8px;
  }
  #portal .header-chat .ui-icon {
    width: 17px;
    height: 17px;
  }
  #portal-content {
    padding: 22px 0 145px;
  }
  #portal .portal-footer {
    padding-bottom: 150px;
  }
  #portal .hub-welcome {
    margin-bottom: 17px;
  }
  #portal .hub-welcome h2 {
    font-size: 25px;
  }
  #portal .hub-welcome p {
    display: none;
  }
  #portal .pwa-shortcut {
    margin-bottom: 16px;
    padding: 13px;
    gap: 10px;
    border-radius: 12px;
  }
  #portal .pwa-shortcut > img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  #portal .pwa-shortcut h2 {
    font-size: 14px;
  }
  #portal .pwa-shortcut p {
    font-size: 11px;
    line-height: 1.45;
  }
  #portal .pwa-shortcut > button:not(.board__cell):not(.tray__slot) {
    font-size: 11px;
    padding: 9px;
    min-height: 39px;
  }
  #portal .lobby-play-controls {
    padding: 13px;
    gap: 12px;
    margin-bottom: 23px;
  }
  #portal .lobby-rules {
    gap: 10px;
  }
  #portal .lobby-rules .mode-picker {
    min-width: 0;
  }
  #portal .lobby-rules .mode-option > span {
    padding: 7px 6px;
    min-height: 40px;
  }
  #portal .lobby-rules .mode-option b {
    font-size: 11px;
    white-space: normal;
  }
  #portal .lobby-rules .mode-picker legend,
  #portal .quick-settings label {
    font-size: 11px;
  }
  #portal .quick-settings {
    flex: none;
  }
  #portal .quick-settings select {
    min-height: 40px;
    font-size: 12px;
    padding: 7px;
  }
  #portal .lobby-play-actions {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 6px;
  }
  #portal .lobby-play-actions button:not(.board__cell):not(.tray__slot) {
    font-size: 11px;
    padding: 10px 5px;
  }
  #portal .lobby-match-help {
    font-size: 11px;
  }
  #portal .rooms-heading {
    align-items: end;
    gap: 10px;
  }
  #portal .rooms-heading .eyebrow {
    display: none;
  }
  #portal .rooms-heading h2 {
    font-size: 21px;
  }
  #portal .join-strip {
    gap: 5px;
  }
  #portal .join-strip label {
    font-size: 10px;
  }
  #portal .join-strip input {
    width: 93px;
    padding: 7px;
    min-height: 36px;
    font-size: 12px;
  }
  #portal .join-strip button {
    padding: 6px;
    min-height: 36px;
  }
  #portal .room-filters {
    gap: 5px;
  }
  #portal .room-filters button:not(.board__cell):not(.tray__slot) {
    font-size: 11px;
    padding: 8px 9px;
    min-height: 36px;
  }
  #portal .bot-legend {
    flex-basis: 100%;
    margin: 3px 0 0;
    font-size: 10px;
  }
  #portal .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #portal .room-card {
    border-radius: 12px;
  }
  #portal .room-card button.room-art:not(.board__cell):not(.tray__slot) {
    aspect-ratio: 360/180;
  }
  #portal .room-art-label {
    top: 7px;
    left: 7px;
    font-size: 8px;
    padding: 3px 5px;
    gap: 3px;
  }
  #portal .room-art-label .ui-icon {
    width: 11px;
    height: 11px;
  }
  #portal .room-card-content {
    padding: 11px;
  }
  #portal .room-card-meta {
    font-size: 9px;
    flex-wrap: wrap;
    gap: 4px;
  }
  #portal .room-state {
    font-size: 8px;
  }
  #portal .room-card h3 {
    font-size: 16px;
    min-height: 0;
    margin: 9px 0 4px;
  }
  #portal .room-card .room-host {
    font-size: 10px;
  }
  #portal .room-rule-badges {
    gap: 4px;
  }
  #portal .room-rule-badges > span {
    padding: 4px 5px;
    font-size: 9px;
  }
  #portal .room-rule-badges .ui-icon {
    width: 11px;
    height: 11px;
  }
  #portal .room-card-bottom {
    gap: 9px;
    padding-top: 10px;
    margin-top: 10px;
  }
  #portal button.join-room-button:not(.board__cell):not(.tray__slot) {
    font-size: 11px;
    padding: 8px 10px;
    min-height: 37px;
  }
  #portal #chat-widget {
    left: 15px;
    right: 15px;
    bottom: calc(77px + env(safe-area-inset-bottom));
    width: auto;
    top: auto;
  }
  #portal #chat-widget .chat-toggle {
    width: 100%;
    max-width: none;
    min-height: 49px;
    padding: 8px 13px;
  }
  #portal .chat-toggle strong {
    display: inline;
    font-size: 13px;
  }
  #portal .chat-toggle small {
    display: inline;
    font-size: 11px;
    margin-left: 8px;
    color: #e0e8f4;
  }
  #portal .portal-panel {
    padding: 16px;
    border-radius: 13px;
  }
  #portal[data-page="welcome"] .club-workspace {
    padding: 0 15px;
  }
  #portal-content[data-page="welcome"],
  #portal #initial-landing {
    padding: 20px 0;
  }
  #portal .entry-form {
    padding: 24px 20px;
  }
  #portal .entry-art {
    min-height: 260px;
  }
  #portal .entry-features {
    flex-wrap: wrap;
    font-size: 11px;
    gap: 12px;
  }
}
@media (max-width: 380px) {
  #portal .club-workspace {
    padding: 0 12px;
  }
  #portal .portal-header .club-wordmark {
    display: none;
  }
  #portal .room-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #portal .room-card button.room-art:not(.board__cell):not(.tray__slot) {
    aspect-ratio: 360/150;
  }
  #portal .room-card h3 {
    min-height: 0;
  }
  #portal .room-card .room-host {
    font-size: 12px;
  }
  #portal .room-card-meta {
    font-size: 11px;
    flex-wrap: nowrap;
  }
  #portal .room-state {
    font-size: 10px;
  }
  #portal .room-rule-badges > span {
    font-size: 11px;
  }
  #portal .pwa-shortcut > img {
    display: none;
  }
  #portal .lobby-rules {
    flex-wrap: wrap;
  }
  #portal .lobby-rules .mode-picker {
    flex-basis: 100%;
    max-width: none;
  }
  #portal .quick-settings {
    flex-direction: row;
    align-items: center;
  }
  #portal .lobby-play-actions {
    grid-template-columns: 1fr 1fr;
  }
  #portal .lobby-play-actions .launch-button {
    grid-column: 1/-1;
  }
}
@media (prefers-reduced-motion: reduce) {
  #portal .room-card,
  #portal button {
    transition: none;
  }
}
/* Keep the install label readable and neutralise older lobby form constraints. */
#portal .rooms-heading {
  flex-direction: row;
  align-items: end;
}
#portal .rooms-heading .join-strip {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  width: auto;
}
#portal .lobby-rules .mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}
#portal .lobby-rules .mode-picker label {
  width: auto;
  display: block;
}
#portal .lobby-rules .mode-picker legend {
  grid-column: 1/-1;
}
@media (max-width: 760px) {
  #portal button.install-app {
    width: auto;
    flex: 0 0 auto;
    padding: 8px;
  }
  #portal .install-app .install-label {
    display: inline;
  }
  #portal .portal-header .language-control select {
    width: 48px;
    font-size: 16px;
  }
  #portal .rooms-heading h2 {
    font-size: 19px;
  }
  #portal .join-strip input {
    width: 87px;
  }
  #portal .club-sidebar .portal-nav button {
    min-height: 54px;
    font-size: 9px;
  }
}
#portal .quick-settings {
  width: auto;
  flex: 0 0 auto;
  align-items: stretch;
}
#portal .lobby-rules .mode-picker {
  flex: 1 1 0;
}
@media (max-width: 760px) {
  #portal .quick-settings label {
    max-width: 90px;
  }
  #portal .quick-settings select,
  #portal .join-strip input {
    font-size: 16px;
  }
  #portal .bot-legend {
    display: block;
  }
  #portal .rooms-heading h2 {
    flex-wrap: wrap;
  }
}
@media (min-width: 1024px) {
  body.chat-open #portal-content {
    width: 100%;
    max-width: 1420px;
    margin: 0 auto;
    padding-right: 0;
  }
}
/* Personal practice and rules use the same light chrome around the dark board. */
body:has(#app),
body:has(.rules-page) {
  --color-bg: #f3f5f9;
  --color-text: #20314a;
  --line: #d5deeb;
  --muted: #53637b;
  --purple: #285489;
  background: #f3f5f9;
  color: #20314a;
  color-scheme: light;
}
#app .site-header {
  background: #f3f5f9;
  border-color: #d5deeb;
}
#app .brand,
#app .brand__name > span,
.rules-redesign .brand {
  color: #233c60;
}
#app .control-card,
#app .play-card,
#app .tip-card {
  background: #fff;
  color: #20314a;
  border-color: #d5deeb;
  box-shadow: 0 5px 20px #29466c06;
}
#app .mode-switch {
  background: #f2f5fa;
  border-color: #d5deeb;
}
#app .mode-switch button {
  color: #53637b;
}
#app .mode-switch button[aria-pressed="true"] {
  background: #e1eaf8;
  color: #223f6b;
  border-color: #a5bcde;
}
#app .mode-note,
#app .intro-copy,
#app .tip-card p,
#app .board-instruction,
#app .hud,
#app .site-footer {
  color: #63738a;
}
#app .hud__score {
  color: #233c60;
}
#app .icon-button,
#app .tool-button,
#app .hud__mute,
#app .rotation-bar > button,
#app .language-control select {
  background: #fff;
  color: #294b76;
  border-color: #cbd6e5;
}
#app .primary-button,
#app .overlay__button {
  background: #de5e31;
  color: #fff;
  border-color: #de5e31;
}
#app .primary-button:hover {
  background: #bd471f;
}
#app .overlay {
  background: #f3f5f9f5;
  color: #20314a;
}
#app dialog {
  color: #20314a;
  background: #fff;
  border-color: #cad6e7;
}
#app dialog .secondary-button {
  background: #edf2fa;
  color: #294b76;
  border-color: #cbd6e5;
}
.rules-redesign select {
  background: #fff;
  color: #294b76;
  border-color: #cbd6e5;
}
.rules-redesign > .eyebrow {
  color: #63738a;
}
.rules-redesign #rules > p {
  background: #fff;
  border-color: #d5deeb;
  color: #53637b;
}
.rules-redesign #rules > p::before {
  color: #de5e31;
  background: #fff1e9;
}
.rules-redesign .primary-button {
  color: #fff;
  background: #de5e31;
  border-color: #de5e31;
}
.rules-redesign .secondary-button {
  color: #294b76;
  background: #fff;
  border-color: #cbd6e5;
}
#portal .portal-header button.install-app:not(.board__cell):not(.tray__slot) {
  color: #fff;
  background: #223d68;
  border-color: #223d68;
}
#portal
  .portal-header
  button.install-app:not(.board__cell):not(.tray__slot):hover {
  background: #162d50;
}
#portal .club-page-label {
  display: none;
}
@media (min-width: 1024px) {
  #portal:not([data-page="welcome"]) .portal-header > .brand {
    display: none;
  }
  #portal:not([data-page="welcome"]) .club-page-label {
    display: block;
    margin-right: auto;
    color: #233c60;
    font-size: 18px;
    font-weight: 700;
  }
}
#portal .bootstrap-form > label {
  color: #53637b;
}
#portal table {
  background: #fff;
}
#portal td {
  color: #334e70;
}
#portal .remote-game #remote-score {
  color: #b84c28;
}
#portal .run-summary .result-score {
  color: #b84c28;
}
#portal .run-summary[data-reason="DISCONNECT_TIMEOUT"] .result-symbol,
#portal .run-summary[data-reason="INFRASTRUCTURE"] .result-symbol,
#portal-dialog .run-summary[data-reason="DISCONNECT_TIMEOUT"] .result-symbol,
#portal-dialog .run-summary[data-reason="INFRASTRUCTURE"] .result-symbol {
  color: #8d3d1c;
  background: #fff0dc;
}
#portal .remote-game #remote-time {
  color: #347453;
}
/* Fit the HUD to the playable column, including when desktop chat is open. */
#portal .remote-game {
  container: play-area / inline-size;
}
#portal .remote-game .game-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 16px;
  top: 8px;
  border: 1px solid #cbd6e5;
  border-radius: 14px;
  box-shadow: 0 3px 12px #203c6808;
}
#portal .remote-game .game-top > div {
  min-width: 0;
  gap: 4px;
}
#portal .remote-game .game-top strong {
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
#portal .remote-game #remote-score {
  font-size: clamp(22px, 6cqi, 30px);
  overflow-wrap: anywhere;
}
#portal .remote-game #remote-time {
  font-size: clamp(18px, 5cqi, 28px);
}
#portal .remote-game .game-top > button {
  min-width: 0;
  width: 100%;
  min-height: 42px;
}
#portal[data-page="run"] .panel-title {
  margin-bottom: 16px;
  gap: 12px;
}
#portal[data-page="run"] .ranking-layout-control {
  margin-bottom: 12px;
}
@container play-area (min-width: 560px) {
  #portal .remote-game .game-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
    gap: 20px;
    padding: 16px 20px;
  }
  #portal .remote-game .game-top > button {
    width: auto;
  }
}
@container play-area (max-width: 300px) {
  #portal .remote-game .game-top {
    padding: 12px;
    gap: 10px;
  }
}
/* Room flow: stable live surfaces, explicit readiness and a server-timed gate. */
#portal
  .lobby-play-actions
  .play-now-button:not(.board__cell):not(.tray__slot) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  min-width: 215px;
  padding: 14px 22px;
  background: #d85225;
  border-color: #c6441b;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 6px 18px #d852252b;
}
#portal .play-now-button > span {
  flex: 1;
}
#portal .play-now-button > .ui-icon {
  width: 21px;
  height: 21px;
}
#portal .lobby-play-actions {
  align-items: stretch;
}
#portal .lobby-play-actions .secondary-button {
  align-self: center;
}
#portal .confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
#portal .confirm-actions button {
  min-height: 46px;
}
#portal #confirm-room-leave {
  background: #cf4929;
  color: #fff;
  border-color: #cf4929;
}
#portal .room-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}
#portal .room-toolbar [data-action="leave-room"] {
  margin-left: auto;
}
#portal .room-toolbar [data-action="ready"] {
  min-height: 48px;
  font-size: 14px;
}
#portal .room-toolbar [data-action="ready"][aria-pressed="true"] {
  color: #286244;
  background: #e5f3e9;
  border-color: #78a98d;
}
#portal button.room-chat-button:not(.board__cell):not(.tray__slot) {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #234c80;
  background: #e7effb;
  border-color: #aec4e3;
}
#portal .run-room-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#portal .member-list .person {
  padding: 14px;
  border: 1px solid #d5deeb;
  border-left: 4px solid #c1cbd8;
  border-radius: 11px;
  min-height: 86px;
}
#portal .member-list .person[data-state="ready"] {
  border-left-color: #3e8c62;
  background: #f1f8f3;
}
#portal .member-list .person[data-state="playing"] {
  border-left-color: #c47a28;
  background: #fff9ee;
}
#portal .member-list .person p {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 7px 5px 4px 0;
  background: #e9eef5;
  color: #53637b;
  font-size: 12px;
  font-weight: 650;
}
#portal .member-list .person[data-state="ready"] p {
  background: #dcefe2;
  color: #286244;
}
#portal .member-list .person[data-state="playing"] p {
  background: #ffedcf;
  color: #855319;
}
#portal .member-presence {
  display: inline-block;
  font-size: 11px;
  margin-left: 3px;
}
#portal .room-host-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
#portal .room-guide {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  margin: 18px 0;
  border: 1px solid #c0d2e9;
  background: #edf3fc;
  border-radius: 12px;
}
#portal .room-guide > div {
  flex: 1;
}
#portal .room-guide strong {
  color: #294b76;
  font-size: 14px;
}
#portal .room-guide p {
  font-size: 12px;
  line-height: 1.6;
  margin: 6px 0 0;
}
#portal .room-guide button {
  flex: none;
}
#portal .room-countdown {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid #e9bb8c;
  background: #fff5e7;
  border-radius: 14px;
  margin: 18px 0;
}
#portal .room-countdown > strong {
  display: grid;
  place-items: center;
  flex: none;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  color: #fff;
  background: #d85225;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
#portal .room-countdown h2 {
  font-size: 21px;
  color: #8d3d1c;
  margin: 0 0 7px;
}
#portal .room-countdown p {
  color: #795337;
  font-size: 13px;
  margin: 0;
}
#portal #room-results:not(:empty) {
  margin-top: 24px;
}
@media (max-width: 760px) {
  #portal .lobby-play-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #portal
    .lobby-play-actions
    .play-now-button:not(.board__cell):not(.tray__slot) {
    grid-column: 1/-1;
    min-width: 0;
    min-height: 54px;
    padding: 13px 18px;
    font-size: 17px;
  }
  #portal .room-toolbar {
    gap: 7px;
  }
  #portal .room-toolbar [data-action="ready"] {
    flex-basis: 100%;
    min-height: 49px;
    font-size: 15px;
  }
  #portal .room-toolbar [data-action="leave-room"] {
    margin-left: 0;
  }
  #portal .room-guide {
    align-items: flex-start;
    padding: 13px;
    gap: 10px;
  }
  #portal .room-guide button {
    padding: 7px 10px;
    font-size: 12px;
  }
  #portal .room-countdown {
    gap: 14px;
    padding: 15px;
  }
  #portal .room-countdown > strong {
    width: 58px;
    height: 58px;
    font-size: 35px;
  }
  #portal .room-countdown h2 {
    font-size: 18px;
  }
  #portal .room-countdown p {
    font-size: 12px;
  }
  #portal .run-room-controls {
    width: 100%;
    justify-content: space-between;
  }
  #portal .member-list .person {
    gap: 9px;
    padding: 12px 10px;
  }
}
#portal .waiting-code,
#portal .waiting-code strong {
  color: #294b76;
}
.social-discovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.invitation-person,
.people-search-result {
  display: flex;
  align-items: center;
  gap: 12px;
}
.invitation-person > div,
.people-search-result > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.invitation-person small,
.people-search-result small {
  color: #63738a;
}
#people-results {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
#portal-dialog .people-search-result {
  width: 100%;
  text-align: left;
}
.friend-share {
  text-align: center;
}
.friend-share input {
  min-width: 0;
  width: 100%;
}
.friend-share .row-actions {
  justify-content: center;
}
#friend-qr img {
  max-width: 100%;
  height: auto;
}
#portal .chat-tab-navigation {
  display: flex;
  flex: none;
  align-items: center;
  min-width: 0;
  background: #f2f5fa;
  border-bottom: 1px solid #dbe3ef;
}
#portal .chat-tab-navigation .chat-tabs {
  flex: 1;
  min-width: 0;
  border: 0;
}
#portal .chat-tab-navigation > button {
  flex: none;
  width: 32px;
  min-height: 36px;
  padding: 3px;
  margin: 3px;
  font-size: 24px;
}
#portal .room-event-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-top: 16px;
  border: 1px solid #e7be91;
  border-radius: 12px;
  background: #fff3e4;
  color: #754a22;
}
#portal .room-event-banner p {
  flex: 1;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.6;
  color: inherit;
}
#portal .room-event-banner button {
  flex: none;
  min-width: 32px;
  min-height: 32px;
  padding: 2px;
  background: transparent;
  color: inherit;
  font-size: 24px;
}
.cms-config-history {
  margin-top: 28px;
}
.cms-config-history pre {
  max-width: 320px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cms-google-panel {
  max-width: 980px;
}
.cms-google-status {
  display: flex;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 16px;
  background: #eaf1fa;
  border-radius: 12px;
  margin: 18px 0;
}
.cms-google-panel fieldset {
  border: 1px solid #cbd8eb;
  border-radius: 12px;
  padding: 20px;
  margin: 18px 0;
  min-width: 0;
}
.cms-google-panel legend {
  font-weight: 700;
  padding: 0 8px;
}
.cms-google-panel input {
  min-width: 0;
  max-width: 100%;
}
.cms-google-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}
.cms-google-help {
  margin-top: 28px;
  line-height: 1.7;
}
.cms-google-help li {
  margin: 10px 0;
}
#portal .portal-ad {
  width: 100%;
  min-width: 0;
  margin: 36px auto;
  padding: 16px 0;
  max-width: 970px;
}
#portal .portal-ad-label {
  display: block;
  color: #647187;
  font-size: 11px;
  margin-bottom: 12px;
  text-align: center;
}
#portal-content[data-page="run"] > .portal-ad {
  margin-top: 150px;
}

#portal-content[data-page="lobby"]:has(> .portal-ad) {
  display: flex;
  flex-direction: column;
}
#portal-content[data-page="lobby"] > .portal-ad {
  order: -1;
  margin-top: 0;
}

@media (min-width: 1440px) {
  body:not(.chat-open) #portal-content[data-page="lobby"]:has(> .portal-ad) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
  }
  body:not(.chat-open) #portal-content[data-page="lobby"] > .portal-ad {
    order: 0;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 24px 0;
  }
}

/* Results are a resting page, with no game controls or board underneath. */
#portal .game-layout[hidden],
#portal .ranking-layout-control[hidden],
#portal .room-terminal[hidden] {
  display: none;
}
.room-terminal {
  max-width: 1120px;
  margin: 16px auto 32px;
}
.match-results {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid #ccd9e8;
  border-radius: 20px;
  background: #f8fbff;
}
.match-results > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.match-results h2 {
  margin: 0;
}
.match-results > p {
  color: #526882;
  line-height: 1.6;
}
.result-state {
  flex-shrink: 0;
  border-radius: 20px;
  padding: 6px 12px;
  background: #e9eef9;
  font-size: 12px;
}
.match-results[data-official="true"] .result-state {
  background: #d5f3e6;
  color: #205c44;
}
.match-results table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}
.match-results th,
.match-results td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #dce5ef;
}
.match-results th {
  background: #e6edf7;
  color: #465d7b;
  font-size: 13px;
}
.match-results tbody tr:nth-child(even) {
  background: #eff4fa;
}
.room-terminal > .result-actions {
  justify-content: center;
  margin-top: 24px;
}
.room-terminal > .result-actions button {
  min-width: 200px;
}
.result-access {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 12px 6px 0;
  color: #526882;
  font-size: 13px;
}
.onboarding-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
  border-radius: 16px;
  border: 1px solid #cadbef;
  background: #eef6ff;
}
.onboarding-offer p {
  margin: 6px 0 0;
  line-height: 1.5;
}
.onboarding-offer .row-actions {
  flex-shrink: 0;
}
#cms-root .cms-metric-cards,
#cms-root .cms-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin: 20px 0;
}
#cms-root .cms-metric-cards article,
#cms-root .cms-chart,
#cms-root .cms-detail {
  padding: 20px;
  border: 1px solid #d4dfeb;
  border-radius: 16px;
  background: #f9fbfe;
  min-width: 0;
}
#cms-root .cms-metric-cards span {
  display: block;
  color: #526882;
}
#cms-root .cms-metric-cards strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}
#cms-root .cms-chart svg {
  display: block;
  width: 100%;
  height: auto;
}
#cms-root .cms-chart-range {
  font-size: 12px;
  color: #526882;
}
#cms-root .cms-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
#cms-root .cms-facts div {
  padding: 10px;
  border-bottom: 1px solid #d4dfeb;
  min-width: 0;
  overflow-wrap: anywhere;
}
#cms-root dt {
  color: #526882;
  font-size: 13px;
}
#cms-root dd {
  margin: 5px 0 0;
  font-weight: 600;
}
#cms-root .cms-detail {
  margin: 24px 0;
}
#cms-root .cms-detail[hidden] {
  display: none;
}
#cms-root table {
  width: 100%;
  border-collapse: collapse;
}
#cms-root th,
#cms-root td {
  padding: 12px;
  border-bottom: 1px solid #d4dfeb;
  text-align: left;
  vertical-align: top;
}
@media (max-width: 600px) {
  .onboarding-offer {
    align-items: flex-start;
    flex-direction: column;
  }
  .match-results {
    padding: 14px;
    border-radius: 14px;
  }
  .match-results h2 {
    font-size: 18px;
  }
}
.result-mobile-status {
  display: none;
}
@media (max-width: 600px) {
  .result-mobile-status {
    display: block;
    margin-top: 4px;
    color: #526882;
    font-size: 12px;
  }
}

.simulation-info {
  color: #63738a;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#portal .room-card .simulation-info {
  margin: -3px 0 10px;
  font-size: 11px;
}

/* Live scores remain discoverable before the board, including narrow phones. */
#portal .live-score-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid #a8c4dd;
  border-radius: 14px;
  background: #edf6ff;
}
#live-score-snapshot {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  min-width: 0;
}
.live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #21567a;
  font-weight: 750;
  font-size: 12px;
}
.live-label i,
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #178660;
  box-shadow: 0 0 0 3px #17866015;
}
.live-your-rank {
  color: #223e64;
  font-size: 15px;
}
.live-leader {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #526882;
  font-size: 12px;
}
#portal #open-live-standings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border-color: #aac4e1;
  color: #204e7c;
}
.live-standings {
  border: 1px solid #ccd9e8;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.live-standings > header {
  padding: 16px;
  background: #f0f6fc;
  border-bottom: 1px solid #e0e8f1;
}
#portal .live-standings h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  margin: 0 0 6px;
}
.live-standings ol {
  list-style: none;
  margin: 0;
  padding: 4px 10px;
}
.live-standings li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px 6px;
  border-bottom: 1px solid #edf1f6;
}
.live-standings li:last-child {
  border-bottom: 0;
}
.live-standings li.is-you {
  background: #eaf5ed;
  border-radius: 8px;
}
.live-standings li > div {
  min-width: 0;
}
.live-standings li strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.live-standings li small {
  display: block;
  font-size: 11px;
  margin-top: 4px;
}
.live-standings li strong small {
  display: inline;
}
.live-standings li b {
  font-size: 16px;
  color: #204f7e;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  max-width: 100px;
}
.live-place {
  color: #6c7e95;
  font-weight: 700;
}
#portal .live-standings > p {
  font-size: 11px;
  padding: 0 16px 12px;
  line-height: 1.6;
}
@media (min-width: 1280px) {
  #portal .game-layout[data-position="beside"] {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
  .game-layout[data-position="beside"] > #live-ranking {
    position: sticky;
    top: 16px;
  }
}
#portal .personal-run-summary {
  margin: 20px 0 16px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid #d2e0ed;
  border-radius: 18px;
  background: #fff;
}
.personal-run-summary > header {
  display: flex;
  align-items: center;
  gap: 14px;
}
#portal .personal-run-summary h2 {
  font-size: 19px;
  margin: 0 0 6px;
}
#portal .personal-run-summary p {
  margin: 0;
  line-height: 1.6;
}
.personal-result-symbol {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #25634e;
  background: #e0f3e9;
  font-size: 26px;
}
.personal-run-summary dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}
.personal-run-summary dl > div {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f2f6fb;
}
.personal-run-summary dt {
  color: #596f8b;
  font-size: 12px;
}
.personal-run-summary dd {
  margin: 6px 0 0;
  color: #203e68;
  font-weight: 750;
  font-size: 24px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
#portal .terminal-board {
  padding: 16px;
  border: 1px solid #d2e0ed;
  border-radius: 18px;
  background: #f8fbff;
}
.terminal-board > summary {
  cursor: pointer;
  color: #2b4d74;
  font-weight: 700;
  padding: 4px 0 16px;
}
#portal .terminal-board .game-top,
#portal .terminal-board .remote-mode,
#portal .terminal-board .board-instruction,
#portal .terminal-board #remote-status,
#portal .terminal-board #remote-result {
  display: none;
}
#portal .terminal-board button:disabled {
  opacity: 1;
  cursor: default;
}
@media (max-width: 600px) {
  #portal .live-score-strip {
    gap: 10px;
    padding: 10px;
  }
  #live-score-snapshot {
    gap: 5px;
  }
  .live-label,
  .live-leader {
    width: 100%;
    font-size: 11px;
  }
  .live-your-rank {
    font-size: 13px;
  }
  #portal #open-live-standings {
    font-size: 12px;
    padding: 7px 9px;
    max-width: 124px;
  }
  .personal-run-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .personal-run-summary > header {
    align-items: start;
  }
}
#portal .hud-rank-button:not(.board__cell):not(.tray__slot) {
  margin-left: 8px;
  padding: 3px 6px;
  min-height: 26px;
  font-size: 10px;
  border-color: #b7cee7;
  color: #245987;
  background: #f3f8ff;
  vertical-align: middle;
}
#portal .remote-game #remote-result:empty {
  display: none;
}

/* One compact HUD; full standings stay below, with an optional desktop pane. */
#portal .remote-game .game-top--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
#portal .remote-game .game-top--compact:not(:has(.hud-rank-button)) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
}
#portal .game-top--compact > div {
  gap: 2px;
}
#portal .game-top--compact small {
  font-size: 10px;
}
#portal .game-top--compact #remote-score {
  font-size: clamp(20px, 5cqi, 28px);
}
#portal .game-top--compact #remote-time {
  font-size: clamp(17px, 4cqi, 24px);
}
#portal
  .game-top--compact
  > button.game-action-icon:not(.board__cell):not(.tray__slot) {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  margin: 0;
  padding: 8px;
  border-color: #bccfe3;
  background: #fff;
  border-radius: 10px;
}
#portal .game-top--compact .game-action-icon .ui-icon {
  width: 20px;
  height: 20px;
}
#portal
  .game-top--compact
  > button.end-run-icon:not(.board__cell):not(.tray__slot) {
  color: #a84b35;
  border-color: #ead2c9;
}
#portal .game-top--compact > button[aria-expanded="true"] {
  background: #e0efff;
  border-color: #709ac3;
}
#portal .full-live-ranking {
  margin-top: 20px;
  min-width: 0;
}
#portal .live-standings > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
}
#portal .live-standings h2 {
  font-size: 15px;
  margin: 0;
}
#portal .live-standings > header small {
  font-size: 11px;
}
#portal .live-standings table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}
#portal .live-standings th,
#portal .live-standings td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e1e9f2;
}
#portal .live-standings th {
  font-size: 11px;
}
#portal .live-standings td {
  font-size: 12px;
}
#portal .live-standings tr.is-you > td {
  background: #eaf5ed;
}
.live-player-name {
  overflow-wrap: anywhere;
}
.live-player-name strong small {
  font-weight: 400;
}
#portal .live-standings td.live-points {
  font-size: 18px;
  font-weight: 750;
  color: #204f7e;
  font-variant-numeric: tabular-nums;
}
#live-ranking-side {
  min-width: 0;
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border-radius: 16px;
}
#portal .close-live-side {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 6px;
}
#live-ranking-side .live-standings > header {
  flex-direction: column;
  align-items: start;
  padding-right: 48px;
}
@media (min-width: 1024px) {
  #portal .game-layout[data-side-open="true"] {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 16px;
  }
}
/* Full player statistics fit in cards inside the narrow pane and mobile popup. */
#portal .live-standings--cards table,
#portal .live-standings--cards tbody {
  display: block;
  min-width: 0;
}
#portal .live-standings--cards thead {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
#portal .live-standings--cards tbody {
  padding: 8px;
}
#portal .live-standings--cards tr {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
  padding: 8px;
  border: 1px solid #e1e9f2;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}
#portal .live-standings--cards tr.is-you {
  background: #eaf5ed;
  border-color: #b9d9c2;
}
#portal .live-standings--cards td {
  border: 0;
  padding: 5px 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  background: transparent;
}
#portal .live-standings--cards td.live-place {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  font-weight: 700;
}
#portal .live-standings--cards td.live-player-name {
  grid-column: 1 / -1;
  padding-left: 28px;
}
#portal .live-standings--cards td[data-label]::before {
  content: attr(data-label);
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #526882;
  padding-bottom: 3px;
}
#portal .live-standings--cards td.live-player-status {
  grid-column: span 2;
}
@media (max-width: 600px) {
  #portal .remote-game .game-top--compact {
    padding: 10px;
    gap: 4px;
  }
  #portal .live-standings > header {
    flex-wrap: wrap;
    gap: 6px;
  }
  #portal[data-page="run"] .panel-title {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 12px;
  }
  #portal[data-page="run"] .panel-title h1 {
    font-size: 20px;
    margin: 0;
  }
  #portal[data-page="run"] .run-room-controls {
    width: auto;
    gap: 6px;
    flex: none;
  }
  #portal[data-page="run"] .run-room-controls button {
    padding: 7px 9px;
    min-height: 36px;
    font-size: 12px;
  }
  #portal[data-page="run"] .run-room-controls .run-chat-text {
    display: none;
  }
  #portal .full-live-ranking .live-standings table,
  #portal .full-live-ranking .live-standings tbody {
    display: block;
    min-width: 0;
  }
  #portal .full-live-ranking .live-standings thead {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  #portal .full-live-ranking .live-standings tbody {
    padding: 8px;
  }
  #portal .full-live-ranking .live-standings tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: relative;
    padding: 8px;
    border: 1px solid #e1e9f2;
    border-radius: 10px;
    margin-bottom: 8px;
  }
  #portal .full-live-ranking .live-standings td {
    border: 0;
    padding: 5px 4px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  #portal .full-live-ranking td.live-place {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    font-weight: 700;
  }
  #portal .full-live-ranking td.live-player-name {
    grid-column: 1 / -1;
    padding-left: 28px;
  }
  #portal .full-live-ranking td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #526882;
    padding-bottom: 3px;
  }
  #portal .full-live-ranking td.live-player-status {
    grid-column: span 2;
  }
}
#portal .game-top--compact .run-timer small,
#portal .game-top--compact #remote-time {
  white-space: normal;
  overflow-wrap: anywhere;
}
