@font-face {
  font-family: "Great Vibes";
  src: url("../assets/fonts/great-vibes/great-vibes-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("../assets/fonts/cinzel/cinzel-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("../assets/fonts/cinzel/cinzel-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("../assets/fonts/cinzel/cinzel-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("../assets/fonts/cinzel/cinzel-900.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("../assets/fonts/eb-garamond/eb-garamond-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("../assets/fonts/eb-garamond/eb-garamond-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("../assets/fonts/eb-garamond/eb-garamond-italic-400.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("../assets/fonts/eb-garamond/eb-garamond-italic-500.ttf") format("truetype");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}

:root {
  --page-top: #0b2a24;
  --page-mid: #081e1a;
  --page-bottom: #061512;
  --ink: #31261d;
  --muted: #756553;
  --line: #5a4635;
  --line-soft: rgba(90, 70, 53, 0.22);
  --panel: rgba(253, 248, 239, 0.9);
  --panel-strong: rgba(255, 250, 242, 0.96);
  --shadow-lg: 0 22px 46px rgba(58, 40, 20, 0.18);
  --shadow-md: 0 10px 22px rgba(58, 40, 20, 0.14);
  --shadow-sm: 0 4px 10px rgba(58, 40, 20, 0.1);
  --wood-dark: #6f543d;
  --wood-mid: #8a694d;
  --wood-light: #b8916f;
  --board-frame: #2d6e77;
  --board-frame-inner: #69aeb3;
  --board-grid: rgba(12, 67, 76, 0.94);
  --board-image: none;
  --board-grid-top: 10.546140%;
  --board-grid-right: 5.555556%;
  --board-grid-bottom: 10.080508%;
  --board-grid-left: 8.286252%;
  --board-grid-column-gap: 0.188324%;
  --board-grid-row-gap: 0.188324%;
  --board-tile-scale: 1;
  --tile-top: #fffaf0;
  --tile-mid: #f3ead1;
  --tile-bottom: #e2cf9f;
  --tile-edge: #7e6a43;
  --tile-shadow: 0 10px 16px rgba(55, 37, 15, 0.18);
  --tile-shadow-active: 0 14px 24px rgba(55, 37, 15, 0.22);
  --tw: #e33a34;
  --dw: #e9b4aa;
  --tl: #1886d4;
  --dl: #c0e9f5;
  --start: #d8b64d;
  --good: #2f6a4a;
  --warn: #9a4f31;
  --accent: #36594c;
}

@property --turn-ring-progress {
  syntax: "<angle>";
  inherits: false;
  initial-value: 360deg;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(215, 170, 85, 0.16), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(42, 140, 101, 0.18), transparent 30%),
    linear-gradient(145deg, #07130f, #10261d 48%, #183527);
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: clamp(340px, 32vw, 580px);
  height: clamp(340px, 32vw, 580px);
  border-radius: 999px;
  filter: blur(36px);
  pointer-events: none;
}

body::before {
  top: 36px;
  left: clamp(-120px, 4vw, 72px);
  opacity: 0.12;
  background: radial-gradient(circle, rgba(215, 170, 85, 0.5), rgba(215, 170, 85, 0.16) 46%, transparent 76%);
}

body::after {
  right: clamp(8px, 7vw, 120px);
  bottom: clamp(24px, 10vh, 130px);
  opacity: 0.15;
  background: radial-gradient(circle, rgba(42, 140, 101, 0.54), rgba(42, 140, 101, 0.18) 48%, transparent 78%);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100vw - 30px));
  margin: 0 auto;
  padding: 10px 0 24px;
}

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(272px, auto) minmax(0, 1fr) auto;
  gap: 10px 18px;
  align-items: center;
  margin-bottom: 8px;
  padding: 12px 18px;
  border: 1px solid rgba(215, 168, 96, 0.28);
  border-radius: 22px;
  background: #0e1c16;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(247, 241, 227, 0.08);
  backdrop-filter: blur(5px);
}

.platform-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.platform-brand:focus-visible {
  outline: 2px solid #d7a860;
  outline-offset: 3px;
  border-radius: 12px;
}

.platform-brand__icon {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.24));
}

.platform-brand__copy {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 58px;
  min-width: 0;
}

.platform-brand__name {
  color: #d7a860;
  font-size: clamp(1.26rem, 1.35vw, 1.34rem);
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.platform-brand__tagline {
  color: rgba(247, 241, 227, 0.9);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.125em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.online-mode-entry {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.online-mode-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: auto;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(219, 188, 145, 0.2);
  border-radius: 12px;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(16, 28, 23, 0.96), rgba(9, 17, 14, 0.96));
  color: rgba(242, 229, 208, 0.84);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 219, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(5px);
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.online-mode-button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(215, 168, 96, 0.98), transparent);
  opacity: 0;
  transform: scaleX(0.5);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.online-mode-button__icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.24));
}

.online-mode-button:hover,
.online-mode-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(215, 168, 96, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    rgba(20, 43, 35, 0.72);
  color: #fff7e8;
  box-shadow:
    0 7px 13px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(247, 241, 227, 0.09);
  outline: none;
}

.online-mode-button:hover::after,
.online-mode-button:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.online-mode-button:focus-visible {
  outline: 2px solid rgba(215, 168, 96, 0.42);
  outline-offset: 3px;
}

.site-header[data-online-user-state="connected"] .online-mode-button--guest,
.site-header[data-online-user-state="guest"] .online-mode-button--connected {
  display: none;
}

.notification-center {
  position: absolute;
  top: var(--notification-center-top, 50%);
  left: var(--notification-center-left, 50%);
  transform: translate(-50%, -50%);
  z-index: 12420;
}

.notification-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(215, 168, 96, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(11, 33, 27, 0.92);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(247, 241, 227, 0.08);
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.notification-bell:hover,
.notification-bell:focus-visible,
.notification-center.is-open .notification-bell {
  transform: translateY(-1px);
  border-color: rgba(215, 168, 96, 0.55);
  box-shadow:
    0 11px 20px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(215, 168, 96, 0.08);
  outline: none;
}

.notification-bell img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 1px solid rgba(255, 230, 190, 0.75);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8d4d, #cc3d22);
  color: #fff9ed;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.notification-badge[hidden],
.notification-panel[hidden],
.notification-empty[hidden] {
  display: none;
}

body:has(#setupModal:not([hidden])) .notification-center,
body:has(#setupModal:not([hidden])) #notificationsPanel {
  display: none !important;
}

.notification-panel {
  position: fixed;
  top: var(--notifications-panel-top, 112px);
  left: var(--notifications-panel-left, 50vw);
  width: min(360px, calc(100vw - 32px));
  max-height: min(460px, calc(100vh - 130px));
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(215, 168, 96, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    #0d2119;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(247, 241, 227, 0.08);
  color: #f7f1e3;
  transform: translateX(-50%);
  z-index: 13050;
}

.notification-panel__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.notification-panel__head strong {
  min-width: 0;
  color: #f7d58d;
  font-size: 1.08rem;
  line-height: 1.15;
}

.notification-panel__head button {
  padding: 7px 10px;
  border: 1px solid rgba(215, 168, 96, 0.28);
  border-radius: 8px;
  background: rgba(247, 241, 227, 0.05);
  color: rgba(247, 241, 227, 0.84);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.12;
  white-space: nowrap;
}

.notification-panel__close {
  order: 3;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #fff4d6;
  font-size: 1.05rem;
  line-height: 1;
}

.notification-panel__head button:not(.notification-panel__close) {
  order: 2;
}

.notification-list {
  display: grid;
  gap: 9px;
}

.notification-item {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid rgba(215, 168, 96, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.notification-item.is-unread {
  border-color: rgba(255, 141, 77, 0.46);
  background: rgba(255, 141, 77, 0.08);
}

.notification-item strong {
  color: #fff4d6;
  font-size: 0.98rem;
  line-height: 1.18;
}

.notification-item p {
  margin: 0;
  color: rgba(247, 241, 227, 0.82);
  font-size: 0.9rem;
  line-height: 1.38;
}

.notification-item time,
.notification-empty {
  color: rgba(247, 241, 227, 0.62);
  font-size: 0.82rem;
  line-height: 1.35;
}

.notification-empty {
  margin: 10px 0 0;
}

.platform-nav {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 0.38vw, 7px);
  min-width: 0;
  overflow: visible;
  scrollbar-width: none;
}

.platform-nav::-webkit-scrollbar {
  display: none;
}

.platform-nav__item {
  position: relative;
  flex: 0 0 auto;
  padding: 7px 8px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(247, 241, 227, 0.9);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.platform-nav__item::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(215, 168, 96, 0.98), transparent);
  opacity: 0;
  transform: scaleX(0.5);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.platform-nav__item:hover,
.platform-nav__item:focus-visible {
  color: #fff7e8;
  border-color: rgba(215, 168, 96, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    rgba(20, 43, 35, 0.72);
  box-shadow:
    0 7px 13px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(247, 241, 227, 0.09);
  outline: none;
  transform: translateY(-1px);
}

.platform-nav__item:hover::after,
.platform-nav__item:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.platform-nav__item--active {
  color: #fff7e8;
  border-color: rgba(215, 168, 96, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(20, 43, 35, 0.82);
  box-shadow:
    0 8px 14px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(247, 241, 227, 0.1);
}

.platform-nav__item--active::after {
  opacity: 0.82;
  transform: scaleX(1);
}

.platform-nav-more {
  position: relative;
  display: none;
  flex: 0 0 auto;
}

.platform-nav-more__summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 10px 8px;
  border: 1px solid rgba(215, 168, 96, 0.26);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    rgba(20, 43, 35, 0.72);
  color: rgba(247, 241, 227, 0.92);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  list-style: none;
  white-space: nowrap;
  box-shadow:
    0 7px 13px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(247, 241, 227, 0.08);
}

.platform-nav-more__summary::-webkit-details-marker {
  display: none;
}

.platform-nav-more__summary::after {
  content: "⌄";
  margin-left: 6px;
  color: #d7a860;
  font-size: 0.95em;
  line-height: 1;
}

.platform-nav-more[open] .platform-nav-more__summary::after {
  transform: rotate(180deg);
}

.platform-nav-more__dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  gap: 4px;
  min-width: 170px;
  padding: 8px;
  border: 1px solid rgba(215, 168, 96, 0.26);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(33, 55, 46, 0.98), rgba(9, 18, 15, 0.98));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(247, 241, 227, 0.08);
}

.platform-nav-more__item {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(247, 241, 227, 0.9);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
}

.platform-nav-more__item--mobile-only,
.platform-nav-more__item--download,
.platform-nav-more__item--primary,
.platform-nav-more__header {
  display: none;
}

.platform-nav-more__item:hover,
.platform-nav-more__item:focus-visible {
  background: rgba(215, 168, 96, 0.12);
  color: #fff7e8;
  outline: none;
}

.platform-nav-toast {
  position: fixed;
  /* Doit rester au-dessus du header/menu, qui passe en z-index:7000 (dropdown
     jusqu'a 9100) sous 1180px de large — sinon ce toast se retrouve caché
     derrière l'interface sur mobile/tablette et petites fenêtres desktop. */
  z-index: 20000;
  top: clamp(78px, 9vh, 112px);
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(215, 168, 96, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(34, 61, 48, 0.96), rgba(6, 24, 17, 0.96));
  color: #fff7e8;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 246, 223, 0.09);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  transform: translate(-50%, -8px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.platform-nav-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.platform-nav-toast[hidden] {
  display: none;
}

.cookie-consent-banner {
  position: fixed;
  z-index: 16000;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px clamp(16px, 4vw, 28px);
  padding: clamp(14px, 2.4vh, 20px) clamp(16px, 4vw, 28px);
  padding-bottom: calc(clamp(14px, 2.4vh, 20px) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(215, 168, 96, 0.42);
  background:
    linear-gradient(180deg, rgba(34, 61, 48, 0.97), rgba(6, 24, 17, 0.98));
  color: #fff7e8;
  box-shadow:
    0 -18px 36px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 246, 223, 0.09);
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.cookie-consent-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-consent-banner[hidden] {
  display: none;
}

.cookie-consent-banner__text {
  flex: 1 1 320px;
  max-width: 640px;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.cookie-consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.cookie-consent-banner__actions button {
  min-height: 44px;
  min-width: 138px;
  padding: 0 22px;
  border-radius: 16px;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 150ms ease,
    filter 150ms ease,
    box-shadow 150ms ease;
}

.cookie-consent-banner__actions button:hover {
  transform: translateY(-1px);
}

.cookie-consent-banner__actions button:active {
  transform: translateY(1px);
  filter: brightness(0.97);
}

.cookie-consent-banner__actions button:focus-visible {
  outline: 2px solid #ffe8a8;
  outline-offset: 2px;
}

.cookie-consent-banner__accept {
  border: 1px solid rgba(120, 86, 30, 0.55);
  background: linear-gradient(180deg, #ffe8a8, #d7a860);
  color: #132018;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.cookie-consent-banner__accept:hover {
  filter: brightness(1.05);
  box-shadow:
    0 13px 24px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.cookie-consent-banner__reject {
  border: 1px solid rgba(215, 168, 96, 0.5);
  background:
    linear-gradient(180deg, rgba(34, 61, 48, 0.98), rgba(6, 20, 14, 0.98));
  color: #fff7e8;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 246, 223, 0.08);
}

.cookie-consent-banner__reject:hover {
  filter: brightness(1.14);
  box-shadow:
    0 13px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 246, 223, 0.12);
}

@media (max-width: 640px) {
  .cookie-consent-banner {
    justify-content: stretch;
    text-align: center;
  }

  .cookie-consent-banner__actions {
    width: 100%;
    justify-content: center;
  }

  .cookie-consent-banner__actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 380px) {
  .cookie-consent-banner__actions {
    flex-direction: column;
  }

  .cookie-consent-banner__actions button {
    width: 100%;
  }
}

.cookie-prefs-inline-link {
  margin-top: 10px;
  padding: 4px 2px;
  border: none;
  background: none;
  color: var(--muted);
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.cookie-prefs-inline-link:hover {
  color: #f5e8d1;
}

.cookie-prefs-inline-link:focus-visible {
  outline: 2px solid #d7a860;
  outline-offset: 2px;
}

.site-game-title {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  gap: 2px;
  padding-top: 0;
  border-top: 0;
  justify-self: center;
  justify-items: center;
  text-align: center;
}

.site-game-title h1 {
  font-size: clamp(1.72rem, 2.15vw, 2.24rem);
  line-height: 1;
  color: #d7a860;
  text-shadow: 0 0 18px rgba(215, 168, 96, 0.14), 0 2px 14px rgba(0, 0, 0, 0.28);
}

.site-game-title .eyebrow {
  color: rgba(247, 241, 227, 0.9);
}

.site-game-title .subtitle {
  font-size: 0.92rem;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid rgba(210, 182, 138, 0.28);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(246, 219, 181, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(27, 42, 36, 0.96), rgba(14, 23, 19, 0.98));
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 241, 217, 0.1);
  backdrop-filter: blur(6px);
}

.topbar-brand,
.topbar-actions {
  min-width: 0;
}

.topbar-status {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(205, 177, 132, 0.18);
  background:
    linear-gradient(180deg, rgba(243, 214, 174, 0.13), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(24, 40, 34, 0.96), rgba(15, 24, 20, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 223, 0.08),
    inset 0 0 0 1px rgba(10, 18, 15, 0.28);
}

.topbar-status .subtle {
  color: rgba(236, 222, 196, 0.82);
}

.status-label {
  color: rgba(226, 210, 183, 0.72);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.turn-banner {
  display: block;
  font-size: 1.22rem;
  line-height: 1.2;
  color: #fff3d7;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.turn-meta {
  display: block;
  font-size: 0.92rem;
  line-height: 1.35;
}

.turn-meta-label {
  color: #fff0cc;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.topbar-timing {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.game-controls-bar {
  grid-column: 2 / 4;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.game-controls-bar .topbar-timing {
  gap: 8px;
}

.account-area {
  position: relative;
  justify-self: end;
  min-width: 0;
}

.account-area[data-account-state="connected"] .account-auth,
.account-area[data-account-state="guest"] .profile-menu {
  display: none;
}

.profile-menu {
  position: relative;
}

.profile-menu[open] .profile-chevron {
  transform: rotate(180deg);
}

.profile-trigger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 178px;
  padding: 6px 8px 6px 6px;
  border: 1px solid rgba(215, 168, 96, 0.26);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.016)),
    rgba(11, 33, 27, 0.9);
  color: #f7f1e3;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(247, 241, 227, 0.08);
  list-style: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.profile-trigger:hover,
.profile-trigger:focus-visible,
.profile-menu[open] .profile-trigger {
  transform: translateY(-1px);
  border-color: rgba(215, 168, 96, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025)),
    rgba(15, 43, 35, 0.94);
  box-shadow:
    0 13px 24px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(215, 168, 96, 0.08),
    inset 0 1px 0 rgba(247, 241, 227, 0.11);
  outline: none;
}

.profile-trigger::-webkit-details-marker {
  display: none;
}

.profile-avatar {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 0;
  object-fit: contain;
  border: 0;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.3));
}

.profile-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.profile-copy strong,
.profile-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  color: #fff7e8;
  font-size: 0.95rem;
  line-height: 1.08;
}

.profile-copy span {
  color: rgba(247, 241, 227, 0.9);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.08;
}

.profile-level-star {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 3px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  line-height: 1;
  vertical-align: -0.18em;
}

.profile-level-star.is-trophy-icon {
  width: 22px;
  height: 22px;
  margin-left: 5px;
  filter: drop-shadow(0 2px 5px rgba(215, 168, 96, 0.32));
  vertical-align: -0.3em;
}

.profile-chevron {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(215, 168, 96, 0.18));
  transition:
    transform 150ms ease,
    filter 160ms ease;
}

.profile-trigger:hover .profile-chevron,
.profile-trigger:focus-visible .profile-chevron,
.profile-menu[open] .profile-chevron {
  filter: drop-shadow(0 0 12px rgba(215, 168, 96, 0.34));
}

.profile-menu[open] {
  z-index: 12250 !important;
}

.account-auth {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(6, 20, 16, 0.18);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.account-auth button {
  padding: 8px 12px;
  border: 1px solid rgba(215, 168, 96, 0.4);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(247, 241, 227, 0.06), rgba(247, 241, 227, 0)),
    rgba(10, 32, 25, 0.94);
  color: rgba(247, 241, 227, 0.9);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(247, 241, 227, 0.08);
  transition:
    transform 150ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.account-auth button:nth-child(2) {
  border-color: rgba(247, 216, 145, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 241, 196, 0.28), rgba(215, 168, 96, 0.04)),
    #d7a860;
  color: #0e1c16;
  box-shadow:
    0 7px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 248, 217, 0.55);
}

.account-auth:hover {
  background: rgba(215, 168, 96, 0.06);
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.16);
}

.account-auth button:hover,
.account-auth button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(247, 216, 145, 0.78);
  background:
    linear-gradient(180deg, rgba(247, 241, 227, 0.14), rgba(247, 241, 227, 0.03)),
    rgba(17, 49, 38, 0.98);
  color: #fff7e8;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(215, 168, 96, 0.12),
    0 0 18px rgba(215, 168, 96, 0.18),
    inset 0 1px 0 rgba(247, 241, 227, 0.16);
  outline: none;
}

.account-auth button:nth-child(2):hover,
.account-auth button:nth-child(2):focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 248, 217, 0.42), rgba(215, 168, 96, 0.06)),
    #e3b971;
  color: #07150f;
  box-shadow:
    0 11px 20px rgba(0, 0, 0, 0.24),
    0 0 20px rgba(215, 168, 96, 0.24),
    inset 0 1px 0 rgba(255, 250, 228, 0.7);
  outline: none;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12260 !important;
  display: grid;
  gap: 4px;
  min-width: 268px;
  padding: 14px 10px 10px;
  border: 1px solid rgba(215, 168, 96, 0.26);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 48, 38, 0.98), rgba(7, 22, 17, 0.99)),
    #0e1c16;
  opacity: 1;
  isolation: isolate;
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(247, 241, 227, 0.07);
}

.profile-dropdown > * {
  position: relative;
  z-index: 1;
}

.profile-xp-card {
  display: grid;
  gap: 6px;
  padding: 12px 12px 11px;
  margin: 22px 0 6px;
  border: 1px solid rgba(215, 168, 96, 0.26);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 246, 213, 0.12), rgba(255, 246, 213, 0.022)),
    rgba(15, 43, 35, 0.78);
  color: #fff7e8;
  box-shadow:
    inset 0 1px 0 rgba(247, 241, 227, 0.11),
    inset 0 -10px 18px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.14);
}

.profile-xp-card__eyebrow {
  color: #d7a860;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-xp-card strong {
  color: #fff7e8;
  font-size: 0.95rem;
  line-height: 1.1;
}

.profile-xp-card p {
  margin: 0;
  color: rgba(247, 241, 227, 0.84);
  font-size: 0.78rem;
  line-height: 1.28;
}

.profile-xp-bar,
.endgame-xp-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(215, 168, 96, 0.34);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.05)),
    rgba(6, 20, 16, 0.72);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.46),
    0 1px 0 rgba(255, 244, 205, 0.08);
}

.profile-xp-bar span,
.endgame-xp-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 247, 213, 0.68), rgba(255, 247, 213, 0.08)),
    linear-gradient(90deg, #916227, #d7a860 54%, #fff0b7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 12px rgba(215, 168, 96, 0.32);
  transition: width 420ms ease;
}

.profile-dropdown__close {
  position: absolute;
  top: 10px;
  left: auto;
  right: 10px;
  z-index: 6;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(224, 187, 116, 0.38);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 239, 190, 0.16), transparent 56%),
    rgba(9, 24, 19, 0.78);
  color: rgba(255, 238, 199, 0.94);
  display: inline-grid;
  place-items: center;
  font-size: 1.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.24);
  transition:
    transform 120ms ease,
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.profile-dropdown button {
  width: 100%;
  min-height: 40px;
  padding: 8px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(247, 241, 227, 0.9);
  text-align: left;
  font-size: 0.98rem;
  line-height: 1.25;
}

.profile-dropdown button.profile-dropdown__close {
  position: absolute;
  top: 10px;
  left: auto;
  right: 10px;
  z-index: 6;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(224, 187, 116, 0.38);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 239, 190, 0.16), transparent 56%),
    rgba(9, 24, 19, 0.78);
  color: rgba(255, 238, 199, 0.94);
  text-align: center;
  font-size: 1.72rem;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.24);
}

.profile-dropdown button.profile-dropdown__close:hover,
.profile-dropdown button.profile-dropdown__close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 221, 144, 0.78);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 236, 181, 0.28), transparent 58%),
    rgba(27, 48, 38, 0.94);
  color: #ffe6a8;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.18),
    0 10px 20px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(231, 185, 100, 0.16);
}

.profile-dropdown button:hover,
.profile-dropdown button:focus-visible {
  background: rgba(215, 168, 96, 0.12);
  color: #fff7e8;
  outline: none;
}

.time-mode-picker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(208, 177, 134, 0.18);
  background:
    linear-gradient(180deg, rgba(243, 214, 174, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(24, 39, 34, 0.95), rgba(15, 24, 20, 0.94));
  color: rgba(241, 226, 203, 0.82);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.time-mode-picker select {
  border: none;
  outline: none;
  background: transparent;
  color: #fff3db;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}

.time-mode-picker select option {
  color: #241a12;
}

.game-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(219, 188, 145, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(16, 28, 23, 0.96), rgba(9, 17, 14, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 219, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.16);
  color: #fff3db;
  backdrop-filter: blur(5px);
}

.match-timer {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.match-timer[hidden] {
  display: none;
}

.match-timer__icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter:
    drop-shadow(0 1px 0 rgba(255, 242, 214, 0.12))
    drop-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
}

.match-timer .game-timer-label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: none;
}

.match-timer .game-timer-value {
  margin-left: 0;
  color: #fff7e8;
  font-size: 0.92rem;
}

.game-timer.is-timed {
  border-color: rgba(228, 195, 122, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 219, 0.1),
    0 10px 18px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(216, 177, 105, 0.08);
}

.game-timer-icon {
  opacity: 0.78;
  font-size: 0.95rem;
}

.game-timer-label {
  color: rgba(236, 219, 191, 0.74);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.game-timer-value {
  margin-left: auto;
  font-size: 1rem;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #fff7ea;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 146px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(219, 188, 145, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(16, 28, 23, 0.96), rgba(9, 17, 14, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 219, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.16);
  color: #fff3db;
  backdrop-filter: blur(5px);
  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    filter 160ms ease;
}

.sound-toggle:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 219, 0.1),
    0 10px 18px rgba(0, 0, 0, 0.2);
}

.sound-toggle.is-enabled {
  border-color: rgba(120, 214, 147, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 219, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(101, 199, 130, 0.08);
}

.sound-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.sound-toggle-icon img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.sound-toggle-text {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(242, 229, 208, 0.84);
}

.topbar-meta {
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 4px;
  color: rgba(217, 196, 168, 0.68);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3.35vw, 3rem);
  letter-spacing: 0.02em;
  color: #fff2dc;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

h2 {
  font-size: 1.08rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

code {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.95em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.subtitle,
.subtle {
  color: var(--muted);
}

.subtitle {
  margin-top: 3px;
  font-size: 0.9rem;
  color: rgba(227, 212, 189, 0.76);
}

.primary,
.actions button,
.ffsc-link {
  border-radius: 16px;
  border: 1px solid rgba(77, 57, 38, 0.6);
  font-weight: 700;
  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary:hover,
.actions button:hover,
.ffsc-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.primary {
  padding: 12px 20px;
  background:
    linear-gradient(180deg, #d9b26e, #b27f3e),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent);
  border-color: rgba(105, 66, 27, 0.8);
  color: #fff8ec;
  box-shadow:
    0 14px 22px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 245, 221, 0.48);
}

.layout {
  display: grid;
  grid-template-columns: minmax(236px, 300px) minmax(660px, 1fr) minmax(210px, 260px);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}

.board-panel,
.panel {
  border-radius: 28px;
  border: 1px solid rgba(205, 177, 132, 0.16);
  background:
    linear-gradient(180deg, rgba(243, 215, 176, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(22, 34, 29, 0.96), rgba(15, 22, 19, 0.96));
  box-shadow:
    0 20px 38px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 243, 221, 0.06);
}

.board-panel {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 4px 16px 30px;
  min-width: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(72, 118, 96, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(244, 215, 175, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(17, 30, 25, 0.98), rgba(11, 18, 15, 0.98));
  border-color: rgba(205, 177, 132, 0.22);
}

.board-panel h2,
.board-panel .subtle,
.rack-card h2,
.rack-card .subtle {
  color: #f3ead7;
}

.board-header .subtle,
.rack-header .subtle {
  color: rgba(235, 226, 212, 0.78);
}

.panel {
  padding: 16px;
}

.panel-head {
  display: grid;
  gap: 4px;
}

.panel-head--with-icon {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.scores .panel-head--with-icon {
  grid-template-columns: auto auto minmax(0, 1fr);
}

.match-online-action {
  display: none;
}

.scores .notification-center {
  position: relative;
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  margin: 0;
  top: auto;
  left: auto;
  transform: none;
}

.scores .notification-bell {
  width: 28px;
  height: 28px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.scores .notification-bell:hover,
.scores .notification-bell:focus-visible,
.scores .notification-center.is-open .notification-bell {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.scores .notification-bell img {
  width: 22px;
  height: 22px;
}

.panel-title-icon {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter:
    drop-shadow(0 1px 0 rgba(255, 242, 214, 0.12))
    drop-shadow(0 4px 7px rgba(0, 0, 0, 0.22));
}

.panel-title-icon-players {
  width: 34px;
  height: 34px;
}

.match-title-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.panel-head h2 {
  color: #f6ead3;
}

.panel-head .subtle {
  color: rgba(236, 220, 194, 0.8);
}

.board-header,
.rack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.board-header > div {
  display: grid;
  gap: 0;
  width: 100%;
}

.board-info {
  min-width: 0;
  width: 100%;
}

.enriched-word-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  max-width: none;
  height: 92px;
  min-height: 92px;
  margin: 0;
  padding: 7px 14px 8px;
  border-radius: 16px;
  border: 1px solid rgba(226, 191, 126, 0.24);
  background:
    linear-gradient(180deg, rgba(35, 61, 51, 0.9), rgba(14, 25, 21, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 222, 0.1),
    0 6px 14px rgba(0, 0, 0, 0.1);
}

.panel-lexicon {
  padding: 12px;
}

.panel-lexicon .board-header {
  display: block;
}

.panel-lexicon .enriched-word-panel {
  height: 212px;
  min-height: 212px;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel-status {
  padding-top: 9px;
  padding-bottom: 9px;
}

.panel-status .message {
  max-height: 82px;
  min-height: 62px;
  overflow: auto;
  padding-top: 8px;
  padding-bottom: 8px;
}

.enriched-word-panel[data-state="default"] {
  gap: 4px;
  background: linear-gradient(180deg, rgba(31, 51, 43, 0.76), rgba(14, 25, 21, 0.8));
}

.enriched-word-panel:not([data-state="default"]) {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding-top: 8px;
}

.panel-lexicon .enriched-word-panel[data-state="default"],
.panel-lexicon .enriched-word-panel:not([data-state="default"]) {
  background: transparent;
}

.panel-lexicon .enriched-word-panel:not([data-state="default"]) {
  padding-top: 2px;
}

.enriched-word-panel.has-guide-demo {
  display: grid;
  align-content: stretch;
}

.enriched-word-panel.has-guide-demo > :not(.interactive-guide-lexicon-demo) {
  display: none;
}

.board-stage {
  position: relative;
  display: block;
  width: min(100%, 1062px);
  margin: -18px auto -32px;
  aspect-ratio: 1;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 242, 202, 0.2), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(126, 83, 43, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 241, 207, 0.58), rgba(185, 133, 75, 0.18) 28%, transparent 48%),
    linear-gradient(315deg, rgba(88, 55, 28, 0.22), transparent 42%),
    linear-gradient(180deg, #edd09b 0%, #d9ad70 12%, #a97843 50%, #d2a066 88%, #f1d8a7 100%);
  border: 0;
  box-shadow:
    inset 0 2px 0 rgba(255, 248, 223, 0.48),
    inset 0 -2px 0 rgba(88, 55, 28, 0.22),
    inset 0 0 0 1px rgba(255, 230, 181, 0.2),
    0 24px 40px rgba(0, 0, 0, 0.22);
}

body[data-board-style="classic-css"] .board-stage {
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 250, 222, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(119, 84, 47, 0.94), rgba(69, 49, 28, 0.98));
  border: 1px solid rgba(214, 184, 123, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 214, 0.1),
    inset 0 0 0 1px rgba(36, 23, 12, 0.3),
    0 24px 40px rgba(0, 0, 0, 0.32);
}

body[data-board-style="native-css"] .board-stage {
  --board-grid-top: 5.9%;
  --board-grid-right: 5.45%;
  --board-grid-bottom: 5.45%;
  --board-grid-left: 5.9%;
  --board-grid-column-gap: 0px;
  --board-grid-row-gap: 0px;
  width: min(98%, 1120px);
  max-width: 100%;
  margin: 12px auto 0;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 241, 207, 0.72), rgba(185, 133, 75, 0.18) 22%, transparent 42%),
    linear-gradient(315deg, rgba(126, 83, 43, 0.34), transparent 38%),
    linear-gradient(180deg, #efd19a 0%, #d8aa68 11%, #a9743f 50%, #d5a365 89%, #f5dca9 100%);
  border: 1px solid rgba(255, 232, 184, 0.62);
  box-shadow:
    inset 0 2px 0 rgba(255, 250, 225, 0.62),
    inset 0 -2px 0 rgba(98, 55, 25, 0.28),
    inset 0 0 0 8px rgba(255, 230, 181, 0.22),
    inset 0 0 0 16px rgba(113, 70, 36, 0.14),
    0 24px 46px rgba(0, 0, 0, 0.28);
}

.word-highlights {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.board-tour-target {
  position: absolute;
  inset: var(--board-grid-top) var(--board-grid-right) var(--board-grid-bottom) var(--board-grid-left);
  pointer-events: none;
  z-index: 0;
}

.ai-move-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}

.ai-move-layer:not(.is-active) {
  display: none;
}

.ai-move-layer .ai-flying-tile {
  position: absolute;
  margin: 0;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 10px 16px rgba(16, 12, 7, 0.2));
  transform: translate3d(0, 0, 0) scale(0.92);
  justify-self: auto;
  align-self: auto;
  transition:
    transform 520ms cubic-bezier(0.2, 0.8, 0.22, 1),
    opacity 170ms ease-out;
  transition-delay: var(--ai-flight-delay, 0ms);
}

.ai-move-layer .ai-flying-tile.is-visible {
  opacity: 1;
}

.ai-move-layer .ai-flying-tile.is-travelling {
  opacity: 1;
  transform: translate3d(var(--ai-flight-dx, 0px), var(--ai-flight-dy, 0px), 0) scale(1);
}

.master-move-celebration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.master-move-celebration[hidden] {
  display: none;
}

.joker-picker {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: rgba(8, 15, 13, 0.34);
  backdrop-filter: blur(2px);
}

.joker-picker[hidden] {
  display: none;
}

.confirm-modal {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  background: rgba(8, 15, 13, 0.38);
  backdrop-filter: blur(2px);
}

.confirm-modal[hidden] {
  display: none;
}

.resume-modal,
.setup-modal {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  padding: clamp(14px, 3vw, 24px);
  overflow: auto;
}

.resume-modal {
  z-index: 31;
}

.setup-modal {
  z-index: 32;
}

.resume-modal-card {
  width: min(92%, 440px);
}

.setup-modal-card {
  width: min(94vw, 1120px);
  min-height: min(84vh, 920px);
  max-height: min(90vh, 940px);
  overflow: hidden;
  padding: 26px 26px 24px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.setup-modal-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.interactive-guide-button {
  margin-top: 0;
  border-color: rgba(229, 196, 132, 0.3);
  background:
    linear-gradient(180deg, rgba(229, 196, 132, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(17, 31, 26, 0.9);
}

.interactive-guide-button:hover {
  border-color: rgba(229, 196, 132, 0.52);
}

.setup-modal-card {
  position: relative;
}

.setup-modal-back {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(238, 203, 141, 0.46);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 247, 224, 0.98), rgba(225, 194, 142, 0.92)),
    rgba(238, 203, 141, 0.92);
  color: #2b2015;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 20px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.setup-modal-back:hover,
.setup-modal-back:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 226, 166, 0.72);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 24px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(238, 203, 141, 0.18);
}

.setup-modal-header {
  padding-right: 96px;
}

.setup-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  align-items: stretch;
}

.setup-section {
  display: grid;
  gap: 14px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(212, 184, 141, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(13, 20, 18, 0.42);
}

.setup-section--avatars {
  min-height: 0;
}

.setup-section--details {
  align-content: start;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 10px;
  scrollbar-color: rgba(215, 168, 96, 0.82) rgba(7, 22, 17, 0.42);
  scrollbar-width: thin;
}

.setup-section--details::-webkit-scrollbar {
  width: 8px;
}

.setup-section--details::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(7, 22, 17, 0.42);
}

.setup-section--details::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 22, 17, 0.42);
  border-radius: 999px;
  background: rgba(215, 168, 96, 0.82);
}

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

.setup-field-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

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

.setup-player-roster[hidden] {
  display: none;
}

.setup-player-chip {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(212, 184, 141, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(11, 18, 16, 0.48);
  color: #f7ead0;
  text-align: left;
  transition:
    transform 120ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.setup-player-chip.is-active {
  border-color: rgba(239, 203, 136, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.12),
    0 10px 18px rgba(0, 0, 0, 0.16);
}

.setup-player-chip-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  object-position: 50% 10%;
  border: 1px solid rgba(255, 247, 232, 0.1);
  background: rgba(15, 23, 19, 0.82);
}

.setup-player-chip-copy {
  display: grid;
  gap: 3px;
}

.setup-player-chip-copy strong {
  color: #fff2d9;
  font-size: 0.92rem;
}

.setup-player-chip-copy span {
  color: rgba(240, 225, 198, 0.78);
  font-size: 0.77rem;
}

.setup-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

#setupInvalidPenaltyField {
  grid-column: 1 / -1;
}

.setup-field span {
  color: rgba(243, 230, 205, 0.82);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-weight: 700;
}

.setup-field input,
.setup-field select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(201, 171, 124, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(12, 20, 17, 0.78);
  color: #f7e9cf;
  padding: 0 12px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 246, 225, 0.06);
}

.setup-field input::placeholder {
  color: rgba(232, 216, 193, 0.48);
}

.setup-avatar-grid-wrap {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.setup-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.setup-avatar-option {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(212, 184, 141, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(11, 18, 16, 0.5);
  color: #f7ead0;
  text-align: left;
  transition:
    transform 120ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.setup-avatar-option:hover {
  transform: translateY(-1px);
  border-color: rgba(223, 193, 147, 0.28);
}

.setup-avatar-option.is-selected {
  border-color: rgba(239, 203, 136, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.1),
    0 10px 18px rgba(0, 0, 0, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 240, 205, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(17, 28, 23, 0.58);
}

.setup-avatar-option.is-disabled {
  opacity: 0.38;
  filter: saturate(0.58);
  cursor: not-allowed;
}

.setup-avatar-option.is-disabled:hover {
  transform: none;
  border-color: rgba(212, 184, 141, 0.18);
}

.setup-avatar-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 247, 232, 0.08);
  background: rgba(15, 23, 19, 0.82);
}

.setup-avatar-copy {
  display: grid;
  gap: 3px;
}

.setup-avatar-name {
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-weight: 800;
  color: #fff2d9;
  font-size: 0.98rem;
}

.setup-avatar-meta {
  display: none;
}

.setup-summary {
  margin: 0;
  line-height: 1.55;
}

.setup-modal-actions {
  margin-top: auto;
}

.setup-opponent-preview[hidden] {
  display: none;
}

.setup-opponent-preview {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: visible;
  padding: 12px;
  padding-bottom: 14px;
  border: 1px solid rgba(215, 168, 96, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 16% 0%, rgba(215, 168, 96, 0.13), transparent 42%),
    rgba(7, 22, 17, 0.56);
}

.setup-opponent-preview__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.setup-opponent-preview__head h3 {
  margin: 0;
  color: #fff2d9;
  font-size: 0.98rem;
  line-height: 1.15;
}

.setup-opponent-preview__head span,
.setup-opponent-preview__status {
  color: rgba(243, 230, 205, 0.68);
  font-size: 0.76rem;
  font-weight: 800;
}

.setup-opponent-preview__list {
  display: grid;
  gap: 8px;
}

.setup-opponent-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(212, 184, 141, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.07), rgba(255, 255, 255, 0.018)),
    rgba(11, 18, 16, 0.48);
}

.setup-opponent-card img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 247, 232, 0.1);
  background: rgba(15, 23, 19, 0.82);
  object-fit: cover;
  object-position: center top;
}

.setup-opponent-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.setup-opponent-card strong {
  overflow: hidden;
  color: #fff2d9;
  font-size: 0.92rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-opponent-card span {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(215, 168, 96, 0.12);
  color: #ffe4a8;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.setup-opponent-card p {
  margin: 0;
  color: rgba(247, 234, 208, 0.78);
  font-size: 0.78rem;
  line-height: 1.28;
}

.setup-opponent-preview__status {
  margin: 0;
}

.setup-field[hidden],
.setup-player-roster[hidden] {
  display: none;
}

.turn-transition-modal {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  padding: clamp(14px, 3vw, 24px);
  overflow: auto;
  z-index: 34;
}

.turn-transition-card {
  margin: auto;
  width: min(92vw, 430px);
  text-align: center;
  gap: 12px;
  justify-items: center;
}

.game-timer.is-warning {
  border-color: rgba(229, 199, 118, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 218, 0.14),
    0 0 0 1px rgba(224, 191, 118, 0.14),
    0 10px 20px rgba(0, 0, 0, 0.22);
}

.game-timer.match-timer.is-timed,
.game-timer.match-timer.is-warning {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.turn-transition-card .confirm-modal-actions {
  width: 100%;
  justify-content: center;
}

.turn-transition-card button {
  min-width: 210px;
}


.secondary-panel-action {
  margin-top: 14px;
  min-height: 38px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(201, 171, 124, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(17, 27, 23, 0.84);
  color: #f5e8d1;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 225, 0.08),
    0 6px 12px rgba(0, 0, 0, 0.16);
}

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

.guide-pdf-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.guide-pdf-download-link:hover {
  color: #fff2dc;
}

.history-export-action {
  margin-top: 10px;
  min-height: 34px;
}

.joker-picker-card {
  width: min(92%, 420px);
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(221, 194, 150, 0.26);
  background:
    linear-gradient(180deg, rgba(249, 238, 219, 0.12), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(22, 34, 29, 0.98), rgba(12, 20, 17, 0.98));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 246, 225, 0.08);
}

.confirm-modal-card {
  width: min(92%, 380px);
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(221, 194, 150, 0.26);
  background:
    linear-gradient(180deg, rgba(249, 238, 219, 0.12), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(22, 34, 29, 0.98), rgba(12, 20, 17, 0.98));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 246, 225, 0.08);
}

.confirm-modal-card.setup-modal-card {
  width: min(94vw, 1120px);
  min-height: min(84vh, 920px);
  max-height: min(90vh, 940px);
  overflow: hidden;
  padding: 26px 26px 24px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.joker-picker-card h3 {
  margin: 0 0 6px;
  color: #f8edda;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.confirm-modal-card h3 {
  margin: 0 0 8px;
  color: #f8edda;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.joker-picker-card .subtle {
  color: rgba(232, 216, 193, 0.78);
  font-size: 0.92rem;
}

.confirm-modal-card .subtle {
  color: rgba(232, 216, 193, 0.82);
  font-size: 0.94rem;
  line-height: 1.4;
}

.joker-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.joker-choice,
.joker-picker-actions button {
  border-radius: 12px;
  border: 1px solid rgba(201, 171, 124, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(238, 224, 197, 0.94)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  color: #2e2217;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 6px 12px rgba(0, 0, 0, 0.16);
}

.joker-choice {
  min-height: 40px;
  font-size: 1rem;
}

.joker-choice:hover,
.joker-picker-actions button:hover {
  transform: translateY(-1px);
}

.joker-picker-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.joker-picker-actions button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.confirm-modal-actions button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 171, 124, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(238, 224, 197, 0.94)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  color: #2e2217;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 6px 12px rgba(0, 0, 0, 0.16);
}

#confirmOkBtn {
  background:
    linear-gradient(180deg, rgba(121, 213, 139, 0.9), rgba(48, 94, 58, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent);
  color: #f4fff4;
  border-color: rgba(117, 214, 138, 0.3);
}

.confirm-modal.exchange-modal {
  position: fixed;
  inset: 0;
  z-index: 66;
  padding: clamp(16px, 4vw, 28px);
  background: rgba(4, 12, 9, 0.62);
  backdrop-filter: blur(4px);
}

.exchange-modal-card {
  width: min(94vw, 520px);
}

.exchange-tile-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
  margin: 16px 0 10px;
}

.exchange-tile-option {
  min-height: 62px;
  padding: 8px 6px;
  border-radius: 14px;
  border: 1px solid rgba(215, 168, 96, 0.24);
  background:
    linear-gradient(180deg, rgba(34, 57, 47, 0.92), rgba(12, 24, 19, 0.96));
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 225, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.16);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.exchange-tile-option:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 203, 132, 0.48);
  filter: brightness(1.05);
}

.exchange-tile-option.is-selected {
  border-color: rgba(255, 218, 132, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 225, 0.16),
    0 0 0 2px rgba(255, 218, 132, 0.22),
    0 12px 22px rgba(0, 0, 0, 0.24);
}

.exchange-tile-face {
  width: 46px;
  max-width: 100%;
  display: block;
  pointer-events: none;
  cursor: pointer;
}

.exchange-tile-face.tile-joker .tile-art {
  opacity: 1;
  mix-blend-mode: normal;
  filter: drop-shadow(0 2px 3px rgba(32, 23, 9, 0.24));
}

.exchange-modal-status {
  min-height: 1.4em;
  margin: 0;
}

.exchange-modal-status.is-warning {
  color: #ffd083;
}

.exchange-modal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.exchange-modal-tools button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(215, 168, 96, 0.28);
  background:
    linear-gradient(180deg, rgba(37, 61, 51, 0.94), rgba(15, 29, 24, 0.98));
  color: #f4ead4;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 225, 0.08),
    0 6px 12px rgba(0, 0, 0, 0.14);
}

.exchange-modal-tools button:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 203, 132, 0.48);
}

.exchange-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.online-mode-modal {
  position: fixed;
  inset: 0;
  /* ONLINE-0C-MULTI4-E — doit rester au-dessus de .cookie-consent-banner
     (z-index: 16000, position: fixed, pointer-events: auto une fois
     visible) : sur mobile/tablette, avec 3-4 cartes de sieges, ce dialogue
     modal (role="dialog" aria-modal="true") peut approcher le bas du
     viewport et se faire recouvrir par le bandeau cookies, rendant
     Continuer/Quitter inaccessibles pour un premier visiteur — repere
     via capture d'ecran reelle (390x844/412x915, salle a 4 joueurs).
     Reste sous .platform-nav-toast (20000, notification transitoire). */
  z-index: 16500;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 28px);
  background: rgba(4, 12, 9, 0.62);
  backdrop-filter: blur(5px);
}

.online-mode-modal[hidden] {
  display: none;
}

.online-mode-modal__card {
  position: relative;
  width: min(92vw, 560px);
  transition: width 0.15s ease;
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(215, 168, 96, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 168, 96, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(31, 50, 41, 0.98), rgba(10, 24, 19, 0.98));
  color: rgba(247, 241, 227, 0.92);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 243, 221, 0.08);
}

/* ONLINE-0C-MULTI4-E — l'ecran "salle" (cartes joueurs) a besoin de plus de
   largeur qu'un simple choix creer/rejoindre pour que 3 ou 4 cartes
   respirent (grille 2x2, ligne de 3) sans jamais toucher au gabarit des
   deux autres ecrans du meme modal. */
.online-mode-modal__card--room {
  width: min(94vw, 720px);
}

.online-mode-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 168, 96, 0.26);
  border-radius: 10px;
  background: rgba(9, 22, 17, 0.72);
  color: rgba(247, 241, 227, 0.9);
  font-size: 1.25rem;
  line-height: 1;
}

.online-mode-modal__close:hover,
.online-mode-modal__close:focus-visible {
  border-color: rgba(215, 168, 96, 0.54);
  background: rgba(25, 48, 39, 0.9);
  color: #fff7e8;
  outline: none;
}

.online-mode-modal__eyebrow {
  margin: 0 0 8px;
  color: rgba(215, 168, 96, 0.9);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.online-mode-modal h3 {
  margin: 0 36px 10px 0;
  color: #fff2dc;
  font-size: clamp(1.35rem, 2vw, 1.72rem);
  line-height: 1.16;
}

.online-mode-modal p {
  margin: 0;
  color: rgba(247, 241, 227, 0.88);
  font-size: 1rem;
  line-height: 1.55;
}

.online-mode-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.online-mode-benefits li {
  position: relative;
  min-height: 34px;
  padding: 8px 10px 8px 30px;
  border: 1px solid rgba(215, 168, 96, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 216, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(12, 31, 24, 0.76);
  color: rgba(247, 241, 227, 0.9);
  font-size: 0.88rem;
  font-weight: 750;
}

.online-mode-benefits li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d7a860;
  box-shadow: 0 0 12px rgba(215, 168, 96, 0.34);
  transform: translateY(-50%);
}

.online-mode-modal__notice {
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid rgba(215, 168, 96, 0.22);
  border-radius: 12px;
  background: rgba(215, 168, 96, 0.08);
  color: #efd39b;
  font-weight: 850;
}

.online-mode-modal__notice[hidden] {
  display: none;
}

.online-mode-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.online-mode-modal__actions button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(215, 168, 96, 0.28);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(247, 241, 227, 0.08), rgba(247, 241, 227, 0.02)),
    rgba(13, 34, 27, 0.92);
  color: rgba(247, 241, 227, 0.92);
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(247, 241, 227, 0.08);
}

.online-mode-modal__actions button:hover,
.online-mode-modal__actions button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(215, 168, 96, 0.5);
  background:
    linear-gradient(180deg, rgba(247, 241, 227, 0.13), rgba(247, 241, 227, 0.03)),
    rgba(21, 49, 39, 0.98);
  outline: none;
}

.online-mode-modal__actions .online-mode-modal__primary {
  border-color: rgba(247, 216, 145, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 241, 196, 0.3), rgba(215, 168, 96, 0.06)),
    #d7a860;
  color: #0e1c16;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 248, 217, 0.55);
}

.online-mode-modal__actions .online-mode-modal__primary:hover,
.online-mode-modal__actions .online-mode-modal__primary:focus-visible {
  border-color: rgba(255, 229, 166, 0.86);
  background:
    linear-gradient(180deg, rgba(255, 248, 217, 0.42), rgba(215, 168, 96, 0.08)),
    #e3b971;
  color: #07150f;
}

/* ONLINE-0B-FRONT-B — lobby en ligne (creer/rejoindre/attendre une salle) */

.online-lobby-state[hidden] {
  display: none;
}

.online-lobby-resume {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(215, 168, 96, 0.3);
  border-radius: 12px;
  background: rgba(215, 168, 96, 0.08);
}

.online-lobby-resume__text {
  margin: 0 0 10px;
  color: #efd39b;
  font-weight: 750;
}

.online-lobby-resume__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.online-lobby-choice-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.online-lobby-choice-btn {
  min-height: 48px;
  border: 1px solid rgba(215, 168, 96, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(247, 241, 227, 0.08), rgba(247, 241, 227, 0.02)),
    rgba(13, 34, 27, 0.92);
  color: rgba(247, 241, 227, 0.92);
  font-weight: 850;
  font-size: 1rem;
}

.online-lobby-choice-btn:hover,
.online-lobby-choice-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(215, 168, 96, 0.5);
  outline: none;
}

/* ONLINE-0C-MULTI4-E — choix du nombre de joueurs avant creation. */
.online-lobby-player-count {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.online-lobby-player-count__label {
  color: rgba(215, 168, 96, 0.9);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.online-lobby-segmented {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(215, 168, 96, 0.3);
  border-radius: 12px;
  background: rgba(9, 22, 17, 0.6);
}

.online-lobby-segmented__btn {
  min-width: 46px;
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(247, 241, 227, 0.72);
  font-weight: 850;
  font-size: 0.98rem;
  cursor: pointer;
}

.online-lobby-segmented__btn:hover,
.online-lobby-segmented__btn:focus-visible {
  color: #fff2dc;
  outline: none;
}

.online-lobby-segmented__btn.is-active {
  background:
    linear-gradient(180deg, rgba(255, 241, 196, 0.3), rgba(215, 168, 96, 0.06)),
    #d7a860;
  color: #0e1c16;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 248, 217, 0.5);
}

.online-lobby-field {
  display: block;
  margin: 18px 0 6px;
  color: rgba(215, 168, 96, 0.9);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.online-lobby-code-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(215, 168, 96, 0.34);
  border-radius: 12px;
  background: rgba(9, 22, 17, 0.72);
  color: #fff2dc;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
}

.online-lobby-code-input:focus-visible {
  outline: none;
  border-color: rgba(215, 168, 96, 0.7);
}

.online-lobby-error {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(214, 92, 92, 0.4);
  border-radius: 12px;
  background: rgba(214, 92, 92, 0.1);
  color: #f3b8b8;
  font-weight: 750;
  font-size: 0.9rem;
}

.online-lobby-error[hidden] {
  display: none;
}

.online-lobby-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(215, 168, 96, 0.38);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 244, 216, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(9, 22, 17, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 219, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.16);
}

.online-lobby-code-value {
  color: #fff2dc;
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.online-lobby-copy-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(215, 168, 96, 0.36);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(247, 241, 227, 0.1), rgba(247, 241, 227, 0.02)),
    rgba(13, 34, 27, 0.94);
  color: rgba(247, 241, 227, 0.92);
  font-weight: 800;
  font-size: 0.84rem;
}

.online-lobby-copy-feedback {
  color: #9fd7ab;
  font-weight: 800;
  font-size: 0.84rem;
}

.online-lobby-copy-feedback[hidden] {
  display: none;
}

.online-lobby-status-text {
  margin-top: 10px;
  color: rgba(247, 241, 227, 0.8);
  font-size: 0.92rem;
}

/* ONLINE-0C-MULTI4-E — grille par defaut = 2 joueurs (identique a avant) ;
   les modificateurs --n3/--n4 (ajoutes par renderOnlineLobbySeats()) ne
   changent le nombre de colonnes qu'a partir de 641px (voir media query
   plus bas) pour ne jamais entrer en conflit avec l'empilement mobile. */
.online-lobby-seats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 28px) clamp(22px, 3.4vw, 30px);
  margin-top: 24px;
}

@media (min-width: 641px) {
  .online-lobby-seats--n3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .online-lobby-seats--n4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.online-lobby-seat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  gap: 11px;
  padding: 22px 16px 20px;
  border: 1px solid rgba(215, 168, 96, 0.32);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 244, 216, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(12, 31, 24, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 219, 0.08),
    0 14px 26px rgba(0, 0, 0, 0.16);
  text-align: center;
}

.online-lobby-seat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 246, 219, 0.1), transparent 42%);
  pointer-events: none;
}

.online-lobby-seat--empty {
  border-style: dashed;
  opacity: 0.78;
  box-shadow: inset 0 1px 0 rgba(255, 246, 219, 0.05);
}

.online-lobby-seat__avatar {
  position: relative;
  width: 66px;
  height: 66px;
  border: 2px solid rgba(239, 211, 155, 0.58);
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 4px rgba(215, 168, 96, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.2);
}

.online-lobby-seat__avatar[hidden] {
  display: none;
}

.online-lobby-seat__placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 2px dashed rgba(215, 168, 96, 0.42);
  border-radius: 50%;
  color: rgba(215, 168, 96, 0.7);
  font-size: 1.3rem;
  font-weight: 900;
  background: rgba(6, 18, 14, 0.2);
}

.online-lobby-seat__placeholder[hidden] {
  display: none;
}

.online-lobby-seat__name {
  position: relative;
  max-width: 100%;
  color: rgba(247, 241, 227, 0.92);
  font-weight: 850;
  font-size: 0.98rem;
  line-height: 1.18;
  word-break: break-word;
}

.online-lobby-seat__badge {
  position: relative;
  padding: 3px 9px;
  border: 1px solid rgba(239, 211, 155, 0.28);
  border-radius: 999px;
  background: rgba(215, 168, 96, 0.2);
  color: #f4dba5;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 246, 219, 0.1);
}

.online-lobby-seat__badge[hidden] {
  display: none;
}

.online-lobby-ready-message {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  padding: 10px 12px;
  border: 1px solid rgba(159, 215, 171, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(159, 215, 171, 0.13), rgba(159, 215, 171, 0.07)),
    rgba(9, 22, 17, 0.38);
  color: #bfe9c6;
  font-weight: 800;
}

.online-lobby-ready-message::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9fd7ab;
  box-shadow: 0 0 10px rgba(159, 215, 171, 0.35);
}

.online-lobby-ready-message[hidden] {
  display: none;
}

/* ONLINE-0C-C2 — indicateur discret "En ligne" sur le panneau Match une
   fois le gameplay online affiche (lecture seule). */
.online-game-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 10px;
  border: 1px solid rgba(215, 168, 96, 0.4);
  border-radius: 999px;
  background: rgba(215, 168, 96, 0.14);
  color: #efd39b;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.online-game-badge[hidden] {
  display: none;
}

.word-highlight {
  position: absolute;
  border-radius: 14px;
  border: 3px solid rgba(255, 244, 212, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(20, 15, 8, 0.12),
    0 6px 14px rgba(15, 12, 8, 0.14);
  opacity: 1;
}

.word-highlight.vertical {
  border-radius: 16px;
}

.word-highlight.is-main {
  border-width: 4px;
}

.word-highlight.is-cross {
  border-width: 2px;
}

.word-highlight.is-player {
  border-color: rgba(209, 63, 70, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 229, 231, 0.14),
    0 0 0 1px rgba(81, 23, 26, 0.14),
    0 0 10px rgba(209, 63, 70, 0.18);
}

.word-highlight.is-ai {
  border-color: rgba(244, 133, 34, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 239, 219, 0.16),
    0 0 0 1px rgba(98, 50, 9, 0.16),
    0 0 10px rgba(244, 133, 34, 0.22);
}

.word-highlight.is-master-move-focus.is-player,
.word-highlight.is-master-move-focus.is-ai {
  box-shadow:
    inset 0 0 0 1px rgba(255, 249, 229, 0.3),
    0 0 0 1px rgba(125, 89, 29, 0.18),
    0 0 16px rgba(255, 222, 118, 0.5),
    0 0 28px rgba(255, 204, 72, 0.3);
}

.word-score-badge {
  position: absolute;
  min-width: 28px;
  height: 17px;
  padding: 0 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  color: #fffdf7;
  text-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0.82;
  backdrop-filter: blur(0.25px);
  transform: translateZ(0);
}

.word-score-badge.horizontal {
  transform: translateY(-50%);
}

.word-score-badge.vertical {
  transform: translateY(-50%);
}

.word-score-badge.is-player {
  background:
    linear-gradient(180deg, rgba(209, 63, 70, 0.78), rgba(143, 33, 39, 0.74));
}

.word-score-badge.is-ai {
  background:
    linear-gradient(180deg, rgba(244, 133, 34, 0.8), rgba(188, 95, 17, 0.76));
}

.master-move-burst {
  position: absolute;
  border-radius: 18px;
  border: 2px solid rgba(255, 220, 128, 0.92);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 228, 142, 0.18), rgba(255, 228, 142, 0.04) 60%, transparent 78%);
  box-shadow:
    0 0 0 1px rgba(255, 248, 224, 0.14),
    0 0 18px rgba(255, 212, 88, 0.42),
    inset 0 0 12px rgba(255, 241, 191, 0.14);
  animation: masterMovePulse 1.2s ease-in-out infinite;
}

.master-move-burst.vertical {
  border-radius: 20px;
}

.master-move-burst.is-ai {
  border-color: rgba(255, 188, 82, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 242, 214, 0.14),
    0 0 18px rgba(255, 166, 55, 0.44),
    inset 0 0 12px rgba(255, 213, 158, 0.16);
}

.master-move-burst.is-double {
  border-color: rgba(255, 236, 158, 0.98);
  box-shadow:
    0 0 0 2px rgba(255, 247, 217, 0.2),
    0 0 28px rgba(255, 212, 75, 0.72),
    0 0 46px rgba(204, 139, 31, 0.36),
    inset 0 0 18px rgba(255, 246, 205, 0.24);
  animation: masterMoveDoublePulse 1.1s ease-in-out infinite;
}

.master-move-banner {
  position: absolute;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  min-width: 210px;
  padding: 12px 18px 11px;
  border-radius: 20px;
  display: grid;
  justify-items: center;
  gap: 3px;
  background:
    linear-gradient(180deg, rgba(28, 23, 15, 0.86), rgba(11, 12, 10, 0.78)),
    linear-gradient(180deg, rgba(255, 240, 202, 0.12), transparent);
  border: 1px solid rgba(241, 204, 120, 0.42);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 247, 227, 0.16);
  backdrop-filter: blur(3px);
  animation: masterMoveBannerIn 320ms ease-out;
}

.master-move-banner.is-ai {
  border-color: rgba(243, 167, 72, 0.46);
}

.master-move-banner.is-double {
  background:
    linear-gradient(180deg, rgba(57, 42, 17, 0.94), rgba(10, 36, 24, 0.88)),
    radial-gradient(circle at 50% 0%, rgba(255, 236, 161, 0.28), transparent 62%);
  border-color: rgba(255, 221, 126, 0.72);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.3),
    0 0 26px rgba(250, 199, 82, 0.36),
    inset 0 1px 0 rgba(255, 249, 230, 0.24);
  animation: masterMoveBannerIn 320ms ease-out, masterMoveDoubleGlow 1.65s ease-in-out infinite;
}

.master-move-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 228, 169, 0.9);
}

.master-move-message {
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: clamp(1.25rem, 2.8vw, 1.72rem);
  font-weight: 900;
  color: #fff4db;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.master-move-bonus {
  padding: 2px 10px 3px;
  border-radius: 999px;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 900;
  color: #2f1c03;
  background:
    linear-gradient(180deg, rgba(255, 233, 163, 0.96), rgba(245, 192, 71, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.65),
    0 6px 14px rgba(85, 51, 6, 0.2);
}

.master-move-particles {
  position: absolute;
  inset: 0;
}

.master-move-particle {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: var(--spark-color, rgba(255, 228, 142, 0.92));
  box-shadow: 0 0 10px rgba(255, 226, 153, 0.35);
  opacity: 0;
  animation: masterMoveSpark var(--spark-duration, 2.4s) ease-out var(--spark-delay, 0s) forwards;
}

@keyframes masterMovePulse {
  0%,
  100% {
    transform: scale(0.995);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.018);
    opacity: 1;
  }
}

@keyframes masterMoveDoublePulse {
  0%,
  100% {
    transform: scale(0.99);
    opacity: 0.94;
  }
  50% {
    transform: scale(1.035);
    opacity: 1;
  }
}

@keyframes masterMoveBannerIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes masterMoveDoubleGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 217, 101, 0));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(255, 217, 101, 0.45));
  }
}

@keyframes masterMoveSpark {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.7);
  }
  12% {
    opacity: 1;
  }
  70% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--spark-drift-x, 0), var(--spark-drift-y, 120px), 0) rotate(var(--spark-rotation, 80deg)) scale(1.04);
  }
}

.board-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(205, 177, 132, 0.18);
  background:
    linear-gradient(180deg, rgba(243, 214, 174, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(16, 26, 22, 0.88);
  color: #f6ead3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.board {
  position: absolute;
  inset: var(--board-grid-top) var(--board-grid-right) var(--board-grid-bottom) var(--board-grid-left);
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  grid-template-rows: repeat(15, minmax(0, 1fr));
  column-gap: var(--board-grid-column-gap);
  row-gap: var(--board-grid-row-gap);
  margin: 0;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  z-index: 2;
}

.board::before {
  display: none;
}

body[data-board-style="classic-css"] .board {
  padding: 0.3%;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(226, 210, 167, 0.92), rgba(201, 180, 132, 0.96));
  box-shadow:
    inset 0 0 0 2px rgba(72, 48, 24, 0.42),
    0 10px 18px rgba(0, 0, 0, 0.2);
}

body[data-board-style="classic-css"] .board::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(67, 48, 27, 0.22), rgba(255, 247, 220, 0.06));
}

body[data-board-style="native-css"] .board {
  padding: 0;
  border-radius: 8px;
  overflow: visible;
  background:
    linear-gradient(180deg, #f6e4bc, #dfbd81);
  border: 1px solid rgba(108, 76, 42, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 235, 0.52),
    0 8px 18px rgba(78, 45, 20, 0.24);
}

body[data-board-style="native-css"] .board::before {
  content: "";
  position: absolute;
  inset: -2.35rem;
  border-radius: 18px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.32), rgba(122, 77, 39, 0.08));
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 214, 0.36),
    inset 0 0 0 9px rgba(138, 92, 50, 0.13);
  z-index: -1;
}

.cell {
  position: relative;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  transition:
    background 140ms ease,
    transform 120ms ease,
    box-shadow 140ms ease;
}

body[data-board-style="art"] .board .cell {
  overflow: hidden;
}

.cell.empty:hover {
  background: rgba(246, 249, 255, 0.14);
}

.cell.tw {
  background: transparent;
}

.cell.dw {
  background: transparent;
}

.cell.tl {
  background: transparent;
}

.cell.dl {
  background: transparent;
}

.cell.start {
  background: transparent;
}

body[data-board-style="classic-css"] .cell {
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(53, 35, 16, 0.12);
}

body[data-board-style="classic-css"] .cell.empty:hover {
  background: rgba(255, 250, 219, 0.35);
}

body[data-board-style="classic-css"] .cell.tw {
  background: linear-gradient(180deg, rgba(227, 72, 56, 0.96), rgba(173, 35, 30, 0.94));
}

body[data-board-style="classic-css"] .cell.dw {
  background: linear-gradient(180deg, rgba(244, 202, 190, 0.98), rgba(220, 165, 148, 0.96));
}

body[data-board-style="classic-css"] .cell.tl {
  background: linear-gradient(180deg, rgba(69, 145, 223, 0.96), rgba(31, 102, 182, 0.96));
}

body[data-board-style="classic-css"] .cell.dl {
  background: linear-gradient(180deg, rgba(212, 240, 255, 0.98), rgba(165, 215, 236, 0.98));
}

body[data-board-style="classic-css"] .cell.start {
  background: linear-gradient(180deg, rgba(236, 198, 86, 0.98), rgba(198, 154, 49, 0.98));
}

body[data-board-style="native-css"] .cell {
  border-radius: 0;
  overflow: visible;
  background: #f1e3c2;
  box-shadow:
    inset 0 0 0 1px rgba(128, 94, 55, 0.24);
}

body[data-board-style="native-css"] .cell.empty:not(.tw):not(.m4):not(.dw):not(.tl):not(.dl):not(.start):hover {
  background: #f1e3c2;
  box-shadow:
    inset 0 0 0 1px rgba(128, 94, 55, 0.24);
}

body[data-board-style="native-css"] .cell.tw.empty:hover {
  background: linear-gradient(180deg, #7b355f, #623052);
}

body[data-board-style="native-css"] .cell.m4.empty:hover {
  background: linear-gradient(180deg, #0b6d55, #064d3e);
}

body[data-board-style="native-css"] .cell.dw.empty:hover {
  background: linear-gradient(180deg, #5da0a0, #3e817f);
}

body[data-board-style="native-css"] .cell.tl.empty:hover {
  background: linear-gradient(180deg, #d88b42, #ba7134);
}

body[data-board-style="native-css"] .cell.dl.empty:hover {
  background: linear-gradient(180deg, #8aa35d, #6f874a);
}

body[data-board-style="native-css"] .cell.start.empty:hover {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 245, 178, 0.88), transparent 24%),
    linear-gradient(180deg, #11725a, #07503f);
}

body[data-board-style="classic-css"] .cell.empty:hover {
  background: #f5e8ca;
  box-shadow:
    inset 0 0 0 2px rgba(104, 76, 44, 0.18),
    inset 0 0 0 1px rgba(128, 94, 55, 0.24);
}

body[data-board-style="native-css"] .cell.tw {
  background: linear-gradient(180deg, #7b355f, #623052);
}

body[data-board-style="native-css"] .cell.m4 {
  background: linear-gradient(180deg, #0b6d55, #064d3e);
}

body[data-board-style="native-css"] .cell.dw {
  background: linear-gradient(180deg, #5da0a0, #3e817f);
}

body[data-board-style="native-css"] .cell.tl {
  background: linear-gradient(180deg, #d88b42, #ba7134);
}

body[data-board-style="native-css"] .cell.dl {
  background: linear-gradient(180deg, #8aa35d, #6f874a);
}

body[data-board-style="native-css"] .cell.start {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 245, 178, 0.88), transparent 24%),
    linear-gradient(180deg, #11725a, #07503f);
}

.cell.pending {
  box-shadow: inset 0 0 0 2px rgba(255, 242, 197, 0.46);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cell.drag-over,
.rack-slot.drag-over {
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 202, 0.74),
    0 0 0 1px rgba(255, 249, 238, 0.65);
}

.bonus {
  display: none;
}

body[data-board-style="classic-css"] .bonus {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 5% 5%;
  white-space: pre-line;
  text-align: center;
  line-height: 1.08;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(0.32rem, 0.56vw, 0.58rem);
  font-weight: 900;
  letter-spacing: 0.025em;
  color: rgba(34, 30, 23, 0.82);
  text-transform: uppercase;
  pointer-events: none;
}

body[data-board-style="native-css"] .bonus {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 6%;
  white-space: pre-line;
  text-align: center;
  line-height: 1.08;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(0.36rem, 0.64vw, 0.72rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: rgba(255, 248, 224, 0.94);
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(23, 14, 8, 0.42);
}

body[data-board-style="classic-css"] .cell.start .bonus,
body[data-board-style="native-css"] .cell.start .bonus {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(0.92rem, 1.45vw, 1.34rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: rgba(255, 245, 203, 0.98);
  text-shadow:
    0 1px 2px rgba(40, 24, 8, 0.4),
    0 0 9px rgba(255, 224, 138, 0.42);
}

body[data-board-style="native-css"] .cell.dw .bonus,
body[data-board-style="native-css"] .cell.dl .bonus,
body[data-board-style="native-css"] .cell.start .bonus {
  color: rgba(255, 251, 227, 0.96);
}

body[data-board-style="native-css"] .cell:not(.tw):not(.m4):not(.dw):not(.tl):not(.dl):not(.start) .bonus {
  display: none;
}

.coord {
  display: none;
}

body[data-board-style="art"] .coord {
  display: block;
  position: absolute;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(92, 70, 40, 0.92);
  text-shadow: 0 1px 0 rgba(255, 247, 228, 0.45);
  pointer-events: none;
}

body[data-board-style="art"] .coord-top {
  left: 50%;
  top: -1.28rem;
  transform: translateX(-50%);
}

body[data-board-style="art"] .coord-left {
  top: 50%;
  left: -1.18rem;
  transform: translateY(-50%);
}

body[data-board-style="classic-css"] .coord {
  display: block;
  position: absolute;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 246, 220, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

body[data-board-style="classic-css"] .coord-top,
body[data-board-style="classic-css"] .coord-bottom {
  left: 50%;
  transform: translateX(-50%);
}

body[data-board-style="classic-css"] .coord-top {
  top: -1.35rem;
}

body[data-board-style="classic-css"] .coord-bottom {
  bottom: -1.35rem;
}

body[data-board-style="classic-css"] .coord-left,
body[data-board-style="classic-css"] .coord-right {
  top: 50%;
  transform: translateY(-50%);
}

body[data-board-style="classic-css"] .coord-left {
  left: -1.1rem;
}

body[data-board-style="classic-css"] .coord-right {
  right: -1.1rem;
}

body[data-board-style="native-css"] .coord {
  display: block;
  position: absolute;
  z-index: 12;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(0.62rem, 0.98vw, 0.96rem);
  font-weight: 900;
  color: rgba(66, 48, 29, 0.96);
  text-shadow:
    0 1px 0 rgba(255, 247, 220, 0.86),
    0 0 6px rgba(255, 238, 194, 0.24);
  pointer-events: none;
}

body[data-board-style="native-css"] .coord-top,
body[data-board-style="native-css"] .coord-bottom {
  left: 50%;
  transform: translateX(-50%);
}

body[data-board-style="native-css"] .coord-top {
  top: -1.42rem;
}

body[data-board-style="native-css"] .coord-bottom {
  display: none;
}

body[data-board-style="native-css"] .coord-left,
body[data-board-style="native-css"] .coord-right {
  top: 50%;
  transform: translateY(-50%);
}

body[data-board-style="native-css"] .coord-left {
  left: -1.38rem;
}

body[data-board-style="native-css"] .coord-right {
  display: none;
}

.tile {
  width: calc(100% * var(--board-tile-scale));
  height: calc(100% * var(--board-tile-scale));
  border-radius: 3px;
  border: none;
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: #1f1912;
  margin: auto;
  justify-self: center;
  align-self: center;
  transition:
    transform 120ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

body[data-board-style="art"] .board .tile {
  width: calc(100% * var(--board-tile-scale));
  height: calc(100% * var(--board-tile-scale));
  max-width: none;
  aspect-ratio: auto;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
}

.tile::before {
  display: none;
}

.tile-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 2px rgba(32, 23, 9, 0.16));
}

body[data-board-style="art"] .board .tile-art {
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  object-position: var(--tile-art-x, 50%) var(--tile-art-y, 50%);
  transform: translateX(var(--tile-art-shift-x, 0px));
  filter: none;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 251, 232, 0.98), rgba(244, 233, 190, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(126, 106, 67, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body[data-board-style="art"] .board .cell[data-col="6"] .tile-art {
  object-position: 50% 50%;
  --tile-art-shift-x: -2px;
}

body[data-board-id="original-green"] .board .cell[data-row="14"][data-col="0"] .tile-art {
  --tile-art-shift-x: 1px;
}

body[data-board-style="native-css"] .board .tile {
  border-radius: 5px;
  filter: drop-shadow(0 3px 4px rgba(45, 27, 10, 0.22));
}

.tile-joker {
  background:
    linear-gradient(180deg, #fff9e9 0%, #f3e7c9 54%, #dfc894 100%);
  box-shadow:
    inset 0 0 0 1px rgba(126, 106, 67, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 12px rgba(55, 37, 15, 0.14);
}

.tile-joker .tile-art {
  opacity: 0.88;
  mix-blend-mode: multiply;
}

body[data-board-style="native-css"] .board .tile-art {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: 50% 50%;
  transform: none;
  filter: none;
  border-radius: 5px;
}

.tile-glyph {
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: clamp(1.14rem, 1.98vw, 1.82rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.tile-joker-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: clamp(1rem, 1.82vw, 1.68rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #a34747;
  text-shadow:
    0 1px 0 rgba(255, 248, 238, 0.72),
    0 0 3px rgba(255, 235, 214, 0.12);
  pointer-events: none;
}

body[data-board-style="art"] .board .tile.tile-joker-assigned {
  background:
    linear-gradient(180deg, rgba(255, 251, 232, 0.98), rgba(244, 233, 190, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(126, 106, 67, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body[data-board-style="native-css"] .board .tile.tile-joker-assigned {
  background:
    linear-gradient(180deg, #fffece 0%, #fdfcda 54%, #fef9c9 100%);
  box-shadow:
    inset 0 0 0 1px rgba(126, 106, 67, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 12px rgba(55, 37, 15, 0.14);
}

body[data-board-style="art"] .board .tile.tile-joker-assigned .tile-joker-letter {
  color: #a34747;
  font-weight: 900;
  font-size: clamp(1.08rem, 1.98vw, 1.82rem);
  text-shadow:
    0 1px 0 rgba(255, 248, 238, 0.78),
    0 0 3px rgba(255, 235, 214, 0.12);
}

.tile-joker-rack .tile-glyph,
.tile-joker-rack .tile-joker-letter,
.tile-joker-rack .tile-joker-tag,
.tile-joker-rack .tile-value:not(.tile-joker-value) {
  display: none;
}

.rack-tile .tile-joker-letter {
  font-size: clamp(1rem, 1.55vw, 1.28rem);
}

.tile-joker-tag {
  display: none;
}

.tile-joker-value {
  color: rgba(87, 60, 29, 0.72);
}

body[data-board-style="native-css"] .board .tile.tile-joker-assigned .tile-joker-letter {
  font-size: clamp(1.16rem, 2.08vw, 1.92rem);
}

body[data-board-style="art"] .board .tile.tile-joker-assigned .tile-art,
body[data-board-style="art"] .board .tile.tile-joker-assigned .tile-value,
body[data-board-style="art"] .board .tile.tile-joker-assigned .tile-glyph,
body[data-board-style="art"] .board .tile.tile-joker-assigned .tile-joker-tag {
  display: none;
}

.tile small {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 0.44em;
  font-weight: 800;
  color: rgba(67, 48, 24, 0.7);
}

.tile-fallback {
  opacity: 0;
  pointer-events: none;
}

.tile-image-missing .tile-fallback {
  opacity: 1;
}

.tile-pending {
  filter: none;
}

.rack-card {
  position: relative;
  z-index: 1;
  width: min(100%, 690px);
  max-width: 690px;
  margin: -2px auto 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  display: grid;
  grid-template-columns: minmax(348px, 472px) minmax(154px, 188px);
  align-items: center;
  justify-content: center;
  justify-items: stretch;
  column-gap: 18px;
  row-gap: 6px;
}

body[data-board-style="native-css"] .rack-card {
  margin-top: -10px;
  padding-top: 4px;
}

.rack.is-masked {
  pointer-events: none;
}

.rack-slot.is-masked {
  border-color: rgba(191, 168, 130, 0.18);
  background:
    linear-gradient(180deg, rgba(23, 30, 27, 0.52), rgba(8, 14, 12, 0.62)),
    rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 244, 218, 0.05);
}

.rack-card .subtle {
  max-width: 32rem;
  color: rgba(223, 206, 182, 0.72);
}

.rack-header {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rack-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0;
  width: auto;
}

.rack-quick-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(30px, 1fr));
  align-items: center;
  justify-content: stretch;
  align-content: center;
  gap: 5px 4px;
  margin-top: 0;
  width: 100%;
  align-self: center;
  justify-self: stretch;
  transform: translateY(20px);
}

.action-icon-button {
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  color: #efdfc7;
  box-shadow: none;
  transition: transform 120ms ease, opacity 140ms ease, filter 140ms ease;
}

.action-icon-art {
  width: 46px;
  height: auto;
  max-height: 46px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  user-select: none;
}

.action-label {
  font-size: 0.68rem;
  line-height: 1.05;
  color: rgba(239, 223, 199, 0.9);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.action-icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.action-icon-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.rack {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  max-width: 472px;
  min-height: 64px;
  margin: 0;
  padding: 8px 6px 15px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.03), rgba(255, 255, 255, 0.01)),
    linear-gradient(180deg, rgba(14, 22, 20, 0.12), rgba(10, 16, 14, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
  justify-self: start;
  align-items: end;
  contain: layout paint;
  isolation: isolate;
}

.rack::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 2px;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(204, 171, 126, 0.3), rgba(93, 67, 42, 0.42)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent);
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 242, 214, 0.15);
  pointer-events: none;
}

.rack::after {
  content: "";
  position: absolute;
  left: 5.5%;
  right: 5.5%;
  bottom: 15px;
  height: 2px;
  border-radius: 999px;
  background: rgba(245, 222, 187, 0.16);
  pointer-events: none;
}

.rack-slot {
  position: relative;
  z-index: 1;
  min-height: 0;
  min-width: 0;
  aspect-ratio: 1 / 1.06;
  border-radius: 10px;
  border: none;
  background: transparent;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 2px 0 4px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.rack-slot.filled {
  align-items: stretch;
}

.rack-tile {
  width: min(94%, 42px);
  min-height: 0;
  aspect-ratio: 80 / 78;
  padding: 0;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #3b2913;
  position: relative;
  overflow: visible;
  box-shadow: none;
  transition:
    transform 120ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.rack-tile.tile-joker,
.held-preview.tile-joker {
  background: transparent;
  box-shadow: none;
}

.rack-tile .tile-art {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(32, 23, 9, 0.14));
}

.rack-tile .tile-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
}

.rack-tile small {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: 0.56rem;
  color: rgba(67, 48, 24, 0.82);
}

.rack-tile.selected {
  transform: translateY(-2px);
  box-shadow:
    0 7px 14px rgba(53, 35, 16, 0.14),
    0 0 0 2px rgba(255, 241, 200, 0.32);
}

.rack-slot.drag-over {
  box-shadow:
    inset 0 -3px 0 rgba(255, 242, 197, 0.7),
    0 0 0 1px rgba(255, 249, 238, 0.2);
}

.rack-slot.preview-gap {
  align-items: center;
  justify-items: center;
}

.rack-slot.preview-gap::after {
  content: "";
  width: 3px;
  height: 72%;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 247, 213, 0.98), rgba(222, 187, 98, 0.82));
  box-shadow:
    0 0 0 1px rgba(255, 247, 213, 0.18),
    0 0 14px rgba(239, 203, 125, 0.42);
}

.rack-tile.held-source,
.cell.held-source .tile {
  opacity: 0;
  pointer-events: none;
}

.rack-tile.dragging,
.cell.dragging .tile {
  opacity: 0.38;
  transform: none;
}

.held-preview {
  position: fixed !important;
  left: -9999px;
  top: -9999px;
  margin: 0 !important;
  pointer-events: none !important;
  z-index: 9999 !important;
  opacity: 1 !important;
  transform: none !important;
  will-change: left, top;
}

.held-preview.rack-tile,
.held-preview.tile {
  box-shadow: none;
}

body.tile-held,
body.tile-held * {
  cursor: grabbing !important;
}

.selected-tile {
  min-height: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.actions button,
.ffsc-link {
  padding: 11px 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 231, 210, 0.96)),
    linear-gradient(180deg, rgba(187, 153, 120, 0.08), rgba(255, 255, 255, 0.03));
  color: var(--ink);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.actions button.primary {
  background:
    linear-gradient(180deg, #49685e, #27453a),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
  color: #fff8ec;
}

.rack-actions .actions {
  margin-top: 0;
  gap: 10px;
}

.rack-actions .icon-action {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0;
  box-shadow:
    0 8px 14px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.quick-action.icon-action {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.rack-actions .icon-action::before {
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 800;
}

.quick-action.icon-action::before {
  font-size: 0.98rem;
}

#validateBtn.icon-action {
  background:
    linear-gradient(180deg, rgba(110, 210, 132, 0.32), rgba(18, 52, 32, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
  border-color: rgba(117, 214, 138, 0.4);
}

#validateBtn.icon-action::before {
  content: "✓";
  color: #f0ffeb;
}

#undoBtn.icon-action,
#passBtn.icon-action {
  background:
    linear-gradient(180deg, rgba(35, 55, 94, 0.95), rgba(17, 28, 51, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent);
  border-color: rgba(106, 145, 214, 0.32);
}

#shuffleBtn.icon-action,
#exchangeBtn.icon-action {
  background:
    linear-gradient(180deg, rgba(55, 83, 74, 0.94), rgba(18, 33, 28, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
  border-color: rgba(168, 205, 187, 0.22);
}

#undoBtn.icon-action::before {
  content: "↶";
  color: #ebf4ff;
}

#passBtn.icon-action::before {
  content: "»";
  color: #ebf4ff;
}

#shuffleBtn.icon-action::before {
  content: "↭";
  color: #eefdf4;
}

#exchangeBtn.icon-action::before {
  content: "⇄";
  color: #eefdf4;
}

.rack-actions .icon-action:hover {
  transform: translateY(-1px);
}

.rack-actions .icon-action:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.rack-quick-actions .icon-action:hover {
  transform: translateY(-1px);
}

.rack-quick-actions .icon-action:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.sidebar-left {
  grid-column: 1;
}

.sidebar-right {
  grid-column: 3;
}

.sidebar-guide-followup {
  display: grid;
  gap: 14px;
}

.scores {
  padding-top: 16px;
}

.sidebar-left .panel,
.sidebar-right .panel {
  border-radius: 24px;
}

.sidebar-left .panel {
  background:
    linear-gradient(180deg, rgba(56, 94, 80, 0.24), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(20, 34, 29, 0.98), rgba(13, 20, 17, 0.98));
  border-color: rgba(142, 195, 168, 0.18);
}

.sidebar-right .panel {
  background:
    linear-gradient(180deg, rgba(84, 62, 44, 0.18), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(20, 29, 26, 0.98), rgba(12, 18, 16, 0.98));
  border-color: rgba(212, 181, 136, 0.14);
}

.panel-game-quick {
  gap: 10px;
  padding: 13px;
  background:
    radial-gradient(circle at 14% 0%, rgba(219, 177, 100, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(48, 77, 65, 0.38), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(17, 30, 25, 0.99), rgba(9, 16, 14, 0.99)) !important;
  border-color: rgba(226, 190, 130, 0.22) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 220, 0.1),
    inset 0 0 0 1px rgba(7, 15, 12, 0.28),
    0 16px 30px rgba(0, 0, 0, 0.18);
}

.quick-new-game {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: 17px;
  letter-spacing: 0.01em;
}

.quick-new-game-plus {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 249, 229, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-size: 1.02rem;
  line-height: 1;
}

.quick-match-list {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.quick-match-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 14px;
  border: 1px solid rgba(212, 181, 136, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 246, 224, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(13, 24, 20, 0.74);
  color: #f3dfb8;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 244, 221, 0.05);
}

.quick-match-row.is-observer,
.quick-match-row.is-local-mode {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
}

.quick-match-row.is-observer .turn-meta-label,
.quick-match-row.is-observer .quick-match-value,
.quick-match-row.is-local-mode .turn-meta-label,
.quick-match-row.is-local-mode .quick-match-value {
  min-width: 0;
}

.quick-match-row.is-observer .quick-match-icon,
.quick-match-row.is-local-mode .quick-match-icon {
  grid-row: 1 / 3;
  align-self: center;
}

.quick-match-row.is-observer .turn-meta-label,
.quick-match-row.is-local-mode .turn-meta-label {
  grid-column: 2;
  line-height: 1.05;
  max-width: 100%;
  white-space: normal;
}

.quick-match-row.is-observer .quick-match-value,
.quick-match-row.is-local-mode .quick-match-value {
  grid-column: 2;
  justify-self: start;
  max-width: 100%;
  width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-size: 0.93rem;
  line-height: 1.18;
}

.quick-match-row-status {
  grid-template-columns: auto minmax(0, 1fr);
}

.quick-match-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter:
    drop-shadow(0 1px 0 rgba(255, 242, 214, 0.1))
    drop-shadow(0 3px 5px rgba(0, 0, 0, 0.22));
}

.quick-match-value,
.quick-turn-banner {
  color: #f9e9c8;
  font-weight: 800;
}

.quick-turn-banner {
  font-size: 1rem;
  line-height: 1.2;
}

.quick-match-icon-bag {
  width: 29px;
  height: 29px;
}

.quick-match-icon-clock {
  width: 28px;
  height: 28px;
}

.quick-match-icon-level {
  width: 29px;
  height: 29px;
}

.score-grid {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.match-welcome-empty {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(218, 187, 122, 0.34);
  background:
    radial-gradient(circle at 16% 10%, rgba(236, 200, 132, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(34, 61, 51, 0.9), rgba(12, 24, 20, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 226, 0.12),
    inset 0 0 0 1px rgba(8, 18, 14, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.match-welcome-title {
  color: #fff0d3;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.match-welcome-copy {
  margin: 0;
  color: rgba(246, 232, 204, 0.82);
  font-size: 0.9rem;
  line-height: 1.45;
}

.match-welcome-action {
  width: 100%;
  min-height: 46px;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(255, 232, 177, 0.54);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #f5d99c 0%, #d99c46 100%);
  color: #22170d;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 226, 0.6),
    0 8px 18px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(99, 66, 23, 0.2);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.match-welcome-action:hover,
.match-welcome-action:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.06) brightness(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 251, 232, 0.76),
    0 10px 22px rgba(0, 0, 0, 0.22),
    0 0 20px rgba(225, 178, 87, 0.24);
}

.score-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 18px;
  border: 1px solid rgba(212, 184, 127, 0.2);
  background:
    radial-gradient(circle at 10% 14%, rgba(233, 201, 129, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(35, 62, 52, 0.96), rgba(15, 26, 22, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 228, 0.12),
    inset 0 0 0 1px rgba(7, 16, 13, 0.28),
    0 6px 12px rgba(0, 0, 0, 0.12);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease,
    filter 220ms ease;
}

.score-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-width: 0;
}

.score-avatar {
  width: 74px;
  height: 82px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid rgba(255, 241, 212, 0.18);
  background:
    linear-gradient(180deg, rgba(46, 84, 67, 0.34), rgba(18, 29, 24, 0.28));
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 252, 242, 0.08);
}

.score-card-body {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding-right: 44px;
}

.score-player-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.score-card.active {
  transform: translateX(3px) scale(1.012);
  border-color: rgba(244, 209, 138, 0.76);
  background:
    radial-gradient(circle at 11% 14%, rgba(249, 218, 151, 0.28), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(142, 195, 168, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(51, 89, 73, 0.98), rgba(20, 36, 31, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 226, 0.24),
    inset 0 0 0 1px rgba(255, 221, 156, 0.12),
    0 0 0 2px rgba(236, 198, 122, 0.24),
    0 0 24px rgba(219, 177, 102, 0.18),
    0 10px 20px rgba(0, 0, 0, 0.18);
  filter: saturate(1.06);
}

.score-card.is-placeholder {
  border-color: rgba(205, 177, 132, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(13, 22, 19, 0.56);
}

.score-card.is-placeholder .score-avatar {
  object-fit: contain;
  padding: 5px;
  background:
    radial-gradient(circle at 50% 28%, rgba(240, 222, 184, 0.18), transparent 58%),
    rgba(10, 18, 16, 0.78);
}

.score-card.is-placeholder .score-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.08;
}

.score-name {
  display: -webkit-box;
  color: rgba(255, 238, 210, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.12;
  max-width: none;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: normal;
  overflow-wrap: anywhere;
}

.score-player-copy .subtle {
  color: rgba(241, 228, 203, 0.78);
  font-size: 0.8rem;
}

.score-player-copy .score-ai-style {
  display: -webkit-box;
  color: rgba(229, 196, 126, 0.88);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.16;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.score-value {
  font-size: 1.55rem;
  line-height: 0.92;
  color: #fff2dc;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.score-value-stack {
  position: absolute;
  top: 14px;
  right: 12px;
  display: grid;
  justify-items: end;
  gap: 13px;
  min-width: 44px;
}

.score-turn-ring {
  --turn-ring-progress: 360deg;
  --turn-ring-track: rgba(9, 18, 15, 0.58);
  --turn-ring-fill: #dfbc72;
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #fff4d9;
  background:
    radial-gradient(circle at 50% 50%, rgba(26, 47, 39, 0.96) 0 52%, transparent 53%),
    conic-gradient(var(--turn-ring-fill) var(--turn-ring-progress), var(--turn-ring-track) 0deg),
    linear-gradient(145deg, rgba(255, 239, 190, 0.22), rgba(0, 0, 0, 0.2));
  box-shadow:
    inset 0 1px 1px rgba(255, 249, 225, 0.18),
    inset 0 -2px 4px rgba(0, 0, 0, 0.26),
    0 4px 9px rgba(0, 0, 0, 0.22);
  transition: --turn-ring-progress 0.9s linear;
}

.score-turn-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 239, 198, 0.16);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

#validateBtn {
  grid-column: 1;
  grid-row: 1;
}

#shuffleBtn {
  grid-column: 3;
  grid-row: 1;
}

#undoBtn {
  grid-column: 5;
  grid-row: 1;
}

#passBtn {
  grid-column: 2;
  grid-row: 2;
}

#exchangeBtn {
  grid-column: 4;
  grid-row: 2;
}

.score-turn-ring-value {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff2d0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.score-turn-ring.is-warning {
  --turn-ring-fill: #c66f4a;
  color: #ffe2cc;
  animation: turn-ring-warning-pulse 1s ease-in-out infinite;
}

.score-turn-ring.is-warning .score-turn-ring-value {
  color: #ffe1c7;
}

@keyframes turn-ring-warning-pulse {
  0%,
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
  50% {
    filter: brightness(1.23);
    transform: scale(1.045);
  }
}

.score-rack {
  color: rgba(252, 236, 198, 0.96);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lexicon-loading {
  min-height: 116px;
  margin-top: 10px;
  padding: 16px 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(209, 178, 134, 0.18);
  background:
    linear-gradient(180deg, rgba(246, 221, 180, 0.1), rgba(255, 255, 255, 0.025)),
    linear-gradient(180deg, rgba(18, 29, 25, 0.98), rgba(12, 18, 16, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 229, 0.08),
    inset 0 -10px 18px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(7, 14, 12, 0.32);
}

.lexicon-loading-copy {
  display: grid;
  gap: 6px;
}

.lexicon-loading-title {
  color: #f3e4c5;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.lexicon-loading-detail {
  color: rgba(239, 225, 196, 0.8);
  font-size: 0.88rem;
  line-height: 1.4;
}

.lexicon-loading-progress {
  position: relative;
  margin-top: 14px;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(110, 92, 57, 0.55);
  background:
    linear-gradient(180deg, rgba(8, 14, 13, 0.9), rgba(21, 33, 29, 0.92));
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.34),
    inset 0 -1px 1px rgba(255, 243, 215, 0.05),
    0 10px 18px rgba(0, 0, 0, 0.14);
}

.lexicon-loading-progress::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 248, 230, 0.08), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(53, 68, 61, 0.34), rgba(14, 22, 20, 0.12));
  pointer-events: none;
}

.lexicon-loading-fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 247, 218, 0.95) 0%, rgba(232, 202, 122, 0.98) 18%, rgba(187, 154, 76, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 240, 0.65),
    inset 0 -2px 4px rgba(99, 70, 17, 0.22),
    0 0 0 1px rgba(126, 101, 42, 0.18);
  transition: width 220ms ease-out;
}

.lexicon-loading-fill::before {
  content: '';
  position: absolute;
  inset: 1px 1px 7px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.04));
  opacity: 0.95;
}

.lexicon-loading-fill::after {
  content: '';
  position: absolute;
  inset: -30% auto -30% -32%;
  width: 38%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 249, 228, 0.42), rgba(255, 255, 255, 0));
  transform: skewX(-20deg);
  animation: lexicon-loading-sheen 1.5s ease-in-out infinite;
}

.message {
  min-height: 116px;
  margin-top: 10px;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(209, 178, 134, 0.16);
  background:
    linear-gradient(180deg, rgba(243, 214, 174, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(18, 29, 25, 0.98), rgba(12, 18, 16, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 221, 0.06),
    inset 0 0 0 1px rgba(8, 15, 13, 0.28);
  line-height: 1.5;
  color: #f2dc97;
}

.lexicon-retry-button {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(232, 202, 122, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 246, 214, 0.14), rgba(215, 168, 96, 0.05)),
    rgba(13, 31, 25, 0.96);
  color: #fff0c4;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 229, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

.lexicon-retry-button:hover,
.lexicon-retry-button:focus-visible {
  border-color: rgba(255, 225, 161, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 246, 214, 0.2), rgba(215, 168, 96, 0.08)),
    rgba(18, 43, 34, 0.98);
  outline: none;
}

.message[hidden],
#lastMoveSummary[hidden],
.lexicon-loading[hidden],
.lexicon-retry-button[hidden] {
  display: none !important;
}

@keyframes lexicon-loading-sheen {
  0% {
    transform: translateX(-120%) skewX(-20deg);
    opacity: 0;
  }

  18% {
    opacity: 0.95;
  }

  62% {
    opacity: 0.95;
  }

  100% {
    transform: translateX(320%) skewX(-20deg);
    opacity: 0;
  }
}

#lastMoveSummary {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  color: rgba(240, 223, 195, 0.9);
}

.history {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
  max-height: 176px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(229, 196, 132, 0.54) rgba(10, 20, 17, 0.48);
  scrollbar-width: thin;
  display: grid;
  gap: 7px;
}

.history::-webkit-scrollbar {
  width: 8px;
}

.history::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(10, 20, 17, 0.48);
}

.history::-webkit-scrollbar-thumb {
  border: 2px solid rgba(10, 20, 17, 0.48);
  border-radius: 999px;
  background: rgba(229, 196, 132, 0.62);
}

.history li {
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(159, 205, 180, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(32, 55, 47, 0.96), rgba(18, 31, 26, 0.98));
  color: #f0e5d2;
  font-size: 0.84rem;
  line-height: 1.3;
  box-shadow: inset 0 1px 0 rgba(255, 243, 221, 0.04);
}

.panel-history:not(.is-expanded) .history {
  max-height: 176px;
  overflow: hidden;
}

.panel-history:not(.is-expanded) .history li:nth-child(n+4) {
  display: none;
}

.panel-history.is-expanded .history {
  max-height: min(32vh, 260px);
  overflow-y: auto;
  overflow-x: hidden;
}

.panel-history.is-observer .history {
  max-height: min(24vh, 176px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.panel-history.is-observer.is-expanded .history {
  max-height: min(26vh, 184px);
  overflow-y: auto;
  overflow-x: hidden;
}

.history-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(212, 181, 136, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 244, 216, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(11, 22, 19, 0.7);
  color: rgba(244, 230, 204, 0.88);
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.history-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(224, 190, 130, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 244, 216, 0.13), rgba(255, 255, 255, 0.03)),
    rgba(17, 31, 26, 0.82);
}

.panel-tools {
  gap: 16px;
}

.panel-tools .ffsc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
}

.observer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.observer-controls[hidden] {
  display: none !important;
}

.observer-controls button {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(212, 181, 136, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 244, 216, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(15, 30, 25, 0.78);
  color: rgba(244, 230, 204, 0.92);
  font-size: 0.78rem;
  font-weight: 800;
}

.observer-controls button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(224, 190, 130, 0.42);
}

.guide-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(219, 188, 145, 0.22);
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 244, 216, 0.1), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(16, 28, 23, 0.96), rgba(9, 17, 14, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 219, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.14);
  color: rgba(244, 230, 204, 0.9);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 120ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.guide-link:hover {
  transform: translateY(-1px);
  border-color: rgba(224, 190, 130, 0.42);
  color: #fff3db;
}

.top-guide-button {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  min-height: 42px;
  padding: 10px 18px;
  border-color: rgba(246, 203, 111, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 246, 214, 0.96), rgba(229, 176, 78, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -1px 0 rgba(91, 57, 13, 0.2),
    0 10px 20px rgba(0, 0, 0, 0.2),
    0 0 18px rgba(229, 182, 88, 0.22);
  color: #251707;
  font-size: 0.78rem;
  text-shadow: 0 1px 0 rgba(255, 244, 214, 0.45);
}

.top-guide-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 220, 142, 0.86);
  background:
    linear-gradient(180deg, rgba(255, 250, 229, 1), rgba(241, 190, 88, 1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
  color: #1b1105;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    inset 0 -1px 0 rgba(91, 57, 13, 0.18),
    0 12px 22px rgba(0, 0, 0, 0.22),
    0 0 24px rgba(239, 197, 105, 0.32);
}

.top-guide-button:focus-visible {
  outline: 3px solid rgba(255, 239, 191, 0.66);
  outline-offset: 3px;
}

.top-guide-button.is-guide-hint-visible {
  animation: topGuideCtaGlow 1.55s ease-in-out 9;
}

.top-guide-button.is-guide-hint-visible::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -20% -45%;
  background:
    linear-gradient(
      110deg,
      transparent 0%,
      rgba(255, 255, 255, 0.05) 31%,
      rgba(255, 252, 224, 0.38) 43%,
      rgba(255, 255, 255, 0.88) 50%,
      rgba(255, 232, 148, 0.36) 57%,
      rgba(255, 255, 255, 0.04) 69%,
      transparent 100%
    );
  pointer-events: none;
  transform: translateX(-120%) skewX(-18deg);
  animation: topGuideCtaSheen 1.85s ease-in-out 7;
}

.top-guide-button.is-guide-hint-visible::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -5px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 221, 123, 0.34), transparent 68%);
  opacity: 0;
  pointer-events: none;
  animation: topGuideCtaHalo 1.55s ease-in-out 9;
}

@keyframes topGuideCtaGlow {
  0%,
  100% {
    transform: none;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.52),
      inset 0 -1px 0 rgba(91, 57, 13, 0.2),
      0 10px 20px rgba(0, 0, 0, 0.2),
      0 0 18px rgba(229, 182, 88, 0.28),
      0 0 0 0 rgba(255, 218, 118, 0.2);
  }
  45% {
    transform: none;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.72),
      inset 0 -1px 0 rgba(91, 57, 13, 0.18),
      0 12px 24px rgba(0, 0, 0, 0.24),
      0 0 0 3px rgba(255, 235, 168, 0.2),
      0 0 26px rgba(255, 222, 134, 0.72),
      0 0 46px rgba(235, 174, 65, 0.44);
  }
}

@keyframes topGuideCtaHalo {
  0%,
  100% {
    opacity: 0;
    transform: none;
  }
  45% {
    opacity: 1;
    transform: none;
  }
}

@keyframes topGuideCtaSheen {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-120%) skewX(-18deg);
  }
  14% {
    opacity: 0.95;
  }
  52% {
    opacity: 0;
    transform: translateX(120%) skewX(-18deg);
  }
}

@media (max-width: 1180px) {
  .site-header,
  .account-area,
  .profile-menu,
  .platform-nav,
  .platform-nav-more {
    position: relative;
    z-index: 7000;
  }

  .platform-nav-more__dropdown,
  .profile-dropdown {
    z-index: 9100;
  }

  .panel-history.is-expanded .history {
    max-height: min(34vh, 280px);
  }
}

@media (max-width: 1180px) and (min-width: 700px) {
  .endgame-screen {
    align-items: start;
    place-items: start center;
    padding-top: clamp(78px, 11dvh, 118px);
    padding-bottom: 18px;
    overflow: auto;
  }

  .endgame-card {
    max-height: calc(100dvh - clamp(96px, 13dvh, 136px));
    margin: 0 auto;
  }
}

@media (max-width: 1400px) and (min-width: 1280px) {
  .layout {
    grid-template-columns: minmax(220px, 270px) minmax(760px, 1fr) minmax(180px, 220px);
    gap: 8px;
  }

  .board-panel {
    padding-inline: 8px;
  }
}

@media (max-width: 899px) {

  body[data-board-style="native-css"] .rack-card {
    margin-top: 6px;
    padding-top: 8px;
  }

  .rack-card {
    width: min(100%, 544px);
    max-width: 544px;
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 8px;
  }

  .rack {
    width: 100%;
    margin: 0 auto;
    justify-self: center;
  }

  .rack-quick-actions {
    grid-template-columns: repeat(5, minmax(48px, 1fr));
    gap: 8px;
    width: min(100%, 450px);
    margin-top: 0;
    transform: none;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .platform-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 6px;
  }

  .site-game-title {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .online-mode-entry {
    grid-column: 1;
    grid-row: 4;
    justify-self: start;
  }

  .notification-center {
    position: relative;
    grid-column: 2;
    grid-row: 4;
    justify-self: end;
    margin-left: 0;
    top: auto;
    left: auto;
    transform: none;
  }

  .notification-panel {
    left: var(--notifications-panel-left, calc(100vw - 180px));
    transform: translateX(-50%);
  }

  .game-controls-bar {
    grid-column: 1 / -1;
    grid-row: 5;
    justify-self: end;
  }

  .account-area {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 1279px) and (min-width: 1181px) {
  .layout {
    grid-template-columns: minmax(206px, 250px) minmax(700px, 1fr) minmax(174px, 220px);
    gap: 8px;
    margin-top: 14px;
  }

  .board-panel {
    padding: 4px 8px 24px;
  }

  .panel {
    padding: 14px;
  }

  .rack-card {
    width: min(100%, 660px);
    max-width: 660px;
    grid-template-columns: minmax(320px, 1fr) minmax(150px, 174px);
    column-gap: 12px;
  }

  .rack-quick-actions {
    transform: translateY(8px);
  }
}

@media (max-width: 1180px) and (min-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }

  .site-header {
    grid-template-columns: minmax(238px, auto) minmax(0, 1fr) auto;
    position: relative;
    z-index: 9000;
    gap: 5px 10px;
    margin-bottom: 6px;
    padding: 8px 12px;
    border-radius: 18px;
  }

  .platform-brand__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .platform-brand__copy {
    gap: 2px;
    min-height: 42px;
  }

  .platform-brand__name {
    font-size: clamp(0.9rem, 1.42vw, 1.04rem);
    letter-spacing: 0.095em;
  }

  .platform-brand__tagline {
    font-size: 0.68rem;
    letter-spacing: 0.045em;
  }

  .platform-nav {
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 1px;
  }

  .platform-nav-more {
    display: none;
  }

  .platform-nav__item {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 5px 5px;
    border-radius: 6px;
    font-size: clamp(0.6rem, 0.72vw, 0.68rem);
    letter-spacing: 0;
  }

  .platform-nav-more__summary {
    min-height: 34px;
    padding: 4px 8px 5px;
    border-radius: 7px;
    font-size: clamp(0.66rem, 0.9vw, 0.72rem);
  }

  .platform-nav-more__dropdown {
    min-width: 154px;
    padding: 7px;
  }

  .platform-nav-more__item {
    min-height: 38px;
    padding: 7px 8px;
    font-size: 0.78rem;
  }

  .site-game-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .site-game-title h1 {
    font-size: clamp(1.34rem, 2.22vw, 1.72rem);
  }

  .site-game-title .eyebrow {
    display: none;
  }

  .online-mode-entry {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .notification-center {
    position: relative;
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    align-self: center;
    margin-left: clamp(8px, 1.2vw, 16px);
    top: auto;
    left: auto;
    transform: none;
  }

  .online-mode-button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .online-mode-button__icon {
    width: 18px;
    height: 18px;
  }

  .game-controls-bar {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: end;
    padding: 0;
  }

  .account-area {
    grid-column: 3;
    grid-row: 1;
    z-index: 9200;
  }

  .platform-nav-more__dropdown,
  .profile-dropdown {
    z-index: 9400;
  }

  .profile-trigger {
    min-width: 150px;
    padding: 4px 7px 4px 4px;
    border-radius: 12px;
  }

  .profile-avatar {
    width: 38px;
    height: 38px;
  }

  .profile-copy strong {
    font-size: 0.9rem;
  }

  .profile-copy span {
    font-size: 0.7rem;
  }

  .sound-toggle {
    min-width: 130px;
    gap: 7px;
    padding: 7px 11px;
  }

  .sound-toggle-icon img {
    width: 19px;
    height: 19px;
  }

  .sound-toggle-text {
    font-size: 0.68rem;
  }

  .top-guide-button {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 0.7rem;
  }

  .layout {
    grid-template-columns: clamp(180px, 18vw, 212px) minmax(0, 1fr) clamp(148px, 16vw, 190px);
    gap: 6px;
    margin-top: 7px;
  }

  .sidebar {
    gap: 8px;
  }

  .board-panel {
    grid-column: 2;
    order: initial;
    padding: 0 4px 12px;
    border-radius: 24px;
  }

  .sidebar-left {
    grid-column: 1;
    order: initial;
  }

  .sidebar-right {
    grid-column: 3;
    order: initial;
  }

  .panel {
    padding: 10px;
    border-radius: 18px;
  }

  .sidebar-left .panel,
  .sidebar-right .panel {
    border-radius: 18px;
  }

  .panel-head {
    gap: 6px;
  }

  .panel-head h2 {
    font-size: 1rem;
  }

  .match-title-icon {
    width: 18px;
    height: 18px;
  }

  .score-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px;
    padding: 7px 7px;
  }

  .score-avatar {
    width: 42px;
    height: 48px;
    border-radius: 12px;
  }

  .score-card-body {
    gap: 3px;
    padding-right: 24px;
  }

  .score-card-head {
    padding-right: 0;
  }

  .score-name {
    font-size: 0.72rem;
    line-height: 1.08;
  }

  .score-player-copy .subtle {
    font-size: 0.62rem;
    line-height: 1.08;
  }

  .score-player-copy .score-ai-style {
    font-size: 0.58rem;
    line-height: 1.08;
  }

  .score-value-stack {
    top: 8px;
    right: 6px;
    min-width: 24px;
  }

  .score-value {
    font-size: 0.98rem;
  }

  body[data-board-style="native-css"] .board-stage {
    width: min(100%, calc(100dvh - 176px), 744px);
    margin: 8px auto 2px;
    border-radius: 22px;
  }

  .board-stage {
    width: min(100%, calc(100dvh - 176px), 744px);
    margin: 0 auto -4px;
  }

  body[data-board-style="native-css"] .rack-card {
    margin-top: 4px;
    padding-top: 0;
  }

  .rack-card {
    width: min(100%, 680px);
    max-width: 680px;
    grid-template-columns: minmax(300px, 1fr) minmax(212px, 228px);
    align-items: end;
    justify-items: stretch;
    column-gap: 12px;
    row-gap: 2px;
  }

  .rack {
    max-width: 430px;
    min-height: 58px;
    padding: 7px 5px 13px;
  }

  .rack-quick-actions {
    grid-template-columns: repeat(5, minmax(36px, 1fr));
    align-items: center;
    justify-items: center;
    gap: 2px;
    width: 100%;
    align-self: end;
    transform: translateY(2px);
  }

  .rack-quick-actions #validateBtn,
  .rack-quick-actions #shuffleBtn,
  .rack-quick-actions #undoBtn,
  .rack-quick-actions #passBtn,
  .rack-quick-actions #exchangeBtn {
    grid-column: auto;
    grid-row: auto;
  }

  .rack-quick-actions #validateBtn {
    order: 1;
  }

  .rack-quick-actions #shuffleBtn {
    order: 2;
  }

  .rack-quick-actions #undoBtn {
    order: 3;
  }

  .rack-quick-actions #passBtn {
    order: 4;
  }

  .rack-quick-actions #exchangeBtn {
    order: 5;
  }

  .action-icon-art {
    width: 32px;
    max-height: 32px;
  }

  .action-label {
    font-size: 0.55rem;
  }

  .score-grid {
    gap: 7px;
  }

  .score-card {
    gap: 6px;
    padding: 6px 7px;
    border-radius: 14px;
  }

  .score-avatar {
    width: 46px;
    height: 52px;
    border-radius: 13px;
  }

  .score-card-body {
    gap: 4px;
    padding-right: 0;
  }

  .score-card-head {
    padding-right: 28px;
  }

  .score-name {
    font-size: 0.72rem;
    line-height: 1.08;
  }

  .score-player-copy .subtle {
    font-size: 0.64rem;
    line-height: 1.1;
  }

  .score-player-copy .score-ai-style {
    font-size: 0.61rem;
    line-height: 1.08;
  }

  .score-rack {
    display: block;
    white-space: nowrap;
    font-size: 0.64rem;
    line-height: 1.05;
    letter-spacing: 0;
  }

  .score-value-stack {
    top: 10px;
    right: 7px;
    gap: 8px;
    min-width: 28px;
  }

  .score-value {
    font-size: 1.06rem;
  }

  .score-turn-ring {
    width: 32px;
    height: 32px;
  }

  .match-timer__icon {
    width: 14px;
    height: 14px;
  }

  .scores .panel-head--with-icon {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 4px;
    row-gap: 0;
    align-items: center;
  }

  .scores .panel-head--with-icon h2 {
    min-width: 0;
    font-size: 0.82rem;
    letter-spacing: 0.045em;
    white-space: nowrap;
  }

  .scores .match-timer {
    grid-column: auto;
    justify-self: end;
    margin-top: 0;
    gap: 3px;
    padding: 2px 5px;
    border: 1px solid rgba(215, 168, 96, 0.28);
    border-radius: 999px;
    background: rgba(16, 28, 23, 0.76);
    box-shadow:
      inset 0 1px 0 rgba(255, 243, 219, 0.06),
      0 6px 12px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
  }

  .scores .match-timer .game-timer-label {
    font-size: 0.58rem;
    letter-spacing: 0;
  }

  .scores .match-timer .game-timer-value {
    font-size: 0.78rem;
  }

  .quick-new-game {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .quick-match-list {
    gap: 6px;
  }

  .quick-match-row {
    gap: 6px;
    min-height: 32px;
    padding: 6px 7px;
    border-radius: 12px;
  }

  #turnMeta.quick-match-row {
    grid-template-columns: 24px max-content minmax(42px, 1fr);
  }

  #turnMeta .turn-meta-label {
    white-space: nowrap;
    font-size: 0.82rem;
    line-height: 1;
  }

  #turnMeta .quick-match-value {
    justify-self: end;
    text-align: right;
    white-space: nowrap;
    font-size: 0.82rem;
    line-height: 1;
  }

  .quick-match-icon {
    width: 24px;
    height: 24px;
  }

  .quick-match-value,
  .quick-turn-banner {
    font-size: 0.86rem;
  }

  .match-welcome-empty {
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
  }

  .match-welcome-title {
    font-size: 0.95rem;
  }

  .match-welcome-copy {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 0.8rem;
    line-height: 1.28;
  }

  .match-welcome-action {
    min-height: 38px;
    padding: 0.6rem 0.75rem;
    border-radius: 14px;
  }

  .panel-lexicon {
    padding: 10px;
  }

  .panel-lexicon .enriched-word-panel {
    height: 124px;
    min-height: 124px;
    padding: 8px 10px;
    overflow: hidden;
    font-size: 0.7rem;
    line-height: 1.2;
  }

  .panel-lexicon .enriched-word-panel[data-state="default"] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 3px;
  }

  .panel-lexicon .enriched-word-panel[data-state="default"] .enriched-word-eyebrow {
    font-size: 0.88rem;
    line-height: 1.05;
  }

  .panel-lexicon .enriched-word-panel[data-state="default"] .enriched-word-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .panel-lexicon .enriched-word-panel:not([data-state="default"]) {
    overflow: auto;
  }

  .panel-lexicon .enriched-word-content {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .panel-lexicon .enriched-word-definition,
  .panel-lexicon .enriched-word-message,
  .panel-lexicon .enriched-word-notes,
  .panel-lexicon .enriched-word-compact,
  .panel-lexicon .enriched-word-missing-inline {
    font-size: 0.72rem;
    line-height: 1.22;
  }

  .panel-lexicon .enriched-word-detail {
    font-size: 0.66rem;
    line-height: 1.18;
  }

  .panel-status .panel-head .subtle,
  .panel-history .panel-head .subtle {
    display: none;
  }

  .panel-status .message {
    min-height: 58px;
    padding: 9px 10px;
    font-size: 0.83rem;
    line-height: 1.28;
  }

  #lastMoveSummary {
    font-size: 0.76rem;
  }

  .history {
    gap: 6px;
    max-height: 116px;
  }

  .history li {
    padding: 8px 9px;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .panel-history:not(.is-expanded) .history {
    max-height: 116px;
  }

  .history-toggle,
  .history-export-action {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .panel-tools .panel-head .subtle {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .panel-tools .ffsc-link {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 0.83rem;
  }

  .panel-history.is-expanded .history {
    max-height: min(30vh, 240px);
  }
}

@media (max-width: 1099px) and (min-width: 900px) {
  .layout {
    grid-template-columns: clamp(172px, 18vw, 196px) minmax(0, 1fr) clamp(124px, 14vw, 156px);
    gap: 5px;
  }

  .board-panel {
    padding-inline: 2px;
  }

  .panel {
    padding: 8px;
  }

  .platform-nav > .platform-nav__item {
    display: none;
  }

  .platform-nav > a.platform-nav__item {
    display: inline-flex;
  }

  .platform-nav-more {
    display: block;
  }

  .platform-nav-more__item--mobile-only,
  .platform-nav-more__item--primary,
  .platform-nav-more__item--download {
    display: block;
  }

  .platform-nav-more__dropdown {
    position: fixed;
    top: 62px;
    right: 14px;
    width: min(280px, calc(100vw - 28px));
    max-height: calc(100dvh - 76px);
    overflow: auto;
  }
}

@media (max-width: 1180px) and (min-width: 1140px) {
  .platform-nav > .platform-nav__item:nth-of-type(6) {
    display: inline-flex;
  }

  .platform-nav-more__item:nth-child(2) {
    display: none;
  }
}

@media (max-width: 1180px) and (min-width: 1160px) {
  .platform-nav > .platform-nav__item:nth-of-type(7) {
    display: inline-flex;
  }

  .platform-nav-more__item:nth-child(3) {
    display: none;
  }
}

@media (max-width: 1180px) and (min-width: 1180px) {
  .platform-nav > .platform-nav__item:nth-of-type(n+8) {
    display: inline-flex;
  }

  .platform-nav-more {
    display: none;
  }

  .platform-nav {
    gap: 2px;
  }

  .platform-nav__item {
    padding-inline: 7px;
    font-size: 0.7rem;
  }
}

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

  .board-panel {
    grid-column: 1;
    order: 1;
  }

  .sidebar-left {
    grid-column: 1;
    order: 2;
  }

  .sidebar-right {
    grid-column: 1;
    order: 3;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100vw - 16px, 1440px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    gap: 9px;
    padding: 10px 12px;
  }

  .platform-brand__icon {
    width: 48px;
    height: 48px;
  }

  .platform-brand__copy {
    gap: 3px;
    min-height: 48px;
  }

  .platform-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding-bottom: 2px;
  }

  .platform-nav__item {
    padding: 6px 9px 7px;
    font-size: 0.82rem;
  }

  .topbar-actions,
  .topbar-meta {
    justify-items: stretch;
    justify-content: flex-start;
  }

  .game-controls-bar {
    grid-column: 1 / -1;
    grid-row: 5;
    justify-self: stretch;
  }

  .online-mode-entry {
    grid-column: 1;
    grid-row: 4;
    justify-self: start;
  }

  .notification-center {
    grid-column: 2;
    grid-row: 4;
    justify-self: end;
    margin-left: 0;
  }

  .notification-bell {
    width: 34px;
    height: 34px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .notification-bell:hover,
  .notification-bell:focus-visible,
  .notification-center.is-open .notification-bell {
    transform: none;
    border-color: transparent;
    box-shadow: none;
  }

  .notification-bell img {
    width: 25px;
    height: 25px;
  }

  .account-area {
    grid-column: 2;
    grid-row: 1;
  }

  .profile-trigger {
    min-width: 160px;
  }

  .site-game-title {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .panel-history.is-expanded .history {
    max-height: min(32vh, 240px);
  }

  .panel-history.is-observer.is-expanded .history {
    max-height: min(24vh, 168px);
  }

  .topbar,
  .board-panel,
  .panel {
    border-radius: 22px;
  }

  .topbar,
  .board-header,
  .rack-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .topbar-actions,
  .topbar-meta {
    justify-items: stretch;
    justify-content: flex-start;
  }

  .topbar-timing {
    justify-content: flex-start;
  }

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

  .confirm-modal-card.setup-modal-card {
    width: min(96vw, 760px);
    min-height: auto;
    overflow: auto;
  }

  .setup-field-grid,
  .setup-field-grid--compact {
    grid-template-columns: 1fr;
  }

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

  .selected-tile {
    text-align: left;
  }

  .board {
    margin: 0;
  }

  .coord-top,
  .coord-bottom {
    font-size: 0.68rem;
  }

  .coord-left,
  .coord-right {
    font-size: 0.66rem;
  }
}

@media (min-width: 700px) and (max-width: 899px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: min(100vw - 14px, 1440px);
  }

  .site-header {
    grid-template-columns: minmax(224px, auto) minmax(0, 1fr) auto;
    position: relative;
    z-index: 9000;
    gap: 6px 10px;
    padding: 8px 10px;
    border-radius: 18px;
    overflow: visible;
  }

  .platform-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .platform-brand__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .platform-brand__copy {
    gap: 2px;
    min-height: 42px;
  }

  .platform-brand__name {
    font-size: 0.98rem;
    letter-spacing: 0.12em;
  }

  .platform-brand__tagline {
    font-size: 0.58rem;
    letter-spacing: 0.045em;
  }

  .account-area {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    z-index: 9300;
  }

  .profile-trigger {
    min-width: 148px;
    padding: 4px 7px 4px 4px;
    border-radius: 12px;
  }

  .profile-avatar {
    width: 38px;
    height: 38px;
  }

  .profile-copy strong {
    font-size: 0.9rem;
  }

  .profile-copy span {
    font-size: 0.68rem;
  }

  .platform-nav {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
    align-self: center;
    flex-wrap: nowrap;
    gap: 2px;
    min-width: 0;
    overflow: visible;
  }

  .platform-nav > .platform-nav__item:nth-of-type(n+5) {
    display: none;
  }

  .platform-nav-more {
    display: block;
    z-index: 9300;
  }

  .platform-nav-more__dropdown {
    position: fixed;
    z-index: 9500;
    top: 74px;
    right: 14px;
    left: auto;
    width: min(238px, calc(100vw - 28px));
    min-width: 0;
    max-height: min(70vh, 520px);
    overflow: auto;
    padding: 10px;
  }

  .platform-nav-more__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 2px 8px;
    color: #d7a860;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .platform-nav-more__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(215, 168, 96, 0.36);
    border-radius: 999px;
    background: rgba(12, 23, 18, 0.88);
    color: #f6dfaa;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
  }

  .profile-dropdown {
    position: fixed;
    z-index: 9600;
    top: 74px;
    right: 14px;
    width: min(220px, calc(100vw - 28px));
  }

  .platform-nav__item,
  .platform-nav-more__summary {
    min-height: 28px;
    padding: 4px 7px 5px;
    border-radius: 7px;
    font-size: clamp(0.64rem, 1vw, 0.72rem);
    letter-spacing: 0;
  }

  .site-game-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .site-game-title h1 {
    font-size: clamp(1.34rem, 3.2vw, 1.68rem);
  }

  .site-game-title .eyebrow {
    display: none;
  }

  .online-mode-entry {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    align-self: center;
  }

  .online-mode-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .online-mode-button__icon {
    width: 18px;
    height: 18px;
  }

  .game-controls-bar {
    grid-column: 2 / 4;
    grid-row: 3;
    justify-self: end;
    align-self: center;
    padding: 0;
  }

  .topbar-timing {
    justify-content: flex-end;
  }

  .sound-toggle {
    min-width: 126px;
    padding: 7px 10px;
    gap: 7px;
  }

  .sound-toggle-icon img {
    width: 18px;
    height: 18px;
  }

  .sound-toggle-text,
  .top-guide-button {
    font-size: 0.68rem;
  }

  .top-guide-button {
    min-height: 36px;
    padding: 8px 14px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
  }

  .sidebar-left,
  .sidebar-right,
  .sidebar-guide-followup {
    display: contents;
  }

  .scores {
    order: 1;
    grid-column: 1;
    padding: 10px;
    border-radius: 20px;
  }

  .scores .panel-head--with-icon {
    grid-template-columns: auto minmax(0, max-content) auto;
    justify-content: start;
    column-gap: 8px;
  }

  .match-title-icon {
    width: 24px;
    height: 24px;
  }

  .scores .panel-head--with-icon h2 {
    font-size: 1rem;
    white-space: nowrap;
  }

  .scores .match-timer {
    justify-self: start;
    padding: 3px 8px;
    border: 1px solid rgba(215, 168, 96, 0.28);
    border-radius: 999px;
    background: rgba(16, 28, 23, 0.76);
    white-space: nowrap;
  }

  .score-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-top: 7px;
  }

  .match-welcome-empty {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 14px;
    padding: 11px 13px;
    border-radius: 16px;
  }

  .match-welcome-title {
    font-size: 0.95rem;
  }

  .match-welcome-copy {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .match-welcome-action {
    grid-row: 1 / span 2;
    grid-column: 2;
    min-height: 38px;
    padding: 0.58rem 0.8rem;
    white-space: nowrap;
  }

  .score-card {
    gap: 6px;
    padding: 6px 7px;
    border-radius: 14px;
  }

  .score-avatar {
    width: 48px;
    height: 54px;
    border-radius: 12px;
  }

  .score-card-body {
    gap: 3px;
    padding-right: 0;
  }

  .score-card-head {
    padding-right: 28px;
  }

  .score-name {
    font-size: 0.72rem;
  }

  .score-player-copy .subtle {
    font-size: 0.64rem;
    line-height: 1.12;
  }

  .score-rack {
    display: block;
    white-space: nowrap;
    font-size: 0.63rem;
    line-height: 1.05;
    letter-spacing: 0;
  }

  .score-value-stack {
    top: 8px;
    right: 7px;
    gap: 7px;
    min-width: 30px;
  }

  .score-value {
    font-size: 1.08rem;
  }

  .score-turn-ring {
    width: 30px;
    height: 30px;
  }

  .board-panel {
    order: 2;
    grid-column: 1;
    padding: 8px 8px 12px;
    border-radius: 22px;
    overflow-x: hidden;
  }

  body[data-board-style="native-css"] .board-stage,
  .board-stage {
    width: min(100%, calc(100vw - 124px), 696px);
    margin: 4px auto 6px;
  }

  body[data-board-style="native-css"] .rack-card {
    margin-top: 6px;
    padding-top: 0;
  }

  .rack-card {
    width: min(100%, 690px);
    max-width: 690px;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 238px);
    align-items: end;
    justify-content: center;
    column-gap: 10px;
    row-gap: 4px;
  }

  .rack-header {
    display: none;
  }

  .rack {
    max-width: none;
    min-height: 56px;
    padding: 7px 6px 14px;
  }

  .rack-quick-actions {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
    gap: 2px;
    align-self: end;
    transform: none;
  }

  .action-icon-art {
    width: 34px;
    max-height: 34px;
  }

  .action-label {
    font-size: 0.54rem;
  }

  .panel-status {
    order: 3;
    grid-column: 1;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .panel-status .panel-head .subtle {
    display: none;
  }

  .panel-status .message {
    min-height: 52px;
    max-height: 78px;
    padding: 9px 10px;
    font-size: 0.86rem;
    line-height: 1.28;
  }

  #lastMoveSummary {
    font-size: 0.78rem;
  }

  .panel-lexicon {
    order: 4;
    grid-column: 1;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .panel-lexicon .enriched-word-panel {
    height: 132px;
    min-height: 132px;
    padding: 8px 10px;
    overflow: auto;
  }

  .panel-history {
    order: 5;
    grid-column: 1;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .history,
  .panel-history:not(.is-expanded) .history {
    max-height: 132px;
  }

  .history li {
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .history-toggle,
  .history-export-action {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .panel-game-quick {
    order: 6;
    grid-column: 1;
    padding: 11px 12px;
    border-radius: 20px;
  }

  .quick-new-game {
    min-height: 38px;
    padding: 8px 12px;
  }

  .quick-match-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .quick-match-row {
    gap: 7px;
    min-height: 34px;
    padding: 7px 9px;
  }

  .quick-match-icon {
    width: 23px;
    height: 23px;
  }

  .quick-match-value,
  .quick-turn-banner,
  #turnMeta .turn-meta-label,
  #turnMeta .quick-match-value {
    font-size: 0.82rem;
  }

  .panel-tools {
    order: 7;
    grid-column: 1;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .panel-tools .panel-head .subtle {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.84rem;
    line-height: 1.24;
  }

  .panel-tools .ffsc-link {
    min-height: 42px;
    padding: 10px 12px;
  }
}

@media (min-width: 700px) and (max-width: 780px) {
  body[data-board-style="native-css"] .board-stage,
  .board-stage {
    width: min(100%, calc(100vw - 220px), 568px);
  }

  .rack-card {
    width: min(100%, 568px);
    max-width: 568px;
    grid-template-columns: minmax(0, 1fr) minmax(196px, 222px);
    column-gap: 8px;
  }

  .rack-quick-actions {
    grid-template-columns: repeat(5, minmax(34px, 1fr));
  }

  .action-icon-art {
    width: 32px;
    max-height: 32px;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 2rem;
  }

  .site-header {
    border-radius: 18px;
  }

  .platform-brand__name {
    font-size: 0.86rem;
    letter-spacing: 0.13em;
  }

  .platform-brand__tagline {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }

  .online-mode-button {
    min-height: 40px;
    padding: 9px 13px;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
  }

  .platform-nav__item {
    padding: 5px 7px 6px;
    font-size: 0.74rem;
    letter-spacing: 0;
  }

  .site-game-title h1 {
    font-size: 1.62rem;
  }

  .game-controls-bar {
    padding: 8px;
  }

  .profile-trigger {
    min-width: 0;
    grid-template-columns: auto auto;
    padding: 5px 7px 5px 5px;
    border-radius: 12px;
  }

  .profile-copy {
    display: none;
  }

  .profile-avatar {
    width: 36px;
    height: 36px;
  }

  .profile-dropdown {
    right: 0;
  }

  .account-auth {
    gap: 6px;
  }

  .account-auth button {
    padding: 7px 9px;
    font-size: 0.76rem;
  }

  .word-highlight {
    border-width: 2px;
  }

  .word-highlight.is-main {
    border-width: 3px;
  }

  .word-highlight.is-cross {
    border-width: 1.5px;
  }

  .online-mode-modal__card {
    border-radius: 16px;
    padding: 18px;
  }

  .online-mode-benefits {
    grid-template-columns: 1fr;
  }

  .online-mode-modal__actions {
    justify-content: stretch;
  }

  .online-mode-modal__actions button {
    flex: 1 1 120px;
  }

  .online-lobby-code-value {
    font-size: 1.5rem;
    letter-spacing: 0.16em;
  }

  .online-lobby-code-box {
    padding: 12px;
    gap: 8px;
  }

  .online-lobby-seats {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
  }

  .online-lobby-seat {
    min-height: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px;
    text-align: left;
  }

  .online-lobby-seat__avatar,
  .online-lobby-seat__placeholder {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
  }

  .online-lobby-seat__name {
    flex: 1 1 auto;
    min-width: 0;
  }

  .online-lobby-seat__badge {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .history {
    max-height: 150px;
  }

  .panel-history:not(.is-expanded) .history {
    max-height: 150px;
  }

  .panel-history.is-expanded .history {
    max-height: min(30vh, 220px);
  }

  .panel-history.is-observer .history,
  .panel-history.is-observer.is-expanded .history {
    max-height: min(24vh, 150px);
  }

  .guide-link {
    width: 100%;
  }

  .interactive-guide {
    padding: 12px;
  }

  .interactive-guide__spotlight {
    border-radius: min(var(--tour-spot-radius), 18px);
    box-shadow:
      0 0 0 9999px rgba(5, 11, 9, 0.56),
      0 0 0 4px rgba(229, 196, 132, 0.08),
      0 0 22px rgba(229, 196, 132, 0.24);
  }

  .interactive-guide__card,
  .interactive-guide.is-targetless .interactive-guide__card {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: min(62vh, 460px);
    overflow: auto;
    padding: 16px;
    border-radius: 18px;
  }

  .interactive-guide__pdf-download {
    position: static;
    justify-self: start;
    width: max-content;
  }

  .interactive-guide__card--actions {
    max-height: min(70vh, 520px);
  }

  .interactive-guide__card--lexicon-demo {
    top: 12px;
    bottom: auto;
    max-height: min(36vh, 280px);
  }

  .interactive-guide-action-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .interactive-guide-action-icon {
    width: 30px;
    height: 30px;
  }

  .interactive-guide-action-text span {
    font-size: 0.81rem;
  }

  .interactive-guide-rack-demo {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    inset: 4px 6px 8px;
    min-height: 54px;
    padding: 9px 8px;
  }

  .interactive-guide-rack-demo__badge {
    left: 8px;
    top: -9px;
    padding: 3px 7px;
  }

  .interactive-guide-rack-demo__tile {
    width: min(96%, 34px);
  }

  .interactive-guide-lexicon-demo {
    padding: 10px;
  }

  .interactive-guide-lexicon-demo p {
    font-size: 0.82rem;
  }

  .tour-demo-tile {
    width: 78%;
    height: 78%;
    border-radius: 6px;
    border-width: 1px;
    font-size: clamp(0.68rem, 3.4vw, 0.98rem);
  }

  .tour-demo-label {
    padding: 3px 5px;
    font-size: clamp(0.42rem, 2vw, 0.58rem);
  }

  .tour-demo-label--horizontal {
    grid-column: 5 / span 7;
  }

  .tour-demo-label--vertical {
    grid-column: 10 / span 5;
  }

  .tour-bonus-label {
    padding: 4px 6px;
    border-radius: 11px 11px 11px 5px;
    font-size: clamp(0.44rem, 2.1vw, 0.62rem);
    line-height: 1.1;
  }

  .tour-bonus-label::after {
    border-left-width: 6px;
    border-right-width: 6px;
  }

  .tour-bonus-label--word4::after,
  .tour-bonus-label--word3::after {
    bottom: -6px;
    border-top-width: 7px;
  }

  .tour-bonus-label--word2::after,
  .tour-bonus-label--letter3::after,
  .tour-bonus-label--letter2::after {
    top: -6px;
    border-bottom-width: 7px;
  }

  .tour-bonus-label--word3 {
    grid-column: 1 / span 5;
  }

  .tour-bonus-label--word2 {
    grid-column: 7 / span 7;
  }

  .tour-bonus-label--letter3 {
    grid-column: 2 / span 5;
  }

  .tour-bonus-label--letter2 {
    grid-column: 8 / span 7;
  }

  .interactive-guide.is-target-clickable .interactive-guide__card {
    top: 12px;
    bottom: auto;
    max-height: min(46vh, 360px);
  }

  .interactive-guide-target-cue::after {
    right: 50%;
    bottom: calc(100% + 7px);
    max-width: min(240px, 70vw);
    transform: translateX(50%);
    white-space: normal;
  }

  .interactive-guide__actions,
  .interactive-guide__nav {
    justify-content: stretch;
  }

  .interactive-guide__actions button {
    flex: 1 1 120px;
  }

  .board-panel {
    padding: 16px;
  }

  .board {
    margin: 0;
  }

  .rack {
    gap: 2px;
    width: min(100%, 424px);
    min-height: 58px;
    padding: 7px 6px 13px;
  }

  .rack-quick-actions {
    grid-template-columns: repeat(3, minmax(54px, 1fr));
    width: min(100%, 280px);
    gap: 7px 9px;
  }

  .action-icon-art {
    width: 36px;
    max-height: 36px;
  }

  .rack-slot {
    min-height: 0;
  }

  .rack-tile {
    min-height: 0;
  }

  .rack-tile .tile-glyph {
    font-size: 1.3rem;
  }

  .actions,
  .actions-secondary {
    display: grid;
    grid-template-columns: 1fr;
  }

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

@media (max-width: 639px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    padding: 6px 6px 16px;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    margin-bottom: 6px;
    padding: 7px 8px;
    border-radius: 16px;
    overflow: visible;
  }

  .platform-brand {
    grid-column: 1;
    grid-row: 1;
    gap: 8px;
    align-self: center;
  }

  .platform-brand__icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .platform-brand__copy {
    min-height: 38px;
    gap: 1px;
  }

  .platform-brand__name {
    color: #d7a860;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(0.78rem, 4.1vw, 0.98rem);
    font-weight: 400;
    letter-spacing: 0.11em;
  }

  .platform-brand__tagline {
    max-width: 190px;
    overflow: hidden;
    font-size: clamp(0.48rem, 2.5vw, 0.58rem);
    letter-spacing: 0.055em;
    text-overflow: ellipsis;
  }

  .account-area {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  .profile-trigger {
    min-width: 0;
    grid-template-columns: auto auto;
    gap: 5px;
    padding: 3px 6px 3px 3px;
    border-radius: 11px;
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
  }

  .profile-chevron {
    font-size: 1rem;
  }

  .profile-dropdown {
    right: 0;
    min-width: min(190px, calc(100vw - 18px));
  }

  .platform-nav,
  .online-mode-entry {
    display: none;
  }

  .site-game-title {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 0;
    padding-top: 1px;
  }

  .site-game-title .eyebrow {
    display: none;
  }

  .site-game-title h1 {
    color: #f1ead7;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.16rem, 6.4vw, 1.45rem);
    font-weight: 700;
    line-height: 0.96;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  }

  .game-controls-bar {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
    padding: 0;
  }

  .topbar-timing {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: 7px;
    justify-content: stretch;
    width: 100%;
  }

  .sound-toggle,
  .top-guide-button {
    min-width: 0;
    min-height: 34px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 999px;
  }

  .sound-toggle {
    justify-content: center;
    gap: 6px;
  }

  .sound-toggle-icon img {
    width: 18px;
    height: 18px;
  }

  .sound-toggle-text,
  .top-guide-button {
    font-size: clamp(0.62rem, 2.7vw, 0.72rem);
    letter-spacing: 0.075em;
    white-space: nowrap;
  }

  .guide-link.top-guide-button {
    width: 100%;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
  }

  .sidebar-left,
  .sidebar-right,
  .sidebar-guide-followup {
    display: contents;
  }

  .scores {
    order: 1;
    grid-column: 1;
    padding: 8px;
    border-radius: 17px;
    overflow: hidden;
  }

  .scores .panel-head--with-icon {
    grid-template-columns: auto auto minmax(0, 1fr);
    column-gap: 6px;
    align-items: center;
  }

  .match-title-icon {
    width: 22px;
    height: 22px;
  }

  .scores .panel-head--with-icon h2 {
    font-size: 0.98rem;
    line-height: 1;
    white-space: nowrap;
  }

  .scores .match-timer {
    justify-self: end;
    min-width: 0;
    padding: 3px 8px;
    gap: 5px;
    border: 1px solid rgba(215, 168, 96, 0.28);
    border-radius: 999px;
    background: rgba(16, 28, 23, 0.78);
  }

  .match-timer__icon {
    width: 20px;
    height: 20px;
  }

  .match-timer .game-timer-label,
  .match-timer .game-timer-value {
    font-size: 0.76rem;
    line-height: 1;
  }

  .score-grid {
    display: flex;
    gap: 8px;
    margin-top: 7px;
    padding: 0 1px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(215, 168, 96, 0.5) rgba(255, 255, 255, 0.04);
  }

  .score-grid::-webkit-scrollbar {
    height: 5px;
  }

  .score-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(215, 168, 96, 0.52);
  }

  .match-welcome-empty {
    flex: 0 0 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 11px;
    border-radius: 15px;
  }

  .match-welcome-title {
    font-size: 0.86rem;
  }

  .match-welcome-copy {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.76rem;
    line-height: 1.22;
  }

  .match-welcome-action {
    width: 100%;
    min-height: 34px;
    padding: 0.52rem 0.72rem;
    border-radius: 13px;
    font-size: 0.88rem;
  }

  .score-card {
    flex: 0 0 min(68vw, 226px);
    scroll-snap-align: start;
    min-height: 70px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    padding: 6px 8px;
    border-radius: 15px;
  }

  .score-card.active {
    transform: none;
    border-color: rgba(244, 209, 138, 0.82);
    box-shadow:
      inset 0 1px 0 rgba(255, 246, 226, 0.2),
      0 0 0 2px rgba(236, 198, 122, 0.24),
      0 0 18px rgba(219, 177, 102, 0.2);
  }

  .score-avatar {
    width: 48px;
    height: 54px;
    border-radius: 13px;
  }

  .score-card-body {
    gap: 3px;
    padding-right: 34px;
  }

  .score-card-head {
    gap: 3px;
  }

  .score-name {
    font-size: 0.76rem;
    line-height: 1.02;
  }

  .score-player-copy .subtle {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.62rem;
    line-height: 1.08;
  }

  .score-rack {
    display: block;
    font-size: 0.64rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .score-value-stack {
    top: 8px;
    right: 7px;
    gap: 7px;
    min-width: 30px;
  }

  .score-value {
    font-size: 1.15rem;
  }

  .score-turn-ring {
    width: 32px;
    height: 32px;
  }

  .score-turn-ring-value {
    font-size: 0.62rem;
  }

  .panel-game-quick {
    order: 2;
    grid-column: 1;
    gap: 7px;
    padding: 8px;
    border-radius: 17px;
  }

  .quick-new-game {
    min-height: 35px;
    padding: 7px 10px;
    border-radius: 13px;
    font-size: 0.9rem;
  }

  .quick-new-game-plus {
    width: 19px;
    height: 19px;
    font-size: 0.92rem;
  }

  .quick-match-list {
    grid-template-columns: 0.78fr 0.78fr 1.44fr;
    gap: 5px;
    margin-top: 0;
  }

  .quick-match-row {
    min-height: 31px;
    gap: 4px;
    padding: 5px 6px;
    border-radius: 12px;
    font-size: 0.66rem;
  }

  .quick-match-row-status {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .quick-match-icon,
  .quick-match-icon-bag,
  .quick-match-icon-clock,
  .quick-match-icon-level {
    width: 19px;
    height: 19px;
  }

  .quick-match-value,
  .quick-turn-banner,
  #turnMeta .turn-meta-label,
  #turnMeta .quick-match-value {
    font-size: 0.66rem;
    line-height: 1.08;
  }

  .quick-turn-banner {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-panel {
    order: 3;
    grid-column: 1;
    gap: 4px;
    padding: 6px 4px 9px;
    border-radius: 18px;
    overflow-x: hidden;
  }

  body[data-board-style="native-css"] .board-stage,
  .board-stage {
    width: min(100%, calc(100vw - 14px));
    margin: 0 auto 2px;
    border-radius: 18px;
  }

  .coord-top,
  .coord-bottom {
    font-size: clamp(0.46rem, 1.9vw, 0.6rem);
  }

  .coord-left,
  .coord-right {
    font-size: clamp(0.44rem, 1.8vw, 0.58rem);
  }

  .cell .tile,
  .tile {
    --board-tile-scale: 0.96;
  }

  body[data-board-style="native-css"] .rack-card {
    margin-top: 3px;
    padding-top: 0;
  }

  .rack-card {
    width: min(100%, calc(100vw - 14px));
    max-width: none;
    grid-template-columns: 1fr;
    row-gap: 5px;
    margin: 2px auto 0;
  }

  .rack-header {
    display: none;
  }

  .rack {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    min-height: 54px;
    padding: 6px 6px 13px;
  }

  .rack-slot {
    min-height: 0;
    padding-bottom: 4px;
  }

  .rack-tile {
    width: min(96%, 42px);
  }

  .rack-tile .tile-glyph {
    font-size: clamp(1.05rem, 4.9vw, 1.3rem);
  }

  .rack-tile small {
    right: 14%;
    bottom: 8%;
    font-size: 0.56rem;
  }

  .rack-quick-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    transform: none;
  }

  .action-icon-button {
    gap: 2px;
    min-height: 46px;
  }

  .action-icon-art {
    width: 32px;
    max-height: 32px;
  }

  .action-label {
    font-size: 0.54rem;
    line-height: 1;
  }

  .panel-status {
    order: 4;
    grid-column: 1;
    padding: 8px 10px;
    border-radius: 17px;
  }

  .panel-status .panel-head {
    gap: 1px;
  }

  .panel-status .panel-head h2 {
    font-size: 0.98rem;
    line-height: 1.05;
  }

  .panel-status .panel-head .subtle {
    display: none;
  }

  .panel-status .message {
    min-height: 42px;
    max-height: 62px;
    padding: 8px 9px;
    overflow: auto;
    font-size: 0.82rem;
    line-height: 1.22;
  }

  #lastMoveSummary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.72rem;
    line-height: 1.18;
  }

  .panel-lexicon {
    order: 5;
    grid-column: 1;
    padding: 8px 10px;
    border-radius: 17px;
  }

  .panel-lexicon .board-header {
    display: block;
  }

  .panel-lexicon .enriched-word-panel {
    height: 118px;
    min-height: 118px;
    padding: 8px 9px;
    overflow: auto;
  }

  .panel-lexicon .enriched-word-definition,
  .panel-lexicon .enriched-word-message,
  .panel-lexicon .enriched-word-notes,
  .panel-lexicon .enriched-word-compact,
  .panel-lexicon .enriched-word-missing-inline {
    font-size: 0.74rem;
    line-height: 1.18;
  }

  .panel-history {
    order: 6;
    grid-column: 1;
    padding: 8px 10px;
    border-radius: 17px;
  }

  .panel-history .panel-head {
    gap: 1px;
  }

  .panel-history .panel-head h2,
  .panel-tools .panel-head h2 {
    font-size: 0.98rem;
  }

  .panel-history .panel-head .subtle,
  .panel-tools .panel-head .subtle {
    display: none;
  }

  .history,
  .panel-history:not(.is-expanded) .history {
    max-height: 102px;
  }

  .history li {
    padding: 7px 8px;
    font-size: 0.76rem;
    line-height: 1.18;
  }

  .history-toggle,
  .history-export-action {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 12px;
    font-size: 0.74rem;
  }

  .panel-tools {
    order: 7;
    grid-column: 1;
    padding: 8px 10px;
    border-radius: 17px;
  }

  .panel-tools .ffsc-link,
  .panel-tools .guide-link,
  .panel-tools .guide-download-link {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .panel-tools .interactive-guide-button {
    display: none;
  }

  /* Mobile portrait: closer to the dedicated game-app layout. */
  .app-shell {
    padding: 4px 4px 12px;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-rows: auto auto;
    gap: 2px 5px;
    margin-bottom: 4px;
    padding: 5px 7px 6px;
    border-radius: 14px;
    position: relative;
    z-index: 3000;
  }

  .platform-brand {
    grid-column: 1;
    grid-row: 1;
    gap: 6px;
  }

  .platform-brand__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .platform-brand__copy {
    min-height: 0;
    gap: 0;
  }

  .platform-brand__name {
    max-width: clamp(136px, 37vw, 150px);
    overflow: hidden;
    font-size: clamp(0.66rem, 3.1vw, 0.78rem);
    letter-spacing: 0.12em;
    text-overflow: ellipsis;
  }

  .platform-brand__tagline {
    display: none;
  }

  .site-game-title {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    justify-items: start;
    padding-left: 0;
    text-align: left;
  }

  .site-game-title h1 {
    font-size: clamp(1.18rem, 5.25vw, 1.36rem);
    line-height: 1;
    white-space: nowrap;
  }

  .account-area {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .profile-trigger {
    grid-template-columns: auto auto auto;
    gap: 5px;
    padding: 3px 5px 3px 3px;
    border-radius: 11px;
  }

  .profile-avatar {
    width: 30px;
    height: 30px;
  }

  .profile-copy {
    display: grid;
    max-width: 72px;
    gap: 0;
  }

  .profile-copy strong {
    display: none;
  }

  .profile-copy span {
    display: block;
    color: #f8ead0;
    font-size: 0.58rem;
    line-height: 1;
  }

  .profile-level-star {
    width: 12px;
    height: 12px;
    margin-left: 1px;
  }

  .profile-chevron {
    font-size: 0.92rem;
  }

  .game-controls-bar {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    width: 40px;
  }

  .topbar-timing {
    display: inline-flex;
    gap: 5px;
    width: 40px;
    flex-wrap: nowrap;
  }

  .sound-toggle,
  .top-guide-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
  }

  .sound-toggle-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .sound-toggle-icon img {
    width: 21px;
    height: 21px;
  }

  .top-guide-button {
    display: none !important;
  }

  .guide-link.top-guide-button {
    display: none !important;
  }

  .platform-nav {
    grid-column: 4;
    grid-row: 1 / span 2;
    display: flex;
    align-self: center;
    justify-self: end;
    overflow: visible;
  }

  .platform-nav > .platform-nav__item {
    display: none;
  }

  .platform-nav-more {
    display: block;
  }

  .platform-nav-more__summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    color: transparent;
    font-size: 0;
  }

  .platform-nav-more__summary::before {
    content: "☰";
    color: #d7a860;
    font-size: 1.08rem;
    line-height: 1;
  }

  .platform-nav-more__summary::after {
    content: none;
  }

  .platform-nav-more__summary::before {
    content: "";
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: #d7a860;
    color: #d7a860;
    font-size: 0;
    line-height: 1;
    box-shadow:
      0 -5px 0 currentColor,
      0 5px 0 currentColor;
  }

  .platform-nav-more__dropdown {
    position: fixed;
    z-index: 5200;
    top: 78px;
    right: 8px;
    left: 8px;
    display: grid;
    width: auto;
    min-width: 0;
    max-height: min(72vh, 520px);
    overflow: auto;
    padding: 10px;
    border-color: rgba(215, 168, 96, 0.46);
    background: #0e1c16;
    box-shadow:
      0 20px 38px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(247, 241, 227, 0.09);
  }

  .platform-nav-more__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 9px;
    color: #d7a860;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .platform-nav-more__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(215, 168, 96, 0.36);
    background: rgba(12, 23, 18, 0.88);
    color: #f6dfaa;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1;
  }

  .platform-nav-more:not([open]) .platform-nav-more__dropdown,
  .profile-menu:not([open]) .profile-dropdown {
    display: none !important;
  }

  .platform-nav-more__item,
  .platform-nav-more__item--mobile-only,
  .platform-nav-more__item--download,
  .platform-nav-more__item--primary {
    display: block;
  }

  .platform-nav-more__item {
    padding: 10px 11px;
    border-radius: 10px;
    font-size: 0.86rem;
  }

  .platform-nav-more__item--download {
    margin-top: 3px;
    border: 1px solid rgba(246, 203, 111, 0.5);
    background:
      linear-gradient(180deg, rgba(255, 246, 214, 0.96), rgba(229, 176, 78, 0.96));
    color: #251707;
    font-weight: 900;
    text-align: center;
  }

  .platform-nav-more__item--primary {
    margin-bottom: 4px;
    border: 1px solid rgba(246, 203, 111, 0.42);
    background:
      linear-gradient(180deg, rgba(229, 178, 92, 0.28), rgba(160, 103, 45, 0.2)),
      rgba(19, 34, 27, 0.96);
    color: #ffe8b2;
    font-weight: 900;
  }

  .profile-dropdown {
    position: fixed;
    z-index: 5300;
    top: 78px;
    right: 8px;
    left: auto;
    width: min(220px, calc(100vw - 16px));
    min-width: 0;
    border-color: rgba(215, 168, 96, 0.46);
    background: #0e1c16;
    box-shadow:
      0 20px 38px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(247, 241, 227, 0.09);
  }

  .layout {
    gap: 6px;
    margin-top: 4px;
  }

  .scores {
    padding: 6px 8px 7px;
    width: calc(100% + 8px);
    margin-right: -4px;
    margin-left: -4px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .scores .panel-head--with-icon {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    column-gap: 5px;
  }

  .match-title-icon {
    width: 19px;
    height: 19px;
  }

  .scores .panel-head--with-icon h2 {
    font-size: 0.86rem;
  }

  .match-online-action {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid rgba(215, 168, 96, 0.28);
    border-radius: 999px;
    background:
      linear-gradient(180deg, rgba(255, 246, 224, 0.08), rgba(255, 255, 255, 0.02)),
      rgba(13, 24, 20, 0.74);
    color: #f9e9c8;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
  }

  .match-online-action img {
    width: 14px;
    height: 14px;
    object-fit: contain;
  }

  .scores .match-timer {
    padding: 2px 7px;
  }

  .match-timer__icon {
    width: 18px;
    height: 18px;
  }

  .match-timer .game-timer-label,
  .match-timer .game-timer-value {
    font-size: 0.68rem;
  }

  .score-grid {
    gap: 6px;
    margin-top: 5px;
    padding-bottom: 2px;
  }

  .score-card {
    flex-basis: min(42vw, 176px);
    min-height: 60px;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 14px;
  }

  .score-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(244, 209, 138, 0.42);
  }

  .score-card-body {
    gap: 2px;
    padding-right: 27px;
  }

  .score-name {
    font-size: 0.68rem;
  }

  .score-player-copy .subtle {
    font-size: 0.54rem;
  }

  .score-rack {
    font-size: 0.58rem;
  }

  .score-value-stack {
    top: 7px;
    right: 6px;
    min-width: 25px;
  }

  .score-value {
    font-size: 1rem;
  }

  .score-turn-ring {
    width: 27px;
    height: 27px;
  }

  .score-turn-ring-value {
    font-size: 0.56rem;
  }

  .panel-game-quick {
    gap: 0;
    width: calc(100% + 8px);
    margin-right: -4px;
    margin-left: -4px;
    padding: 3px 8px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .quick-new-game {
    display: inline-flex;
    min-height: 34px;
    margin-bottom: 4px;
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .quick-match-list {
    grid-template-columns: minmax(70px, 0.72fr) minmax(104px, 1.08fr) minmax(136px, 1.35fr);
    gap: 5px;
  }

  .quick-match-row {
    min-height: 28px;
    padding: 4px 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
  }

  .quick-match-icon,
  .quick-match-icon-bag,
  .quick-match-icon-clock,
  .quick-match-icon-level {
    width: 16px;
    height: 16px;
  }

  .quick-match-value,
  .quick-turn-banner,
  #turnMeta .turn-meta-label,
  #turnMeta .quick-match-value {
    font-size: 0.62rem;
    line-height: 1;
    white-space: nowrap;
  }

  .board-panel {
    display: contents;
  }

  body[data-board-style="native-css"] .board-stage,
  .board-stage {
    order: 3;
    grid-column: 1;
    width: min(100%, calc(100vw - 10px));
    margin: 0 auto;
    border-radius: 16px;
  }

  .panel-status {
    order: 4;
    width: calc(100% + 8px);
    margin-right: -4px;
    margin-left: -4px;
    padding: 4px 8px;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
    align-content: start;
  }

  .panel-status .panel-head {
    margin-bottom: 2px;
  }

  .panel-status .panel-head h2 {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    line-height: 1;
  }

  .panel-status .message {
    min-height: 24px;
    max-height: 28px;
    padding: 4px 7px;
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1.08;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .panel-status.is-mobile-status-flash {
    box-shadow:
      inset 0 -1px 0 rgba(246, 203, 111, 0.32),
      inset 0 1px 0 rgba(246, 203, 111, 0.32),
      0 0 18px rgba(229, 178, 92, 0.2);
  }

  .panel-status .lexicon-loading[hidden] {
    display: none !important;
  }

  .panel-status .lexicon-loading {
    min-height: 28px;
    margin-top: 2px;
    padding: 4px 7px;
    border-radius: 10px;
  }

  .panel-status .lexicon-loading-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
  }

  .panel-status .lexicon-loading-title,
  .panel-status .lexicon-loading-detail {
    overflow: hidden;
    font-size: 0.64rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel-status .lexicon-loading-progress {
    display: none;
  }

  .panel-status.is-endgame-access {
    padding: 6px 9px;
  }

  .panel-status.is-endgame-access .endgame-status-access {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 8px;
    padding: 7px 8px;
    border-radius: 13px;
  }

  .panel-status.is-endgame-access .endgame-status-access__eyebrow {
    grid-column: 1 / -1;
    font-size: 0.52rem;
    line-height: 1;
  }

  .panel-status.is-endgame-access #endGameAccessText {
    font-size: 0.76rem;
    line-height: 1.05;
  }

  .panel-status.is-endgame-access .endgame-status-access p:not(.endgame-status-access__eyebrow):not(#endGameAccessText) {
    display: none;
  }

  .panel-status.is-endgame-access #endGameAccessText {
    display: block;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel-status.is-endgame-access .endgame-status-access__button {
    min-height: 28px;
    margin: 0;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.66rem;
    white-space: nowrap;
  }

  #lastMoveSummary {
    display: none;
  }

  .rack-card {
    order: 5;
    grid-column: 1;
    width: min(100%, calc(100vw - 10px));
    row-gap: 1px;
    margin: 2px auto 0;
  }

  .rack {
    gap: 4px;
    height: 78px;
    min-height: 78px;
    padding: 14px 8px 9px;
    overflow: visible;
    align-items: center;
  }

  .rack-tile {
    width: min(98%, 52px);
  }

  .rack-tile .tile-glyph {
    font-size: clamp(1.26rem, 5.8vw, 1.54rem);
  }

  .rack-tile small {
    font-size: 0.62rem;
  }

  .rack-quick-actions {
    gap: 4px;
    margin-top: -4px;
  }

  #validateBtn,
  #shuffleBtn,
  #undoBtn,
  #passBtn,
  #exchangeBtn {
    grid-column: auto;
    grid-row: auto;
  }

  .action-icon-button {
    min-height: 54px;
    gap: 3px;
  }

  .action-icon-art {
    width: 38px;
    max-height: 38px;
  }

  .action-label {
    font-size: 0.64rem;
  }

  .word-score-badge {
    display: none;
  }

  .panel-lexicon {
    order: 6;
  }

  .panel-history {
    order: 7;
  }

  .panel-tools {
    order: 8;
  }

  .setup-modal {
    z-index: 6000;
    align-items: start;
    justify-items: center;
    padding: 8px;
    overflow: auto;
  }

  .setup-modal-card {
    width: min(100%, calc(100vw - 16px));
    min-height: 0;
    max-height: calc(100dvh - 16px);
    padding: 12px;
    overflow: auto;
    display: block;
    border-radius: 16px;
  }

  .setup-modal-back {
    top: 10px;
    right: 10px;
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.7rem;
  }

  .setup-modal-header {
    gap: 4px;
    margin-bottom: 9px;
    padding-right: 82px;
  }

  .setup-modal-header .endgame-eyebrow {
    font-size: 0.62rem;
  }

  .setup-modal-header h3 {
    font-size: 1.02rem;
    line-height: 1.1;
  }

  .setup-modal-header .subtle {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .setup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 0;
    padding-bottom: 0;
  }

  .setup-section {
    min-height: auto;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
  }

  .setup-section--avatars,
  .setup-section--details {
    align-content: start;
  }

  .setup-section .panel-head {
    gap: 2px;
  }

  .setup-section .panel-head h2 {
    font-size: 0.9rem;
  }

  .setup-section .panel-head .subtle {
    font-size: 0.68rem;
    line-height: 1.16;
  }

  .setup-field-grid,
  .setup-field-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .setup-field {
    gap: 4px;
  }

  .setup-field span {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }

  .setup-field input,
  .setup-field select {
    min-height: 36px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: 0.8rem;
  }

  .setup-avatar-grid-wrap {
    max-height: clamp(160px, 26dvh, 190px);
    padding-right: 3px;
    overflow: auto;
  }

  .setup-avatar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .setup-avatar-option {
    gap: 5px;
    padding: 6px;
    border-radius: 12px;
  }

  .setup-avatar-thumb {
    border-radius: 10px;
  }

  .setup-avatar-name {
    font-size: 0.72rem;
    line-height: 1.05;
  }

  .setup-summary {
    font-size: 0.7rem;
    line-height: 1.22;
  }

  .setup-modal-actions {
    position: static;
    margin: 4px 0 0;
    padding-top: 2px;
    background: none;
  }

  .setup-modal-actions button {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  .platform-brand__tagline {
    max-width: 168px;
  }

  .topbar-timing {
    gap: 0;
    width: 34px;
  }

  .sound-toggle {
    padding-right: 0;
    padding-left: 0;
  }

  .sound-toggle-text {
    font-size: 0.62rem;
    letter-spacing: 0.055em;
  }

  .score-card {
    flex-basis: min(42vw, 166px);
  }

  .quick-match-row {
    padding-right: 4px;
    padding-left: 4px;
  }

  .action-label {
    font-size: 0.5rem;
  }
}

@media (max-width: 380px) and (max-height: 700px) {
  body[data-board-style="native-css"] .board-stage,
  .board-stage {
    width: min(100%, 350px);
  }

  .panel-status {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .panel-status .panel-head {
    display: none;
  }

  .panel-status .message {
    min-height: 24px;
    max-height: 24px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .panel-status .lexicon-loading {
    min-height: 24px;
    margin-top: 0;
    padding-top: 3px;
    padding-bottom: 3px;
  }
}

@media (max-width: 640px) and (max-height: 760px) and (orientation: portrait) {
  .setup-modal {
    padding: 6px;
  }

  .setup-modal-card {
    width: min(100%, calc(100vw - 12px));
    max-height: calc(100dvh - 12px);
    padding: 9px;
    border-radius: 14px;
  }

  .setup-modal-back {
    top: 8px;
    right: 8px;
    min-height: 31px;
    padding: 0 9px;
    font-size: 0.64rem;
    letter-spacing: 0.03em;
  }

  .setup-modal-header {
    gap: 2px;
    margin-bottom: 6px;
    padding-right: 72px;
  }

  .setup-modal-header .endgame-eyebrow {
    font-size: 0.56rem;
  }

  .setup-modal-header h3 {
    font-size: 0.92rem;
    line-height: 1.05;
  }

  .setup-modal-header .subtle,
  .setup-section .panel-head .subtle {
    display: none;
  }

  .setup-layout {
    gap: 7px;
  }

  .setup-section {
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
  }

  .setup-section .panel-head h2 {
    font-size: 0.82rem;
    line-height: 1.05;
  }

  .avatar-filter-bar--setup {
    margin-bottom: 6px;
    padding-bottom: 4px;
  }

  .avatar-filter-button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .setup-avatar-grid-wrap {
    max-height: clamp(150px, 25dvh, 172px);
    padding-right: 2px;
  }

  .setup-avatar-grid {
    gap: 6px;
  }

  .setup-avatar-option {
    gap: 4px;
    padding: 5px;
    border-radius: 10px;
  }

  .setup-avatar-thumb {
    border-radius: 9px;
  }

  .setup-avatar-name {
    font-size: 0.62rem;
    line-height: 1;
  }

  .setup-field-grid,
  .setup-field-grid--compact {
    gap: 6px;
  }

  .setup-field input,
  .setup-field select {
    min-height: 33px;
  }

  .setup-modal-actions button {
    min-height: 34px;
  }
}

@media (max-width: 639px) {
  .joker-picker.is-board-picker {
    position: fixed;
    top: var(--board-picker-top, 8px);
    left: var(--board-picker-left, 8px);
    width: var(--board-picker-width, calc(100vw - 16px));
    height: var(--board-picker-height, min(100vw, 420px));
    inset: auto;
    z-index: 82;
    padding: 8px;
    place-items: center;
  }

  .joker-picker.is-board-picker .joker-picker-card {
    width: min(94%, 420px);
    max-height: calc(var(--board-picker-height, 100dvh) - 16px);
    overflow: auto;
  }

  .confirm-modal.is-board-confirm {
    position: fixed;
    top: var(--board-confirm-top, 8px);
    left: var(--board-confirm-left, 8px);
    width: var(--board-confirm-width, calc(100vw - 16px));
    height: var(--board-confirm-height, min(100vw, 420px));
    inset: auto;
    z-index: 80;
    padding: 8px;
    place-items: center;
  }

  .confirm-modal.is-board-confirm .confirm-modal-card {
    width: min(92%, 340px);
    max-width: 340px;
  }

  .app-shell {
    padding-top: 0;
  }

  .coord {
    display: none !important;
  }

  body[data-board-style="classic-css"] .bonus,
  body[data-board-style="native-css"] .bonus {
    inset: 0;
    width: 100%;
    height: 100%;
    font-size: clamp(0.48rem, 2.05vw, 0.66rem);
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    text-transform: none;
    align-items: center;
    justify-items: center;
    place-items: center;
  }

  body[data-board-style="classic-css"] .bonus {
    color: rgba(34, 30, 23, 0.86);
  }

  body[data-board-style="native-css"] .bonus {
    color: rgba(255, 250, 230, 0.96);
  }

  body[data-board-style="classic-css"] .bonus:not([data-short-label="✦"]),
  body[data-board-style="native-css"] .bonus:not([data-short-label="✦"]) {
    font-size: 0;
  }

  body[data-board-style="classic-css"] .bonus:not([data-short-label="✦"])::after,
  body[data-board-style="native-css"] .bonus:not([data-short-label="✦"])::after {
    content: attr(data-short-label);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(0.48rem, 2.05vw, 0.66rem);
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    transform: translateY(-0.08em);
  }

  .site-header {
    width: calc(100% + 8px);
    margin: 0 -4px 6px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  body[data-board-style="native-css"] .board-stage,
  .board-stage {
    width: calc(100% + 8px);
    max-width: none;
    margin-right: -4px;
    margin-left: -4px;
    border-radius: 0;
  }

  .rack {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 2px;
    align-items: end;
    margin-bottom: 4px;
    padding-top: 10px;
    padding-bottom: 14px;
    transform: translateY(-4px);
  }

  .rack-slot {
    min-width: 0;
  }

  .rack-tile {
    width: min(100%, 38px);
  }

  .rack-tile .tile-glyph {
    font-size: clamp(0.98rem, 4.4vw, 1.18rem);
  }

  .rack-tile small {
    font-size: 0.52rem;
  }

  .rack-quick-actions {
    width: min(100%, 300px);
    justify-self: center;
    gap: 2px;
    margin-top: 2px;
  }

  .score-grid {
    position: relative;
    margin: 7px -8px 0;
    padding: 0 8px 7px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 8px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: none;
  }

  .score-grid::-webkit-scrollbar {
    display: none;
  }

  .score-card {
    flex: 0 0 min(67vw, 225px);
    scroll-snap-align: center;
    border-radius: 18px;
  }

  .score-card.active {
    border-radius: 19px;
  }

  .quick-match-row,
  #turnMeta.quick-match-row,
  .quick-match-row.quick-match-row-status {
    border-radius: 0;
  }

  .sidebar-right .panel-game-quick,
  .sidebar-left .scores,
  .sidebar-left .panel-status,
  .sidebar-left .panel-lexicon,
  .panel-game-quick,
  .scores,
  .score-grid,
  .panel-lexicon,
  .panel-status {
    border-radius: 0;
  }

  .quick-match-list {
    border-radius: 0;
  }

  .panel-lexicon {
    width: calc(100% + 8px);
    margin-right: -4px;
    margin-left: -4px;
    border-right: 0;
    border-left: 0;
  }

  .panel-status.is-endgame-access,
  .panel-status.is-endgame-access .endgame-status-access,
  .endgame-status-access {
    border-radius: 0;
  }
}

@media (max-width: 932px) and (max-height: 480px) and (orientation: landscape) {
  .word-highlight {
    border-width: 2px;
  }

  .word-highlight.is-main {
    border-width: 3px;
  }

  .word-highlight.is-cross {
    border-width: 1.5px;
  }

  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(280px, min(52vw, calc(100dvh - 8px))) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(34px, auto) auto auto auto auto auto;
    gap: 0 4px;
    width: 100%;
    min-height: 100dvh;
    padding: 4px 4px 14px;
    overflow: visible;
  }

  .layout,
  .sidebar-left,
  .sidebar-right,
  .sidebar-guide-followup,
  .board-panel {
    display: contents;
  }

  .site-header {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 7000;
    width: calc(100% + 8px);
    min-width: 0;
    margin: 0 -4px;
    padding: 3px 8px;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-rows: auto auto;
    gap: 0 5px;
    align-self: start;
    overflow: visible;
  }

  .platform-brand {
    grid-column: 1;
    grid-row: 1;
    gap: 5px;
    min-width: 0;
  }

  .platform-brand__icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .platform-brand__copy {
    min-height: 0;
    gap: 0;
    display: none;
  }

  .platform-brand__name {
    max-width: none;
    color: #d7a860;
    font-size: clamp(0.56rem, 1.25vw, 0.68rem);
    font-weight: 400;
    letter-spacing: 0.14em;
  }

  .platform-brand__tagline,
  .online-mode-entry,
  .top-guide-button,
  .guide-link.top-guide-button {
    display: none !important;
  }

  .coord {
    display: none !important;
  }

  body[data-board-style="classic-css"] .bonus,
  body[data-board-style="native-css"] .bonus {
    inset: 0;
    width: 100%;
    height: 100%;
    font-size: clamp(0.44rem, 1.55vw, 0.62rem);
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    text-transform: none;
    align-items: center;
    justify-items: center;
    place-items: center;
  }

  body[data-board-style="classic-css"] .bonus:not([data-short-label="✦"]),
  body[data-board-style="native-css"] .bonus:not([data-short-label="✦"]) {
    font-size: 0;
  }

  body[data-board-style="classic-css"] .bonus:not([data-short-label="✦"])::after,
  body[data-board-style="native-css"] .bonus:not([data-short-label="✦"])::after {
    content: attr(data-short-label);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(0.44rem, 1.55vw, 0.62rem);
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    transform: translateY(-0.08em);
  }

  .site-game-title {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    justify-items: start;
    padding: 0;
    text-align: left;
    display: none;
  }

  .site-game-title .eyebrow {
    display: none;
  }

  .site-game-title h1 {
    color: #f1ead7;
    font-size: clamp(1.05rem, 2.8vw, 1.34rem);
    line-height: 0.96;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .account-area {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .profile-trigger {
    min-width: 0;
    grid-template-columns: auto auto auto;
    gap: 6px;
    padding: 2px 7px 2px 2px;
    border-radius: 10px;
  }

  .profile-avatar {
    width: 28px;
    height: 28px;
  }

  .profile-copy {
    max-width: 68px;
  }

  .profile-copy strong {
    display: none;
  }

  .profile-copy span {
    color: #f8ead0;
    font-size: 0.54rem;
    line-height: 1;
  }

  .profile-level-star {
    width: 11px;
    height: 11px;
    margin-left: 1px;
  }

  .profile-chevron {
    font-size: 0.82rem;
  }

  .game-controls-bar {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    width: 40px;
  }

  .topbar-timing {
    display: inline-flex;
    width: 40px;
    gap: 0;
    flex-wrap: nowrap;
  }

  .sound-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
  }

  .sound-toggle-icon img {
    width: 20px;
    height: 20px;
  }

  .sound-toggle-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .platform-nav {
    grid-column: 4;
    grid-row: 1 / span 2;
    display: flex;
    align-self: center;
    justify-self: end;
    overflow: visible;
  }

  .platform-nav > .platform-nav__item {
    display: none;
  }

  .platform-nav-more {
    display: block;
  }

  .platform-nav-more__summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    color: transparent;
    font-size: 0;
  }

  .platform-nav-more__summary::before {
    content: "";
    width: 15px;
    height: 2px;
    border-radius: 999px;
    background: #d7a860;
    color: #d7a860;
    box-shadow:
      0 -5px 0 currentColor,
      0 5px 0 currentColor;
  }

  .platform-nav-more__summary::after {
    content: none;
  }

  .platform-nav-more__dropdown {
    position: fixed;
    z-index: 9200;
    top: 6px;
    right: 6px;
    left: auto;
    width: min(280px, calc(100vw - 12px));
    min-width: 0;
    max-height: calc(100dvh - 12px);
    overflow: auto;
    padding: 10px;
    border-color: rgba(215, 168, 96, 0.46);
    border-radius: 12px;
    background: #0e1c16;
    box-shadow:
      0 20px 38px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(247, 241, 227, 0.09);
  }

  .platform-nav-more__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 9px;
    color: #d7a860;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .platform-nav-more__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(215, 168, 96, 0.36);
    border-radius: 999px;
    background: rgba(12, 23, 18, 0.88);
    color: #f6dfaa;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
  }

  .platform-nav-more:not([open]) .platform-nav-more__dropdown,
  .profile-menu:not([open]) .profile-dropdown {
    display: none !important;
  }

  .platform-nav-more__item,
  .platform-nav-more__item--mobile-only,
  .platform-nav-more__item--download,
  .platform-nav-more__item--primary {
    display: block;
  }

  .platform-nav-more__item {
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 0.82rem;
  }

  .platform-nav-more__item--primary {
    margin-bottom: 4px;
    border: 1px solid rgba(246, 203, 111, 0.42);
    background:
      linear-gradient(180deg, rgba(229, 178, 92, 0.28), rgba(160, 103, 45, 0.2)),
      rgba(19, 34, 27, 0.96);
    color: #ffe8b2;
    font-weight: 900;
  }

  .platform-nav-more__item--download {
    margin-top: 3px;
    border: 1px solid rgba(246, 203, 111, 0.5);
    background:
      linear-gradient(180deg, rgba(255, 246, 214, 0.96), rgba(229, 176, 78, 0.96));
    color: #251707;
    font-weight: 900;
    text-align: center;
  }

  .profile-dropdown {
    position: fixed;
    z-index: 9300;
    top: 58px;
    right: 6px;
    width: min(220px, calc(100vw - 12px));
    min-width: 0;
    border-color: rgba(215, 168, 96, 0.46);
    background: #0e1c16;
  }

  .scores,
  .sidebar-left .scores,
  .sidebar-left .panel.scores {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    z-index: 1;
    align-self: stretch;
    min-width: 0;
    width: calc(100% + 8px) !important;
    margin: 0 -4px 0 !important;
    padding: 3px 0 2px !important;
    border-radius: 0 !important;
    border-right: 0;
    border-left: 0;
    overflow: hidden;
  }

  .scores .panel-head--with-icon {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    min-height: 23px;
    margin: 0 0 5px;
    padding: 0 8px;
    transform: none;
  }

  .scores .match-title-icon {
    width: 18px;
    height: 18px;
  }

  .scores .panel-head--with-icon h2 {
    color: #fff3d7;
    font-size: 0.78rem;
    line-height: 1;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .scores .match-online-action {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 22px;
    padding: 3px 9px;
    border: 1px solid rgba(215, 168, 96, 0.32);
    border-radius: 999px;
    background: rgba(9, 23, 18, 0.48);
    color: #f9e9c8;
    font-size: 0.58rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
  }

  .scores .match-online-action img {
    width: 12px;
    height: 12px;
  }

  .scores .notification-center {
    grid-column: 3;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    margin: 0;
  }

  .scores .notification-bell {
    width: 25px;
    height: 25px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .scores .notification-bell:hover,
  .scores .notification-bell:focus-visible,
  .scores .notification-center.is-open .notification-bell {
    transform: none;
    border-color: transparent;
    box-shadow: none;
  }

  .scores .notification-bell img {
    width: 20px;
    height: 20px;
  }

  .scores .match-timer {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #f9e9c8;
  }

  .scores .match-timer[hidden] {
    display: none;
  }

  .scores .match-timer__icon {
    width: 17px;
    height: 17px;
  }

  .scores .match-timer .game-timer-label,
  .scores .match-timer .game-timer-value {
    color: #fff3d7;
    font-size: 0.62rem;
    line-height: 1;
    white-space: nowrap;
  }

  .score-grid {
    display: flex;
    gap: 12px;
    height: 63px;
    width: 100%;
    margin: 0;
    padding: 0 8px 4px;
    border: 0 !important;
    border-radius: 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 12px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: transparent;
    box-shadow: none;
  }

  .score-grid::-webkit-scrollbar {
    display: none;
  }

  .score-card {
    flex: 0 0 min(62%, 252px);
    min-height: 59px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px;
    padding: 4px 7px;
    border-radius: 17px;
    scroll-snap-align: center;
  }

  .score-card.active {
    border-radius: 18px;
  }

  .score-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
  }

  .score-card-body {
    gap: 3px;
    padding-right: 23px;
  }

  .score-name {
    font-size: 0.66rem;
    line-height: 1.06;
  }

  .score-player-copy .subtle {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.56rem;
    line-height: 1.08;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  .score-player-copy .score-ai-style {
    font-size: 0.52rem;
    line-height: 1.08;
  }

  .score-rack {
    display: block;
    margin-top: 2px;
    font-size: 0.6rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .score-value-stack {
    top: 5px;
    right: 5px;
    gap: 4px;
    min-width: 24px;
  }

  .score-value {
    font-size: 0.94rem;
  }

  .score-turn-ring {
    width: 25px;
    height: 25px;
  }

  .score-turn-ring-value {
    font-size: 0.5rem;
  }

  .panel.panel-game-quick {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    width: calc(100% + 8px) !important;
    margin: 0 -4px !important;
    padding: 2px 8px !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    background:
      linear-gradient(180deg, rgba(36, 62, 51, 0.28), rgba(8, 20, 16, 0.2)),
      #0e1c16 !important;
    box-shadow: none !important;
    overflow: visible;
  }

  .quick-new-game {
    display: inline-flex;
    min-height: 28px;
    gap: 5px;
    margin-bottom: 3px;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.66rem;
    line-height: 1;
    white-space: nowrap;
  }

  .quick-new-game-plus {
    width: 16px;
    height: 16px;
    font-size: 0.78rem;
  }

  .quick-match-list {
    display: grid;
    grid-template-columns: minmax(58px, 0.72fr) minmax(92px, 1fr) minmax(100px, 1.18fr);
    gap: 3px;
    margin: 0;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
  }

  .quick-match-row {
    min-height: 22px;
    gap: 4px;
    padding: 2px 6px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
    font-size: 0.6rem;
  }

  #turnMeta.quick-match-row,
  .quick-match-row.quick-match-row-status {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .quick-match-icon,
  .quick-match-icon-bag,
  .quick-match-icon-clock,
  .quick-match-icon-level {
    width: 15px;
    height: 15px;
  }

  .quick-match-value,
  .quick-turn-banner,
  #turnMeta .turn-meta-label,
  #turnMeta .quick-match-value {
    overflow: hidden;
    font-size: 0.6rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel.panel-status {
    grid-column: 2;
    grid-row: 4;
    min-width: 0;
    width: calc(100% + 8px) !important;
    margin: 0 -4px !important;
    padding: 4px 8px !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    background:
      linear-gradient(180deg, rgba(36, 62, 51, 0.28), rgba(8, 20, 16, 0.2)),
      #0e1c16 !important;
    box-shadow: none !important;
    overflow: hidden;
  }

  .match-welcome-empty {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding: 5px 8px;
    border-radius: 10px;
  }

  .match-welcome-title {
    font-size: 0.66rem;
    line-height: 1;
    letter-spacing: 0.055em;
  }

  .match-welcome-copy {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    font-size: 0.58rem;
    line-height: 1.08;
  }

  .match-welcome-action {
    grid-row: 1 / span 2;
    grid-column: 2;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 9px;
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .panel-status .panel-head {
    margin: 0;
    gap: 0;
  }

  .panel-status .panel-head h2 {
    font-size: 0.66rem;
    line-height: 1;
    letter-spacing: 0.11em;
  }

  .panel-status .panel-head .subtle,
  #lastMoveSummary {
    display: none;
  }

  .panel-status .message {
    min-height: 18px;
    max-height: 25px;
    padding: 2px 0;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #fff3d7;
    font-size: 0.64rem;
    line-height: 1.14;
  }

  .panel-status.is-endgame-access .endgame-status-access {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 7px;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .panel-status.is-endgame-access .endgame-status-access__eyebrow {
    grid-column: 1 / -1;
    font-size: 0.5rem;
  }

  .panel-status.is-endgame-access #endGameAccessText {
    overflow: hidden;
    font-size: 0.62rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel-status.is-endgame-access .endgame-status-access__button {
    min-height: 26px;
    margin: 0;
    padding: 4px 8px;
    border-radius: 9px;
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .rack-card {
    grid-column: 2;
    grid-row: 5;
    align-self: start;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: -5px 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 2px 8px 2px;
  }

  .rack-header {
    display: none;
  }

  .rack {
    justify-self: center;
    grid-template-columns: repeat(10, minmax(0, 38px));
    justify-content: center;
    align-items: end;
    gap: 2px;
    width: min(100%, 394px);
    min-height: 55px;
    height: 55px;
    padding: 5px 6px 11px;
    transform: translateY(-10px);
    overflow: visible;
  }

  .rack-slot {
    min-width: 0;
    padding-bottom: 4px;
  }

  .rack-tile {
    width: min(100%, 38px);
  }

  .rack-tile .tile-glyph {
    font-size: clamp(1.04rem, 3.05vw, 1.18rem);
  }

  .rack-tile small {
    font-size: 0.52rem;
  }

  .rack-quick-actions {
    justify-self: center;
    grid-template-columns: repeat(5, 50px);
    justify-content: center;
    justify-items: center;
    gap: 9px;
    width: min(100%, 340px);
    margin-top: -10px;
    transform: translateY(-6px);
  }

  .rack-quick-actions #validateBtn,
  .rack-quick-actions #shuffleBtn,
  .rack-quick-actions #undoBtn,
  .rack-quick-actions #passBtn,
  .rack-quick-actions #exchangeBtn {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .rack-quick-actions #validateBtn {
    order: 1;
  }

  .rack-quick-actions #shuffleBtn {
    order: 2;
  }

  .rack-quick-actions #undoBtn {
    order: 3;
  }

  .rack-quick-actions #passBtn {
    order: 4;
  }

  .rack-quick-actions #exchangeBtn {
    order: 5;
  }

  .action-icon-button {
    width: 50px;
    min-height: 45px;
    gap: 2px;
  }

  .action-icon-art {
    width: 36px;
    max-height: 36px;
  }

  .action-label {
    font-size: 0.53rem;
    line-height: 1;
  }

  body[data-board-style="native-css"] .board-stage,
  .board-stage {
    grid-column: 1;
    grid-row: 1 / 7;
    align-self: start;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .joker-picker.is-board-picker {
    position: fixed;
    top: var(--board-picker-top, 8px);
    left: var(--board-picker-left, 8px);
    width: var(--board-picker-width, min(52vw, 420px));
    height: var(--board-picker-height, min(100dvh, 420px));
    inset: auto;
    z-index: 12160;
    padding: 8px;
    place-items: center;
  }

  .joker-picker.is-board-picker .joker-picker-card {
    width: min(94%, 420px);
    max-height: calc(var(--board-picker-height, 100dvh) - 16px);
    overflow: auto;
  }

  .confirm-modal.is-board-confirm {
    position: fixed;
    top: var(--board-confirm-top, 8px);
    left: var(--board-confirm-left, 8px);
    width: var(--board-confirm-width, min(52vw, 420px));
    height: var(--board-confirm-height, min(100dvh, 420px));
    inset: auto;
    z-index: 12150;
    padding: 8px;
    place-items: center;
  }

  .confirm-modal.is-board-confirm .confirm-modal-card {
    width: min(92%, 340px);
    max-width: 340px;
  }

  .panel-lexicon,
  .panel-history,
  .panel-tools {
    display: grid;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    margin: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .panel-lexicon {
    grid-column: 2;
    grid-row: 6;
    align-self: start;
    width: calc(100% + 8px);
    min-height: 72px;
    margin: -4px -4px 0;
    padding: 7px 10px 8px;
    border-radius: 0 !important;
    overflow: hidden;
    background:
      linear-gradient(180deg, rgba(36, 62, 51, 0.34), rgba(8, 20, 16, 0.28)),
      #0e1c16;
  }

  .panel-lexicon .board-header {
    display: block;
  }

  .panel-lexicon .enriched-word-panel {
    height: 62px;
    min-height: 62px;
    max-height: 62px;
    padding: 0;
    border-radius: 0 !important;
    overflow: auto;
  }

  .panel-lexicon .enriched-word-eyebrow {
    font-size: 0.58rem;
    line-height: 1;
  }

  .panel-lexicon .enriched-word-title {
    font-size: 0.72rem;
    line-height: 1.05;
  }

  .panel-lexicon .enriched-word-definition,
  .panel-lexicon .enriched-word-message,
  .panel-lexicon .enriched-word-notes,
  .panel-lexicon .enriched-word-compact,
  .panel-lexicon .enriched-word-missing-inline {
    font-size: 0.68rem;
    line-height: 1.16;
  }

  .panel-lexicon .enriched-word-content {
    max-height: 40px;
  }

  .panel-history {
    grid-column: 1 / -1;
    grid-row: 7;
    padding: 12px 16px;
  }

  .panel-history .panel-head {
    display: grid;
    gap: 2px;
  }

  .history,
  .panel-history:not(.is-expanded) .history {
    max-height: 128px;
  }

  .panel-history.is-expanded .history {
    max-height: min(46vh, 220px);
  }

  .panel-tools {
    grid-column: 1 / -1;
    grid-row: 8;
    gap: 10px;
    padding: 12px 16px;
  }

  .setup-modal {
    z-index: 12100;
    align-items: start;
    justify-items: center;
    padding: 8px;
    overflow: auto;
  }

  .setup-modal-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(820px, calc(100vw - 16px));
    height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px);
    padding: 9px 10px;
    overflow: hidden;
    border-radius: 12px;
    position: relative;
  }

  .setup-modal-header {
    gap: 2px;
    margin-bottom: 5px;
  }

  .setup-modal-header .endgame-eyebrow {
    font-size: 0.56rem;
  }

  .setup-modal-header h3 {
    font-size: 0.92rem;
    line-height: 1.05;
  }

  .setup-modal-header .subtle {
    font-size: 0.64rem;
    line-height: 1.12;
  }

  .setup-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 7px;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  .setup-section {
    gap: 5px;
    min-height: 0;
    max-height: 100%;
    padding: 7px;
    border-radius: 11px;
    overflow: auto;
    scrollbar-width: thin;
  }

  .setup-section--avatars,
  .setup-section--details {
    align-content: start;
  }

  .setup-section--details {
    scroll-padding-bottom: 48px;
  }

  .setup-section--avatars {
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
  }

  .setup-section--details {
    grid-column: 2;
    grid-row: 1;
  }

  .setup-section .panel-head h2 {
    font-size: 0.78rem;
  }

  .setup-section .panel-head .subtle {
    font-size: 0.6rem;
    line-height: 1.1;
  }

  .setup-field-grid,
  .setup-field-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .setup-field span {
    font-size: 0.56rem;
  }

  .setup-field input,
  .setup-field select {
    min-height: 29px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 0.72rem;
  }

  .setup-avatar-grid-wrap {
    height: min(48vh, 185px);
    max-height: min(48vh, 185px);
    overflow: auto;
  }

  .setup-avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .setup-avatar-option {
    gap: 4px;
    padding: 4px 5px;
    border-radius: 10px;
  }

  .setup-avatar-thumb {
    width: clamp(58px, 16vh, 66px);
    height: clamp(58px, 16vh, 66px);
    justify-self: center;
    border-radius: 9px;
  }

  .setup-avatar-name {
    font-size: 0.62rem;
  }

  .setup-summary {
    font-size: 0.62rem;
    line-height: 1.15;
  }

  .setup-modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    width: auto;
    margin-top: 5px;
    padding-top: 6px;
    padding-bottom: 1px;
    justify-content: flex-end;
    background:
      linear-gradient(180deg, rgba(14, 28, 22, 0), rgba(14, 28, 22, 0.96) 34%),
      rgba(14, 28, 22, 0.96);
  }

  .setup-modal-actions button {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 0.72rem;
  }

  .endgame-screen {
    z-index: 15000;
    align-items: start;
    padding: 10px 8px;
    overflow: auto;
  }

  .endgame-card {
    width: min(92vw, 760px);
    max-height: calc(100dvh - 20px);
    margin: 0 auto;
  }

  .endgame-hero--ceremony {
    min-height: 168px;
    padding: 14px 12px;
    gap: 8px;
  }

  .endgame-hero-palm {
    width: clamp(34px, 10vw, 52px);
    max-height: 112px;
  }

  .endgame-hero-kicker {
    letter-spacing: 0.24em;
    font-size: 0.76rem;
  }

  .endgame-hero--ceremony .endgame-hero-visual {
    width: 78px;
    height: 78px;
    border-radius: 22px;
  }

  .endgame-hero-avatar {
    border-radius: 18px;
  }

  .endgame-victory-title {
    gap: 8px;
    flex-wrap: wrap;
  }

  .endgame-victory-palm {
    width: clamp(28px, 8vw, 42px);
  }

  .endgame-winner-crown {
    width: clamp(24px, 7vw, 32px);
    margin-left: -2px;
  }
}

@media (max-width: 932px) and (orientation: landscape) {
  .endgame-hero--ceremony {
    min-height: 130px;
    padding-block: 10px;
  }

  .endgame-hero-palm {
    width: 34px;
    max-height: 86px;
  }

  .endgame-hero--ceremony .endgame-hero-visual {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }

  .endgame-hero-kicker {
    display: none;
  }

  .endgame-victory-palm {
    width: 28px;
  }

  .endgame-winner-crown {
    width: 24px;
  }
}


/* Garde-fou : le menu profil reste opaque et au-dessus des panneaux de jeu. */
.profile-menu[open],
.site-header:has(.profile-menu[open]),
.account-area:has(.profile-menu[open]) {
  position: relative;
  z-index: 12250 !important;
}

.profile-menu[open] .profile-dropdown {
  z-index: 12260 !important;
  background:
    linear-gradient(180deg, rgba(17, 48, 38, 0.99), rgba(7, 22, 17, 0.995)),
    #0e1c16 !important;
  opacity: 1 !important;
  isolation: isolate;
}

.profile-menu[open] .profile-dropdown > * {
  position: relative;
  z-index: 1;
}

.profile-menu[open] .profile-dropdown > .profile-dropdown__close {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  z-index: 6;
}

@media (max-width: 1180px) {
  .profile-dropdown {
    min-width: 0;
  }
}

@media (min-width: 721px) and (max-width: 1180px) {
  .local-profile-modal {
    align-items: stretch;
    padding: 18px 24px;
  }

  .local-profile-card {
    display: flex;
    width: min(92vw, 820px);
    max-height: calc(100dvh - 36px);
    flex-direction: column;
    overflow: hidden;
  }

  .local-profile-tabs {
    flex: 0 0 auto;
  }

  .local-profile-panels {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 0 6px 72px 0;
  }

  .local-profile-actions {
    flex: 0 0 auto;
  }

  .profile-reward-grid {
    gap: 9px;
  }

  .profile-challenges__grid {
    gap: 9px;
  }

  .profile-challenge-card {
    flex-basis: min(286px, 58vw);
  }
}

@media (max-width: 720px) {
  .local-profile-modal {
    align-items: stretch;
    padding: 10px;
  }

  .local-profile-card {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 18px 14px 16px;
    border-radius: 18px;
  }

  .local-profile-tabs {
    margin: 14px 36px 12px 0;
  }

  .local-profile-tabs button {
    min-height: 34px;
    padding-inline: 11px;
    font-size: 0.78rem;
  }

  .local-profile-panels {
    max-height: calc(100dvh - 170px);
  }

  .local-profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
    padding: 16px 14px;
  }

  .local-profile-close {
    top: 8px;
    right: 8px;
  }

  .local-profile-avatar {
    width: 104px;
    height: 104px;
    border-radius: 18px;
  }

  .profile-challenges__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .profile-challenges__grid {
    gap: 8px;
  }

  .profile-challenge-card {
    flex-basis: min(286px, 82vw);
    min-height: 110px;
  }

  body:has(.profile-menu[open]) .scores .notification-center,
  body:has(.local-profile-modal:not([hidden])) .notification-center {
    display: none;
  }

  .local-profile-status {
    display: grid;
    text-align: left;
  }

  .profile-trophy-current {
    width: min(100%, 240px);
    align-self: auto;
  }

  .profile-reward-grid {
    gap: 8px;
  }

  .profile-reward-current-showcase {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .endgame-penalty-rack {
    flex-wrap: wrap;
    gap: 4px;
  }

  .endgame-penalty-tile {
    width: 31px;
    height: 30px;
  }

  .profile-reward-progress-head {
    display: grid;
    gap: 5px;
    text-align: left;
  }

  .profile-reward-progress-metrics {
    grid-template-columns: 1fr;
  }

  .local-profile-status strong {
    text-align: left;
  }

  .local-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .local-profile-records,
  .local-profile-modes,
  .local-profile-saved-game__details,
  .local-profile-recent-summary-cards,
  .local-profile-online-list,
  .local-profile-stats-grid,
  .local-profile-difficulty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .local-profile-match-card__head,
  .local-profile-match-card__score {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 430px) {
  .local-profile-stats,
  .local-profile-records,
  .local-profile-modes,
  .local-profile-saved-game__details,
  .local-profile-recent-summary-cards,
  .local-profile-online-list,
  .local-profile-stats-grid,
  .local-profile-difficulty-grid {
    grid-template-columns: 1fr;
  }

  .local-profile-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .local-profile-modal {
    align-items: start;
    justify-items: center;
    padding: 6px 8px;
  }

  .local-profile-card {
    display: flex;
    width: min(94vw, 760px);
    max-height: calc(100dvh - 12px);
    flex-direction: column;
    padding: 12px 14px 10px;
  }

  .local-profile-tabs {
    min-height: 34px;
    margin: 0 44px 6px 0;
    padding: 2px 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .local-profile-tabs button {
    min-height: 30px;
    padding-inline: 9px;
    font-size: 0.7rem;
    line-height: 1;
  }

  .local-profile-panels {
    min-height: 0;
    max-height: none;
    overflow: auto;
  }

  .local-profile-hero {
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-items: stretch;
    text-align: left;
    gap: 12px;
    padding: 9px 12px;
  }

  .local-profile-avatar {
    width: 74px;
    height: 74px;
    border-radius: 16px;
  }

  .local-profile-heading h2 {
    font-size: 2rem;
  }

  .local-profile-level-line {
    margin-top: 4px;
  }

  .local-profile-status,
  .local-profile-section {
    margin-top: 10px;
    padding: 12px;
  }

  .profile-trophy-current {
    width: 116px;
    min-width: 116px;
    align-self: stretch;
    padding: 7px;
  }

  .profile-trophy-image {
    width: 52px;
    height: 52px;
  }

  .profile-trophy-current strong {
    font-size: 0.78rem;
  }

  .profile-trophy-current span {
    font-size: 0.58rem;
  }

  .profile-reward-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-reward-card .profile-trophy-image {
    width: 54px;
    height: 54px;
  }

  .profile-reward-current-showcase {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: stretch;
    text-align: left;
    gap: 10px;
    padding: 10px;
  }

  .profile-reward-current-showcase .profile-trophy-image,
  .profile-reward-empty-trophy {
    width: 58px;
    height: 58px;
  }

  .profile-reward-current-showcase strong {
    font-size: 1.05rem;
  }

  .profile-reward-current-showcase p,
  .profile-reward-next p,
  .profile-reward-card p {
    font-size: 0.78rem;
  }

  .profile-reward-grid {
    gap: 8px;
  }

  .profile-reward-card {
    flex-basis: min(286px, 82vw);
    gap: 8px;
    padding: 9px;
  }
}
/* Ajustement manuel - signature diplôme niveau 40 */
.diploma-certificate.is-level-40-certificate .diploma-certificate__direction {
  position: absolute !important;
  right: 6.2% !important;
  bottom: 7.8% !important;
  min-width: 190px;
  text-align: center;
  z-index: 9;
  transform: translateY(-70px) !important;
}

.diploma-certificate.is-level-40-certificate .diploma-certificate__direction strong {
  display: block;
  color: #173021;
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 400;
  line-height: 1;
}

.diploma-certificate.is-level-40-certificate .diploma-certificate__direction strong::after {
  content: "";
  display: block;
  width: 78%;
  height: 1px;
  margin: 0.16em auto 0.28em;
  background: #8e979e;
}

.diploma-certificate.is-level-40-certificate .diploma-certificate__direction span {
  display: block;
  color: #5f6b74;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(0.48rem, 0.9vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Nettoyage visuel - niveau 40 */
.diploma-certificate.is-level-40-certificate .diploma-certificate__direction strong::after {
  content: none !important;
  display: none !important;
}

.diploma-certificate.is-level-40-certificate .diploma-level40-divider,
.diploma-certificate.is-level-40-certificate .diploma-level40-divider::before,
.diploma-certificate.is-level-40-certificate .diploma-level40-divider::after {
  content: none !important;
  display: none !important;
}

/* Ajustement final signature + séparateurs mobile - diplôme niveau 40 */
.diploma-certificate.is-level-40-certificate .diploma-certificate__direction strong::after {
  content: "";
  display: block !important;
  width: 22% !important;
  max-width: 110px !important;
  height: 1px;
  margin: 0.1em auto 0.28em;
  background: #8e979e;
}

/* Mobile : ligne signature plus courte + suppression des séparateurs stats */
@media (max-width: 640px) {
  .diploma-certificate.is-level-40-certificate .diploma-certificate__direction strong::after {
    width: 18% !important;
    max-width: 48px !important;
  }

  .diploma-certificate.is-level-40-certificate .diploma-certificate__stats div::before,
  .diploma-certificate.is-level-40-certificate .diploma-certificate__stats div::after,
  .diploma-certificate.is-level-40-certificate .diploma-certificate__stats dd::before,
  .diploma-certificate.is-level-40-certificate .diploma-certificate__stats dd::after {
    content: none !important;
    display: none !important;
  }

  .diploma-certificate.is-level-40-certificate .diploma-certificate__stats {
    border: 0 !important;
  }
}
/* Mobile - devise niveau 40 moins haute pour éviter le chevauchement */
@media (max-width: 640px) {
  .diploma-certificate.is-level-40-certificate .diploma-certificate__motto {
    bottom: 40% !important;
    width: 82% !important;
    transform: translate(-50%, -12px) !important;
    font-size: clamp(0.36rem, 1.35vw, 0.52rem);
    line-height: 1.1;
    z-index: 7;
  }
}

/* Diplôme niveau 50 : copie du niveau 40 avec palette suprême. */
.diploma-certificate.is-level-50-certificate {
  background:
    radial-gradient(circle 420px at 12% 14%, rgba(202, 178, 106, 0.2) 0%, transparent 70%),
    radial-gradient(circle 380px at 88% 82%, rgba(64, 140, 96, 0.26) 0%, transparent 72%),
    linear-gradient(135deg, #1d3d2b 0%, #17311f 40%, #122718 70%, #0e2418 100%);
}

.diploma-certificate.is-level-50-certificate::before {
  border-color: #c8a74d;
  box-shadow:
    0 0 0 8px #1a3527,
    0 0 0 10px rgba(200, 167, 77, 0.68),
    0 24px 60px rgba(0, 0, 0, 0.55);
}

.diploma-certificate.is-level-50-certificate::after {
  border-color: rgba(185, 143, 45, 0.55);
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__level40-decor::before,
.diploma-certificate.is-level-50-certificate .diploma-certificate__level40-decor::after,
.diploma-certificate.is-level-40-certificate:not(.is-level-50-certificate) .diploma-level40-arc {
  display: none;
}

.diploma-certificate.is-level-50-certificate .diploma-level40-arc {
  position: absolute;
  top: 50%;
  display: block;
  width: clamp(70px, 9vw, 135px);
  transform: translateY(-50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.16));
  opacity: 0.96;
}

.diploma-certificate.is-level-50-certificate .diploma-level40-arc img {
  display: block;
  width: 100%;
  height: auto;
}

.diploma-certificate.is-level-50-certificate .diploma-level40-arc.is-left {
  top: 350px;
  left: -120px;
  right: auto;
}

.diploma-certificate.is-level-50-certificate .diploma-level40-arc.is-right {
  top: 230px;
  right: -120px;
  left: auto;
}

.diploma-certificate.is-level-50-certificate .diploma-level40-palm {
  display: none;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__brand span,
.diploma-certificate.is-level-50-certificate .diploma-certificate__content h2,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction strong {
  color: #2f250d;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__brand strong,
.diploma-certificate.is-level-50-certificate #diplomaPreviewText,
.diploma-certificate.is-level-50-certificate .diploma-certificate__stats dt,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction span,
.diploma-certificate.is-level-50-certificate .diploma-certificate__qr span {
  color: #7f6f4a;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__content h2::after {
  background: #b98f2d;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__direction strong::after {
  content: "";
  display: block;
  width: 38%;
  max-width: 86px;
  height: 1px;
  margin: 0.16em auto 0.28em;
  background: #b98f2d;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__direction {
  border: 0 !important;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__direction::before,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction::after {
  content: none !important;
  display: none !important;
}

/* Niveau 50 - sous-titre et ligne décorative séparés */
.diploma-certificate.is-level-50-certificate .diploma-certificate__brand {
  position: relative;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__brand span {
  position: relative;
  display: block;
  transform: translateY(-16px) !important;
  z-index: 2;
}

/* On désactive la ligne attachée directement au texte */
.diploma-certificate.is-level-50-certificate .diploma-certificate__brand span::after {
  content: none !important;
  display: none !important;
}

/* On recrée la ligne + losange indépendamment du texte */
.diploma-certificate.is-level-50-certificate .diploma-certificate__brand::after {
  content: "♦";
  position: absolute;
  left: 50%;
  top: calc(100% + 0.75em);
  transform: translateX(-50%);
  display: block;
  width: min(38vw, 460px);
  color: #b98f2d;
  font-size: clamp(0.72rem, 1.1vw, 1rem);
  line-height: 1;
  text-align: center;
  background:
    linear-gradient(
      to right,
      transparent 0%,
      transparent 8%,
      rgba(185, 143, 45, 0.18) 8%,
      rgba(185, 143, 45, 0.55) 47%,
      transparent 47%,
      transparent 53%,
      rgba(185, 143, 45, 0.55) 53%,
      rgba(185, 143, 45, 0.18) 92%,
      transparent 92%,
      transparent 100%
    );
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: center;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__rank {
  background: linear-gradient(160deg, #8a6519, #c8a74d 35%, #fff2b7 55%, #b98f2d 80%);
  background-clip: text;
  color: transparent;
  font-size: clamp(1rem, 2.55vw, 2.55rem);
  gap: 0.42em;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__rank::before {
  content: "NIVEAU 50";
  border-color: #c8a74d;
  background: linear-gradient(160deg, #102b1f, #1a3527 55%, #0b2118);
  color: #c8a74d;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__stats div {
  border-right-color: #c8a74d;
}

/* Niveau 50 - agrandir légèrement les textes des statistiques */
.diploma-certificate.is-level-50-certificate .diploma-certificate__stats dt {
  font-size: clamp(0.46rem, 0.9vw, 0.78rem) !important;
  letter-spacing: 0.13em !important;
  line-height: 1.05 !important;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__stats dd {
  font-size: clamp(0.68rem, 1.08vw, 0.96rem) !important;
  line-height: 1.05 !important;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__signature {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__qr {
  top: auto !important;
  bottom: 16.2% !important;
  left: 10.9% !important;
  transform: none !important;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__stats {
  position: absolute;
  bottom: 17.7%;
  left: 26%;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__direction {
  position: absolute !important;
  left: 72% !important;
  right: auto !important;
  bottom: 5.2% !important;
  width: 18% !important;
  text-align: center;
  z-index: 9;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__motto {
  position: absolute !important;
  top: 85% !important;
  bottom: auto !important;
  left: 31% !important;
  right: auto !important;
  width: 42% !important;
  text-align: center;
  z-index: 9;
  transform: none !important;
}

@media (max-width: 820px) {
  .diploma-certificate.is-level-50-certificate .diploma-certificate__rank {
    top: 54.5%;
    font-size: clamp(0.92rem, 2.15vw, 1.9rem);
  }

  .diploma-certificate.is-level-50-certificate .diploma-certificate__phrase {
    top: 66.5%;
  }

  .diploma-certificate.is-level-50-certificate .diploma-certificate__motto {
  left: 30% !important;
  right: auto !important;
  bottom: 4.4% !important;
  width: 44% !important;
  transform: translateY(6px) !important;
  text-align: center;
  z-index: 9;
}

/* Niveau 50 - arcs mobile vers l'extérieur avec vide près du cadre intérieur */
.diploma-certificate.is-level-50-certificate .diploma-level40-arc {
  width: clamp(52px, 15vw, 78px) !important;
  transform: translateY(-50%) !important;
  z-index: 2;
  pointer-events: none;
}

.diploma-certificate.is-level-50-certificate .diploma-level40-arc.is-left {
  top: 54% !important;
  left: clamp(-88px, -18vw, -54px) !important;
  right: auto !important;
}

.diploma-certificate.is-level-50-certificate .diploma-level40-arc.is-right {
  top: 36% !important;
  right: clamp(-88px, -18vw, -54px) !important;
  left: auto !important;
}

}

/* Niveau 50 - signature : garder une seule ligne courte */
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction strong,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction span {
  border: 0 !important;
  box-shadow: none !important;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__direction::before,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction::after,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction span::before,
.diploma-certificate.is-level-50-certificate .diploma-certificate__direction span::after {
  content: none !important;
  display: none !important;
}

.diploma-certificate.is-level-50-certificate .diploma-certificate__direction strong::after {
  content: "" !important;
  display: block !important;
  width: 110px !important;
  max-width: 110px !important;
  min-width: 110px !important;
  height: 1px !important;
  margin: 0.12em auto 0.28em !important;
  background: #b98f2d !important;
}
