:root {
  color-scheme: dark;
  --bg: #111411;
  --panel: #1e261f;
  --panel-strong: #273326;
  --table: #1f6b43;
  --table-dark: #155032;
  --felt-line: rgba(255, 255, 255, 0.16);
  --text: #f4f1e8;
  --muted: #c9c2b4;
  --gold: #d9aa45;
  --red: #c74444;
  --black: #222222;
  --card: #faf7ed;
  --shadow: rgba(0, 0, 0, 0.32);
}

/* Social actions are compact controls, never the oversized primary game CTA. */
body:not(.game-active) #onlineContent .social-shell .start-game-button.compact {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: end !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 36px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-style: normal !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

body:not(.game-active) #onlineContent .social-shell .start-game-button.compact::before,
body:not(.game-active) #onlineContent .social-shell .start-game-button.compact::after {
  display: none !important;
  content: none !important;
}

body:not(.game-active) #onlineContent .social-shell .start-game-button.compact:disabled {
  opacity: .72 !important;
  cursor: default !important;
}

@media (max-width: 700px) {
  body:not(.game-active) #onlineContent .social-search-result .start-game-button.compact {
    justify-self: start !important;
  }
}

/* Avatar preview: vergroot profielbeelden bij muis/keyboard zonder layoutverschuiving. */
@media (hover: hover) and (pointer: fine) {
  .home-v2-avatar-button,
  .home-v2-header-avatar,
  body:not(.game-active) .avatar-preview,
  body.game-active .player .avatar {
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
    transform-origin: center;
  }

  .home-v2-avatar-button:hover,
  .home-v2-avatar-button:focus-visible,
  body:not(.game-active) .avatar-preview:hover,
  body.game-active .player .avatar:hover {
    z-index: 120 !important;
    transform: scale(1.55) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .42), 0 0 0 3px rgba(222, 176, 73, .9) !important;
    filter: brightness(1.06) saturate(1.05);
  }
}

/* Op touchscreens blijft de avatar vergroot zolang deze wordt aangeraakt of focus heeft. */
@media (hover: none), (pointer: coarse) {
  .home-v2-avatar-button:active,
  .home-v2-avatar-button:focus-visible,
  body:not(.game-active) .avatar-preview:active {
    z-index: 150 !important;
    transform: scale(1.65) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.48), 0 0 0 3px rgba(222,176,73,.95) !important;
    filter: brightness(1.08) saturate(1.06);
  }
}

body.game-active .player .avatar.avatar-mobile-preview {
  position: relative;
  z-index: 180 !important;
  transform: scale(1.85) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.52), 0 0 0 4px rgba(222,176,73,.98) !important;
  filter: brightness(1.09) saturate(1.08);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

/* Touch preview is viewport-based so seat translations cannot move the zoom away. */
body.game-active .mobile-avatar-zoom-overlay {
  position: fixed !important;
  z-index: 10000 !important;
  margin: 0 !important;
  translate: none !important;
  transform-origin: 50% 50% !important;
  pointer-events: none !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.52), 0 0 0 4px rgba(222,176,73,.98) !important;
  filter: brightness(1.09) saturate(1.08);
  animation: mobileAvatarCenteredZoom 160ms ease-out both;
}

@keyframes mobileAvatarCenteredZoom {
  from {
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    transform: translate(-50%, -50%) scale(1.85);
  }
}

/* Daguitdaging — ivoor, goud en speeltafelgroen volgens het aangeleverde ontwerp. */
.online-dialog:has(.daily-reference-hero) {
  width: min(94vw, 1180px) !important;
  max-height: min(95dvh, 920px) !important;
  padding: 18px 28px 24px !important;
  border: 3px solid #c48a2d !important;
  border-radius: 28px !important;
  color: #2d2016 !important;
  background:
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.95), transparent 30%),
    linear-gradient(135deg, #fffdf4, #f3e6cc 72%, #e9d2a9) !important;
  box-shadow: inset 0 0 0 3px rgba(255, 248, 221, 0.9), 0 28px 90px rgba(0, 0, 0, 0.72) !important;
}

.online-dialog:has(.daily-reference-hero) > .last-trick-header {
  margin: -4px 0 14px !important;
  padding: 0 4px 12px !important;
  border-bottom: 1px solid rgba(140, 92, 28, 0.34) !important;
}

.online-dialog:has(.daily-reference-hero) > .last-trick-header span {
  color: #4b2e18 !important;
  font-family: Georgia, serif;
  font-size: 17px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.online-dialog:has(.daily-reference-hero) #onlineTitle {
  color: #0b512d !important;
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 48px) !important;
  line-height: 0.95 !important;
}

.online-dialog:has(.daily-reference-hero) #closeOnlineButton {
  display: grid !important;
  place-items: center !important;
  width: 48px !important;
  height: 48px !important;
  overflow: hidden;
  border: 2px solid #d9a84b !important;
  border-radius: 50% !important;
  color: transparent !important;
  font-size: 0 !important;
  background: linear-gradient(180deg, #275a3d, #0a2d1d) !important;
  box-shadow: inset 0 0 0 2px #1c3e2b, 0 2px 6px rgba(0, 0, 0, 0.35) !important;
}

.online-dialog:has(.daily-reference-hero) #closeOnlineButton::after {
  content: "×";
  display: block;
  color: #f7d574;
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 900;
  line-height: 36px;
}

.daily-reference-hero {
  position: relative;
  display: grid !important;
  grid-template-columns: 124px minmax(0, 1fr) !important;
  align-items: center !important;
  min-height: 160px;
  padding: 20px 30px !important;
  overflow: hidden;
  border: 3px solid #c99435 !important;
  border-radius: 25px !important;
  color: #fff9e7 !important;
  background:
    radial-gradient(circle at 88% 50%, rgba(69, 137, 80, 0.24), transparent 28%),
    linear-gradient(135deg, #0b4829, #0d5b30 55%, #06331f) !important;
  box-shadow: inset 0 0 0 3px rgba(6, 48, 27, 0.75), 0 5px 12px rgba(58, 35, 8, 0.28) !important;
}

.daily-reference-hero::after {
  content: "♣";
  position: absolute;
  right: 30px;
  top: 50%;
  color: rgba(111, 175, 116, 0.18);
  font-size: 132px;
  transform: translateY(-52%);
}

.daily-date-card {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100px;
  min-height: 116px;
  border: 2px solid #d1a252;
  border-radius: 13px;
  color: #2f2015;
  background: linear-gradient(#fffdf5, #efe0c8);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.28);
}

.daily-date-card span {
  width: 100%;
  padding: 5px 2px;
  border-radius: 10px 10px 0 0;
  color: #fff7df !important;
  background: linear-gradient(#714626, #4b2816);
  font-family: Georgia, serif;
  font-size: 13px !important;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.daily-date-card strong { font: 900 46px/1 Georgia, serif; }
.daily-date-card small { padding-bottom: 7px; font: 800 12px/1 Georgia, serif; }

.daily-reference-hero .daily-hero-copy { position: relative; z-index: 1; }
.daily-reference-hero .daily-hero-copy > span { color: #f0cd73 !important; font: 700 20px/1.1 Georgia, serif; }
.daily-reference-hero .daily-hero-copy h2 { margin: 4px 0 10px !important; color: #fffdf1 !important; font: 900 clamp(30px, 4vw, 47px)/1 Georgia, serif !important; text-transform: uppercase; }
.daily-reference-hero .daily-hero-copy p { max-width: 820px; margin: 0 !important; color: #fff !important; font-size: 16px !important; font-weight: 650; line-height: 1.45 !important; }

.daily-reference-grid { gap: 22px !important; margin: 22px 4px 16px !important; }

#onlineContent .daily-reference-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 42px 28px 18px !important;
  border: 2px solid #c79a4d !important;
  border-radius: 22px !important;
  color: #39281b !important;
  background: linear-gradient(145deg, #fffdf6, #f1e2c9) !important;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.72), 0 4px 10px rgba(79, 49, 15, 0.2) !important;
  text-align: center;
}

.daily-variant-ribbon {
  position: absolute;
  top: -15px;
  left: 50%;
  width: min(78%, 320px);
  padding: 7px 18px;
  border: 2px solid #d4a447;
  border-radius: 8px 8px 16px 16px;
  color: #f6d77b !important;
  background: linear-gradient(#1d7240, #07512b);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  font: 900 23px/1 Georgia, serif;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.daily-rotterdam .daily-variant-ribbon { background: linear-gradient(#a62118, #720a07); }
.daily-reference-card h2 { margin: 3px 0 0 !important; color: #3c291c !important; font: 900 clamp(24px, 2.5vw, 34px)/1.1 Georgia, serif !important; }
.daily-reference-card p { margin: 0 !important; color: #33281f !important; font-size: 15px !important; }
.daily-card-divider { width: 88%; height: 1px; margin: 5px 0; background: linear-gradient(90deg, transparent, #ae8a51, transparent); }
.daily-attempt-status { color: #0a592f !important; font: 800 16px/1.2 Georgia, serif; }
.daily-rotterdam .daily-attempt-status { color: #8e1811 !important; }

#onlineContent .daily-reference-start {
  display: grid !important;
  grid-template-columns: 44px 1fr 30px;
  align-items: center;
  width: 100% !important;
  min-height: 66px !important;
  margin-top: 6px !important;
  border: 2px solid #d6a640 !important;
  border-radius: 18px !important;
  color: #fffde9 !important;
  background: linear-gradient(#16723a, #064c27) !important;
  box-shadow: inset 0 0 0 2px rgba(7, 57, 29, 0.85), 0 4px 8px rgba(0, 0, 0, 0.28) !important;
}

#onlineContent .daily-rotterdam .daily-reference-start { background: linear-gradient(#be2418, #800b08) !important; }
.daily-reference-start b { font: 900 clamp(18px, 2vw, 27px)/1 Georgia, serif; text-transform: uppercase; }
.daily-reference-start span { color: #f6d67c; font-size: 20px; }

#onlineContent .daily-reference-info,
.daily-reference-score {
  position: relative;
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 20px !important;
  overflow: hidden;
  border: 1px solid #c7a46c !important;
  border-radius: 15px !important;
  color: #302219 !important;
  background: rgba(255, 250, 235, 0.42) !important;
}

.daily-info-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid #d6a64e;
  border-radius: 50%;
  color: #f3d071;
  background: #0b4b2c;
  font: 900 24px/1 Georgia, serif;
}

.daily-reference-info strong,
.daily-reference-score .daily-board-title { margin: 0 !important; color: #0b4c2d !important; font: 900 18px/1.1 Georgia, serif !important; text-transform: uppercase; }
.daily-reference-info p { margin: 3px 0 0 !important; color: #34271d !important; }
.daily-info-watermark { color: rgba(151, 109, 50, 0.17); font-size: 52px; }
.daily-reference-score { grid-template-columns: 54px minmax(0, 1fr); }

.online-dialog:has(.daily-reference-hero) .leaderboard-table {
  margin-top: 8px;
  border: 1px solid #c7a46c !important;
  border-radius: 14px;
  color: #31251c !important;
  background: rgba(255, 252, 242, 0.82) !important;
}

@media (max-width: 720px) {
  .online-dialog:has(.daily-reference-hero) { padding: 12px !important; border-radius: 18px !important; }
  .daily-reference-hero { grid-template-columns: 74px minmax(0, 1fr) !important; min-height: 128px; padding: 14px !important; }
  .daily-date-card { width: 62px; min-height: 86px; }
  .daily-date-card strong { font-size: 32px; }
  .daily-date-card span { font-size: 9px !important; }
  .daily-date-card small { font-size: 9px; }
  .daily-reference-hero .daily-hero-copy > span { font-size: 14px !important; }
  .daily-reference-hero .daily-hero-copy h2 { font-size: 25px !important; }
  .daily-reference-hero .daily-hero-copy p { font-size: 12px !important; }
  .daily-reference-grid { grid-template-columns: 1fr !important; gap: 26px !important; }
  #onlineContent .daily-reference-card { padding: 36px 14px 14px !important; }
  .daily-variant-ribbon { font-size: 18px; }
  .daily-reference-info, .daily-reference-score { grid-template-columns: 44px minmax(0, 1fr) !important; padding: 10px !important; }
  .daily-info-watermark { display: none; }
}

/* Exacte referentiedetails, met behoud van compact formaat en Arial. */
.online-dialog:has(.daily-reference-hero) > .last-trick-header {
  position: relative;
  min-height: 58px;
  padding-left: 92px !important;
}

.online-dialog:has(.daily-reference-hero) > .last-trick-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 78px;
  height: 70px;
  background: url("./assets/de-klaverjassen-tafel-emblem.png") center / contain no-repeat;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}

.daily-reference-grid {
  position: relative;
}

.daily-reference-grid::after {
  content: "♣\A♢";
  white-space: pre;
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid #d3a24b;
  border-radius: 50%;
  color: #edc762;
  background: radial-gradient(circle, #164f31 0 52%, #092d1c 54% 100%);
  box-shadow: 0 0 0 3px #f6e5bd, 0 4px 8px rgba(0, 0, 0, 0.35);
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 14px;
  font-weight: 900;
  line-height: 0.9;
  transform: translate(-50%, -50%);
}

#onlineContent .daily-reference-start {
  grid-template-columns: 58px minmax(0, 1fr) 30px !important;
  overflow: hidden;
}

.daily-button-cards {
  position: relative;
  display: block !important;
  width: 54px;
  height: 45px;
}

.daily-button-cards i {
  position: absolute;
  left: 6px;
  bottom: -8px;
  display: grid;
  place-items: start center;
  width: 34px;
  height: 50px;
  padding-top: 6px;
  border: 1px solid #c8b997;
  border-radius: 4px;
  color: #b51e1e;
  background: #fffdf5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  transform: rotate(-7deg);
}

.daily-button-cards i + i {
  left: 24px;
  color: #111;
  transform: rotate(8deg);
}

.daily-button-flourish {
  color: #e8c45d !important;
  font-size: 24px !important;
}

.daily-reference-score {
  grid-template-columns: 40px minmax(0, 1fr) auto !important;
}

.daily-reference-score p {
  margin: 2px 0 0;
  color: #302219;
  font-size: 12px;
}

.daily-score-open {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #c38c2f;
  border-radius: 8px;
  color: #164d30;
  background: linear-gradient(#fffdf4, #eedcbc);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.68);
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.daily-score-results[hidden] { display: none; }
.daily-score-results { margin-top: 8px; }
.daily-reference-score p { display: flex; flex-wrap: wrap; gap: 3px 16px; }
.daily-winner { font-weight: 800; }
.daily-winner-amsterdam { color: #0b5a34; }
.daily-winner-rotterdam { color: #8b1712; }
.daily-variant-score-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.daily-variant-score-results[hidden] { display: none; }
.daily-variant-score-results section { min-width: 0; border: 1px solid rgba(154, 107, 28, .38); border-radius: 10px; padding: 8px; background: rgba(255, 250, 239, .8); }
.daily-variant-score-results h3 { margin: 0 0 6px; font: 800 14px/1.2 Arial, sans-serif; color: #0b4c2d; }
.daily-variant-score-results section:last-child h3 { color: #8b1712; }
@media (max-width: 680px) { .daily-variant-score-results { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  .online-dialog:has(.daily-reference-hero) > .last-trick-header { min-height: 48px; padding-left: 62px !important; }
  .online-dialog:has(.daily-reference-hero) > .last-trick-header::before { width: 54px; height: 50px; }
  .daily-reference-grid::after { display: none; }
  .daily-reference-score { grid-template-columns: 34px minmax(0, 1fr) !important; }
  .daily-score-open { grid-column: 1 / -1; width: 100%; }
}

/* Competition actions: icon, then one explicit label, then Premium. */
body:not(.game-active) .competition-entry .online-entry-actions .premium-action {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(30px, 1fr) auto auto !important;
  align-items: center !important;
  justify-items: center !important;
  align-content: center !important;
  gap: clamp(3px, 0.55dvh, 7px) !important;
  min-width: 0 !important;
  text-align: center !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action-icon {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: block !important;
  align-self: end !important;
  justify-self: center !important;
  margin: 0 !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action-text {
  grid-column: 1 !important;
  grid-row: 2 !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  color: #fff0c4 !important;
  -webkit-text-fill-color: #fff0c4 !important;
  font-size: clamp(11px, 1.05vw, 16px) !important;
  font-weight: 560 !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action-text::before,
body:not(.game-active) .competition-entry .online-entry-actions .premium-action-text::after {
  display: none !important;
  content: none !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action small {
  grid-column: 1 !important;
  grid-row: 3 !important;
  justify-self: center !important;
  margin: 0 !important;
}

/* Portrait design v1: premium vertical menu following the supplied reference. */
@media (orientation: portrait) {
  body:not(.game-active) .start-menu {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.38) 58%, rgba(0, 0, 0, 0.72)),
      url("./assets/vertical-menu/background-staand.png") center / cover no-repeat !important;
    color: #fff2d3 !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(100vw, 620px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 auto !important;
    padding: max(8px, env(safe-area-inset-top)) clamp(10px, 2.8vw, 18px) max(8px, env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(260px, 41dvh) minmax(0, 1fr) !important;
    gap: clamp(6px, 1dvh, 10px) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: none !important;
  }

  body:not(.game-active) .start-menu-stage::before,
  body:not(.game-active) .start-menu-stage::after,
  body:not(.game-active) .start-menu-panel::before,
  body:not(.game-active) .start-menu-panel::after,
  body:not(.game-active) .start-heading,
  body:not(.game-active) .menu-error {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) .brand-showcase {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase img,
  body:not(.game-active) .brand-showcase p {
    display: none !important;
  }

  body:not(.game-active) .brand-showcase::before {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    bottom: clamp(-10px, -1.3dvh, 0px) !important;
    width: min(112vw, 690px) !important;
    height: min(43dvh, 430px) !important;
    max-height: 100% !important;
    transform: translateX(-50%) !important;
    background: url("./assets/vertical-menu/table-menu.png") center bottom / contain no-repeat !important;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.86)) !important;
  }

  body:not(.game-active) .start-menu-panel {
    position: relative !important;
    z-index: 3 !important;
    width: min(100%, 540px) !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows:
      minmax(82px, 1.05fr)
      minmax(78px, 0.92fr)
      minmax(76px, 0.9fr)
      minmax(112px, 1.34fr)
      minmax(58px, 0.72fr) !important;
    gap: clamp(8px, 1.18dvh, 13px) !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .home-player-section {
    display: none !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: clamp(10px, 1.35dvh, 14px) clamp(10px, 2.8vw, 16px) !important;
    border: 1px solid rgba(211, 145, 55, 0.84) !important;
    border-radius: clamp(10px, 2.4vw, 16px) !important;
    background:
      linear-gradient(180deg, rgba(33, 20, 11, 0.82), rgba(9, 7, 5, 0.86)),
      radial-gradient(circle at 50% 0%, rgba(238, 179, 84, 0.11), transparent 56%) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 225, 150, 0.16),
      0 8px 16px rgba(0, 0, 0, 0.36) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .variant-group {
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 2.1vw, 12px) !important;
  }

  body:not(.game-active) .level-group {
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 2.1vw, 12px) !important;
  }

  body:not(.game-active) .home-options-section {
    grid-row: 3 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(7px, 1dvh, 10px) !important;
  }

  body:not(.game-active) .competition-entry {
    grid-row: 4 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.02fr) minmax(82px, 0.68fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 2vw, 12px) !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    grid-row: 5 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 clamp(14px, 4vw, 24px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: clamp(10px, 3vw, 16px) !important;
    border: 1px solid rgba(255, 204, 84, 0.9) !important;
    border-radius: clamp(10px, 2.6vw, 16px) !important;
    background:
      linear-gradient(180deg, rgba(28, 112, 30, 0.98), rgba(10, 69, 22, 0.99)),
      radial-gradient(circle at 50% 0%, rgba(255, 242, 154, 0.22), transparent 64%) !important;
    color: #efd194 !important;
    -webkit-text-fill-color: #efd194 !important;
    font-size: clamp(28px, 7.4vw, 45px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.74) !important;
    box-shadow:
      inset 0 2px 0 rgba(255, 238, 157, 0.3),
      inset 0 -4px 0 rgba(0, 41, 11, 0.58),
      0 8px 18px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend,
  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before {
    grid-column: 1 / -1 !important;
    position: absolute !important;
    left: clamp(18px, 5vw, 32px) !important;
    top: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 clamp(8px, 2vw, 12px) !important;
    transform: translateY(-52%) !important;
    clip: auto !important;
    overflow: visible !important;
    background: linear-gradient(90deg, rgba(16, 11, 6, 0.94), rgba(33, 22, 10, 0.94)) !important;
    color: #e3a93c !important;
    font-size: clamp(12px, 3vw, 18px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    text-align: left !important;
    border-radius: 999px !important;
  }

  body:not(.game-active) .variant-group legend {
    font-size: 0 !important;
  }

  body:not(.game-active) .variant-group legend::after {
    content: "Speelvariant" !important;
    font-size: clamp(12px, 3vw, 18px) !important;
  }

  body:not(.game-active) .level-group legend {
    font-size: 0 !important;
  }

  body:not(.game-active) .level-group legend::after {
    content: "AI-niveau" !important;
    font-size: clamp(12px, 3vw, 18px) !important;
  }

  body:not(.game-active) .home-options-section h2 {
    font-size: 0 !important;
  }

  body:not(.game-active) .home-options-section h2::after {
    content: "Opties" !important;
    font-size: clamp(12px, 3vw, 18px) !important;
  }

  body:not(.game-active) .competition-entry::before {
    content: "Competitie" !important;
    display: block !important;
  }

  body:not(.game-active) .variant-group .menu-choice,
  body:not(.game-active) .level-group .menu-choice,
  body:not(.game-active) .home-action-card,
  body:not(.game-active) .premium-action,
  body:not(.game-active) .home-highscore,
  body:not(.game-active) .competition-copy {
    position: relative !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    border: 1px solid rgba(208, 137, 48, 0.72) !important;
    border-radius: clamp(8px, 2vw, 13px) !important;
    background:
      linear-gradient(180deg, rgba(45, 28, 13, 0.94), rgba(12, 10, 7, 0.94)),
      radial-gradient(circle at 50% 0%, rgba(241, 198, 103, 0.12), transparent 60%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 226, 156, 0.15), 0 4px 9px rgba(0, 0, 0, 0.34) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .variant-group .menu-choice {
    padding: clamp(8px, 1.2dvh, 12px) clamp(10px, 2.3vw, 15px) !important;
    display: grid !important;
    grid-template-columns: clamp(34px, 8.2vw, 52px) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: clamp(8px, 2vw, 12px) !important;
  }

  body:not(.game-active) .variant-group .menu-choice::before {
    content: "" !important;
    width: clamp(31px, 7.2vw, 46px) !important;
    height: clamp(31px, 7.2vw, 46px) !important;
    justify-self: center !important;
    background: url("./assets/vertical-menu/icon-tafels.png") center / contain no-repeat !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.56)) !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(2)::before {
    background-image: url("./assets/vertical-menu/icon-statistieken.png") !important;
  }

  body:not(.game-active) .variant-group .menu-choice input:checked + span,
  body:not(.game-active) .level-group .menu-choice input:checked + span {
    box-shadow: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice:has(input:checked),
  body:not(.game-active) .level-group .menu-choice:has(input:checked) {
    border-color: rgba(255, 211, 93, 0.96) !important;
    background:
      linear-gradient(180deg, rgba(28, 99, 39, 0.96), rgba(13, 55, 24, 0.96)),
      radial-gradient(circle at 50% 0%, rgba(255, 233, 138, 0.24), transparent 62%) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 236, 170, 0.2),
      0 0 0 1px rgba(255, 207, 77, 0.36),
      0 0 18px rgba(255, 202, 69, 0.2) !important;
  }

  body:not(.game-active) .variant-group .menu-choice span,
  body:not(.game-active) .level-group .menu-choice span {
    min-width: 0 !important;
    padding: 0 !important;
    display: block !important;
    background: none !important;
    text-align: left !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong,
  body:not(.game-active) .level-group .menu-choice strong,
  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .competition-copy strong,
  body:not(.game-active) .home-highscore strong,
  body:not(.game-active) .premium-action-text {
    color: #fff0c8 !important;
    font-weight: 520 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.74) !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    display: block !important;
    font-size: clamp(12px, 3.1vw, 19px) !important;
    line-height: 1.08 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: block !important;
    margin-top: 3px !important;
    color: rgba(255, 229, 178, 0.88) !important;
    font-size: clamp(8px, 2.25vw, 13px) !important;
    font-weight: 390 !important;
    line-height: 1.14 !important;
    max-height: 2.35em !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    padding: clamp(7px, 1dvh, 10px) clamp(6px, 1.6vw, 10px) !important;
    display: grid !important;
    grid-template-columns: clamp(24px, 6vw, 38px) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: clamp(5px, 1.2vw, 8px) !important;
  }

  body:not(.game-active) .level-group .menu-choice::before {
    content: "" !important;
    width: clamp(24px, 6vw, 38px) !important;
    height: clamp(24px, 6vw, 38px) !important;
    justify-self: center !important;
    background: url("./assets/vertical-menu/icon-tafels.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(2)::before {
    background-image: url("./assets/vertical-menu/icon-eenvoudig.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(3)::before {
    background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    display: block !important;
    font-size: clamp(11px, 2.85vw, 17px) !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .level-group .menu-choice small {
    display: block !important;
    margin-top: 2px !important;
    max-height: 2.15em !important;
    color: rgba(255, 231, 188, 0.84) !important;
    font-size: clamp(7px, 1.95vw, 11px) !important;
    font-weight: 380 !important;
    line-height: 1.08 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-grid {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(8px, 2vw, 12px) !important;
  }

  body:not(.game-active) .home-action-card {
    padding: clamp(7px, 1dvh, 10px) clamp(6px, 1.8vw, 10px) !important;
    display: grid !important;
    grid-template-columns: clamp(28px, 6.5vw, 40px) minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: clamp(5px, 1.4vw, 8px) !important;
    text-align: left !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon {
    width: clamp(28px, 6.5vw, 40px) !important;
    height: clamp(28px, 6.5vw, 40px) !important;
    margin: 0 !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon svg {
    display: none !important;
  }

  body:not(.game-active) .home-action-card[data-info="rules"] .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-tafels.png") !important;
  }

  body:not(.game-active) #startDemoHomeButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-speel-nu.png") !important;
  }

  body:not(.game-active) #openSettingsButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-instellingen.png") !important;
  }

  body:not(.game-active) .home-action-card span:last-child {
    min-width: 0 !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    font-size: clamp(11px, 2.85vw, 17px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-action-card small {
    display: block !important;
    margin-top: 2px !important;
    color: rgba(255, 230, 188, 0.86) !important;
    font-size: clamp(7px, 1.9vw, 11px) !important;
    font-weight: 380 !important;
    line-height: 1.12 !important;
    max-height: 2.25em !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-copy {
    grid-column: 1 !important;
    grid-row: 2 !important;
    height: 100% !important;
    padding: clamp(9px, 1.3dvh, 13px) clamp(8px, 2vw, 12px) !important;
    display: grid !important;
    grid-template-columns: clamp(30px, 7.2vw, 46px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    column-gap: clamp(7px, 1.8vw, 11px) !important;
    align-content: center !important;
  }

  body:not(.game-active) .competition-copy::before {
    content: "" !important;
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    width: clamp(30px, 7.2vw, 46px) !important;
    height: clamp(30px, 7.2vw, 46px) !important;
    align-self: start !important;
    background: url("./assets/vertical-menu/icon-ranglijst.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .competition-copy .online-kicker {
    display: none !important;
  }

  body:not(.game-active) .competition-copy strong {
    grid-column: 2 !important;
    font-size: clamp(12px, 3.05vw, 18px) !important;
    line-height: 1.1 !important;
  }

  body:not(.game-active) .competition-copy p {
    grid-column: 2 !important;
    margin: 3px 0 0 !important;
    color: rgba(255, 230, 187, 0.88) !important;
    font-size: clamp(8px, 2.15vw, 12px) !important;
    font-weight: 380 !important;
    line-height: 1.18 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-highscore {
    grid-column: 2 !important;
    grid-row: 2 !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: clamp(9px, 1.3dvh, 13px) clamp(8px, 2vw, 12px) !important;
    display: grid !important;
    grid-template-columns: clamp(30px, 7.2vw, 46px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    column-gap: clamp(7px, 1.8vw, 11px) !important;
    align-content: center !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    width: clamp(30px, 7.2vw, 46px) !important;
    height: clamp(30px, 7.2vw, 46px) !important;
    background: url("./assets/vertical-menu/icon-daguitdaging.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .home-highscore .home-trophy svg,
  body:not(.game-active) .home-highscore::before {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    grid-column: 2 !important;
    color: #e8ae42 !important;
    font-size: clamp(8px, 2.05vw, 12px) !important;
    font-weight: 520 !important;
    line-height: 1.1 !important;
    letter-spacing: 0.035em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore strong {
    grid-column: 2 !important;
    font-size: clamp(13px, 3.45vw, 21px) !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    grid-column: 2 !important;
    color: #e8ae42 !important;
    font-size: clamp(8px, 2.05vw, 12px) !important;
    font-weight: 500 !important;
    line-height: 1.12 !important;
    text-transform: uppercase !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions {
    grid-column: 3 !important;
    grid-row: 2 !important;
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(5px, 0.75dvh, 8px) !important;
  }

  body:not(.game-active) .premium-action {
    height: 100% !important;
    padding: 0 clamp(5px, 1.5vw, 9px) !important;
    display: grid !important;
    grid-template-columns: clamp(23px, 5.8vw, 34px) minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: clamp(4px, 1.1vw, 7px) !important;
  }

  body:not(.game-active) .premium-action svg {
    display: none !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: clamp(23px, 5.8vw, 34px) !important;
    height: clamp(23px, 5.8vw, 34px) !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-online.png") !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-daguitdaging.png") !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
  }

  body:not(.game-active) .premium-action-text {
    display: block !important;
    width: 100% !important;
    font-size: clamp(10px, 2.55vw, 15px) !important;
    line-height: 1.06 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .premium-action small {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::before {
    content: "" !important;
    flex: 0 0 auto !important;
    width: clamp(28px, 7vw, 44px) !important;
    height: clamp(28px, 7vw, 44px) !important;
    margin: 0 !important;
    background: url("./assets/vertical-menu/icon-speel-nu.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::after {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) button,
  body:not(.game-active) label {
    touch-action: manipulation !important;
  }
}

@media (orientation: portrait) and (max-height: 820px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(214px, 37dvh) minmax(0, 1fr) !important;
    padding-top: max(6px, env(safe-area-inset-top)) !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom)) !important;
  }

  body:not(.game-active) .brand-showcase::before {
    height: min(38dvh, 348px) !important;
    width: min(110vw, 620px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(68px, 1fr)
      minmax(62px, 0.86fr)
      minmax(58px, 0.78fr)
      minmax(96px, 1.24fr)
      minmax(48px, 0.62fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: 9px 10px !important;
  }

  body:not(.game-active) .variant-group .menu-choice small,
  body:not(.game-active) .level-group .menu-choice small,
  body:not(.game-active) .home-action-card small,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    font-size: clamp(22px, 6.2vw, 34px) !important;
  }
}

@media (orientation: portrait) and (max-width: 390px), (orientation: portrait) and (max-height: 720px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(188px, 34dvh) minmax(0, 1fr) !important;
    padding-inline: 8px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(60px, 1fr)
      minmax(54px, 0.86fr)
      minmax(52px, 0.82fr)
      minmax(84px, 1.18fr)
      minmax(44px, 0.58fr) !important;
    gap: 5px !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: 8px !important;
  }

  body:not(.game-active) .level-group .menu-choice,
  body:not(.game-active) .home-action-card,
  body:not(.game-active) .premium-action {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    text-align: center !important;
  }

  body:not(.game-active) .level-group .menu-choice::before,
  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .premium-action-icon {
    display: none !important;
  }
}

/* Final desktop browser table fit: square, viewport-bound and centered. */
@media (min-width: 981px) and (min-height: 560px) {
  body.game-active .app-shell {
    width: 100% !important;
    max-width: 100vw !important;
    margin-inline: auto !important;
  }

  body.game-active .table {
    box-sizing: border-box !important;
    width: min(100%, calc(100dvh - 250px)) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 250px) !important;
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    place-self: center !important;
  }
}

/* Desktop browser game: keep the felt square, viewport-bound and centered. */
@media (min-width: 981px) and (min-height: 560px) {
  body.game-active .app-shell {
    width: 100% !important;
    max-width: 100vw !important;
    margin-inline: auto !important;
  }

  body.game-active .table {
    box-sizing: border-box !important;
    width: min(100%, calc(100dvh - 250px)) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 250px) !important;
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    place-self: center !important;
  }
}

/* Houd het daguitdagingthema boven latere generieke online-modalregels. */
#onlineContent .daily-reference-hero.daily-hero {
  border-color: #c99435 !important;
  color: #fff9e7 !important;
  background: radial-gradient(circle at 88% 50%, rgba(69, 137, 80, 0.24), transparent 28%), linear-gradient(135deg, #0b4829, #0d5b30 55%, #06331f) !important;
}

#onlineContent .daily-reference-grid .daily-reference-card {
  border-color: #c79a4d !important;
  color: #39281b !important;
  background: linear-gradient(145deg, #fffdf6, #f1e2c9) !important;
}

#onlineContent .daily-reference-info.online-card {
  border-color: #c7a46c !important;
  color: #302219 !important;
  background: rgba(255, 250, 235, 0.72) !important;
}

/* Compacte verhouding binnen het hoofdmenu; voor deze popup altijd Arial. */
.online-dialog:has(.daily-reference-hero),
.online-dialog:has(.daily-reference-hero) * ,
.online-dialog:has(.daily-reference-hero) *::before,
.online-dialog:has(.daily-reference-hero) *::after {
  font-family: Arial, Helvetica, sans-serif !important;
}

.online-dialog:has(.daily-reference-hero) {
  width: min(88vw, 880px) !important;
  max-height: min(88dvh, 740px) !important;
  padding: 12px 18px 16px !important;
  border-radius: 22px !important;
}

.online-dialog:has(.daily-reference-hero) > .last-trick-header {
  margin-bottom: 9px !important;
  padding-bottom: 8px !important;
}

.online-dialog:has(.daily-reference-hero) > .last-trick-header span {
  font-size: 13px !important;
}

.online-dialog:has(.daily-reference-hero) #onlineTitle {
  font-size: clamp(26px, 3vw, 36px) !important;
}

.online-dialog:has(.daily-reference-hero) #closeOnlineButton {
  width: 40px !important;
  height: 40px !important;
}

.online-dialog:has(.daily-reference-hero) #closeOnlineButton::after {
  font-size: 29px !important;
  line-height: 29px !important;
}

#onlineContent .daily-reference-hero.daily-hero {
  grid-template-columns: 92px minmax(0, 1fr) !important;
  min-height: 118px !important;
  padding: 13px 20px !important;
  border-radius: 19px !important;
}

.daily-reference-hero::after {
  right: 20px !important;
  font-size: 96px !important;
}

.daily-date-card {
  width: 74px !important;
  min-height: 88px !important;
  border-radius: 10px !important;
}

.daily-date-card span { font-size: 9px !important; }
.daily-date-card strong { font-size: 34px !important; }
.daily-date-card small { font-size: 9px !important; }
.daily-reference-hero .daily-hero-copy > span { font-size: 14px !important; }
.daily-reference-hero .daily-hero-copy h2 { margin: 2px 0 6px !important; font-size: clamp(25px, 3vw, 34px) !important; }
.daily-reference-hero .daily-hero-copy p { font-size: 12px !important; line-height: 1.35 !important; }

.daily-reference-grid {
  gap: 15px !important;
  margin: 16px 2px 10px !important;
}

#onlineContent .daily-reference-grid .daily-reference-card {
  gap: 4px !important;
  padding: 32px 16px 12px !important;
  border-radius: 17px !important;
}

.daily-variant-ribbon {
  top: -12px !important;
  padding: 5px 12px !important;
  font-size: 16px !important;
}

.daily-reference-card h2 { font-size: clamp(20px, 2.2vw, 26px) !important; }
.daily-reference-card p { font-size: 12px !important; }
.daily-attempt-status { font-size: 13px !important; }

#onlineContent .daily-reference-start {
  grid-template-columns: 34px 1fr 24px !important;
  min-height: 48px !important;
  border-radius: 13px !important;
}

.daily-reference-start b { font-size: clamp(15px, 1.7vw, 20px) !important; }
.daily-reference-start span { font-size: 16px !important; }

#onlineContent .daily-reference-info,
.daily-reference-score {
  grid-template-columns: 40px minmax(0, 1fr) auto !important;
  gap: 10px !important;
  margin-top: 9px !important;
  padding: 8px 14px !important;
  border-radius: 12px !important;
}

.daily-info-icon { width: 34px !important; height: 34px !important; font-size: 17px !important; }
.daily-reference-info strong,
.daily-reference-score .daily-board-title { font-size: 14px !important; }
.daily-reference-info p { font-size: 12px !important; line-height: 1.3 !important; }
.daily-info-watermark { font-size: 36px !important; }
.online-dialog:has(.daily-reference-hero) .leaderboard-table { font-size: 12px !important; }

.online-dialog:has(.daily-reference-hero) #onlineTitle,
#onlineContent .daily-reference-hero .daily-hero-copy > span,
#onlineContent .daily-reference-hero .daily-hero-copy h2,
#onlineContent .daily-reference-hero .daily-hero-copy p,
#onlineContent .daily-date-card span,
#onlineContent .daily-date-card strong,
#onlineContent .daily-date-card small,
#onlineContent .daily-reference-card h2,
#onlineContent .daily-variant-ribbon,
#onlineContent .daily-attempt-status,
#onlineContent .daily-reference-start b,
#onlineContent .daily-reference-info strong,
#onlineContent .daily-reference-score .daily-board-title {
  font-family: Arial, Helvetica, sans-serif !important;
}

@media (max-width: 720px) {
  .online-dialog:has(.daily-reference-hero) { width: calc(100vw - 16px) !important; max-height: 92dvh !important; }
  #onlineContent .daily-reference-hero.daily-hero { grid-template-columns: 66px minmax(0, 1fr) !important; padding: 10px !important; }
  .daily-reference-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  #onlineContent .daily-reference-info, .daily-reference-score { grid-template-columns: 36px minmax(0, 1fr) !important; }
}

/* Final competition labels override. */
body:not(.game-active) .competition-entry .online-entry-actions .premium-action {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(30px, 1fr) auto auto !important;
  place-items: center !important;
  align-content: center !important;
  gap: clamp(3px, 0.55dvh, 7px) !important;
  text-align: center !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action-icon {
  display: block !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: end !important;
  margin: 0 !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action-text {
  display: block !important;
  grid-column: 1 !important;
  grid-row: 2 !important;
  width: 100% !important;
  height: auto !important;
  color: #fff0c4 !important;
  -webkit-text-fill-color: #fff0c4 !important;
  font-size: clamp(11px, 1.05vw, 16px) !important;
  font-weight: 560 !important;
  line-height: 1.1 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action-text::before,
body:not(.game-active) .competition-entry .online-entry-actions .premium-action-text::after {
  display: none !important;
  content: none !important;
}

body:not(.game-active) .competition-entry .online-entry-actions .premium-action small {
  display: block !important;
  grid-column: 1 !important;
  grid-row: 3 !important;
  margin: 0 !important;
}

/* Final phone safeguard: never leave the user's played card visible during trick pickup. */
@media (max-width: 980px), (hover: none) and (pointer: coarse) {
  body.game-active .trick-area.collecting .played-card.seat-user {
    transition:
      transform 180ms cubic-bezier(0.22, 0.78, 0.25, 1),
      opacity 140ms ease !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.game-active .trick-area.collecting .played-card.seat-user .mini-card,
  body.game-active .trick-area.collecting .played-card.seat-user > span {
    transition: opacity 120ms ease !important;
    opacity: 0 !important;
  }
}

/* Phone fix: the user's played card must not linger as a large card while a trick is collected. */
@media (max-width: 980px), (hover: none) and (pointer: coarse) {
  body.game-active .trick-area.collecting .played-card.seat-user {
    transition:
      transform 180ms cubic-bezier(0.22, 0.78, 0.25, 1),
      opacity 140ms ease !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.game-active .trick-area.collecting .played-card.seat-user .mini-card,
  body.game-active .trick-area.collecting .played-card.seat-user > span {
    transition: opacity 120ms ease !important;
    opacity: 0 !important;
  }
}

/* Opening deal animation: decorative only; the real game state stays in main.js. */
body.game-active.deal-animation-active .bid-popup,
body.game-active.deal-animation-active .bid-panel {
  display: none !important;
}

body.game-active.deal-animation-active #playerHand .card {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(10px) scale(0.98) !important;
}

body.game-active .deal-animation-layer {
  --deal-card-w: clamp(38px, 9.2vw, 72px);
  --deal-card-h: calc(var(--deal-card-w) * 1.42);
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

body.game-active .deal-card,
body.game-active .deal-mini-card {
  position: absolute;
  width: var(--deal-card-w);
  height: var(--deal-card-h);
  box-sizing: border-box;
  border-radius: calc(var(--deal-card-w) * 0.12);
  transform-origin: center;
  will-change: left, top, transform, opacity;
  background: var(--card-back-bg);
  border: 2px solid var(--card-back-border);
  box-shadow:
    0 4px 9px rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.14),
    inset 0 0 0 1px rgba(255, 244, 204, 0.18);
}

body.game-active .deal-card::before,
body.game-active .deal-mini-card::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid var(--card-back-inner);
  border-radius: calc(var(--deal-card-w) * 0.08);
}

body.game-active .deal-card::after,
body.game-active .deal-mini-card::after {
  content: var(--card-back-symbol);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--card-back-symbol-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(var(--deal-card-w) * 0.44);
  text-shadow: var(--card-back-symbol-shadow);
}

body.game-active .deal-table-stack {
  position: absolute;
  width: var(--deal-card-w);
  height: var(--deal-card-h);
  transform: translate(-50%, -50%);
  will-change: left, top, transform, opacity;
  z-index: 16;
}

/* De rand van schud- en deelkaarten telt binnen de kaartmaat mee. */
body.game-active .deal-animation-layer :is(.deal-card, .deal-mini-card) {
  box-sizing: border-box !important;
  max-width: var(--deal-card-w) !important;
  max-height: var(--deal-card-h) !important;
}

body.game-active .deal-table-stack .deal-mini-card {
  left: 0;
  top: 0;
}

body.game-active .deal-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(210px, 42%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 211, 103, 0.35), rgba(255, 211, 103, 0.12) 36%, transparent 68%);
  animation: dealGlowPulse 900ms ease-out both;
}

body.game-active.hand-reveal-active #playerHand .card {
  animation: handDealReveal 520ms cubic-bezier(.18,.86,.24,1) both;
}

body.game-active.hand-reveal-active #playerHand .card:nth-child(2) { animation-delay: 35ms; }
body.game-active.hand-reveal-active #playerHand .card:nth-child(3) { animation-delay: 70ms; }
body.game-active.hand-reveal-active #playerHand .card:nth-child(4) { animation-delay: 105ms; }
body.game-active.hand-reveal-active #playerHand .card:nth-child(5) { animation-delay: 140ms; }
body.game-active.hand-reveal-active #playerHand .card:nth-child(6) { animation-delay: 175ms; }
body.game-active.hand-reveal-active #playerHand .card:nth-child(7) { animation-delay: 210ms; }
body.game-active.hand-reveal-active #playerHand .card:nth-child(8) { animation-delay: 245ms; }

@keyframes dealGlowPulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.38); }
}

@keyframes handDealReveal {
  0% {
    opacity: 0;
    transform: translateY(-18px) rotateX(16deg) scale(0.94);
    filter: brightness(1.22);
  }
  70% {
    opacity: 1;
    transform: translateY(2px) rotateX(0deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
    filter: brightness(1);
  }
}

@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body.game-active .deal-animation-layer {
    --deal-card-w: clamp(28px, 5.3vw, 44px);
  }
}

/* Mobile viewport fit v1: keep the full start menu, including the start button, inside phone browsers. */
@media (orientation: portrait) and (max-width: 760px) {
  html,
  body {
    min-height: 100svh !important;
    max-height: 100svh !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu {
    height: 100svh !important;
    min-height: 100svh !important;
    max-height: 100svh !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage {
    height: 100svh !important;
    min-height: 0 !important;
    max-height: 100svh !important;
    padding:
      max(5px, env(safe-area-inset-top))
      clamp(8px, 2.4vw, 14px)
      max(5px, env(safe-area-inset-bottom)) !important;
    grid-template-rows: clamp(150px, 29svh, 245px) minmax(0, 1fr) !important;
    gap: clamp(4px, 0.7svh, 7px) !important;
  }

  body:not(.game-active) .brand-showcase::before {
    width: min(106vw, 590px) !important;
    height: clamp(148px, 31svh, 258px) !important;
    bottom: clamp(-8px, -0.9svh, -2px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    min-height: 0 !important;
    max-height: 100% !important;
    grid-template-rows:
      minmax(48px, 0.68fr)
      minmax(46px, 0.58fr)
      minmax(44px, 0.54fr)
      minmax(74px, 0.9fr)
      clamp(42px, 7.1svh, 58px) !important;
    gap: clamp(4px, 0.68svh, 7px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: clamp(7px, 1svh, 10px) clamp(8px, 2.2vw, 12px) !important;
    border-radius: clamp(9px, 2.1vw, 14px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section {
    gap: clamp(5px, 1.4vw, 8px) !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.04fr) minmax(76px, 0.74fr) !important;
    gap: clamp(5px, 1.45vw, 8px) !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend,
  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before {
    font-size: clamp(10px, 2.55vw, 14px) !important;
  }

  body:not(.game-active) .variant-group legend::after,
  body:not(.game-active) .level-group legend::after,
  body:not(.game-active) .home-options-section h2::after {
    font-size: clamp(10px, 2.55vw, 14px) !important;
  }

  body:not(.game-active) .variant-group .menu-choice {
    padding: clamp(5px, 0.8svh, 8px) clamp(6px, 1.7vw, 10px) !important;
    grid-template-columns: clamp(26px, 6.2vw, 38px) minmax(0, 1fr) !important;
    gap: clamp(5px, 1.35vw, 8px) !important;
  }

  body:not(.game-active) .variant-group .menu-choice::before {
    width: clamp(25px, 6vw, 36px) !important;
    height: clamp(25px, 6vw, 36px) !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(10px, 2.65vw, 15px) !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .variant-group .menu-choice small,
  body:not(.game-active) .level-group .menu-choice small,
  body:not(.game-active) .home-action-card small,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    padding: clamp(5px, 0.78svh, 8px) clamp(5px, 1.5vw, 8px) !important;
    grid-template-columns: clamp(20px, 5vw, 30px) minmax(0, 1fr) !important;
    gap: clamp(4px, 1vw, 6px) !important;
  }

  body:not(.game-active) .level-group .menu-choice::before {
    width: clamp(20px, 5vw, 30px) !important;
    height: clamp(20px, 5vw, 30px) !important;
  }

  body:not(.game-active) .level-group .menu-choice strong,
  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .premium-action-text {
    font-size: clamp(9px, 2.35vw, 13px) !important;
    line-height: 1.04 !important;
  }

  body:not(.game-active) .home-action-grid {
    gap: clamp(5px, 1.45vw, 8px) !important;
  }

  body:not(.game-active) .home-action-card {
    padding: clamp(5px, 0.75svh, 8px) clamp(5px, 1.5vw, 8px) !important;
    grid-template-columns: clamp(22px, 5.2vw, 31px) minmax(0, 1fr) !important;
    gap: clamp(4px, 1.1vw, 6px) !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon {
    width: clamp(22px, 5.2vw, 31px) !important;
    height: clamp(22px, 5.2vw, 31px) !important;
  }

  body:not(.game-active) .competition-copy,
  body:not(.game-active) .home-highscore {
    padding: clamp(6px, 0.8svh, 9px) clamp(5px, 1.5vw, 8px) !important;
    grid-template-columns: clamp(24px, 5.7vw, 34px) minmax(0, 1fr) !important;
    column-gap: clamp(4px, 1.2vw, 7px) !important;
  }

  body:not(.game-active) .competition-copy::before,
  body:not(.game-active) .home-highscore .home-trophy {
    width: clamp(24px, 5.7vw, 34px) !important;
    height: clamp(24px, 5.7vw, 34px) !important;
  }

  body:not(.game-active) .competition-copy strong,
  body:not(.game-active) .home-highscore strong {
    font-size: clamp(10px, 2.55vw, 14px) !important;
  }

  body:not(.game-active) .home-highscore .winner-label,
  body:not(.game-active) .home-highscore small {
    font-size: clamp(7px, 1.85vw, 10px) !important;
  }

  body:not(.game-active) .online-entry-actions {
    gap: clamp(4px, 0.6svh, 6px) !important;
  }

  body:not(.game-active) .premium-action {
    padding: 0 clamp(4px, 1.2vw, 7px) !important;
    grid-template-columns: clamp(20px, 4.8vw, 29px) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: clamp(20px, 4.8vw, 29px) !important;
    height: clamp(20px, 4.8vw, 29px) !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    min-height: 0 !important;
    padding: 0 clamp(10px, 3vw, 18px) !important;
    font-size: clamp(18px, 5.4vw, 30px) !important;
    letter-spacing: 0.025em !important;
    flex-shrink: 0 !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::before {
    width: clamp(22px, 5.8vw, 34px) !important;
    height: clamp(22px, 5.8vw, 34px) !important;
  }
}

@media (orientation: portrait) and (max-height: 700px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: clamp(128px, 25svh, 178px) minmax(0, 1fr) !important;
    gap: 3px !important;
  }

  body:not(.game-active) .brand-showcase::before {
    height: clamp(124px, 27svh, 170px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(42px, 0.6fr)
      minmax(38px, 0.5fr)
      minmax(38px, 0.48fr)
      minmax(60px, 0.76fr)
      clamp(38px, 6.4svh, 48px) !important;
    gap: 3px !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: 6px 7px !important;
  }
}

/* Table points burst final v1: every trick/roem popup appears centered on the table. */
body.game-active .table > #trickPoints,
body.game-active .table > #roemBurst {
  position: absolute !important;
  z-index: 95 !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: clamp(132px, 22vw, 210px) !important;
  max-width: calc(100% - 28px) !important;
  min-height: 56px !important;
  margin: 0 !important;
  padding: 9px 13px !important;
  display: grid !important;
  place-items: center !important;
  text-align: center !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(0.96) !important;
  opacity: 0 !important;
  border: 1px solid rgba(255, 211, 93, 0.96) !important;
  border-radius: 14px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 225, 122, 0.16), transparent 62%),
    rgba(16, 24, 17, 0.96) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.46), 0 0 24px rgba(255, 211, 93, 0.28) !important;
}

body.game-active .table > #roemBurst {
  top: calc(50% + 66px) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 200, 82, 0.2), transparent 62%),
    rgba(52, 31, 9, 0.96) !important;
}

body.game-active .table > #trickPoints.burst-active,
body.game-active .table > #roemBurst.burst-active {
  animation: tablePointsBurstFinal 2000ms ease both !important;
}

body.game-active .table > #trickPoints[hidden],
body.game-active .table > #roemBurst[hidden] {
  display: none !important;
}

body.game-active .table > #trickPoints strong,
body.game-active .table > #roemBurst strong {
  display: block !important;
  width: 100% !important;
  font-size: clamp(22px, 4.2vw, 34px) !important;
  line-height: 1 !important;
  color: #fff2ba !important;
  white-space: nowrap !important;
}

body.game-active .table > #trickPoints span,
body.game-active .table > #roemBurst span {
  display: block !important;
  width: 100% !important;
  margin-top: 4px !important;
  font-size: clamp(10px, 1.65vw, 13px) !important;
  line-height: 1.15 !important;
  color: rgba(255, 244, 211, 0.92) !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

@keyframes tablePointsBurstFinal {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  12%,
  84% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
}

/* Portrait menu final fix: keep option and competition controls in their boxes. */
@media (orientation: portrait) {
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    overflow: hidden !important;
  }

  body:not(.game-active) .home-options-section::before,
  body:not(.game-active) .home-options-section::after,
  body:not(.game-active) .competition-entry::after,
  body:not(.game-active) .home-action-grid::before,
  body:not(.game-active) .home-action-grid::after,
  body:not(.game-active) .online-entry-actions::before,
  body:not(.game-active) .online-entry-actions::after {
    display: none !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice::before {
    width: clamp(42px, 11.5vw, 72px) !important;
    height: clamp(38px, 10.5vw, 66px) !important;
    background-image: url("./assets/vertical-menu/icon-amsterdams.png") !important;
    background-size: contain !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(2)::before {
    background-image: url("./assets/vertical-menu/icon-rotterdams.png") !important;
  }

  body:not(.game-active) .home-options-section {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  body:not(.game-active) .home-action-grid {
    grid-row: 1 / -1 !important;
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: clamp(8px, 2vw, 12px) !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .home-action-card,
  body:not(.game-active) .home-action-card[data-info="rules"],
  body:not(.game-active) #startDemoHomeButton,
  body:not(.game-active) #openSettingsButton {
    grid-area: auto !important;
    grid-row: auto !important;
    grid-column: auto !important;
    order: initial !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
    display: grid !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(86px, 0.72fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  body:not(.game-active) .competition-entry::before {
    position: absolute !important;
    left: clamp(18px, 5vw, 32px) !important;
    top: 0 !important;
    transform: translateY(-52%) !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: calc(100% - 36px) !important;
    max-height: none !important;
    padding: 0 clamp(8px, 2vw, 12px) !important;
    line-height: 1 !important;
    overflow: visible !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, rgba(16, 11, 6, 0.94), rgba(33, 22, 10, 0.94)) !important;
  }

  body:not(.game-active) .competition-copy,
  body:not(.game-active) .home-highscore,
  body:not(.game-active) .online-entry-actions {
    grid-row: 1 / -1 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
  }

  body:not(.game-active) .competition-copy {
    grid-column: 1 !important;
  }

  body:not(.game-active) .home-highscore {
    grid-column: 2 !important;
  }

  body:not(.game-active) .online-entry-actions {
    grid-column: 3 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(5px, 0.75dvh, 8px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .premium-action,
  body:not(.game-active) #openOnlineButton,
  body:not(.game-active) #openDailyButton,
  body:not(.game-active) #openRankingsButton {
    grid-area: auto !important;
    grid-row: auto !important;
    grid-column: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
    display: grid !important;
    overflow: hidden !important;
  }

  body:not(.game-active) #openOnlineButton {
    order: 1 !important;
  }

  body:not(.game-active) #openDailyButton {
    order: 2 !important;
  }

  body:not(.game-active) #openRankingsButton {
    order: 3 !important;
  }
}

/* Portrait design v3: align buttons and remove inherited ghost overlays. */
@media (orientation: portrait) {
  body:not(.game-active) .home-options-section::before,
  body:not(.game-active) .home-options-section::after,
  body:not(.game-active) .competition-entry::after,
  body:not(.game-active) .home-action-grid::before,
  body:not(.game-active) .home-action-grid::after,
  body:not(.game-active) .online-entry-actions::before,
  body:not(.game-active) .online-entry-actions::after {
    display: none !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice::before {
    background-image: url("./assets/vertical-menu/icon-amsterdams.png") !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(2)::before {
    background-image: url("./assets/vertical-menu/icon-rotterdams.png") !important;
  }

  body:not(.game-active) .variant-group .menu-choice::before {
    width: clamp(42px, 11.5vw, 72px) !important;
    height: clamp(38px, 10.5vw, 66px) !important;
  }

  body:not(.game-active) .home-options-section {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  body:not(.game-active) .home-options-section h2 {
    position: absolute !important;
    left: clamp(18px, 5vw, 32px) !important;
    top: 0 !important;
    transform: translateY(-52%) !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 clamp(8px, 2vw, 12px) !important;
  }

  body:not(.game-active) .home-action-grid {
    grid-row: 1 !important;
    grid-column: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .home-action-card,
  body:not(.game-active) .home-action-card[data-info="rules"],
  body:not(.game-active) #startDemoHomeButton,
  body:not(.game-active) #openSettingsButton {
    grid-row: auto !important;
    grid-column: auto !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
    display: grid !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(86px, 0.72fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-entry::before {
    position: absolute !important;
    left: clamp(18px, 5vw, 32px) !important;
    top: 0 !important;
    transform: translateY(-52%) !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: calc(100% - 36px) !important;
    max-height: none !important;
    padding: 0 clamp(8px, 2vw, 12px) !important;
    line-height: 1 !important;
    overflow: visible !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, rgba(16, 11, 6, 0.94), rgba(33, 22, 10, 0.94)) !important;
  }

  body:not(.game-active) .competition-copy,
  body:not(.game-active) .home-highscore,
  body:not(.game-active) .online-entry-actions {
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
  }

  body:not(.game-active) .competition-copy {
    grid-column: 1 !important;
  }

  body:not(.game-active) .home-highscore {
    grid-column: 2 !important;
  }

  body:not(.game-active) .online-entry-actions {
    grid-column: 3 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(5px, 0.75dvh, 8px) !important;
    position: relative !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .premium-action,
  body:not(.game-active) #openOnlineButton,
  body:not(.game-active) #openDailyButton,
  body:not(.game-active) #openRankingsButton {
    grid-row: auto !important;
    grid-column: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
    display: grid !important;
    overflow: hidden !important;
  }

  body:not(.game-active) #openOnlineButton {
    order: 1 !important;
  }

  body:not(.game-active) #openDailyButton {
    order: 2 !important;
  }

  body:not(.game-active) #openRankingsButton {
    order: 3 !important;
  }
}

/* File-end override: center the wide landscape home and keep the start button fully visible. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 620px) {
  body:not(.game-active) .start-menu {
    display: grid !important;
    place-items: center !important;
    width: 100vw !important;
    min-height: 100dvh !important;
    padding: clamp(18px, 2.6dvh, 34px) clamp(20px, 3vw, 48px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(94vw, 1420px) !important;
    height: min(88dvh, 790px) !important;
    min-height: 650px !important;
    margin: auto !important;
    align-self: center !important;
    justify-self: center !important;
    padding: clamp(18px, 2.2dvh, 28px) clamp(22px, 2.4vw, 38px) clamp(30px, 3.4dvh, 48px) !important;
    overflow: visible !important;
    transform: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(270px, 28%) minmax(410px, 1fr) minmax(310px, 29%) !important;
    grid-template-rows: minmax(150px, 0.74fr) minmax(250px, 1.16fr) minmax(130px, 0.62fr) minmax(112px, 0.48fr) !important;
    gap: clamp(14px, 1.2vw, 20px) !important;
    align-items: stretch !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase {
    width: min(43vw, 600px) !important;
    height: clamp(230px, 34dvh, 340px) !important;
    align-self: start !important;
    justify-self: center !important;
    z-index: 3 !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-actions-panel,
  body:not(.game-active) .competition-panel {
    min-width: 0 !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .start-game-button {
    grid-column: 2 !important;
    grid-row: 4 !important;
    align-self: center !important;
    justify-self: center !important;
    width: min(44vw, 650px) !important;
    height: clamp(94px, 12dvh, 126px) !important;
    min-height: 94px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: url("./assets/button-start-normal.png") center / contain no-repeat !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: none !important;
  }
}

/* Absolute last wide-screen polish: direct fieldset children get usable width. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 620px) {
  body:not(.game-active) .level-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    column-gap: clamp(14px, 1.15vw, 20px) !important;
    row-gap: 14px !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    display: block !important;
  }

  body:not(.game-active) .level-group .menu-choice span {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 66px !important;
    height: 100% !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 10px !important;
    font-size: clamp(14px, 0.95vw, 18px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-align: center !important;
    background-image: none !important;
  }

  body:not(.game-active) .level-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .home-options-section {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    gap: clamp(12px, 1vw, 18px) !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .home-options-section legend {
    grid-column: 1 / -1 !important;
  }

  body:not(.game-active) .home-options-section .menu-choice {
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  body:not(.game-active) .home-options-section .menu-choice span {
    width: 100% !important;
    min-height: 96px !important;
    display: grid !important;
    grid-template-rows: 1fr auto !important;
    place-items: center !important;
    gap: 7px !important;
    padding: 10px 8px !important;
    font-size: clamp(12px, 0.78vw, 15px) !important;
    line-height: 1.05 !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  body:not(.game-active) .home-options-section .menu-choice small {
    display: none !important;
  }
}

/* Final wide-screen polish: keep landscape level and option controls readable. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 620px) {
  body:not(.game-active) .level-group {
    padding: clamp(18px, 2dvh, 24px) clamp(18px, 1.8vw, 28px) !important;
    align-content: center !important;
  }

  body:not(.game-active) .level-group .choice-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(16px, 1.5vw, 26px) !important;
    align-items: center !important;
  }

  body:not(.game-active) .level-group .menu-choice span {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 0 12px !important;
    border-radius: 15px !important;
    display: grid !important;
    place-items: center !important;
    font-size: clamp(16px, 1.08vw, 22px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    background-image: none !important;
    filter: none !important;
    transform: none !important;
  }

  body:not(.game-active) .home-actions-panel {
    padding: clamp(16px, 1.8dvh, 22px) clamp(18px, 1.6vw, 24px) !important;
    align-content: center !important;
  }

  body:not(.game-active) .home-actions-panel .menu-group {
    min-height: 0 !important;
  }

  body:not(.game-active) .home-actions-panel .choice-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(14px, 1.2vw, 20px) !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .home-actions-panel .menu-choice span {
    min-height: 98px !important;
    padding: 12px 8px !important;
    display: grid !important;
    grid-template-rows: 1fr auto !important;
    place-items: center !important;
    gap: 8px !important;
    font-size: clamp(13px, 0.82vw, 16px) !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    text-align: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-actions-panel .menu-choice svg,
  body:not(.game-active) .home-actions-panel .menu-choice .option-icon {
    width: clamp(38px, 3vw, 52px) !important;
    height: clamp(38px, 3vw, 52px) !important;
    flex: 0 0 auto !important;
  }
}

/* Final wide-screen fieldset correction: labels are direct children, not wrapped. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 620px) {
  body:not(.game-active) .level-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    column-gap: clamp(14px, 1vw, 18px) !important;
    row-gap: 14px !important;
  }

  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
    margin: 0 !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body:not(.game-active) .level-group .menu-choice span {
    width: 100% !important;
    height: 100% !important;
    min-height: 62px !important;
  }

  body:not(.game-active) .level-group .menu-choice small,
  body:not(.game-active) .home-options-section .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .home-options-section {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    gap: clamp(12px, 1vw, 18px) !important;
    padding: clamp(16px, 1.7dvh, 22px) clamp(18px, 1.6vw, 24px) !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .home-options-section legend {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
    margin: 0 !important;
  }

  body:not(.game-active) .home-options-section .menu-choice {
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body:not(.game-active) .home-options-section .menu-choice span {
    width: 100% !important;
    height: 100% !important;
    min-height: 100px !important;
    display: grid !important;
    grid-template-rows: 1fr auto !important;
    place-items: center !important;
    gap: 8px !important;
    padding: 12px 8px !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  body:not(.game-active) .home-options-section .menu-choice svg {
    width: clamp(40px, 3vw, 54px) !important;
    height: clamp(40px, 3vw, 54px) !important;
  }
}

/* Landscape final: make Niveau and Opties readable in compact mobile width. */
@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(94px, 0.74fr)
      minmax(108px, 0.92fr)
      minmax(72px, 0.58fr)
      clamp(48px, 11.6dvh, 62px) !important;
  }

  body:not(.game-active) .home-options-section {
    padding: 10px 12px !important;
    grid-template-rows: 18px minmax(58px, 1fr) !important;
    gap: 8px !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .home-options-section h2 {
    font-size: clamp(13px, 1.6vw, 18px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-action-grid {
    min-height: 0 !important;
    height: 100% !important;
    gap: 9px !important;
  }

  body:not(.game-active) .home-action-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 7px 6px !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(34px, 1fr) auto !important;
    gap: 4px !important;
    justify-items: center !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(36px, 4.3vw, 52px) !important;
    height: clamp(36px, 4.3vw, 52px) !important;
  }

  body:not(.game-active) .home-action-icon svg {
    width: 76% !important;
    height: 76% !important;
  }

  body:not(.game-active) .home-action-card span:last-child {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(10px, 1.16vw, 14px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .level-group {
    padding: 9px 11px !important;
    grid-template-rows: 17px minmax(44px, 1fr) !important;
    gap: 7px 10px !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .level-group legend {
    font-size: clamp(13px, 1.55vw, 18px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-width: 0 !important;
    min-height: 44px !important;
    height: 100% !important;
    padding: 0 9px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(13px, 1.48vw, 18px) !important;
    line-height: 1 !important;
  }
}

/* Compact mobile landscape home: keep every menu block readable inside the viewport. */
@media (orientation: landscape) and (min-width: 720px) and (max-height: 520px) {
  body:not(.game-active) .start-menu {
    padding: clamp(5px, 1.15dvh, 9px) clamp(10px, 1.7vw, 18px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: 100% !important;
    height: 100% !important;
    padding: clamp(10px, 2dvh, 14px) clamp(14px, 2vw, 22px) !important;
    grid-template-columns: minmax(238px, 29%) minmax(300px, 1fr) minmax(256px, 29%) !important;
    grid-template-rows: minmax(0, 1fr) clamp(50px, 12.5dvh, 64px) !important;
    gap: clamp(8px, 1.2vw, 12px) !important;
  }

  body:not(.game-active) .start-menu-stage::before {
    inset: 8px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-columns: minmax(238px, 29%) minmax(300px, 1fr) minmax(256px, 29%) !important;
    grid-template-rows:
      minmax(82px, 0.67fr)
      minmax(116px, 0.95fr)
      minmax(58px, 0.48fr)
      clamp(50px, 12.5dvh, 64px) !important;
    gap: clamp(8px, 1.2vw, 12px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .brand-showcase {
    width: min(36vw, 440px) !important;
    height: clamp(118px, 29dvh, 150px) !important;
    transform: translateY(-2px) !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(36vw, 440px) !important;
    max-height: clamp(118px, 29dvh, 150px) !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .menu-group,
  body:not(.game-active) .competition-entry {
    border-radius: 12px !important;
  }

  body:not(.game-active) .home-player-section {
    padding: 10px 12px !important;
    grid-template-columns: clamp(42px, 5vw, 56px) minmax(0, 1fr) !important;
    grid-template-rows: 18px minmax(0, 1fr) 34px !important;
    gap: 5px 10px !important;
  }

  body:not(.game-active) .home-player-section h2,
  body:not(.game-active) .home-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .online-kicker {
    font-size: clamp(11px, 1.35vw, 15px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .avatar-preview {
    width: clamp(42px, 5vw, 56px) !important;
    height: clamp(42px, 5vw, 56px) !important;
    font-size: clamp(17px, 1.9vw, 24px) !important;
  }

  body:not(.game-active) .player-name-field input {
    height: 32px !important;
    font-size: clamp(20px, 2.35vw, 30px) !important;
  }

  body:not(.game-active) .player-photo-field {
    height: 32px !important;
    padding: 0 10px !important;
  }

  body:not(.game-active) .variant-group {
    padding: 9px 10px !important;
    grid-template-rows: 17px minmax(0, 1fr) !important;
    gap: 7px 10px !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    padding: 7px 9px !important;
    align-content: end !important;
    background-size: cover !important;
    background-position: center !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    max-width: 100% !important;
    font-size: clamp(11px, 1.28vw, 14px) !important;
    line-height: 1.06 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .level-group {
    padding: 8px 10px !important;
    grid-template-rows: 16px minmax(0, 1fr) !important;
    gap: 6px 10px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 36px !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: clamp(12px, 1.45vw, 16px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-options-section {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  body:not(.game-active) .home-action-grid {
    gap: 10px !important;
  }

  body:not(.game-active) .home-action-card {
    padding: 7px !important;
    grid-template-rows: minmax(30px, 1fr) auto !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(34px, 4.1vw, 48px) !important;
    height: clamp(34px, 4.1vw, 48px) !important;
  }

  body:not(.game-active) .home-action-card strong {
    font-size: clamp(9px, 1vw, 12px) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .competition-entry {
    padding: 12px !important;
    grid-template-rows: auto minmax(62px, 0.88fr) minmax(78px, 1fr) !important;
    gap: 9px !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .competition-copy {
    gap: 4px !important;
  }

  body:not(.game-active) .competition-copy strong {
    font-size: clamp(13px, 1.45vw, 17px) !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 62px !important;
    padding: 8px 10px !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    column-gap: 10px !important;
    row-gap: 2px !important;
    border: 1px solid rgba(255, 245, 190, 0.16) !important;
    background: rgba(8, 32, 31, 0.34) !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 44px !important;
    height: 44px !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    font-size: clamp(10px, 1.02vw, 12px) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: clamp(15px, 1.65vw, 20px) !important;
  }

  body:not(.game-active) .home-highscore small {
    display: block !important;
    font-size: clamp(8px, 0.9vw, 10px) !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 78px !important;
    gap: 8px !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    grid-template-rows: 28px auto auto !important;
    gap: 3px !important;
    padding: 6px 5px !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: 28px !important;
    height: 28px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    font-size: clamp(8px, 0.95vw, 11px) !important;
  }

  body:not(.game-active) .online-entry-actions .info-button small {
    font-size: 7px !important;
    padding: 1px 5px !important;
  }

  body:not(.game-active) .start-game-button {
    width: min(46vw, 430px) !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    background:
      url("./assets/button-start-normal.png") center / contain no-repeat !important;
    transform: none !important;
  }
}

/* End override: landscape menu level and options controls stay readable. */
@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(94px, 0.74fr)
      minmax(108px, 0.92fr)
      minmax(72px, 0.58fr)
      clamp(48px, 11.6dvh, 62px) !important;
  }

  body:not(.game-active) .home-options-section {
    padding: 10px 12px !important;
    grid-template-rows: 18px minmax(58px, 1fr) !important;
    gap: 8px !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .level-group legend {
    font-size: clamp(13px, 1.55vw, 18px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-action-grid {
    height: 100% !important;
    gap: 9px !important;
  }

  body:not(.game-active) .home-action-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 7px 6px !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(34px, 1fr) auto !important;
    gap: 4px !important;
    justify-items: center !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(36px, 4.3vw, 52px) !important;
    height: clamp(36px, 4.3vw, 52px) !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(10px, 1.16vw, 14px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .level-group {
    padding: 9px 11px !important;
    grid-template-rows: 17px minmax(44px, 1fr) !important;
    gap: 7px 10px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 44px !important;
    height: 100% !important;
    padding: 0 9px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(13px, 1.48vw, 18px) !important;
    line-height: 1 !important;
  }
}

/* Last-pass menu polish: this must remain at the end of the file. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    min-height: clamp(224px, 29dvh, 278px) !important;
    grid-template-rows: auto minmax(96px, 1fr) minmax(86px, 0.9fr) !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 96px !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    padding: 12px 14px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 64px !important;
    height: 64px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: clamp(20px, 5.4vw, 25px) !important;
  }

  body:not(.game-active) .online-entry-actions,
  body:not(.game-active) .online-entry-actions .premium-action {
    min-height: 86px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(30px, 8.4vw, 40px) !important;
    grid-template-rows: var(--premium-icon-size) auto auto !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon {
    width: var(--premium-icon-size) !important;
    height: var(--premium-icon-size) !important;
  }
}

@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(58px, 0.72fr) minmax(92px, 1fr) !important;
    gap: 8px !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 92px !important;
    gap: 9px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(31px, 3.7vw, 42px) !important;
    min-height: 92px !important;
    grid-template-rows: var(--premium-icon-size) minmax(14px, auto) minmax(13px, auto) !important;
    gap: 4px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon {
    width: var(--premium-icon-size) !important;
    height: var(--premium-icon-size) !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    content: attr(data-short-label) !important;
    font-size: clamp(8.5px, 1vw, 12px) !important;
    white-space: nowrap !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .info-dialog.rules-dialog {
    width: min(94vw, 1040px) !important;
    height: min(90dvh, 430px) !important;
    max-height: 90dvh !important;
    overflow: hidden !important;
  }

  .rules-guide {
    height: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(180px, 0.78fr) minmax(0, 1.55fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "hero tabs"
      "hero panel" !important;
    gap: 10px 12px !important;
    overflow: hidden !important;
  }

  .rules-hero {
    grid-area: hero !important;
    min-height: 0 !important;
    padding: 13px !important;
  }

  .rules-tabs {
    grid-area: tabs !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .rules-tabs button {
    min-height: 36px !important;
    font-size: clamp(10px, 1.15vw, 13px) !important;
    white-space: nowrap !important;
  }

  .rules-panel.active {
    grid-area: panel !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    overflow-y: auto !important;
  }

  .rules-panel:not(.active) {
    display: none !important;
  }

  .rule-card,
  .rule-card.wide {
    min-width: 0 !important;
    padding: 12px !important;
  }
}

/* True final landscape controls: readable Niveau and Opties buttons. */
@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(94px, 0.74fr)
      minmax(108px, 0.92fr)
      minmax(72px, 0.58fr)
      clamp(48px, 11.6dvh, 62px) !important;
  }

  body:not(.game-active) .home-options-section {
    padding: 10px 12px !important;
    grid-template-rows: 18px minmax(58px, 1fr) !important;
    gap: 8px !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .level-group legend {
    font-size: clamp(13px, 1.55vw, 18px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-action-grid {
    min-height: 0 !important;
    height: 100% !important;
    gap: 9px !important;
  }

  body:not(.game-active) .home-action-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 7px 6px !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(34px, 1fr) auto !important;
    gap: 4px !important;
    justify-items: center !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(36px, 4.3vw, 52px) !important;
    height: clamp(36px, 4.3vw, 52px) !important;
  }

  body:not(.game-active) .home-action-icon svg {
    width: 76% !important;
    height: 76% !important;
  }

  body:not(.game-active) .home-action-card span:last-child {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(10px, 1.16vw, 14px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .level-group {
    padding: 9px 11px !important;
    grid-template-rows: 17px minmax(44px, 1fr) !important;
    gap: 7px 10px !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-width: 0 !important;
    min-height: 44px !important;
    height: 100% !important;
    padding: 0 9px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(13px, 1.48vw, 18px) !important;
    line-height: 1 !important;
  }
}

/* Final home polish: portrait premium icons, landscape premium package, and landscape rules readability. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    min-height: clamp(224px, 29dvh, 278px) !important;
    grid-template-rows: auto minmax(96px, 1fr) minmax(86px, 0.9fr) !important;
    gap: clamp(10px, 1.25dvh, 14px) !important;
    padding: clamp(12px, 1.55dvh, 16px) !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 96px !important;
    padding: 12px 14px !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    column-gap: 14px !important;
    row-gap: 4px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 64px !important;
    height: 64px !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    font-size: clamp(12px, 3.3vw, 15px) !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: clamp(20px, 5.4vw, 25px) !important;
    line-height: 1.06 !important;
  }

  body:not(.game-active) .home-highscore small {
    font-size: clamp(10px, 2.9vw, 12px) !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 86px !important;
    gap: 8px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(30px, 8.4vw, 40px) !important;
    min-height: 86px !important;
    grid-template-rows: var(--premium-icon-size) auto auto !important;
    gap: 4px !important;
    padding: 8px 5px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon {
    width: var(--premium-icon-size) !important;
    height: var(--premium-icon-size) !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon svg {
    width: 76% !important;
    height: 76% !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text,
  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    font-size: clamp(10px, 2.9vw, 12px) !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action small {
    font-size: clamp(8px, 2.35vw, 10px) !important;
    padding: 2px 7px !important;
  }
}

@media (orientation: portrait) and (max-width: 390px), (orientation: portrait) and (max-height: 780px) {
  body:not(.game-active) .competition-entry {
    min-height: clamp(204px, 27dvh, 244px) !important;
    grid-template-rows: auto minmax(82px, 1fr) minmax(76px, 0.92fr) !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 82px !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 54px !important;
    height: 54px !important;
  }

  body:not(.game-active) .online-entry-actions,
  body:not(.game-active) .online-entry-actions .premium-action {
    min-height: 76px !important;
  }
}

@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(58px, 0.72fr) minmax(92px, 1fr) !important;
    gap: 8px !important;
    padding: 11px !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 92px !important;
    gap: 9px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(31px, 3.7vw, 42px) !important;
    min-height: 92px !important;
    padding: 8px 6px !important;
    grid-template-rows: var(--premium-icon-size) minmax(14px, auto) minmax(13px, auto) !important;
    gap: 4px !important;
    align-content: center !important;
    justify-items: center !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon {
    width: var(--premium-icon-size) !important;
    height: var(--premium-icon-size) !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon svg {
    width: 74% !important;
    height: 74% !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text {
    font-size: 0 !important;
    width: 100% !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    display: block !important;
    content: attr(data-short-label) !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #fff2cf !important;
    font-size: clamp(8.5px, 1vw, 12px) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action small {
    display: inline-grid !important;
    place-items: center !important;
    max-width: 100% !important;
    padding: 2px 6px !important;
    font-size: clamp(6.8px, 0.8vw, 9px) !important;
    line-height: 1 !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .info-dialog.rules-dialog {
    width: min(94vw, 1040px) !important;
    height: min(90dvh, 430px) !important;
    max-height: 90dvh !important;
    padding: clamp(12px, 2dvh, 18px) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  .rules-dialog .last-trick-header {
    margin-bottom: 8px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .rules-dialog #infoTitle {
    font-size: clamp(20px, 2.7vw, 30px) !important;
    line-height: 1 !important;
  }

  .rules-dialog .info-content {
    height: calc(100% - 54px) !important;
    overflow: hidden !important;
  }

  .rules-guide {
    height: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(180px, 0.78fr) minmax(0, 1.55fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "hero tabs"
      "hero panel" !important;
    gap: 10px 12px !important;
    overflow: hidden !important;
  }

  .rules-hero {
    grid-area: hero !important;
    min-height: 0 !important;
    padding: 13px !important;
    align-content: start !important;
  }

  .rules-hero h2 {
    font-size: clamp(18px, 2.4vw, 26px) !important;
    line-height: 1.05 !important;
  }

  .rules-hero p {
    font-size: clamp(12px, 1.35vw, 15px) !important;
    line-height: 1.28 !important;
  }

  .rules-tabs {
    grid-area: tabs !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin: 0 !important;
  }

  .rules-tabs button {
    min-height: 36px !important;
    padding: 0 8px !important;
    font-size: clamp(10px, 1.15vw, 13px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .rules-panel,
  .rules-panel.active {
    grid-area: panel !important;
    height: 100% !important;
    max-height: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-content: start !important;
    gap: 9px !important;
    overflow-y: auto !important;
    padding: 2px 4px 6px 0 !important;
  }

  .rules-panel:not(.active) {
    display: none !important;
  }

  .rule-card,
  .rule-card.wide {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 12px !important;
  }

  .rule-card.wide {
    grid-column: span 2 !important;
  }

  .rule-card strong {
    font-size: clamp(13px, 1.45vw, 17px) !important;
    line-height: 1.15 !important;
  }

  .rule-card p,
  .rule-card li {
    font-size: clamp(11px, 1.2vw, 14px) !important;
    line-height: 1.28 !important;
    overflow-wrap: anywhere !important;
  }
}

/* iPhone table bottom polish: keep the user's played card and won pile lower. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-user {
    bottom: 18px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 8px !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 8px !important;
    transform: translateX(-50%) scale(0.58) !important;
  }
}

/* Absolute last layout correction for compact tables. This must stay at EOF. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-partner {
    top: 48px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: 6px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.9) !important;
  }

  body.game-active .trick-stack.stack-partner {
    left: calc(50% + 78px) !important;
    right: auto !important;
    top: 22px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 8px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 8px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    left: calc(50% + 78px) !important;
    right: auto !important;
    top: 22px !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: 8px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    right: 8px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body[data-declarer="partner"] .player-top::after,
  body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
  body[data-trick-winner="partner"] .player-top::after {
    right: calc(100% + 5px) !important;
  }
}

/* Absolute last event-bar and pot-review correction. */
body.game-active .game-events {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto) minmax(96px, 0.42fr) !important;
  align-items: stretch !important;
  gap: 6px !important;
}

body.game-active .game-events .message {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
}

body.game-active .game-events .trick-points {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  min-width: 72px !important;
  text-align: center !important;
}

body.game-active .game-events .roem-burst,
body.game-active .game-events .roem-board,
body.game-active .game-events .nat-burst {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  min-width: 0 !important;
  max-width: none !important;
}

body.game-active .game-events .roem-burst,
body.game-active .game-events .roem-board {
  padding: 6px 8px !important;
  border-radius: 8px !important;
}

body.game-active .game-events .roem-burst {
  animation: none !important;
}

body.game-active .game-events .roem-burst strong,
body.game-active .game-events .roem-board strong {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.05 !important;
}

body.game-active .game-events .roem-burst span,
body.game-active .game-events .roem-board p {
  margin-top: 2px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 9px !important;
  line-height: 1.05 !important;
}

@media (max-width: 430px) {
  body.game-active .game-events {
    grid-template-columns: minmax(0, 1fr) 58px 86px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    gap: 4px !important;
  }

  body.game-active .game-events .message {
    font-size: 11px !important;
    line-height: 1.15 !important;
  }

  body.game-active .game-events .trick-points {
    min-width: 58px !important;
    padding: 5px 6px !important;
  }
}

/* Final card and won-pile placement: lower the play line and park side piles under avatars. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-partner {
    top: 70px !important;
  }

  body.game-active .played-card.seat-left {
    top: 56% !important;
    left: 2px !important;
  }

  body.game-active .played-card.seat-right {
    top: 56% !important;
    right: 2px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: -18px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -24px !important;
    transform: translateX(-50%) scale(0.86) !important;
  }

  body.game-active .trick-stack.stack-left {
    left: -18px !important;
    right: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    right: -18px !important;
    left: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -24px !important;
    transform: translateX(-50%) scale(0.54) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: -18px !important;
    right: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: scale(0.54) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    right: -18px !important;
    left: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: scale(0.54) !important;
  }
}

/* Absolute last event-bar and pot-review correction. */
body.game-active .game-events {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto) minmax(96px, 0.42fr) !important;
  align-items: stretch !important;
  gap: 6px !important;
}

body.game-active .game-events .message {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
}

body.game-active .game-events .trick-points {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  min-width: 72px !important;
  text-align: center !important;
}

body.game-active .game-events .roem-burst,
body.game-active .game-events .roem-board,
body.game-active .game-events .nat-burst {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  min-width: 0 !important;
  max-width: none !important;
}

body.game-active .game-events .roem-burst,
body.game-active .game-events .roem-board {
  padding: 6px 8px !important;
  border-radius: 8px !important;
}

body.game-active .game-events .roem-burst {
  animation: none !important;
}

body.game-active .game-events .roem-burst strong,
body.game-active .game-events .roem-board strong {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.05 !important;
}

body.game-active .game-events .roem-burst span,
body.game-active .game-events .roem-board p {
  margin-top: 2px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 9px !important;
  line-height: 1.05 !important;
}

@media (max-width: 430px) {
  body.game-active .game-events {
    grid-template-columns: minmax(0, 1fr) 58px 86px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    gap: 4px !important;
  }

  body.game-active .game-events .message {
    font-size: 11px !important;
    line-height: 1.15 !important;
  }

  body.game-active .game-events .trick-points {
    min-width: 58px !important;
    padding: 5px 6px !important;
  }
}

/* Final score board organization. */
.score-board {
  grid-template-columns: minmax(104px, 0.8fr) minmax(118px, 0.9fr) minmax(126px, 1fr) minmax(240px, auto) !important;
}

.score-card {
  min-width: 0;
}

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

.score-card-wide strong {
  font-variant-numeric: tabular-nums;
}

.score-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(78px, auto));
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.score-actions button {
  white-space: nowrap;
}

@media (max-width: 760px) {
  body.game-active .score-board {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(34px, auto);
    gap: 5px !important;
  }

  body.game-active .score-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.game-active .score-board > div,
  body.game-active .score-actions button {
    min-height: 34px !important;
    padding: 5px 7px !important;
  }

  body.game-active .score-board span {
    display: block !important;
    font-size: 9px !important;
    line-height: 1.05 !important;
  }

  body.game-active .score-board strong {
    margin-top: 2px !important;
    font-size: 12px !important;
    line-height: 1.05 !important;
  }

  body.game-active .score-actions button {
    font-size: 11px !important;
  }
}

/* Stable event bar: reserve fixed slots so messages do not jump when points or roem appear. */
.game-events {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto) minmax(96px, 0.42fr);
  align-items: stretch;
  gap: 6px;
}

.game-events .message {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.game-events .trick-points {
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
  min-width: 72px;
  text-align: center;
}

.game-events .roem-burst,
.game-events .roem-board,
.game-events .nat-burst {
  grid-column: 3;
  grid-row: 1;
  justify-self: stretch;
  min-width: 0;
}

.game-events .roem-burst {
  padding: 6px 8px;
  min-height: 0;
  border-radius: 8px;
  animation: none;
}

.game-events .roem-burst strong {
  font-size: 15px;
  line-height: 1.05;
}

.game-events .roem-burst span {
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.05;
}

.game-events .roem-board {
  padding: 6px 8px;
}

.game-events .roem-board strong {
  margin: 0;
  font-size: 14px;
  line-height: 1.05;
}

.game-events .roem-board p {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pot-review-list {
  width: 100%;
  display: grid;
  gap: 8px;
  max-height: min(58vh, 520px);
  overflow: auto;
}

.pot-review-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
  gap: 4px 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.pot-review-row div {
  grid-row: span 2;
}

.pot-review-row span,
.pot-review-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.pot-review-row strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
}

.pot-review-row p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

@media (max-width: 430px) {
  body.game-active .game-events {
    grid-template-columns: minmax(0, 1fr) 58px 86px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    gap: 4px !important;
  }

  body.game-active .game-events .message {
    font-size: 11px !important;
    line-height: 1.15 !important;
  }

  body.game-active .game-events .trick-points {
    min-width: 58px !important;
    padding: 5px 6px !important;
  }

  body.game-active .game-events .trick-points strong,
  body.game-active .game-events .roem-burst strong,
  body.game-active .game-events .roem-board strong {
    font-size: 13px !important;
  }

  body.game-active .game-events .trick-points span,
  body.game-active .game-events .roem-burst span,
  body.game-active .game-events .roem-board p {
    font-size: 9px !important;
    line-height: 1.05 !important;
  }

  .pot-review-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pot-review-row div {
    grid-row: auto;
  }
}

/* Absolute last layout correction for compact tables. This must stay at EOF. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-partner {
    top: 48px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: 6px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.9) !important;
  }

  body.game-active .trick-stack.stack-partner {
    left: calc(50% + 78px) !important;
    right: auto !important;
    top: 22px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 8px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 8px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    left: calc(50% + 78px) !important;
    right: auto !important;
    top: 22px !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: 8px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    right: 8px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body[data-declarer="partner"] .player-top::after,
  body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
  body[data-trick-winner="partner"] .player-top::after {
    right: calc(100% + 5px) !important;
  }
}

/* Final table organization pass: keep won piles near players and leave the center clear. */
.score-board {
  grid-template-columns: minmax(104px, 0.8fr) minmax(118px, 0.9fr) minmax(126px, 1fr) minmax(240px, auto);
}

.score-card {
  min-width: 0;
}

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

.score-card-wide strong {
  font-variant-numeric: tabular-nums;
}

.score-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, auto));
  gap: 6px;
  align-items: stretch;
}

.score-actions button {
  white-space: nowrap;
}

body[data-declarer="partner"] .player-top::after,
body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
body[data-trick-winner="partner"] .player-top::after {
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  transform: translateY(-50%);
  white-space: nowrap;
}

.played-card.seat-partner {
  top: 62px;
}

.trick-stack.stack-user {
  bottom: -4px;
}

.trick-stack.stack-partner {
  left: calc(50% + 58px);
  top: 28px;
}

.trick-stack.stack-left {
  left: 12px;
  top: calc(50% + 66px);
}

.trick-stack.stack-right {
  right: 12px;
  top: calc(50% + 66px);
}

.trick-area.collecting.winner-user .played-card {
  bottom: -4px;
}

.trick-area.collecting.winner-partner .played-card {
  left: calc(50% + 58px);
  top: 28px;
}

.trick-area.collecting.winner-left .played-card {
  left: 12px;
  top: calc(50% + 66px);
}

.trick-area.collecting.winner-right .played-card {
  right: 12px;
  top: calc(50% + 66px);
}

@media (max-width: 760px) {
  body.game-active .score-board {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(34px, auto);
    gap: 5px !important;
  }

  body.game-active .score-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.game-active .score-board > div,
  body.game-active .score-actions button {
    min-height: 34px !important;
    padding: 5px 7px !important;
  }

  body.game-active .score-board span {
    display: block !important;
    font-size: 9px !important;
    line-height: 1.05 !important;
  }

  body.game-active .score-board strong {
    margin-top: 2px !important;
    font-size: 12px !important;
    line-height: 1.05 !important;
  }

  body.game-active .score-actions button {
    font-size: 11px !important;
  }
}

@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-partner {
    top: 48px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: 6px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.9) !important;
  }

  body.game-active .trick-stack.stack-partner {
    left: calc(50% + 54px) !important;
    right: auto !important;
    top: 34px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 10px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 10px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    left: calc(50% + 54px) !important;
    right: auto !important;
    top: 34px !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: 10px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    right: 10px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body[data-declarer="partner"] .player-top::after,
  body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
  body[data-trick-winner="partner"] .player-top::after {
    right: calc(100% + 5px);
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body.game-active .score-board {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.game-active .score-actions {
    grid-column: 1 / -1;
  }

  body.game-active .played-card.seat-partner {
    top: 48px !important;
  }

  body.game-active .trick-stack.stack-partner {
    left: calc(50% + 52px) !important;
    top: 28px !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 12px !important;
    top: calc(50% + 58px) !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 12px !important;
    top: calc(50% + 58px) !important;
  }
}

* {
  box-sizing: border-box;
}

@property --menu-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 170, 69, 0.14), transparent 30%),
    linear-gradient(135deg, #0f140f, #161b16 50%, #111411);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.game-active {
  height: 100dvh;
  overflow: hidden;
}

button {
  font: inherit;
}

.start-menu {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 38%, rgba(9, 87, 124, 0.48), transparent 34%),
    radial-gradient(circle at 17% 52%, rgba(14, 58, 105, 0.58), transparent 28%),
    linear-gradient(rgba(2, 13, 18, 0.38), rgba(2, 12, 18, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(255,255,255,0.024) 54px 55px),
    linear-gradient(135deg, #031219, #062434 48%, #020b10);
}

.start-menu[hidden],
.app-shell[hidden] {
  display: none;
}

.start-menu-stage {
  position: relative;
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding: 22px 22px 26px;
  border: 1px solid rgba(217, 170, 69, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(7, 32, 45, 0.18), rgba(5, 24, 34, 0.95) 42%, rgba(4, 18, 27, 0.98)),
    radial-gradient(circle at 50% 20%, rgba(11, 91, 132, 0.34), transparent 42%);
  box-shadow:
    0 0 0 1px rgba(255, 235, 166, 0.16),
    0 0 28px rgba(217, 170, 69, 0.24),
    0 0 64px rgba(217, 170, 69, 0.12),
    0 34px 90px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  isolation: isolate;
}

.start-menu-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  z-index: -1;
  border-radius: 14px;
  border: 1px solid rgba(217, 170, 69, 0.13);
  pointer-events: none;
}

.home-sound-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 235, 166, 0.62);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 242, 183, 0.92), rgba(207, 153, 48, 0.92));
  color: #211707;
  box-shadow: 0 0 12px rgba(217, 170, 69, 0.24), 0 6px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  cursor: pointer;
}

.home-sound-button::before {
  content: "";
  width: 15px;
  height: 16px;
  clip-path: polygon(0 36%, 32% 36%, 72% 8%, 72% 92%, 32% 64%, 0 64%);
  background: currentColor;
}

.home-sound-button::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  right: 7px;
  border: 2px solid currentColor;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 9px 0 0;
  transform: rotate(45deg);
}

.home-sound-button .sound-icon {
  display: none;
}

.home-sound-button.muted {
  filter: saturate(0.55);
  opacity: 0.84;
}

.home-sound-button.muted::after {
  width: 23px;
  height: 2px;
  right: 5px;
  top: 16px;
  border: 0;
  border-radius: 999px;
  background: #6f1d1d;
  transform: rotate(-42deg);
}

.brand-showcase {
  position: relative;
  z-index: 3;
  min-width: 0;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0;
  text-align: center;
  isolation: isolate;
}

.brand-showcase::before {
  content: "";
  position: absolute;
  inset: 10% 8% 4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 170, 69, 0.18), rgba(12, 89, 132, 0.22) 44%, transparent 72%);
  filter: blur(18px);
}

.brand-showcase img {
  display: block;
  width: min(74vw, 440px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: -112px;
  filter: drop-shadow(0 30px 34px rgba(0, 0, 0, 0.44));
}

.brand-showcase p {
  display: none;
  color: #eee4cf;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.start-menu-panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 112px 22px 22px;
  display: grid;
  gap: 14px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(5, 30, 43, 0.7), rgba(5, 24, 34, 0.98) 28%, rgba(6, 36, 52, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(217, 170, 69, 0.16), transparent 34%);
  border: 1px solid rgba(217, 170, 69, 0.34);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.start-menu-panel::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 19px;
  padding: 3px;
  pointer-events: none;
  background:
    conic-gradient(from var(--menu-border-angle, 0deg),
      rgba(217, 170, 69, 0.28),
      rgba(255, 235, 166, 0.95),
      rgba(217, 170, 69, 0.34),
      rgba(11, 91, 132, 0.28),
      rgba(217, 170, 69, 0.28));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: menuGoldenBorder 5.5s linear infinite;
}

.start-menu-panel::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 239, 190, 0.12);
  pointer-events: none;
}

.start-heading {
  display: grid;
  gap: 5px;
}

.start-heading > p:last-child {
  color: var(--muted);
}

.menu-field {
  display: grid;
  gap: 6px;
}

.menu-field span,
.menu-group legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.menu-field input {
  min-height: 48px;
  width: 100%;
  border: 1px solid rgba(86, 156, 201, 0.28);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(3, 20, 30, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
}

.avatar-upload-field {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.avatar-upload-field::after {
  content: "Kies foto";
  padding: 7px 10px;
  border: 1px solid rgba(217, 170, 69, 0.38);
  border-radius: 8px;
  background: rgba(217, 170, 69, 0.12);
  color: #ffe7ac;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.avatar-upload-field input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.avatar-upload-field strong,
.avatar-upload-field small {
  display: block;
}

.avatar-upload-field small {
  color: var(--muted);
  font-size: 12px;
}

.avatar-preview,
.online-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efe4cc center / cover no-repeat;
  color: #26301f;
  font-weight: 900;
  border: 2px solid rgba(217, 170, 69, 0.45);
  overflow: hidden;
}

.online-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-group {
  min-width: 0;
  margin: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.menu-group:first-of-type {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.menu-group legend {
  padding: 0 6px;
}

.start-menu-panel .variant-group legend,
.start-menu-panel .level-group legend {
  grid-column: 1 / -1;
}

/* Home section labels: keep fieldset titles inside their panels like Speler and Competitie. */
.start-menu-panel .menu-group {
  align-content: start;
}

.start-menu-panel .menu-group legend {
  float: left;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.start-menu-panel .menu-group legend + .menu-choice {
  clear: both;
}

.start-menu-panel .variant-group,
.start-menu-panel .level-group {
  align-items: stretch;
}

.start-menu-panel .variant-group .menu-choice,
.start-menu-panel .level-group .menu-choice {
  width: 100%;
  min-width: 0;
}

.menu-choice {
  min-width: 0;
  position: relative;
  display: block;
}

.menu-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.menu-choice > span {
  height: 100%;
  min-height: 66px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(86, 156, 201, 0.22);
  border-radius: 8px;
  background: rgba(4, 28, 40, 0.82);
  cursor: pointer;
}

.menu-choice input:checked + span {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
  background: linear-gradient(145deg, rgba(17, 65, 83, 0.94), rgba(75, 57, 22, 0.62));
}

.menu-choice strong {
  color: var(--text);
  font-size: 15px;
}

.menu-choice small {
  color: var(--muted);
  line-height: 1.3;
}

.info-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(86, 156, 201, 0.28);
  border-radius: 8px;
  background: rgba(3, 22, 33, 0.5);
  color: var(--text);
  cursor: pointer;
}

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

.home-action-card {
  min-width: 0;
  min-height: 82px;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(86, 156, 201, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(4, 31, 44, 0.9), rgba(4, 21, 31, 0.8));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.home-action-card.primary {
  border-color: rgba(217, 170, 69, 0.5);
  background:
    linear-gradient(145deg, rgba(21, 76, 96, 0.95), rgba(93, 70, 24, 0.82));
  box-shadow: inset 0 0 0 1px rgba(217, 170, 69, 0.22), 0 0 22px rgba(217, 170, 69, 0.12);
}

.home-action-card:hover,
.home-action-card:focus-visible {
  border-color: rgba(217, 170, 69, 0.72);
  transform: translateY(-1px);
}

.home-action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(217, 170, 69, 0.16);
  color: #ffe6a4;
  font-weight: 900;
}

.home-action-icon svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(217, 170, 69, 0.22));
}

.home-action-card.primary .home-action-icon {
  background: rgba(255, 230, 164, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 230, 164, 0.22), 0 0 18px rgba(217, 170, 69, 0.18);
}

.home-action-card.primary .home-action-icon svg {
  fill: rgba(255, 230, 164, 0.14);
}

.home-action-card strong,
.home-action-card small {
  display: block;
}

.home-action-card strong {
  font-size: 15px;
}

.home-action-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.online-entry {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(217, 170, 69, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 54, 82, 0.74), rgba(5, 25, 38, 0.7));
}

.competition-entry {
  position: relative;
  overflow: hidden;
}

.competition-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 64% 28%, rgba(217, 170, 69, 0.2), transparent 28%),
    linear-gradient(90deg, transparent, rgba(217, 170, 69, 0.06));
}

.competition-copy,
.home-highscore,
.online-entry-actions {
  position: relative;
  z-index: 1;
}

.competition-copy {
  min-width: 0;
}

.competition-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.home-highscore {
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 230, 164, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(5, 23, 32, 0.72), rgba(89, 65, 19, 0.44));
  box-shadow: inset 0 0 0 1px rgba(217, 170, 69, 0.12), 0 0 24px rgba(217, 170, 69, 0.08);
}

.home-highscore {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "trophy label"
    "trophy name"
    "trophy score";
  align-items: center;
  column-gap: 10px;
}

.home-highscore .home-trophy {
  grid-area: trophy;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 230, 164, 0.62);
  background:
    radial-gradient(circle at 36% 24%, rgba(255, 246, 188, 0.9), transparent 32%),
    linear-gradient(145deg, #f2c45c, #9a6817);
  box-shadow: 0 0 14px rgba(217, 170, 69, 0.28);
}

.home-highscore .home-trophy svg {
  width: 21px;
  height: 21px;
  fill: #211505;
}

.home-highscore .winner-label,
.home-highscore small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-highscore .winner-label {
  grid-area: label;
  color: var(--gold);
}

.home-highscore strong {
  grid-area: name;
  display: block;
  margin: 3px 0;
  color: #ffe6a4;
  font-size: 15px;
  line-height: 1.2;
}

.home-highscore small {
  grid-area: score;
}

/* Competition winner v1: make the first competition bar a compact trophy winner strip. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .home-highscore {
    grid-template-columns: 28px minmax(0, 1fr) !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 3px 7px !important;
    column-gap: 7px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 26px !important;
    height: 26px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy svg {
    width: 16px !important;
    height: 16px !important;
  }

  body:not(.game-active) .home-highscore .winner-label,
  body:not(.game-active) .home-highscore small {
    font-size: 8px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-highscore strong {
    margin: 1px 0 !important;
    font-size: clamp(11px, 3vw, 13px) !important;
    line-height: 1.05 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

.online-entry strong,
.online-kicker {
  display: block;
}

.online-kicker {
  margin-bottom: 3px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.online-entry-actions {
  width: min(180px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.online-entry-actions .info-button {
  position: relative;
  min-width: 0;
  width: 100%;
  padding-inline: 8px;
  white-space: nowrap;
}

.online-entry-actions .info-button.premium-locked {
  padding-right: 76px;
  border-color: rgba(217, 170, 69, 0.48);
  background:
    linear-gradient(145deg, rgba(8, 33, 47, 0.92), rgba(55, 42, 18, 0.72));
  box-shadow: inset 0 0 0 1px rgba(217, 170, 69, 0.14);
}

.online-entry-actions .info-button.premium-locked::after {
  content: "Premium";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(217, 170, 69, 0.95);
  color: #1d1607;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.online-dialog {
  width: min(980px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
}

.online-profile,
.online-match-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.online-match-head {
  grid-template-columns: repeat(4, 1fr);
}

.online-profile > div,
.online-match-head > div {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.online-profile > .online-profile-player {
  display: flex;
  align-items: center;
  gap: 10px;
}

.online-profile span,
.online-match-head span,
.online-card > span,
.daily-hero > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.online-profile strong,
.online-match-head strong {
  display: block;
  margin-top: 3px;
}

.online-grid,
.ranking-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.online-card,
.daily-hero,
.ranking-columns > section {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--panel-strong);
}

.online-card h2,
.daily-hero h2,
.ranking-columns h2 {
  margin: 5px 0 8px;
}

.online-card p,
.daily-hero p,
.online-status {
  color: var(--muted);
  line-height: 1.4;
}

.daily-hero-upgraded {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  gap: 14px;
  align-items: stretch;
  border-color: rgba(217, 170, 69, 0.36);
  background:
    radial-gradient(circle at 15% 12%, rgba(217, 170, 69, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(13, 54, 82, 0.74), rgba(5, 25, 38, 0.9));
}

.daily-hero-copy {
  display: grid;
  align-content: center;
  gap: 6px;
}

.daily-hero-copy h2 {
  margin: 0;
  font-size: 26px;
}

.daily-hero-stats {
  display: grid;
  gap: 8px;
}

.daily-hero-stats > div {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.daily-hero-stats span,
.daily-board-title {
  color: var(--muted);
}

.daily-hero-stats span {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.daily-hero-stats strong {
  display: block;
  margin-top: 3px;
}

.daily-board-title {
  margin: 14px 0 8px;
  font-size: 16px;
}

.daily-challenge-banner {
  border-color: rgba(217, 170, 69, 0.88);
  box-shadow: 0 0 0 1px rgba(217, 170, 69, 0.22), 0 16px 40px var(--shadow);
}

body.daily-challenge-active .top-bar,
body.daily-challenge-active .score-board {
  border-color: rgba(217, 170, 69, 0.28);
}

.online-card label {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.online-card select,
.online-card input,
.lobby-actions input {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.lobby-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
}

.lobby-players,
.online-seats {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.table-queue-meter {
  display: grid;
  gap: 2px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid rgba(217, 170, 69, 0.3);
  border-radius: 8px;
  background: rgba(217, 170, 69, 0.12);
}

.table-queue-meter strong {
  color: #ffe6a4;
  font-size: 24px;
}

.table-queue-meter span {
  color: var(--muted);
}

.table-seat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 12px;
}

.table-seat-list > div {
  padding: 8px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.table-seat-list > div.occupied {
  border-style: solid;
  border-color: rgba(217, 170, 69, 0.36);
  background: rgba(32, 71, 52, 0.5);
}

.table-seat-list strong,
.table-seat-list span {
  display: block;
}

.table-seat-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.fill-ai-button {
  width: 100%;
  margin-top: 6px;
}

.fill-ai-button:disabled {
  opacity: 0.55;
}

.lobby-players > div,
.online-seats span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.online-trick {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--table-dark);
}

.online-trick > div {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.online-trick > div strong {
  min-width: 58px;
  min-height: 78px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--card);
  color: var(--black);
  font-size: 24px;
}

.online-actions,
.online-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.online-actions button,
.online-hand button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.online-actions button {
  min-height: 42px;
  padding: 0 16px;
  background: var(--gold);
  color: #1d1607;
  font-weight: 900;
}

.online-hand button {
  width: 72px;
  height: 102px;
  padding: 8px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  background: var(--card);
  color: var(--black);
  font-size: 18px;
  font-weight: 900;
}

.online-hand button strong {
  justify-self: center;
  font-size: 36px;
}

.online-hand button .red {
  color: var(--red);
}

.online-hand button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.online-status {
  margin-top: 12px;
}

.online-error {
  padding: 10px;
  border-radius: 8px;
  background: rgba(110, 24, 24, 0.55);
  color: #ffd6d6;
}

.online-action-alert {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.online-action-alert-card {
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: linear-gradient(145deg, #123d2a, #071c13);
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

.online-action-alert-card > span {
  color: #4ade80;
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.online-action-alert-card h2 {
  color: #fff;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
}

.online-action-alert-card p {
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.55;
}

.online-action-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.online-action-alert-actions button {
  flex: 1 1 150px;
}

.leaderboard-table {
  display: grid;
  gap: 4px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 36px 1fr 80px 96px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.14);
  font-size: 13px;
}

.leaderboard-row.header {
  color: var(--muted);
  font-weight: 800;
}

.premium-hero {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(217, 170, 69, 0.34);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 170, 69, 0.18), transparent 42%),
    rgba(16, 25, 18, 0.86);
}

.premium-hero span,
.account-form > span,
.verify-card > span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.premium-hero h2 {
  margin-top: 4px;
}

.premium-hero p,
.account-form small,
.premium-feature-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-grid,
.premium-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.account-form {
  display: grid;
  gap: 9px;
}

.account-text-button {
  justify-self: start;
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: #65e49b;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.account-text-button:focus-visible {
  outline: 2px solid #65e49b;
  outline-offset: 4px;
  border-radius: 2px;
}

.account-form input,
.verify-card input {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 0 11px;
  background: rgba(8, 14, 10, 0.78);
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.social-login-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.premium-feature-grid div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.premium-feature-grid strong {
  display: block;
}

.verify-card[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .account-grid,
  .premium-feature-grid {
    grid-template-columns: 1fr;
  }
}

.start-game-button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #1d1607;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(217, 170, 69, 0.22);
}

.social-shell { display: grid; gap: 14px; }
.daily-variant-card .start-game-button { position: relative; z-index: 2; pointer-events: auto; touch-action: manipulation; }
@media (max-width: 900px) {
  #onlineModal:not([hidden]), #infoModal:not([hidden]), #settingsModal:not([hidden]) { pointer-events: none; }
  #onlineModal:not([hidden]) .online-dialog,
  #infoModal:not([hidden]) .info-dialog,
  #settingsModal:not([hidden]) .settings-dialog { pointer-events: auto; }
}
.social-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 12px; background: rgba(0, 0, 0, .28); }
.social-tabs button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 900; cursor: pointer; }
.social-tabs button.active { background: rgba(30, 190, 99, .2); color: #65e49b; box-shadow: inset 0 0 0 1px rgba(101, 228, 155, .3); }
.social-tabs b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 20px; background: #ee4545; color: #fff; font-size: 11px; }
.social-search { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.social-search input, .social-chat-form input, .account-form select { min-height: 44px; width: 100%; border: 1px solid rgba(255,255,255,.15); border-radius: 9px; padding: 0 12px; background: rgba(8,14,10,.86); color: var(--text); font: inherit; }
.social-list { display: grid; gap: 8px; }
.social-player-card, .social-search-result, .social-invite-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 12px; border: 1px solid rgba(255,255,255,.11); border-radius: 13px; background: rgba(255,255,255,.05); }
.social-invite-card { grid-template-columns: 1fr; }
.social-invite-card > div { display: flex; gap: 8px; flex-wrap: wrap; }
.social-avatar { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 50%; background: #177f48; color: #fff; font-size: 20px; font-weight: 900; }
.social-avatar img { width: 100%; height: 100%; object-fit: cover; }
.social-player-copy { display: grid; gap: 2px; min-width: 0; }
.social-player-copy span, .social-search-result small, .social-invite-card small { color: var(--muted); }
.presence { font-size: 12px; font-weight: 800; }.presence.online { color: #52dc8e; }.presence.playing { color: #ff9b42; }.presence.away { color: #f0cf55; }.presence.offline { color: #969d99; }
.social-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.social-request-pending { justify-self: end; padding: 7px 11px; border: 1px solid rgba(217,170,69,.55); border-radius: 999px; color: var(--gold); background: rgba(217,170,69,.1); font-size: 12px; white-space: nowrap; }
.start-game-button.compact, .social-card-actions .info-button, .social-invite-card .info-button { min-height: 38px; padding: 7px 11px; font-size: 13px; }
.social-more { border: 0; padding: 7px; background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
.social-empty { padding: 18px; color: var(--muted); text-align: center; }
.social-search-result > span { display: grid; gap: 3px; }
.social-message-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; width: 100%; padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.05); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.social-chat { display: grid; gap: 12px; }.social-chat-head { display: flex; justify-content: space-between; align-items: center; }.social-chat-messages { display: grid; gap: 7px; max-height: min(48vh, 430px); overflow: auto; padding: 4px; }.social-chat-messages p { display: grid; gap: 2px; max-width: 82%; margin: 0; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.08); }.social-chat-messages p.own { justify-self: end; background: rgba(30,190,99,.2); }.social-chat-messages p.friend { justify-self: start; }.social-chat-messages strong { font-size: 11px; color: #65e49b; }.social-chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.social-profile-actions, .social-settings { display: grid; gap: 9px; }.social-settings label, .social-check { display: flex; gap: 9px; align-items: center; min-height: 38px; }.social-settings input, .social-check input { width: 20px; height: 20px; }.info-button.danger { color: #ff9999; border-color: rgba(255,80,80,.35); }
.social-toast { position: fixed; z-index: 10000; right: 18px; bottom: 94px; display: grid; gap: 4px; width: min(360px, calc(100vw - 36px)); padding: 15px; border: 1px solid rgba(101,228,155,.4); border-radius: 14px; background: #09291a; color: #fff; box-shadow: 0 18px 48px rgba(0,0,0,.45); font: inherit; text-align: left; cursor: pointer; }
@media (max-width: 700px) { .social-player-card { grid-template-columns: auto 1fr; }.social-card-actions { grid-column: 1 / -1; justify-content: stretch; }.social-card-actions button { flex: 1; }.social-search-result { grid-template-columns: 1fr; }.social-tabs button { font-size: 12px; }.social-tabs b { display: none; } }

.menu-error {
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(110, 24, 24, 0.55);
  color: #ffd6d6;
  font-weight: 800;
}

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

.app-shell {
  width: min(1180px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 0.3fr) minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
}

.top-bar,
.score-board,
.setup-panel,
.bid-panel,
.hand-panel,
.table-chat {
  background: rgba(30, 38, 31, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 16px 40px var(--shadow);
}

.top-bar {
  grid-column: 1 / -1;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.variant-banner {
  position: relative;
  grid-column: 1;
  min-height: 76px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-position: center 58%;
  background-size: cover;
  box-shadow: 0 16px 40px var(--shadow);
  isolation: isolate;
}

.variant-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(9, 17, 14, 0.94) 0%, rgba(9, 17, 14, 0.7) 48%, rgba(9, 17, 14, 0.15) 100%);
}

.variant-banner.variant-amsterdam {
  background-image: url("./assets/amsterdam-canals.png");
  border-color: rgba(217, 170, 69, 0.55);
}

.variant-banner.variant-rotterdam {
  background-image: url("./assets/rotterdam-harbor.png");
  border-color: rgba(63, 164, 214, 0.62);
}

.variant-banner.online-match-banner {
  background-image: none;
  background-color: #184a3d;
  border-color: rgba(87, 214, 157, 0.42);
}

.variant-banner.demo-match-banner {
  background-image: none;
  background-color: #263f64;
  border-color: rgba(135, 190, 255, 0.45);
}

.variant-banner-content {
  max-width: 620px;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
}

.variant-banner-content span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.variant-banner-content strong {
  display: block;
  margin-top: 4px;
  color: #fffdf6;
  font-size: 20px;
}

.variant-banner-content p {
  margin-top: 5px;
  color: #eee6d7;
  font-size: 12px;
}

.variant-city-mark {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 6px;
  background: rgba(8, 18, 18, 0.62);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.62);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
}

h2 {
  font-size: 18px;
}

.status-grid,
.score-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}

.status-pill,
.score-board > div {
  padding: 7px 10px;
  background: var(--panel-strong);
  border-radius: 8px;
}

.trump-status {
  position: relative;
  overflow: hidden;
  min-height: 74px;
  border: 1px solid rgba(217, 170, 69, 0.24);
  background:
    radial-gradient(circle at 82% 50%, rgba(217, 170, 69, 0.18), transparent 44%),
    var(--panel-strong);
}

.trump-status-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.trump-status-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(145deg, #fffdf6, #e8dcc2);
  border: 2px solid rgba(217, 170, 69, 0.72);
  color: #1f1f1f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transform: rotate(3deg);
}

.trump-status-icon.red {
  color: var(--red);
}

.trump-status-icon.black {
  color: #151515;
}

.trump-status-icon.proposed {
  opacity: 0.72;
  filter: saturate(0.75);
}

.status-pill span,
.score-board span,
.setup-panel span,
.bid-panel span,
.roem-board span,
.signal-board span,
.player small,
.hand-heading p {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.status-pill strong,
.score-board strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.score-board {
  grid-column: 2;
  padding: 8px;
  grid-template-columns: minmax(104px, 0.8fr) minmax(118px, 0.9fr) minmax(126px, 1fr) minmax(240px, auto);
  align-items: center;
}

#newGameButton,
#nextGameButton,
#lastTrickButton {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #1d1607;
  background: var(--gold);
  font-weight: 800;
  cursor: pointer;
}

#lastTrickButton {
  background: #efe4cc;
  color: #26301f;
}

#nextGameButton {
  background: #e2c16f;
  color: #1d1607;
}

#nextGameButton[hidden] {
  display: none;
}

#lastTrickButton:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bid-panel {
  grid-column: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

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

.bid-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.bid-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.bid-panel.pot-history-panel {
  overflow: hidden;
}

.bid-panel.pot-history-panel .bid-actions {
  min-height: 0;
  overflow: hidden;
}

.pot-history-list {
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.pot-history-row {
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.bid-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  gap: 8px;
}

.bid-popup {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}

.bid-popup[hidden] {
  display: none;
}

.bid-popup-dialog {
  width: min(420px, calc(100vw - 30px));
  padding: 16px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 230, 164, 0.48);
  border-radius: 12px;
  background:
    radial-gradient(circle at 84% 16%, rgba(217, 170, 69, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(18, 31, 30, 0.98), rgba(6, 22, 32, 0.98));
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: auto;
}

.bid-popup-dialog > span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.bid-popup-dialog > strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.18;
}

.bid-popup-dialog > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.bid-popup .bid-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bid-popup .bid-actions:has(.bid-button:nth-child(3)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setup-panel {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-color: rgba(217, 170, 69, 0.32);
}

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

.setup-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.setup-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.name-field {
  min-width: 210px;
  display: grid;
  gap: 5px;
}

.name-field input {
  min-height: 44px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.setup-button,
.bid-button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #1d1607;
  font-weight: 900;
  cursor: pointer;
}

.bid-button {
  flex: 1 1 92px;
}

.setup-button.secondary,
.bid-button.secondary {
  background: #efe4cc;
  color: #26301f;
}

.setup-button.red,
.bid-button.red {
  background: #f1d8d2;
  color: #8b1f1f;
}

.setup-button:disabled,
.bid-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.table {
  position: relative;
  grid-column: 2;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,255,255,0.025) 46px 47px),
    radial-gradient(circle, var(--table) 0%, var(--table-dark) 78%);
  border: 10px solid #5b3922;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08), 0 18px 48px var(--shadow);
}

.table::after {
  content: "";
  position: absolute;
  inset: 42px;
  border: 1px solid var(--felt-line);
  border-radius: 50%;
  pointer-events: none;
}

body[data-table-style="poker-red"] .table {
  background:
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(255,255,255,0.03) 42px 43px),
    radial-gradient(circle, #8d202a 0%, #5c1019 76%);
  border-color: #382018;
}

body[data-table-style="poker-red"] .table::after {
  border-color: rgba(255, 214, 168, 0.2);
}

body[data-table-style="sixties"] .table {
  background:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25% 75%, rgba(255,255,255,0.08) 75%),
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25% 75%, rgba(255,255,255,0.08) 75%),
    radial-gradient(circle, #d6a24a 0%, #9b5f28 78%);
  background-position: 0 0, 24px 24px, center;
  background-size: 48px 48px, 48px 48px, auto;
  border-color: #4c2f1a;
}

body[data-table-style="sixties"] .table::after {
  border-color: rgba(54, 32, 16, 0.25);
}

body[data-table-style="royal-blue"] .table {
  background:
    repeating-linear-gradient(120deg, transparent 0 34px, rgba(255,255,255,0.028) 34px 35px),
    radial-gradient(circle, #0d5a82 0%, #07324a 78%);
  border-color: #c89436;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08), 0 18px 48px var(--shadow), inset 0 0 42px rgba(217, 170, 69, 0.12);
}

body[data-table-style="royal-blue"] .table::after {
  border-color: rgba(217, 170, 69, 0.32);
}

body[data-table-style="amsterdam-cloth"] .table {
  background:
    radial-gradient(circle at center, rgba(246, 219, 174, 0.32), rgba(35, 18, 12, 0.5) 82%),
    linear-gradient(rgba(70, 40, 24, 0.34), rgba(70, 40, 24, 0.34)),
    url("./assets/tafelkleed-amsterdam.png") center / cover no-repeat;
  border-color: rgba(156, 35, 25, 0.72);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08), 0 18px 48px var(--shadow), inset 0 0 46px rgba(98, 24, 18, 0.16);
}

body[data-table-style="rotterdam-cloth"] .table {
  background:
    radial-gradient(circle at center, rgba(236, 210, 166, 0.34), rgba(11, 19, 22, 0.52) 82%),
    linear-gradient(rgba(44, 34, 22, 0.34), rgba(44, 34, 22, 0.34)),
    url("./assets/tafelkleed-rotterdam.png") center / cover no-repeat;
  border-color: rgba(21, 34, 44, 0.72);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08), 0 18px 48px var(--shadow), inset 0 0 46px rgba(14, 24, 29, 0.16);
}

body[data-table-style="old-style-cloth"] .table {
  background:
    radial-gradient(circle at center, rgba(220, 171, 83, 0.18), rgba(5, 8, 6, 0.58) 82%),
    linear-gradient(rgba(12, 24, 14, 0.24), rgba(12, 24, 14, 0.24)),
    url("./assets/tafelkleed-oude-stijl.png") center / cover no-repeat;
  border-color: rgba(174, 105, 42, 0.74);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08), 0 18px 48px var(--shadow), inset 0 0 48px rgba(0, 0, 0, 0.24);
}

body[data-table-style="klaverjastafel-cloth"] .table {
  background:
    radial-gradient(circle at center, rgba(54, 116, 55, 0.16), rgba(4, 10, 6, 0.46) 82%),
    linear-gradient(rgba(8, 20, 12, 0.28), rgba(8, 20, 12, 0.28)),
    url("./assets/tafelkleed-klaverjastafel.png") center / cover no-repeat;
  border-color: rgba(96, 52, 26, 0.88);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.08),
    0 18px 48px var(--shadow),
    inset 0 0 52px rgba(0, 0, 0, 0.26);
}

body[data-table-style="exclusive-cloth"] .table {
  background:
    url("./assets/tafelkleed-exclusief.png") center / 100% 100% no-repeat;
  border-color: transparent;
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.52),
    inset 0 0 22px rgba(255, 199, 105, 0.08);
}

body[data-table-style="exclusive-cloth"] .table::after {
  display: none !important;
}

/* De exclusieve PNG heeft zelf al een volledige houten omlijsting en transparante hoeken. */
body.game-active[data-table-style="exclusive-cloth"] .table {
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.game-active[data-table-style="exclusive-cloth"] .table::before,
body.game-active[data-table-style="exclusive-cloth"] .table::after {
  display: none !important;
  content: none !important;
}

body[data-table-style="amsterdam-cloth"] .table::after {
  border-color: rgba(156, 35, 25, 0.28);
}

body[data-table-style="rotterdam-cloth"] .table::after {
  border-color: rgba(21, 34, 44, 0.32);
}

body[data-table-style="old-style-cloth"] .table::after {
  border-color: rgba(220, 171, 83, 0.24);
}

body[data-table-style="klaverjastafel-cloth"] .table::after {
  border-color: rgba(218, 177, 91, 0.22);
}

.player {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 90px;
}

.player-top {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.player-top .avatar {
  width: 42px;
  height: 42px;
}

.player-top span,
.player-top small {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(18, 24, 18, 0.62);
  text-shadow: 0 2px 5px var(--shadow);
}

.player-left {
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
}

.player-right {
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}

.player-left,
.player-right {
  gap: 7px;
}

.player-info {
  max-width: 104px;
  padding: 4px 9px;
  display: grid;
  justify-items: center;
  gap: 1px;
  border: 1px solid rgba(255, 235, 166, 0.18);
  border-radius: 10px;
  background: rgba(18, 24, 18, 0.72);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  text-shadow: 0 2px 5px var(--shadow);
}

.player-info span,
.player-info small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-info span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.player-info small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efe4cc center / cover no-repeat;
  color: #26301f;
  font-weight: 900;
  box-shadow: 0 8px 20px var(--shadow);
  overflow: hidden;
}

.avatar.has-image {
  color: transparent;
}

.your-player-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

body[data-current-turn="partner"] .player-top .avatar,
body[data-current-turn="left"] .player-left .avatar,
body[data-current-turn="right"] .player-right .avatar {
  border: 3px solid rgba(255, 224, 122, 0.98);
  outline: 3px solid rgba(255, 214, 106, 0.72);
  outline-offset: 3px;
  box-shadow:
    0 0 0 7px rgba(255, 214, 106, 0.18),
    0 0 32px rgba(255, 214, 106, 0.72),
    0 8px 20px var(--shadow);
  animation: turnAvatarPulse 1.25s ease-in-out infinite alternate;
}

body[data-current-turn="partner"] .player-top span,
body[data-current-turn="partner"] .player-top small,
body[data-current-turn="left"] .player-left .player-info,
body[data-current-turn="right"] .player-right .player-info {
  border-color: rgba(255, 224, 122, 0.58);
  background: rgba(73, 52, 13, 0.82);
  box-shadow: 0 0 18px rgba(255, 214, 106, 0.34), 0 8px 20px rgba(0, 0, 0, 0.26);
}

body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
body[data-bid-phase="bidding"].bid-passed-left .player-left::after,
body[data-bid-phase="bidding"].bid-passed-right .player-right::after,
body[data-declarer="partner"] .player-top::after,
body[data-declarer="left"] .player-left::after,
body[data-declarer="right"] .player-right::after,
body[data-trick-winner="partner"] .player-top::after,
body[data-trick-winner="left"] .player-left::after,
body[data-trick-winner="right"] .player-right::after {
  content: "Speelt";
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(217, 170, 69, 0.94);
  color: #1d1607;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}

body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
body[data-bid-phase="bidding"].bid-passed-left .player-left::after,
body[data-bid-phase="bidding"].bid-passed-right .player-right::after {
  content: "Past";
  background: rgba(31, 42, 42, 0.92);
  color: #d8e5df;
}

body[data-trick-winner="partner"] .player-top::after,
body[data-trick-winner="left"] .player-left::after,
body[data-trick-winner="right"] .player-right::after {
  content: "Mijn slag";
  background: rgba(42, 116, 78, 0.96);
  color: #f5fff7;
}

body[data-bid-phase="bidding"].bid-passed-user .your-player-label::after,
body[data-declarer="user"] .your-player-label::after,
body[data-trick-winner="user"] .your-player-label::after {
  content: "Speelt";
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(217, 170, 69, 0.94);
  color: #1d1607;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}

body[data-bid-phase="bidding"].bid-passed-user .your-player-label::after {
  content: "Past";
  background: rgba(31, 42, 42, 0.92);
  color: #d8e5df;
}

body[data-trick-winner="user"] .your-player-label::after {
  content: "Mijn slag";
  background: rgba(42, 116, 78, 0.96);
  color: #f5fff7;
}

@keyframes turnAvatarPulse {
  from {
    filter: drop-shadow(0 0 2px rgba(255, 214, 106, 0.35));
  }

  to {
    filter: drop-shadow(0 0 9px rgba(255, 214, 106, 0.82));
  }
}

.trick-area {
  position: absolute;
  inset: 62px 138px 58px;
  z-index: 1;
}

.played-card {
  position: absolute;
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 112px;
}

.played-card.seat-partner {
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
}

.played-card.seat-user {
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
}

.played-card.seat-left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.played-card.seat-right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.played-card > span {
  color: var(--text);
  font-size: 13px;
  text-shadow: 0 2px 5px var(--shadow);
}

.trick-area.collecting .played-card {
  transition: top 620ms ease, right 620ms ease, bottom 620ms ease, left 620ms ease, transform 620ms ease, opacity 620ms ease;
  opacity: 0.92;
}

.trick-area.collecting.winner-user .played-card {
  top: auto;
  right: auto;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scale(0.72);
}

.trick-area.collecting.winner-partner .played-card {
  top: 12px;
  right: auto;
  bottom: auto;
  left: calc(50% + 86px);
  transform: scale(0.72);
}

.trick-area.collecting.winner-left .played-card {
  top: 78%;
  right: auto;
  bottom: auto;
  left: -118px;
  transform: translateY(-50%) scale(0.72);
}

.trick-area.collecting.winner-right .played-card {
  top: 78%;
  right: -118px;
  bottom: auto;
  left: auto;
  transform: translateY(-50%) scale(0.72);
}

.trick-area.flipping .played-card {
  opacity: 1;
}

.trick-area.flipping .played-card .mini-card {
  transform: rotateY(180deg) scale(0.78);
  color: transparent;
  background: var(--card-back-bg);
  border-color: var(--card-back-border);
  box-shadow: var(--card-back-shadow);
}

.trick-area.flipping .played-card .mini-card::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid var(--card-back-inner);
  border-radius: inherit;
  pointer-events: none;
}

.trick-area.flipping .played-card .mini-card::after {
  content: var(--card-back-symbol);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--card-back-symbol-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  text-shadow: var(--card-back-symbol-shadow);
  pointer-events: none;
}

.trick-area.flipping .played-card .mini-card > * {
  visibility: hidden;
}

.trick-area.flipping .played-card > span {
  opacity: 0;
}

.trick-area.flipping .played-card:nth-of-type(2) {
  margin-left: 5px;
  margin-top: 3px;
}

.trick-area.flipping .played-card:nth-of-type(3) {
  margin-left: 10px;
  margin-top: 6px;
}

.trick-area.flipping .played-card:nth-of-type(4) {
  margin-left: 15px;
  margin-top: 9px;
}

.trick-stack {
  position: absolute;
  z-index: 2;
  width: 96px;
  min-height: 76px;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--text);
  animation: stackArrive 300ms ease both;
}

.trick-stack strong {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(217, 170, 69, 0.96);
  color: #1d1607;
  font-size: 18px;
  box-shadow: 0 8px 18px var(--shadow);
}

.trick-stack small {
  color: var(--muted);
  font-size: 12px;
  text-shadow: 0 2px 5px var(--shadow);
}

.stack-cards {
  position: relative;
  width: 58px;
  height: 40px;
}

.stack-cards span {
  position: absolute;
  width: 48px;
  height: 34px;
  border-radius: 5px;
  border: 1px solid var(--card-back-border);
  background: var(--card-back-bg);
  box-shadow: 0 7px 16px var(--shadow), inset 0 0 0 1px var(--card-back-inner);
}

.stack-cards span::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid var(--card-back-inner);
  border-radius: inherit;
  pointer-events: none;
}

.stack-cards span::after {
  content: var(--card-back-symbol);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--card-back-symbol-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1;
  text-shadow: var(--card-back-symbol-shadow);
  pointer-events: none;
}

.stack-cards span:nth-child(1) {
  left: 0;
  top: 6px;
  transform: rotate(-8deg);
}

.stack-cards span:nth-child(2) {
  left: 5px;
  top: 3px;
  transform: rotate(1deg);
}

.stack-cards span:nth-child(3) {
  left: 10px;
  top: 0;
  transform: rotate(8deg);
}

.trick-stack.stack-user {
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
}

.trick-stack.stack-partner {
  left: calc(50% + 86px);
  top: 12px;
  transform: none;
}

.trick-stack.stack-left {
  left: -118px;
  top: 78%;
  transform: translateY(-50%);
}

.trick-stack.stack-right {
  right: -118px;
  top: 78%;
  transform: translateY(-50%);
}

.message {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 36px));
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(18, 24, 18, 0.72);
  color: var(--text);
  text-align: center;
}

.game-events {
  grid-column: 1 / -1;
  min-height: 58px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: rgba(30, 38, 31, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.game-events .message {
  flex: 1 1 260px;
}

.game-events .roem-board,
.game-events .trick-points,
.game-events .roem-burst,
.game-events .nat-burst {
  position: static;
  inset: auto;
  transform: none;
  width: auto;
  max-width: 360px;
  min-width: 0;
  padding: 7px 10px;
  animation: none;
}

.game-events .trick-points {
  flex: 0 0 auto;
}

.game-events .roem-board,
.game-events .nat-burst {
  flex: 1 1 220px;
}

.game-events .roem-burst {
  flex: 0 0 auto;
  display: grid;
  align-content: center;
}

.game-events .trick-points strong,
.game-events .roem-burst strong,
.game-events .nat-burst strong {
  font-size: 18px;
  line-height: 1;
}

.game-events .trick-points span,
.game-events .roem-burst span,
.game-events .nat-burst span,
.game-events .roem-board p {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
}

.table-chat-bubble {
  position: absolute;
  z-index: 6;
  max-width: min(300px, 42%);
  padding: 9px 12px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 230, 164, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(5, 24, 34, 0.94), rgba(43, 35, 18, 0.9));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 24px rgba(217, 170, 69, 0.16);
  color: var(--text);
  animation: chatBubblePop 220ms ease-out;
}

.table-chat-bubble[hidden] {
  display: none;
}

.table-chat-bubble::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(18, 25, 23, 0.94);
  border-right: 1px solid rgba(255, 230, 164, 0.36);
  border-bottom: 1px solid rgba(255, 230, 164, 0.36);
  transform: rotate(45deg);
}

.table-chat-bubble strong {
  color: #ffe6a4;
  font-size: 11px;
  line-height: 1;
}

.table-chat-bubble span {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  word-break: break-word;
}

.table-chat-bubble.ai {
  border-color: rgba(217, 170, 69, 0.5);
}

.table-chat-bubble.from-user {
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
}

.table-chat-bubble.from-user::after {
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%) rotate(45deg);
}

.table-chat-bubble.from-partner {
  left: 50%;
  top: 92px;
  transform: translateX(-50%);
}

.table-chat-bubble.from-partner::after {
  left: 50%;
  top: -7px;
  transform: translateX(-50%) rotate(225deg);
}

.table-chat-bubble.from-left {
  left: 104px;
  top: 48%;
  transform: translateY(-50%);
}

.table-chat-bubble.from-left::after {
  left: -7px;
  top: 50%;
  transform: translateY(-50%) rotate(135deg);
}

.table-chat-bubble.from-right {
  right: 104px;
  top: 48%;
  transform: translateY(-50%);
}

.table-chat-bubble.from-right::after {
  right: -7px;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.table-chat-bubble.from-table {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.table-chat-bubble.from-table::after {
  display: none;
}

@keyframes chatBubblePop {
  from {
    opacity: 0;
    scale: 0.94;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

.table-chat {
  grid-column: 1 / -1;
  min-height: 126px;
  max-height: 126px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(190px, 0.34fr) minmax(0, 1fr) minmax(260px, 0.42fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 7px 10px;
}

.table-chat-header {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 3px;
}

.table-chat-header span,
.table-chat-header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.table-chat-header span {
  color: var(--gold);
  text-transform: uppercase;
}

.table-chat-header strong {
  color: var(--text);
  font-size: 14px;
}

.table-chat-log {
  grid-column: 2;
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 7px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(4, 22, 32, 0.62);
}

.chat-line {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 7px;
  padding: 7px 9px;
  border-radius: 8px;
  border-left: 3px solid rgba(217, 170, 69, 0.38);
  background: rgba(255, 255, 255, 0.055);
}

.chat-line:last-child {
  margin-bottom: 0;
}

.chat-line.ai {
  border: 1px solid rgba(217, 170, 69, 0.18);
  background: rgba(217, 170, 69, 0.08);
}

.chat-line.system {
  border: 1px solid rgba(86, 156, 201, 0.22);
  background: rgba(86, 156, 201, 0.08);
}

.chat-line strong {
  display: block;
  margin-bottom: 4px;
  color: #ffe6a4;
  font-size: 11px;
  line-height: 1;
}

.chat-line span {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.32;
  word-break: break-word;
}

.table-chat-form button {
  min-height: 32px;
  border: 1px solid rgba(217, 170, 69, 0.28);
  border-radius: 8px;
  background: rgba(3, 22, 33, 0.68);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.table-chat-form {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.table-chat-form input {
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(86, 156, 201, 0.28);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(3, 20, 30, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.table-chat-form button {
  padding: 0 12px;
  background: linear-gradient(145deg, rgba(20, 75, 94, 0.9), rgba(76, 58, 20, 0.72));
}

.demo-coach {
  position: fixed;
  top: max(88px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 40;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  width: min(380px, calc(100vw - 28px));
  height: 230px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 170, 69, 0.45);
  border-radius: 8px;
  background: rgba(20, 28, 25, 0.97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.demo-coach.dragging {
  cursor: grabbing;
}

.demo-coach button {
  cursor: pointer;
  touch-action: manipulation;
}

.demo-panel-highlight {
  position: relative;
  z-index: 7;
  outline: 2px solid rgba(240, 199, 106, 0.9);
  outline-offset: 4px;
  border-color: rgba(240, 199, 106, 0.92) !important;
  box-shadow:
    0 0 0 3px rgba(240, 199, 106, 0.34),
    0 0 28px rgba(240, 199, 106, 0.42),
    0 16px 42px rgba(0, 0, 0, 0.38) !important;
}

.demo-coach[hidden] {
  display: none;
}

.demo-coach span {
  display: block;
  color: #91c9ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.demo-coach strong {
  display: block;
  color: #fff4cf;
  font-size: 18px;
  line-height: 1.2;
}

.demo-coach p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
  max-height: 86px;
  overflow: auto;
}

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

.demo-actions button,
.info-demo-start {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.info-demo-start {
  border-color: rgba(217, 170, 69, 0.55);
  background: linear-gradient(180deg, #f0c76a, #c88b29);
  color: #201409;
}

#nextDemoButton {
  border-color: rgba(255, 220, 120, 0.72);
  background: linear-gradient(180deg, #ffe9a8, #e7af3e 58%, #b8751f);
  color: #201409;
  box-shadow:
    0 0 0 2px rgba(240, 199, 106, 0.18),
    0 0 18px rgba(240, 199, 106, 0.48);
}

.demo-actions button:disabled {
  opacity: 0.42;
  cursor: default;
}

.info-demo-start {
  width: 100%;
  margin-top: 14px;
}

.demo-pointer {
  position: fixed;
  z-index: 39;
  width: 126px;
  height: 58px;
  pointer-events: none;
  transform: translate(-92%, -50%) rotate(-8deg);
  filter:
    drop-shadow(0 0 10px rgba(240, 199, 106, 0.7))
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.48));
}

.demo-pointer::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 23px;
  width: 92px;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff2b8, #f0c76a 52%, #bd7921);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.demo-pointer::after {
  content: "";
  position: absolute;
  right: 0;
  top: 9px;
  width: 44px;
  height: 44px;
  border-radius: 14px 16px 16px 14px;
  background: linear-gradient(135deg, #fff2b8, #e9b451 58%, #b87624);
  clip-path: polygon(0 0, 100% 50%, 0 100%, 20% 50%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.demo-pointer[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .demo-coach {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    max-height: 34dvh;
    padding: 12px;
    border-radius: 12px;
    cursor: default;
    touch-action: auto;
  }

  .demo-actions {
    grid-template-columns: 38px 38px minmax(86px, 1fr) minmax(76px, 0.8fr) minmax(74px, 0.8fr);
    gap: 6px;
  }

  .demo-actions button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .demo-coach p {
    max-height: 58px;
    font-size: 13px;
    line-height: 1.32;
  }

  .demo-coach.collapsed {
    grid-template-rows: auto;
    gap: 7px;
    max-height: none;
    padding: 9px 10px;
  }

  .demo-coach.collapsed p,
  .demo-coach.collapsed #demoStepLabel {
    display: none;
  }

  .demo-coach.collapsed strong {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .demo-coach.collapsed .demo-actions {
    grid-template-columns: 36px 36px minmax(82px, 1fr) 0 0;
  }

  .demo-coach.collapsed #restartDemoButton,
  .demo-coach.collapsed #stopDemoButton {
    display: none;
  }
}

.roem-board,
.signal-board,
.trick-points,
.roem-burst,
.nat-burst {
  position: absolute;
  z-index: 3;
  max-width: 330px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(18, 24, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px var(--shadow);
}

.roem-board {
  top: 14px;
  right: 14px;
  border-color: rgba(217, 170, 69, 0.7);
  background: rgba(61, 43, 13, 0.86);
}

.roem-board[hidden] {
  display: none;
}

.signal-board {
  left: 14px;
  bottom: 64px;
}

.roem-board strong,
.signal-board strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 17px;
}

.roem-board p,
.signal-board p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.trick-points {
  min-width: 158px;
  text-align: center;
  border-color: rgba(217, 170, 69, 0.72);
  background: rgba(18, 24, 18, 0.9);
  transition: top 620ms ease, right 620ms ease, bottom 620ms ease, left 620ms ease, transform 620ms ease;
}

.trick-points[hidden],
.roem-burst[hidden] {
  display: none;
}

.nat-burst[hidden] {
  display: none;
}

.nat-burst {
  top: 50%;
  left: 50%;
  width: min(440px, calc(100% - 40px));
  padding: 22px;
  text-align: center;
  transform: translate(-50%, -50%);
  border-color: rgba(235, 82, 82, 0.92);
  background: rgba(82, 15, 15, 0.94);
  animation: natBurst 2600ms ease both;
}

.nat-burst strong {
  display: block;
  color: #ffd6d6;
  font-size: 44px;
  line-height: 1;
}

.nat-burst span {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.trick-points strong {
  display: block;
  color: #ffe6a4;
  font-size: 26px;
}

.trick-points span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.trick-points.winner-user {
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
}

.trick-points.winner-partner {
  left: 50%;
  top: 104px;
  transform: translateX(-50%);
}

.trick-points.winner-left {
  left: 120px;
  top: 50%;
  transform: translateY(-50%);
}

.trick-points.winner-right {
  right: 120px;
  top: 50%;
  transform: translateY(-50%);
}

.trick-points.collecting.winner-user {
  bottom: 16px;
}

.trick-points.collecting.winner-partner {
  top: 12px;
  left: calc(50% + 86px);
  transform: none;
}

.trick-points.collecting.winner-left {
  left: 16px;
  top: 64%;
}

.trick-points.collecting.winner-right {
  right: 16px;
  top: 64%;
}

.roem-burst {
  top: 50%;
  left: 50%;
  width: min(360px, calc(100% - 40px));
  padding: 18px 22px;
  text-align: center;
  transform: translate(-50%, -50%);
  border-color: rgba(217, 170, 69, 0.9);
  background: rgba(70, 47, 10, 0.92);
  animation: roemBurst 1300ms ease both;
}

.roem-burst strong {
  display: block;
  color: #ffe6a4;
  font-size: 34px;
  line-height: 1;
}

.roem-burst span {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

@keyframes roemBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  68% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -62%) scale(0.94);
  }
}

@keyframes stackArrive {
  from {
    opacity: 0;
    filter: blur(3px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes natBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  12%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  18% {
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 0.96;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes menuGoldenBorder {
  to {
    --menu-border-angle: 360deg;
  }
}

.hand-panel {
  grid-column: 1 / -1;
  padding: 8px 10px;
}

body[data-current-turn="user"] .hand-panel {
  box-shadow: inset 0 0 0 2px rgba(255, 214, 106, 0.62), 0 0 24px rgba(255, 214, 106, 0.18);
}

.hand-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.hand {
  display: grid;
  grid-template-columns: repeat(8, minmax(58px, 1fr));
  gap: 10px;
  min-height: clamp(116px, 14vh, 154px);
  align-items: stretch;
}

.empty-hand-slot {
  visibility: hidden;
  pointer-events: none;
}

.hand-panel:has(.pot-summary-panel) {
  max-height: 178px;
  overflow: hidden;
}

.hand:has(.pot-summary-panel) {
  display: block;
}

.pot-summary-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
}

.pot-nat-banner,
.boom-nat {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(235, 82, 82, 0.55);
  background: rgba(110, 24, 24, 0.48);
  color: #ffd6d6;
  font-weight: 900;
}

.pot-nat-banner {
  grid-column: 1 / -1;
}

.boom-nat {
  margin-bottom: 8px;
  font-size: 13px;
}

.pot-summary-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.pot-summary-head > div {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.online-seats small {
  color: var(--muted);
  font-size: 12px;
}

.online-seats .ai-controlled {
  border: 1px solid rgba(217, 170, 69, 0.45);
  background: rgba(74, 46, 10, 0.52);
}

body.online-match-active .player.computer-takeover .avatar {
  box-shadow: 0 0 0 3px #f2b84b, 0 0 20px rgba(242, 184, 75, 0.55);
}

body.online-match-active .player.computer-takeover .player-info small {
  color: #ffd477;
  font-weight: 800;
}

body.online-match-active .player.computer-takeover .player-info > span::after {
  content: "AI";
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 18px;
  margin-left: 7px;
  padding: 0 5px;
  border: 1px solid rgba(255, 212, 119, 0.78);
  border-radius: 999px;
  color: #3b2608;
  background: linear-gradient(180deg, #ffe39b, #e6ad42);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  vertical-align: 2px;
}

.online-pot-review-button {
  margin-top: 10px;
  width: 100%;
}

.turn-deadline-alert {
  position: fixed;
  z-index: 1800;
  top: clamp(76px, 10vh, 118px);
  left: 50%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 16px;
  width: min(680px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 2px solid #f3bd52;
  border-radius: 18px;
  color: #fff8df;
  background: linear-gradient(135deg, rgba(74, 26, 18, 0.98), rgba(18, 42, 54, 0.98));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 0 5px rgba(243, 189, 82, 0.12);
  transform: translateX(-50%);
  animation: turn-deadline-enter 240ms ease-out both;
}

.turn-deadline-alert[hidden] {
  display: none;
}

.turn-deadline-signal {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #43140e;
  background: #f3bd52;
  font-size: 32px;
  font-weight: 950;
  box-shadow: 0 0 0 8px rgba(243, 189, 82, 0.12);
}

.turn-deadline-copy span {
  color: #f3bd52;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.turn-deadline-copy strong {
  display: block;
  margin-top: 2px;
  font-family: Georgia, serif;
  font-size: clamp(21px, 3vw, 28px);
}

.turn-deadline-copy p {
  margin: 5px 0 0;
  color: rgba(255, 248, 223, 0.84);
  font-size: 14px;
  line-height: 1.42;
}

.turn-deadline-copy b {
  color: #fff;
  font-size: 1.12em;
}

.turn-deadline-clock {
  display: grid;
  place-items: center;
  min-height: 72px;
  border: 1px solid rgba(243, 189, 82, 0.48);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
}

.turn-deadline-clock strong {
  color: #ffd873;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.turn-deadline-clock span {
  margin-top: -8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.turn-deadline-alert[data-urgent="true"] {
  border-color: #ff6b57;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.62), 0 0 28px rgba(255, 72, 50, 0.36);
  animation: turn-deadline-pulse 900ms ease-in-out infinite alternate;
}

.turn-deadline-alert[data-urgent="true"] .turn-deadline-signal {
  color: #fff;
  background: #e74734;
}

@keyframes turn-deadline-enter {
  from { opacity: 0; transform: translate(-50%, -12px) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes turn-deadline-pulse {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.015); }
}

@media (max-width: 620px) {
  .turn-deadline-alert {
    top: 58px;
    grid-template-columns: 42px minmax(0, 1fr) 72px;
    gap: 10px;
    width: calc(100vw - 18px);
    padding: 12px;
    border-radius: 14px;
  }

  .turn-deadline-signal {
    width: 40px;
    height: 40px;
    font-size: 25px;
  }

  .turn-deadline-copy strong { font-size: 19px; }
  .turn-deadline-copy p { font-size: 12px; }
  .turn-deadline-clock { min-height: 62px; }
  .turn-deadline-clock strong { font-size: 23px; }
}

.turn-monitor {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(86, 156, 201, 0.22);
  border-radius: 8px;
  background: rgba(9, 35, 48, 0.5);
}

.turn-monitor.warning {
  border-color: rgba(217, 170, 69, 0.55);
  background: rgba(82, 52, 10, 0.58);
}

.turn-monitor strong,
.turn-monitor span {
  display: block;
}

.turn-monitor span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.pot-summary-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.pot-summary-head strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.pot-summary-list {
  max-height: 56px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.pot-summary-row {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 12px;
}

.card {
  position: relative;
  aspect-ratio: 0.68;
  height: clamp(80px, 14vh, 112px);
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(236, 226, 204, 0.98)),
    var(--card);
  color: var(--black);
  border: 2px solid rgba(68, 46, 24, 0.28);
  box-shadow: 0 10px 24px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.card:hover:not(:disabled) {
  transform: translateY(-7px);
  box-shadow: 0 16px 30px var(--shadow);
}

.card:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.card.red {
  color: var(--red);
}

.card .corner {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  line-height: 1;
  font-weight: 900;
  font-size: 16px;
}

.card .corner-bottom,
.mini-card .corner-bottom {
  display: none;
}

.card .rank-center {
  display: none;
}

.card .suit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 12px;
  font-size: clamp(32px, 6vh, 46px);
  line-height: 1;
}

.card .trump-mark {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #1d1607;
  font-size: 13px;
  font-weight: 900;
  z-index: 5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(255, 255, 255, 0.7);
}

body {
  --card-back-bg:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 22%, rgba(36, 0, 0, 0.12) 54%, rgba(255, 255, 255, 0.1)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 7px),
    linear-gradient(145deg, #f7b2a8 0%, #c95055 42%, #7b1d23 100%);
  --card-back-border: rgba(255, 243, 224, 0.94);
  --card-back-inner: rgba(255, 236, 212, 0.5);
  --card-back-symbol: "\2663";
  --card-back-symbol-color: rgba(255, 245, 220, 0.58);
  --card-back-symbol-shadow: 0 2px 4px rgba(77, 0, 4, 0.45);
  --card-back-shadow:
    0 10px 18px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px rgba(126, 19, 24, 0.58),
    inset 0 0 18px rgba(255, 255, 255, 0.14);
}

body[data-card-style="classic"] {
  --card-back-bg:
    radial-gradient(circle at 50% 48%, rgba(231, 205, 128, 0.18), transparent 36%),
    radial-gradient(circle at 26% 24%, rgba(255, 241, 181, 0.12), transparent 18%),
    repeating-linear-gradient(135deg, rgba(237, 214, 132, 0.13) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(45deg, rgba(11, 42, 24, 0.34) 0 7px, rgba(24, 78, 42, 0.34) 7px 14px),
    linear-gradient(145deg, #1f6f39 0%, #0f4f2a 52%, #082b18 100%);
  --card-back-border: rgba(244, 224, 166, 0.96);
  --card-back-inner: rgba(242, 210, 125, 0.62);
  --card-back-symbol: "\2663";
  --card-back-symbol-color: rgba(247, 220, 135, 0.72);
  --card-back-symbol-shadow: 0 2px 5px rgba(3, 28, 14, 0.82);
  --card-back-shadow:
    0 10px 20px rgba(0, 0, 0, 0.48),
    inset 0 0 0 2px rgba(7, 47, 24, 0.72),
    inset 0 0 20px rgba(248, 219, 137, 0.16);
}

body[data-card-style="modern"] {
  --card-back-bg:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 18%, rgba(255, 255, 255, 0.1) 58%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 8px),
    linear-gradient(145deg, #1f89b5 0%, #0d577b 48%, #063348 100%);
  --card-back-border: rgba(221, 244, 255, 0.96);
  --card-back-inner: rgba(194, 234, 255, 0.52);
  --card-back-symbol: "\25C7";
  --card-back-symbol-color: rgba(231, 249, 255, 0.62);
  --card-back-symbol-shadow: 0 2px 5px rgba(0, 33, 52, 0.78);
  --card-back-shadow:
    0 10px 20px rgba(0, 0, 0, 0.42),
    inset 0 0 0 2px rgba(10, 68, 97, 0.68),
    inset 0 0 22px rgba(255, 255, 255, 0.13);
}

body[data-card-style="black-gold"] {
  --card-back-bg:
    radial-gradient(circle at 50% 42%, rgba(232, 193, 92, 0.24), transparent 31%),
    linear-gradient(135deg, rgba(255, 222, 128, 0.16), transparent 19%, rgba(255, 202, 80, 0.1) 62%, transparent 64%),
    repeating-linear-gradient(45deg, rgba(227, 178, 74, 0.22) 0 1px, transparent 1px 8px),
    linear-gradient(145deg, #1c1710 0%, #090806 48%, #000 100%);
  --card-back-border: rgba(231, 197, 106, 0.98);
  --card-back-inner: rgba(231, 197, 106, 0.72);
  --card-back-symbol: "\2663";
  --card-back-symbol-color: rgba(231, 197, 106, 0.82);
  --card-back-symbol-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  --card-back-shadow:
    0 12px 24px rgba(0, 0, 0, 0.56),
    inset 0 0 0 2px rgba(231, 197, 106, 0.32),
    inset 0 0 24px rgba(231, 197, 106, 0.13);
}

.pip-layout,
.court-figure {
  display: none;
}

body[data-card-style="classic"] .card,
body[data-card-style="classic"] .mini-card,
body[data-card-style="classic"] .last-trick-card .mini-card {
  background-image: var(--classic-card-image);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  background-color: #fff;
  border-color: rgba(40, 40, 40, 0.38);
  font-family: Georgia, "Times New Roman", serif;
}

body[data-card-style="classic"] .card > *,
body[data-card-style="classic"] .mini-card > * {
  visibility: hidden;
}

body[data-card-style="classic"] .card .trump-mark,
body[data-card-style="classic"] .mini-card .trump-mark {
  visibility: visible;
}

body[data-card-style="classic"] .suit-clubs.rank-7 { --classic-card-image: url("./assets/classic-cards/clubs-7.png"); }
body[data-card-style="classic"] .suit-clubs.rank-8 { --classic-card-image: url("./assets/classic-cards/clubs-8.png"); }
body[data-card-style="classic"] .suit-clubs.rank-9 { --classic-card-image: url("./assets/classic-cards/clubs-9.png"); }
body[data-card-style="classic"] .suit-clubs.rank-10 { --classic-card-image: url("./assets/classic-cards/clubs-10.png"); }
body[data-card-style="classic"] .suit-clubs.rank-j { --classic-card-image: url("./assets/classic-cards/clubs-j.png"); }
body[data-card-style="classic"] .suit-clubs.rank-q { --classic-card-image: url("./assets/classic-cards/clubs-q.png"); }
body[data-card-style="classic"] .suit-clubs.rank-k { --classic-card-image: url("./assets/classic-cards/clubs-k.png"); }
body[data-card-style="classic"] .suit-clubs.rank-a { --classic-card-image: url("./assets/classic-cards/clubs-a.png"); }
body[data-card-style="classic"] .suit-spades.rank-7 { --classic-card-image: url("./assets/classic-cards/spades-7.png"); }
body[data-card-style="classic"] .suit-spades.rank-8 { --classic-card-image: url("./assets/classic-cards/spades-8.png"); }
body[data-card-style="classic"] .suit-spades.rank-9 { --classic-card-image: url("./assets/classic-cards/spades-9.png"); }
body[data-card-style="classic"] .suit-spades.rank-10 { --classic-card-image: url("./assets/classic-cards/spades-10.png"); }
body[data-card-style="classic"] .suit-spades.rank-j { --classic-card-image: url("./assets/classic-cards/spades-j.png"); }
body[data-card-style="classic"] .suit-spades.rank-q { --classic-card-image: url("./assets/classic-cards/spades-q.png"); }
body[data-card-style="classic"] .suit-spades.rank-k { --classic-card-image: url("./assets/classic-cards/spades-k.png"); }
body[data-card-style="classic"] .suit-spades.rank-a { --classic-card-image: url("./assets/classic-cards/spades-a.png"); }
body[data-card-style="classic"] .suit-hearts.rank-7 { --classic-card-image: url("./assets/classic-cards/hearts-7.png"); }
body[data-card-style="classic"] .suit-hearts.rank-8 { --classic-card-image: url("./assets/classic-cards/hearts-8.png"); }
body[data-card-style="classic"] .suit-hearts.rank-9 { --classic-card-image: url("./assets/classic-cards/hearts-9.png"); }
body[data-card-style="classic"] .suit-hearts.rank-10 { --classic-card-image: url("./assets/classic-cards/hearts-10.png"); }
body[data-card-style="classic"] .suit-hearts.rank-j { --classic-card-image: url("./assets/classic-cards/hearts-j.png"); }
body[data-card-style="classic"] .suit-hearts.rank-q { --classic-card-image: url("./assets/classic-cards/hearts-q.png"); }
body[data-card-style="classic"] .suit-hearts.rank-k { --classic-card-image: url("./assets/classic-cards/hearts-k.png"); }
body[data-card-style="classic"] .suit-hearts.rank-a { --classic-card-image: url("./assets/classic-cards/hearts-a.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-7 { --classic-card-image: url("./assets/classic-cards/diamonds-7.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-8 { --classic-card-image: url("./assets/classic-cards/diamonds-8.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-9 { --classic-card-image: url("./assets/classic-cards/diamonds-9.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-10 { --classic-card-image: url("./assets/classic-cards/diamonds-10.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-j { --classic-card-image: url("./assets/classic-cards/diamonds-j.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-q { --classic-card-image: url("./assets/classic-cards/diamonds-q.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-k { --classic-card-image: url("./assets/classic-cards/diamonds-k.png"); }
body[data-card-style="classic"] .suit-diamonds.rank-a { --classic-card-image: url("./assets/classic-cards/diamonds-a.png"); }

body[data-card-style="modern"] .card,
body[data-card-style="modern"] .mini-card {
  border-radius: 14px;
  background:
    linear-gradient(160deg, #ffffff, #edf3f7);
  border-color: rgba(31, 70, 92, 0.25);
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

body[data-card-style="modern"] .card .corner,
body[data-card-style="modern"] .mini-card .corner {
  font-weight: 900;
  letter-spacing: -0.04em;
}

body[data-card-style="modern"] .card .suit,
body[data-card-style="modern"] .mini-card .suit {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.16));
}

body[data-card-style="black-gold"] .card,
body[data-card-style="black-gold"] .mini-card {
  background:
    radial-gradient(circle at 50% 42%, rgba(217, 170, 69, 0.18), transparent 38%),
    linear-gradient(145deg, #191510, #050505);
  color: #e7c56a;
  border-color: rgba(217, 170, 69, 0.72);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(255, 231, 168, 0.18);
}

body[data-card-style="black-gold"] .card.red,
body[data-card-style="black-gold"] .mini-card.red {
  color: #ff5d55;
}

body[data-card-style="black-gold"] .card .trump-mark,
body[data-card-style="black-gold"] .mini-card .trump-mark {
  background: #e7c56a;
  color: #080704;
}

.mini-card {
  width: clamp(72px, 9vh, 96px);
  height: clamp(100px, 12.5vh, 134px);
  border-radius: 8px;
  background:
    linear-gradient(145deg, #fffdf6, #eee2ca),
    var(--card);
  color: var(--black);
  border: 2px solid rgba(68, 46, 24, 0.3);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  position: relative;
  transition: transform 420ms ease, background 320ms ease, border-color 320ms ease, color 220ms ease;
}

.mini-card.red {
  color: var(--red);
}

.mini-card .corner {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  line-height: 1;
  font-weight: 900;
  font-size: 17px;
}

.mini-card .rank-center {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 26px;
  font-weight: 900;
}

.mini-card .suit {
  position: absolute;
  inset: 56px 0 0;
  display: grid;
  place-items: start center;
  font-size: 42px;
  line-height: 1;
}

.mini-card .trump-mark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #1d1607;
  font-size: 12px;
  font-weight: 900;
  z-index: 5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(255, 255, 255, 0.7);
}

body[data-card-style="classic"] .mini-card .corner-bottom {
  top: auto;
  left: auto;
  right: 8px;
  bottom: 8px;
  transform: rotate(180deg);
}

.last-trick-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
}

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

.last-trick-dialog,
.boom-dialog,
.info-dialog {
  width: min(720px, 100%);
  padding: 16px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
}

.info-dialog {
  width: min(820px, 100%);
}

.info-dialog.rules-dialog {
  height: min(760px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.info-content {
  color: var(--muted);
  line-height: 1.55;
  max-height: min(72vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.rules-dialog .info-content {
  max-height: none;
  min-height: 0;
  overflow: hidden;
}

.info-content h2 {
  margin-bottom: 8px;
  color: var(--text);
}

.info-content ol {
  margin: 0;
  padding-left: 22px;
}

.rules-guide {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

.rules-hero {
  padding: 14px;
  border: 1px solid rgba(217, 170, 69, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 20%, rgba(217, 170, 69, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(13, 54, 82, 0.86), rgba(5, 25, 38, 0.92));
}

.rules-hero span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rules-hero h2 {
  margin: 4px 0 6px;
}

.rules-hero p {
  margin: 0;
}

.rules-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.rules-tabs button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(86, 156, 201, 0.24);
  border-radius: 8px;
  background: rgba(3, 22, 33, 0.68);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.rules-tabs button.active {
  border-color: rgba(217, 170, 69, 0.72);
  background: linear-gradient(145deg, rgba(20, 75, 94, 0.9), rgba(76, 58, 20, 0.72));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(217, 170, 69, 0.18);
}

.rules-panel {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.rules-panel.active {
  display: grid;
}

.rule-card {
  min-height: 108px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(3, 20, 30, 0.72);
}

.rule-card.wide {
  grid-column: 1 / -1;
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(217, 170, 69, 0.12), rgba(3, 20, 30, 0.72));
}

.rule-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 16px;
}

.rule-card p {
  margin: 0;
}

/* Readable rules modal: compact guide layout for new players. */
.info-dialog.rules-dialog {
  width: min(900px, calc(100vw - 24px));
  height: min(780px, calc(100dvh - 28px));
  padding: 14px;
  border-color: rgba(217, 170, 69, 0.32);
  background:
    radial-gradient(circle at 18% 0%, rgba(217, 170, 69, 0.14), transparent 30%),
    linear-gradient(150deg, rgba(20, 35, 27, 0.98), rgba(4, 24, 35, 0.98));
}

.rules-dialog .last-trick-header {
  margin-bottom: 10px;
}

.rules-dialog #infoTitle {
  color: #fff5d7;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0;
}

.rules-guide {
  gap: 10px;
}

.rules-hero {
  padding: 13px 14px;
  border-color: rgba(217, 170, 69, 0.34);
  background:
    linear-gradient(135deg, rgba(217, 170, 69, 0.13), transparent 42%),
    rgba(3, 31, 41, 0.82);
}

.rules-hero h2 {
  color: #fff9e8;
  font-size: clamp(20px, 2.7vw, 30px);
  line-height: 1.08;
}

.rules-hero p {
  max-width: 68ch;
  color: #d9d6c9;
  font-size: 15px;
  line-height: 1.38;
}

.rules-tabs {
  padding: 5px;
  border: 1px solid rgba(86, 156, 201, 0.2);
  border-radius: 10px;
  background: rgba(2, 18, 28, 0.64);
}

.rules-tabs button {
  min-height: 42px;
  border-radius: 7px;
  color: #d8d0bd;
  letter-spacing: 0;
}

.rules-tabs button.active {
  background:
    linear-gradient(180deg, rgba(248, 204, 91, 0.96), rgba(174, 123, 31, 0.94));
  color: #1d1b12;
  box-shadow:
    0 0 18px rgba(217, 170, 69, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.rules-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 1px 4px 3px 1px;
  scrollbar-width: thin;
}

.rule-card {
  min-height: 0;
  padding: 13px 14px;
  border-color: rgba(217, 170, 69, 0.16);
  background:
    linear-gradient(180deg, rgba(9, 38, 32, 0.84), rgba(2, 19, 27, 0.78));
  color: #ddd8c8;
  line-height: 1.38;
}

.rule-card.wide {
  background:
    linear-gradient(135deg, rgba(217, 170, 69, 0.2), rgba(4, 34, 42, 0.86));
}

.rule-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.rule-number {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd56f, #b77d21);
  color: #1b160d;
  font-weight: 950;
  box-shadow: 0 0 18px rgba(217, 170, 69, 0.26);
}

.rule-card strong {
  margin-bottom: 5px;
  color: #fff5d7;
  font-size: 17px;
  line-height: 1.12;
}

.rule-card p,
.rule-card li {
  font-size: 15px;
}

.rule-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.rule-card li::marker {
  color: var(--gold);
}

.variant-card p {
  margin-bottom: 8px;
  color: #fff5d7;
  font-weight: 800;
}

.rank-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  margin: 7px 0 8px;
}

.rank-strip span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border-radius: 7px;
  background: #f7f1df;
  color: #17150f;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(21, 17, 10, 0.16);
}

.rank-strip.quiet span {
  background: rgba(239, 228, 204, 0.92);
}

.info-demo-start {
  justify-self: end;
  width: min(260px, 100%);
}

@media (max-width: 720px) {
  .info-dialog.rules-dialog {
    width: calc(100vw - 18px);
    height: calc(100dvh - 18px);
    padding: 10px;
    border-radius: 12px;
  }

  .rules-dialog .last-trick-header {
    align-items: center;
    margin-bottom: 7px;
  }

  .rules-dialog #infoTitle {
    font-size: 23px;
  }

  .rules-guide {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .rules-hero {
    padding: 10px;
  }

  .rules-hero span {
    font-size: 11px;
  }

  .rules-hero h2 {
    margin: 3px 0 4px;
    font-size: 19px;
  }

  .rules-hero p {
    font-size: 13px;
    line-height: 1.3;
  }

  .rules-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .rules-tabs button {
    min-height: 34px;
    padding: 0 3px;
    font-size: 11px;
  }

  .rules-panel,
  .rules-panel.active {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .rule-card {
    padding: 10px;
  }

  .rule-summary {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .rule-number {
    width: 32px;
    height: 32px;
  }

  .rule-card strong {
    font-size: 15px;
  }

  .rule-card p,
  .rule-card li {
    font-size: 13px;
  }

  .rank-strip span {
    min-height: 27px;
    font-size: 12px;
  }

  .info-demo-start {
    width: 100%;
    min-height: 42px;
  }
}

/* Mobile home player row polish: align avatar, name and photo button higher with bottom breathing room. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .home-player-section {
    align-items: start !important;
    padding-top: 8px !important;
    padding-bottom: 12px !important;
    row-gap: 5px !important;
  }

  body:not(.game-active) .home-player-section .avatar-preview,
  body:not(.game-active) .home-player-section .player-name-field,
  body:not(.game-active) .home-player-section .player-photo-field {
    align-self: start !important;
    margin-top: 0 !important;
  }

  body:not(.game-active) .home-player-section h2 {
    margin-bottom: 3px !important;
  }
}

/* Final competition action polish: compact readable row above the start button. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto 30px auto !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(44px, auto) !important;
    gap: 6px !important;
    width: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  body:not(.game-active) #openOnlineButton {
    grid-column: auto !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    display: grid !important;
    place-items: center !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 6px 4px !important;
    border: 1px solid rgba(86, 156, 201, 0.28) !important;
    border-radius: 9px !important;
    background: rgba(2, 25, 37, 0.72) !important;
    color: var(--text) !important;
    font-size: clamp(10px, 2.8vw, 12px) !important;
    line-height: 1.05 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions .info-button > span {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

  body:not(.game-active) .online-entry-actions .info-button::after {
    content: none !important;
  }

  body:not(.game-active) .online-entry-actions .info-button.premium-locked {
    padding: 5px 4px 16px !important;
    border-color: rgba(217, 170, 69, 0.48) !important;
    background:
      linear-gradient(145deg, rgba(5, 32, 42, 0.92), rgba(54, 42, 17, 0.72)) !important;
  }

  body:not(.game-active) .online-entry-actions .info-button.premium-locked::after {
    content: "Premium" !important;
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 3px !important;
    transform: translateX(-50%) !important;
    padding: 1px 5px !important;
    border-radius: 999px !important;
    background: rgba(217, 170, 69, 0.96) !important;
    color: #1d1607 !important;
    font-size: 7px !important;
    font-weight: 950 !important;
    letter-spacing: 0.03em !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
  }
}

/* Mobile premium actions: show daily challenge and ranking side by side with clear premium state. */
.online-entry-actions .info-button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto 30px minmax(82px, 1fr) !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(38px, 0.8fr) minmax(42px, 1fr) !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    display: grid !important;
    align-content: center !important;
    justify-items: center !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 6px 7px !important;
    border-radius: 9px !important;
    line-height: 1.05 !important;
    white-space: normal !important;
  }

  body:not(.game-active) #openOnlineButton {
    grid-column: 1 / -1 !important;
  }

  body:not(.game-active) .online-entry-actions .info-button.premium-locked {
    padding: 5px 7px 18px !important;
  }

  body:not(.game-active) .online-entry-actions .info-button.premium-locked::after {
    content: "Premium";
    top: auto !important;
    right: 50% !important;
    bottom: 3px !important;
    transform: translateX(50%) !important;
    padding: 2px 6px !important;
    font-size: 8px !important;
    line-height: 1 !important;
  }
}

/* Rules card growth guard: cards expand with their text instead of clipping content. */
.rules-dialog .info-content,
.rules-guide,
.rules-panel,
.rules-panel.active {
  min-height: 0;
}

.rules-panel {
  align-content: start !important;
  grid-auto-rows: auto !important;
  overflow: auto !important;
}

.rules-panel.active {
  overflow: auto !important;
}

.rule-card,
.rule-card.wide,
.rule-summary {
  height: auto !important;
  min-height: max-content !important;
  overflow: visible !important;
  box-sizing: border-box;
}

.rule-summary {
  align-items: start !important;
}

.rule-summary .rule-number {
  margin-top: 2px;
  flex: 0 0 auto;
}

.rule-card p,
.rule-card li,
.rule-card strong {
  overflow-wrap: anywhere;
}

@media (orientation: portrait) and (max-width: 430px) {
  .rules-panel {
    padding-bottom: 10px !important;
  }
}

#closeInfoButton,
#closeSettingsButton {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #efe4cc;
  color: #26301f;
  font-weight: 800;
  cursor: pointer;
}

.settings-dialog {
  width: min(620px, 100%);
}

.settings-content {
  display: grid;
  gap: 14px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(217, 170, 69, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
}

.settings-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
}

.settings-toggle strong,
.settings-field span {
  display: block;
  color: var(--text);
  font-weight: 900;
}

.settings-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.settings-field {
  display: grid;
  gap: 7px;
}

.settings-field select {
  min-height: 44px;
  border: 1px solid rgba(86, 156, 201, 0.28);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(3, 20, 30, 0.92);
  color: var(--text);
  font: inherit;
}

#hintText.online-waiting-text {
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
}

.boom-dialog {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.last-trick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.last-trick-header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.last-trick-header strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
}

#closeLastTrickButton {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #efe4cc;
  color: #26301f;
  font-weight: 800;
  cursor: pointer;
}

#closeBoomButton {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #efe4cc;
  color: #26301f;
  font-weight: 800;
  cursor: pointer;
}

.last-trick-summary {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  line-height: 1.35;
}

.last-trick-cards {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 12px;
}

.last-trick-card {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.last-trick-card > span {
  color: var(--muted);
  font-size: 13px;
}

.boom-winner {
  padding: 12px;
  border-radius: 8px;
  background: rgba(217, 170, 69, 0.16);
  border: 1px solid rgba(217, 170, 69, 0.36);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.boom-overview {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.boom-result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 0 2px;
}

.online-table-picker {
  margin-bottom: 14px;
}

.daily-variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.daily-variant-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.daily-variant-card .start-game-button {
  margin-top: 6px;
}

@media (max-width: 620px) {
  .daily-variant-grid { grid-template-columns: 1fr; }
}

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

.online-table-option {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(7, 55, 34, 0.72);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.online-table-option.selected {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.28);
  background: rgba(20, 83, 45, 0.95);
}

.online-table-option span,
.online-table-option small {
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 720px) {
  .online-table-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .online-table-options { grid-template-columns: 1fr; }
}

.boom-result-actions button {
  min-width: 140px;
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.boom-result-actions button:last-child {
  background: #1f2937;
}

.boom-reward-earned {
  animation: boom-reward-pop 700ms ease-out;
}

@keyframes boom-reward-pop {
  0% { transform: scale(0.86); opacity: 0.25; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 520px) {
  .boom-result-actions { flex-direction: column; }
  .boom-result-actions button { width: 100%; }
}

.boom-pot {
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.boom-pot header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.boom-pot header strong {
  font-size: 18px;
}

.boom-pot header span {
  color: var(--muted);
  font-size: 13px;
}

.boom-tricks {
  display: grid;
  gap: 5px;
}

.boom-trick {
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 720px) {
  body.game-active {
    height: auto;
    overflow: auto;
  }

  .start-menu {
    padding: 10px;
  }

  .start-menu-panel {
    padding: 16px;
  }

  .online-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .home-highscore {
    min-width: 0;
  }

  .online-entry-actions,
  .online-grid,
  .ranking-columns,
  .online-profile,
  .online-match-head,
  .daily-hero-upgraded {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .leaderboard-row {
    grid-template-columns: 28px 1fr 60px;
  }

  .leaderboard-row > :last-child {
    display: none;
  }

  .start-menu-stage {
    grid-template-columns: 1fr;
    gap: 0;
    width: min(520px, 100%);
    padding: 14px 12px 16px;
    border-radius: 14px;
  }

  .home-sound-button {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }

  .brand-showcase img {
    width: min(78vw, 300px);
    margin-bottom: -76px;
  }

  .brand-showcase p {
    font-size: 14px;
  }

  .start-menu-panel {
    padding: 86px 16px 16px;
    border-radius: 14px;
  }

  .menu-group,
  .menu-group:first-of-type {
    grid-template-columns: 1fr;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    padding: 10px;
    gap: 10px;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .top-bar,
  .variant-banner,
  .score-board,
  .bid-panel,
  .table,
  .hand-panel {
    grid-column: 1;
  }

  .top-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .variant-banner {
    min-height: 138px;
    padding: 14px;
    background-position: center;
  }

  .variant-banner::before {
    background: linear-gradient(90deg, rgba(9, 17, 14, 0.92), rgba(9, 17, 14, 0.42));
  }

  .variant-banner-content strong {
    font-size: 22px;
  }

  .variant-banner-content p {
    font-size: 13px;
  }

  .variant-city-mark {
    font-size: 18px;
  }

  .status-grid,
  .score-board,
  .setup-panel,
  .bid-panel {
    grid-template-columns: 1fr 1fr;
  }

  .setup-panel,
  .bid-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-actions,
  .bid-actions {
    justify-content: stretch;
  }

  .setup-button,
  .bid-button {
    flex: 1 1 calc(50% - 8px);
  }

  #newGameButton,
  #nextGameButton,
  #lastTrickButton {
    grid-column: 1 / -1;
  }

  .name-field {
    min-width: 0;
  }

  .table {
    height: 560px;
    min-height: 560px;
    border-width: 7px;
  }

  .roem-board,
  .signal-board {
    max-width: calc(100% - 28px);
  }

  .roem-board {
    top: 8px;
    right: 8px;
  }

  .signal-board {
    left: 8px;
    bottom: 58px;
  }

  .trick-area {
    inset: 86px 74px 78px;
  }

  .played-card.seat-partner {
    top: 64px;
  }

  .trick-area.collecting.winner-partner .played-card {
    top: 8px;
    left: calc(50% + 66px);
    transform: scale(0.72);
  }

  .trick-area.collecting.winner-left .played-card {
    left: -88px;
    top: 78%;
  }

  .trick-area.collecting.winner-right .played-card {
    right: -88px;
    top: 78%;
  }

  .trick-stack {
    width: 78px;
  }

  .trick-stack.stack-partner {
    left: calc(50% + 66px);
    top: 8px;
    transform: none;
  }

  .trick-stack.stack-left {
    left: -88px;
    top: 78%;
  }

  .trick-stack.stack-right {
    right: -88px;
    top: 78%;
  }

  .trick-stack strong {
    font-size: 15px;
  }

  .trick-stack small {
    font-size: 11px;
  }

  .trick-points {
    min-width: 132px;
  }

  .trick-points strong {
    font-size: 22px;
  }

  .trick-points.winner-left {
    left: 72px;
  }

  .trick-points.winner-right {
    right: 72px;
  }

  .trick-points.collecting.winner-left {
    left: 8px;
    top: 66%;
  }

  .trick-points.collecting.winner-right {
    right: 8px;
    top: 66%;
  }

  .trick-points.collecting.winner-partner {
    left: calc(50% + 66px);
    top: 8px;
    transform: none;
  }

  .roem-burst strong {
    font-size: 28px;
  }

  .nat-burst strong {
    font-size: 36px;
  }

  .player-left,
  .player-right {
    top: 54%;
  }

  .hand {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
  }

  .pot-summary-head,
  .pot-summary-list {
    grid-template-columns: 1fr;
  }

  .card {
    height: auto;
    min-height: 98px;
  }

  .mini-card {
    width: 88px;
    height: 122px;
  }

  .played-card {
    width: 88px;
  }

  .mini-card .corner {
    font-size: 17px;
  }

  .mini-card .rank-center {
    top: 30px;
    font-size: 26px;
  }

  .mini-card .suit {
    inset: 56px 0 0;
    font-size: 42px;
  }

  .last-trick-cards {
    grid-template-columns: repeat(2, minmax(92px, 1fr));
  }

  .boom-pot header {
    display: grid;
  }
}

/* Viewport-fit layer: keep the menu and table inside the visible screen. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.start-menu {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.start-menu-stage {
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

.start-menu-panel {
  min-height: 0;
}

.app-shell {
  max-height: 100dvh;
  overflow: hidden;
}

.table,
.hand-panel,
.bid-panel,
.score-board,
.variant-banner,
.top-bar {
  min-height: 0;
}

.hand-panel {
  overflow: hidden;
}

.hand {
  align-items: stretch;
}

@media (max-height: 760px) {
  .start-menu {
    padding: 10px;
  }

  .start-menu-stage {
    width: min(700px, 100%);
    max-height: calc(100dvh - 20px);
    padding: 12px;
  }

  .brand-showcase img {
    width: min(42vh, 300px);
    margin-bottom: -72px;
  }

  .start-menu-panel {
    width: min(620px, 100%);
    padding: 78px 14px 14px;
    gap: 8px;
  }

  .start-heading {
    gap: 2px;
  }

  .start-heading > p:last-child,
  .menu-choice small {
    display: none;
  }

  .menu-field {
    gap: 4px;
  }

  .menu-field input {
    min-height: 38px;
    font-size: 15px;
  }

  .menu-group {
    padding: 7px;
    gap: 7px;
  }

  .menu-choice > span {
    min-height: 42px;
    padding: 7px 9px;
  }

  .info-button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 13px;
  }

  .home-action-grid {
    gap: 7px;
  }

  .home-action-card {
    min-height: 58px;
    padding: 7px;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .home-action-icon {
    width: 28px;
    height: 28px;
  }

  .home-action-card small {
    display: none;
  }

  .online-entry {
    padding: 8px 10px;
  }

  .competition-copy p,
  .home-highscore small {
    display: none;
  }

  .home-highscore {
    min-width: 150px;
    padding: 7px 9px;
  }

  .home-highscore strong {
    font-size: 13px;
  }

  .online-kicker {
    margin-bottom: 1px;
  }

  .start-game-button {
    min-height: 40px;
  }
}

@media (max-width: 720px) {
  body.game-active {
    height: 100dvh;
    overflow: hidden;
  }

  .start-menu {
    padding: 8px;
  }

  .start-menu-stage {
    max-height: calc(100dvh - 16px);
    padding: 10px;
  }

  .brand-showcase img {
    width: min(52vw, 34vh, 220px);
    margin-bottom: -54px;
  }

  .start-menu-panel {
    padding: 62px 10px 10px;
    gap: 7px;
  }

  .start-heading h1 {
    font-size: 18px;
  }

  .start-heading > p:last-child,
  .menu-choice small,
  .online-entry strong {
    display: none;
  }

  .menu-field input {
    min-height: 34px;
    font-size: 14px;
  }

  .menu-group,
  .menu-group:first-of-type {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
    gap: 6px;
  }

  .menu-group:last-of-type {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .menu-choice > span {
    min-height: 38px;
    padding: 6px;
  }

  .menu-choice strong {
    font-size: 12px;
  }

  .info-button {
    min-width: 0;
    min-height: 28px;
    padding: 0 5px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-action-grid {
    gap: 5px;
  }

  .home-action-card {
    min-height: 42px;
    padding: 6px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 5px;
  }

  .home-action-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .home-action-card strong {
    font-size: 11px;
  }

  .online-entry {
    padding: 7px;
    gap: 6px;
  }

  .online-entry-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .start-game-button {
    min-height: 36px;
  }

  .table-chat {
    max-height: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .table-chat-log {
    grid-row: auto;
    grid-column: 1;
    max-height: 126px;
  }

  .info-dialog {
    padding: 12px;
  }

  .info-dialog.rules-dialog {
    height: calc(100dvh - 24px);
  }

  .info-content {
    max-height: 76vh;
  }

  .rules-dialog .info-content {
    max-height: none;
  }

  .rules-hero {
    padding: 10px;
  }

  .rules-hero h2 {
    font-size: 18px;
  }

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

  .rules-tabs button {
    min-height: 34px;
    font-size: 12px;
  }

  .rules-panel,
  .rules-panel.active {
    grid-template-columns: 1fr;
  }

  .rule-card {
    min-height: 0;
    padding: 10px;
  }

  .app-shell {
    height: 100dvh;
    min-height: 0;
    padding: 6px;
    gap: 5px;
    grid-template-columns: minmax(88px, 0.32fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  .top-bar {
    grid-column: 1 / -1;
    min-height: 0;
    padding: 6px 8px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .top-bar h1 {
    font-size: 16px;
  }

  .eyebrow {
    margin-bottom: 1px;
    font-size: 10px;
  }

  .status-grid {
    grid-template-columns: minmax(116px, 1.5fr) minmax(58px, 0.85fr) minmax(58px, 0.85fr);
    gap: 5px;
  }

  .status-pill {
    min-height: 0;
    padding: 5px;
  }

  .status-pill span,
  .score-board span,
  .bid-panel span,
  .player small,
  .hand-heading p {
    font-size: 10px;
  }

  .status-pill strong,
  .score-board strong {
    margin-top: 1px;
    font-size: 12px;
  }

  .trump-status {
    min-height: 0;
  }

  .trump-status-content {
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 4px;
  }

  .trump-status-content strong {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .trump-status-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 20px;
  }

  .variant-banner {
    grid-column: 1;
    min-height: 0;
    padding: 6px;
  }

  .variant-banner-content strong {
    margin-top: 1px;
    font-size: 12px;
  }

  .variant-banner-content p,
  .variant-city-mark {
    display: none;
  }

  .score-board {
    grid-column: 2;
    padding: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  #newGameButton,
  #nextGameButton,
  #lastTrickButton {
    min-height: 28px;
    grid-column: auto;
    padding: 0 5px;
    font-size: 11px;
  }

  .bid-panel {
    grid-column: 1 / -1;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

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

  .bid-panel strong {
    margin-top: 1px;
    font-size: 13px;
  }

  .bid-panel p {
    display: none;
  }

  .bid-actions {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .bid-button {
    min-height: 30px;
    flex: 0 1 auto;
    padding: 0 8px;
    font-size: 12px;
  }

  .table {
    grid-column: 1 / -1;
    height: auto;
    min-height: 0;
    border-width: 5px;
  }

  .table::after {
    inset: 22px;
  }

  .player {
    min-width: 64px;
    gap: 2px;
    font-size: 11px;
  }

  .player-info {
    max-width: 72px;
    padding: 2px 5px;
    border-radius: 7px;
  }

  .player-info span {
    font-size: 10px;
  }

  .player-info small {
    font-size: 9px;
  }

  .avatar,
  .player-top .avatar {
    width: 28px;
    height: 28px;
  }

  .player-top {
    top: 5px;
  }

  .player-left {
    left: 6px;
  }

  .player-right {
    right: 6px;
  }

  .trick-area {
    inset: 42px 58px 42px;
  }

  .played-card {
    width: 58px;
  }

  .played-card > span {
    font-size: 10px;
  }

  .played-card.seat-partner {
    top: 22px;
  }

  .played-card.seat-user {
    bottom: 32px;
  }

  .mini-card {
    width: 52px;
    height: 72px;
  }

  .mini-card .corner {
    top: 5px;
    left: 5px;
    font-size: 11px;
  }

  .mini-card .rank-center {
    top: 18px;
    font-size: 17px;
  }

  .mini-card .suit {
    inset: 34px 0 0;
    font-size: 25px;
  }

  .mini-card .trump-mark {
    right: 4px;
    bottom: 4px;
    width: 15px;
    height: 15px;
    font-size: 9px;
  }

  .message {
    bottom: 5px;
    width: min(420px, calc(100% - 16px));
    padding: 6px 8px;
    font-size: 12px;
  }

  .roem-board,
  .signal-board,
  .trick-points,
  .roem-burst,
  .nat-burst {
    padding: 6px 8px;
    max-width: calc(100% - 16px);
  }

  .hand-panel {
    grid-column: 1 / -1;
    padding: 5px 6px;
  }

  .hand-heading {
    margin-bottom: 4px;
  }

  .hand-heading h2 {
    font-size: 13px;
  }

  .hand {
    grid-template-columns: repeat(8, minmax(30px, 1fr));
    gap: 4px;
  }

  .card {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 0.68;
    border-width: 1px;
    border-radius: 6px;
  }

  .card .corner {
    top: 4px;
    left: 4px;
    font-size: 10px;
  }

  .card .suit {
    padding-top: 8px;
    font-size: 22px;
  }

  .card .trump-mark {
    right: 3px;
    bottom: 3px;
    width: 14px;
    height: 14px;
    font-size: 8px;
  }
}

@media (max-width: 380px), (max-height: 620px) {
  .start-heading h1,
  .online-entry,
  .variant-banner {
    display: none;
  }

  .start-menu-panel {
    padding-top: 54px;
  }

  .brand-showcase img {
    width: min(48vw, 28vh, 170px);
    margin-bottom: -48px;
  }

  .app-shell {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  .score-board {
    grid-column: 1 / -1;
  }

  .top-bar {
    padding: 5px 6px;
  }

  .top-bar h1 {
    display: none;
  }

  .table {
    border-width: 4px;
  }

  .mini-card {
    width: 46px;
    height: 64px;
  }

  .message {
    font-size: 11px;
  }
}

/* Home frame guard: keep the full start menu visible inside embedded browser frames. */
.start-menu {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding: clamp(6px, 1.4vh, 18px);
}

.start-menu-stage {
  width: min(720px, 100%);
  max-height: calc(100dvh - clamp(12px, 2.8vh, 36px));
  padding: clamp(10px, 1.6vh, 18px);
  overflow: hidden;
}

.brand-showcase img {
  width: min(56vw, 35vh, 330px);
  margin-bottom: clamp(-82px, -9.4vh, -48px);
}

.start-menu-panel {
  width: min(600px, 100%);
  padding: clamp(58px, 9.6vh, 88px) clamp(12px, 2vw, 18px) clamp(10px, 1.7vh, 16px);
  gap: clamp(6px, 1.1vh, 10px);
}

.start-heading {
  gap: 3px;
}

.start-heading h1 {
  margin: 0;
  font-size: clamp(20px, 3.6vh, 34px);
}

.start-heading p {
  margin: 0;
}

.menu-field {
  gap: 4px;
}

.menu-field input {
  min-height: clamp(36px, 5.4vh, 44px);
}

.avatar-upload-field {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 42px;
  gap: 8px;
}

.avatar-preview {
  width: 40px;
  height: 40px;
}

.menu-group {
  padding: clamp(6px, 1vh, 8px);
  gap: 7px;
}

.menu-choice > span {
  min-height: clamp(42px, 7.1vh, 58px);
  padding: 7px 8px;
}

.home-action-grid {
  gap: clamp(5px, 1vh, 8px);
}

.home-action-card {
  min-height: clamp(44px, 8vh, 66px);
  padding: 7px 8px;
}

.online-entry {
  padding: clamp(7px, 1.2vh, 10px);
}

.home-highscore {
  padding: 7px 9px;
}

.start-game-button {
  min-height: clamp(36px, 5.8vh, 42px);
}

@media (max-height: 760px) {
  .start-menu-stage {
    width: min(640px, 100%);
  }

  .brand-showcase img {
    width: min(42vw, 24vh, 178px);
    margin-bottom: -42px;
  }

  .start-menu-panel {
    width: min(580px, 100%);
    padding-top: 44px;
    gap: 5px;
  }

  .menu-group legend,
  .avatar-upload-field small,
  .home-action-card small,
  .competition-copy p,
  .home-highscore small {
    display: none;
  }

  .menu-group {
    padding: 5px;
  }

  .menu-choice > span {
    min-height: 36px;
  }

  .home-action-card {
    min-height: 40px;
  }

  .online-entry,
  .competition-entry {
    display: none;
  }
}

@media (max-height: 660px) {
  .start-menu-stage {
    width: min(640px, 100%);
    padding: 8px;
  }

  .brand-showcase img {
    width: min(48vw, 27vh, 210px);
    margin-bottom: -50px;
  }

  .start-menu-panel {
    padding-top: 54px;
    gap: 5px;
  }

  .start-heading > p:last-child,
  .menu-field span,
  .menu-group legend,
  .avatar-upload-field small,
  .online-entry,
  .competition-entry {
    display: none;
  }
}

/* iOS app fit: safe-area aware, touch-first, and usable in compact landscape. */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html {
  background: #111611;
  -webkit-text-size-adjust: 100%;
}

body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: rgba(217, 170, 69, 0.18);
  -webkit-touch-callout: none;
}

button,
input,
select,
textarea {
  font-size: max(16px, 1em);
}

.start-menu,
.app-shell {
  padding-top: max(clamp(6px, 1.4vh, 18px), var(--safe-top));
  padding-right: max(clamp(6px, 1.4vh, 18px), var(--safe-right));
  padding-bottom: max(clamp(6px, 1.4vh, 18px), var(--safe-bottom));
  padding-left: max(clamp(6px, 1.4vh, 18px), var(--safe-left));
}

.app-shell {
  width: 100%;
}

@media (min-width: 721px) {
  .app-shell {
    width: min(1180px, 100%);
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .start-menu {
    place-items: center;
  }

  .start-menu-stage {
    width: min(680px, calc(100vw - max(16px, var(--safe-left)) - max(16px, var(--safe-right))));
    max-height: calc(100dvh - max(12px, var(--safe-top)) - max(12px, var(--safe-bottom)));
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    padding: 8px;
  }

  .brand-showcase {
    align-self: stretch;
    justify-content: center;
  }

  .brand-showcase img {
    width: 92px;
    margin: 0;
  }

  .brand-showcase p,
  .start-heading > p:last-child,
  .avatar-upload-field small,
  .menu-choice small,
  .home-action-card small,
  .competition-entry {
    display: none;
  }

  .start-menu-panel {
    width: 100%;
    padding: 10px;
    gap: 5px;
  }

  .start-heading h1 {
    font-size: 17px;
  }

  .avatar-upload-field {
    min-height: 34px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .avatar-preview {
    width: 34px;
    height: 34px;
  }

  .menu-field input,
  .start-game-button {
    min-height: 34px;
  }

  .menu-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 5px;
    gap: 5px;
  }

  .menu-group:first-of-type {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-choice > span,
  .home-action-card {
    min-height: 34px;
    padding: 5px 6px;
  }

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

  .home-action-card {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .home-action-icon {
    width: 22px;
    height: 22px;
  }

  .app-shell {
    height: 100dvh;
    max-height: 100dvh;
    gap: 5px;
    grid-template-columns: minmax(116px, 0.2fr) minmax(0, 1fr) minmax(146px, 0.24fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .top-bar {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 0;
    padding: 5px 7px;
    gap: 8px;
  }

  .top-bar h1,
  .variant-banner,
  .table-chat,
  .bid-panel p,
  .hand-heading p {
    display: none;
  }

  .eyebrow {
    margin: 0;
    font-size: 9px;
  }

  .status-grid {
    grid-template-columns: repeat(3, minmax(56px, 1fr));
    gap: 4px;
  }

  .status-pill {
    padding: 4px 5px;
  }

  .trump-status {
    min-height: 0;
  }

  .trump-status-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 18px;
  }

  .score-board {
    grid-column: 3;
    grid-row: 2;
    padding: 5px;
    grid-template-columns: 1fr;
    align-self: stretch;
    overflow: hidden;
    gap: 4px;
  }

  .score-board > div {
    padding: 4px 5px;
  }

  .score-board span,
  .bid-panel span,
  .player small {
    font-size: 9px;
  }

  .status-pill strong,
  .score-board strong,
  .bid-panel strong {
    margin-top: 1px;
    font-size: 11px;
  }

  #newGameButton,
  #nextGameButton,
  #lastTrickButton {
    min-height: 25px;
    padding: 0 5px;
    font-size: 10px;
  }

  .bid-panel {
    grid-column: 1;
    grid-row: 2;
    padding: 6px;
    gap: 5px;
    align-self: stretch;
    overflow: hidden;
  }

  .bid-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .bid-button {
    min-height: 28px;
    padding: 0 6px;
    font-size: 11px;
  }

  .table {
    grid-column: 2;
    grid-row: 2;
    min-height: 210px;
    border-width: 5px;
  }

  .table::after {
    inset: 20px;
  }

  .player {
    min-width: 58px;
    font-size: 10px;
  }

  .avatar,
  .player-top .avatar {
    width: 28px;
    height: 28px;
  }

  .player-top {
    top: 5px;
  }

  .player-left {
    left: 6px;
  }

  .player-right {
    right: 6px;
  }

  .player-info {
    max-width: 66px;
    padding: 2px 4px;
  }

  .trick-area {
    inset: 40px 58px 36px;
  }

  .played-card {
    width: 54px;
    gap: 2px;
  }

  .played-card > span {
    font-size: 9px;
  }

  .mini-card {
    width: 48px;
    height: 66px;
  }

  .mini-card .corner {
    top: 4px;
    left: 4px;
    font-size: 10px;
  }

  .mini-card .rank-center {
    top: 16px;
    font-size: 16px;
  }

  .mini-card .suit {
    inset: 32px 0 0;
    font-size: 24px;
  }

  .message {
    bottom: 4px;
    width: min(360px, calc(100% - 12px));
    padding: 5px 7px;
    font-size: 10px;
  }

  .hand-panel {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 5px 6px;
  }

  .hand-heading {
    margin-bottom: 3px;
  }

  .hand-heading h2 {
    font-size: 11px;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
  }

  .hand {
    min-height: 0;
    grid-template-columns: repeat(8, minmax(34px, 1fr));
    gap: 4px;
  }

  .card {
    height: clamp(52px, 16vh, 68px);
    border-radius: 6px;
  }

  .card .corner {
    top: 4px;
    left: 4px;
    font-size: 9px;
  }

  .card .suit {
    padding-top: 6px;
    font-size: clamp(20px, 6vh, 26px);
  }

  .card .trump-mark {
    right: 3px;
    bottom: 3px;
    width: 14px;
    height: 14px;
    font-size: 8px;
  }

  .table-chat-bubble {
    max-width: min(220px, 44%);
    padding: 6px 8px;
  }
}

@media (orientation: landscape) and (max-height: 390px) {
  .app-shell {
    gap: 4px;
    grid-template-columns: minmax(104px, 0.18fr) minmax(0, 1fr) minmax(130px, 0.22fr);
  }

  .top-bar {
    padding: 4px 6px;
  }

  .table {
    min-height: 190px;
  }

  .score-board > div:nth-of-type(2),
  #lastTrickButton {
    display: none;
  }

  .card {
    height: clamp(48px, 15vh, 58px);
  }
}

/* Safe table layer: stacks and point labels stay inside the felt on small devices. */
@media (max-width: 430px) {
  body.game-active .trick-stack {
    width: 54px;
    min-height: 42px;
    gap: 1px;
  }

  body.game-active .trick-stack strong {
    padding: 1px 6px;
    font-size: 11px;
  }

  body.game-active .trick-stack small {
    display: none;
  }

  body.game-active .stack-cards {
    width: 38px;
    height: 24px;
  }

  body.game-active .stack-cards span {
    width: 32px;
    height: 22px;
  }

  body.game-active .trick-stack.stack-partner {
    top: 74px;
    left: auto;
    right: 76px;
    transform: none;
  }

  body.game-active .trick-stack.stack-left {
    left: 12px;
    top: auto;
    bottom: 78px;
    transform: none;
  }

  body.game-active .trick-stack.stack-right {
    right: 12px;
    top: auto;
    bottom: 78px;
    transform: none;
  }

  body.game-active .trick-stack.stack-user {
    left: 50%;
    right: auto;
    bottom: 34px;
    transform: translateX(-50%);
  }

  body.game-active .trick-points {
    min-width: 96px;
    max-width: 132px;
    padding: 5px 7px;
  }

  body.game-active .trick-points strong {
    font-size: 16px;
  }

  body.game-active .trick-points span {
    margin-top: 0;
    font-size: 9px;
    white-space: nowrap;
  }

  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    top: 96px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  body.game-active .trick-points.winner-left,
  body.game-active .trick-points.collecting.winner-left {
    left: 12px;
    top: auto;
    bottom: 130px;
    right: auto;
    transform: none;
  }

  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right {
    right: 12px;
    top: auto;
    bottom: 130px;
    left: auto;
    transform: none;
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    left: 50%;
    right: auto;
    bottom: 86px;
    transform: translateX(-50%);
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body.game-active .trick-stack.stack-partner {
    top: 8px;
    left: auto;
    right: 78px;
    transform: none;
  }

  body.game-active .trick-stack.stack-left {
    left: 10px;
    top: 8px;
    right: auto;
    bottom: auto;
    transform: none;
  }

  body.game-active .trick-stack.stack-right {
    right: 10px;
    top: 8px;
    left: auto;
    bottom: auto;
    transform: none;
  }

  body.game-active .trick-stack.stack-user {
    left: 50%;
    right: auto;
    bottom: 8px;
    transform: translateX(-50%);
  }

  body.game-active .trick-points {
    min-width: 82px;
    max-width: 104px;
    padding: 4px 6px;
  }

  body.game-active .trick-points strong {
    font-size: 14px;
  }

  body.game-active .trick-points span {
    display: none;
  }

  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    top: 52px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  body.game-active .trick-points.winner-left,
  body.game-active .trick-points.collecting.winner-left {
    left: 74px;
    top: 52px;
    right: auto;
    bottom: auto;
    transform: none;
  }

  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right {
    right: 74px;
    top: 52px;
    left: auto;
    bottom: auto;
    transform: none;
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    left: 50%;
    right: auto;
    bottom: 42px;
    transform: translateX(-50%);
  }
}

/* Full-screen home: the start screen must fill the whole device, not sit in a framed card. */
body:not(.game-active) .start-menu {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  place-items: stretch;
}

body:not(.game-active) .start-menu-stage {
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  align-content: stretch;
  grid-template-rows: minmax(150px, 24vh) minmax(0, 1fr);
  padding-top: max(10px, var(--safe-top));
  padding-right: max(10px, var(--safe-right));
  padding-bottom: max(10px, var(--safe-bottom));
  padding-left: max(10px, var(--safe-left));
  border: 0;
  border-radius: 0;
}

body:not(.game-active) .start-menu-stage::before {
  inset: max(10px, var(--safe-top)) max(10px, var(--safe-right)) max(10px, var(--safe-bottom)) max(10px, var(--safe-left));
  border-radius: 12px;
}

body:not(.game-active) .brand-showcase {
  align-self: end;
  min-height: 0;
}

body:not(.game-active) .start-menu-panel {
  align-self: stretch;
  min-height: 0;
  align-content: space-between;
}

/* Final table safety override: no stack, points label or collected card may leave the table. */
@media (max-width: 430px) {
  body.game-active .trick-area.collecting.winner-left .played-card {
    top: auto;
    left: 48px;
    right: auto;
    bottom: 78px;
    transform: scale(0.58);
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    top: auto;
    left: auto;
    right: 48px;
    bottom: 32px;
    transform: scale(0.58);
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    top: 74px;
    left: auto;
    right: 76px;
    bottom: auto;
    transform: scale(0.58);
  }

  body.game-active .played-card.seat-left {
    left: 42px !important;
  }

  body.game-active .played-card.seat-right {
    right: 42px !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50%;
    right: auto;
    bottom: 34px;
    transform: translateX(-50%) scale(0.58);
  }

  body.game-active .trick-stack.stack-left {
    left: 12px;
    right: auto;
    top: auto;
    bottom: 78px;
    transform: none;
  }

  body.game-active .trick-stack.stack-right {
    left: auto;
    right: 12px;
    top: auto;
    bottom: 32px;
    transform: none;
  }

  body.game-active .trick-stack.stack-partner {
    left: auto;
    right: 76px;
    top: 74px;
    bottom: auto;
    transform: none;
  }

  body.game-active .trick-stack.stack-user {
    left: 50%;
    right: auto;
    bottom: 34px;
    transform: translateX(-50%);
  }

  body.game-active .trick-points.winner-left,
  body.game-active .trick-points.collecting.winner-left,
  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right {
    left: 50%;
    right: auto;
    top: 128px;
    bottom: auto;
    transform: translateX(-50%);
  }

  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    left: 50%;
    right: auto;
    top: 96px;
    bottom: auto;
    transform: translateX(-50%);
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 86px;
    transform: translateX(-50%);
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body.game-active .trick-stack.stack-user {
    left: calc(50% - 72px);
    right: auto;
    bottom: 8px;
    transform: none;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: calc(50% - 18px);
    right: auto;
    bottom: 8px;
    transform: scale(0.58);
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    left: 50%;
    right: auto;
    bottom: 46px;
    transform: translateX(-50%);
  }
}

@media (orientation: portrait) and (max-width: 430px) and (max-height: 760px) {
  .app-shell {
    gap: 4px;
    grid-template-rows: auto auto auto minmax(176px, 1fr) auto;
  }

  .table-chat {
    display: none;
  }

  .top-bar {
    padding: 5px 7px;
  }

  .top-bar h1 {
    display: none;
  }

  .status-grid {
    gap: 4px;
  }

  .score-board {
    padding: 4px;
  }

  .score-board > div {
    padding: 4px 5px;
  }

  .bid-panel {
    padding: 5px 7px;
  }

  .table {
    min-height: 176px;
  }

  .trick-area {
    inset: 84px 106px 44px;
  }

  .played-card.seat-partner {
    top: 20px;
  }

  .played-card.seat-user {
    bottom: 20px;
  }

  .played-card.seat-left {
    left: -20px;
  }

  .played-card.seat-right {
    right: -20px;
  }

  .played-card > span {
    display: none;
  }

  .table-chat-bubble {
    display: none;
  }

  .trick-stack {
    width: 52px;
    min-height: 42px;
    gap: 1px;
  }

  .trick-stack strong {
    padding: 1px 6px;
    font-size: 11px;
  }

  .trick-stack small {
    display: none;
  }

  .stack-cards {
    width: 38px;
    height: 24px;
  }

  .stack-cards span {
    width: 32px;
    height: 22px;
    border-radius: 4px;
  }

  .trick-stack.stack-partner {
    top: 18px;
    left: auto;
    right: -28px;
  }

  .trick-stack.stack-left {
    left: -62px;
    top: 18px;
    bottom: auto;
    transform: none;
  }

  .trick-stack.stack-right {
    right: -28px;
    top: 72px;
    bottom: auto;
    transform: none;
  }

  .trick-stack.stack-user {
    bottom: 28px;
  }

  .trick-area.collecting.winner-partner .played-card {
    top: 18px;
    left: auto;
    right: -28px;
    transform: scale(0.58);
  }

  .trick-area.collecting.winner-left .played-card {
    top: 18px;
    left: -62px;
    bottom: auto;
    transform: scale(0.58);
  }

  .trick-area.collecting.winner-right .played-card {
    top: 72px;
    right: -28px;
    bottom: auto;
    transform: scale(0.58);
  }

  .trick-area.collecting.winner-user .played-card {
    bottom: 28px;
    transform: translateX(-50%) scale(0.58);
  }

  .hand-panel {
    padding: 4px 5px;
  }

  .hand-heading {
    margin-bottom: 3px;
  }

  .hand-heading h2 {
    font-size: 12px;
  }

  .hand {
    min-height: 0;
    grid-template-columns: repeat(8, minmax(28px, 1fr));
    gap: 3px;
  }

  .card {
    height: clamp(54px, 12vh, 72px);
  }
}

@media (orientation: portrait) and (max-width: 430px) {
  .start-menu {
    min-height: 100dvh;
    padding: max(8px, var(--safe-top)) max(10px, var(--safe-right)) max(8px, var(--safe-bottom)) max(10px, var(--safe-left));
    place-items: stretch;
  }

  .start-menu-stage {
    width: 100%;
    height: calc(100dvh - max(8px, var(--safe-top)) - max(8px, var(--safe-bottom)));
    max-height: none;
    align-content: stretch;
    padding: 8px;
  }

  .brand-showcase img {
    width: min(38vw, 128px);
    margin-bottom: -32px;
  }

  .brand-showcase {
    min-height: 88px;
  }

  .start-menu-panel {
    height: 100%;
    min-height: 0;
    padding: 38px 10px 10px;
    gap: 6px;
    align-content: stretch;
    grid-template-rows: auto auto auto auto auto auto minmax(104px, 1fr) auto auto;
  }

  .start-heading {
    gap: 1px;
  }

  .start-heading h1 {
    font-size: 17px;
  }

  .start-heading > p:last-child,
  .menu-group legend,
  .menu-choice small,
  .avatar-upload-field small,
  .home-action-card small,
  .competition-copy p,
  .competition-copy strong,
  .home-highscore small {
    display: none;
  }

  .menu-field {
    gap: 3px;
  }

  .menu-field input {
    min-height: 34px;
  }

  .avatar-upload-field {
    min-height: 36px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 4px 7px;
  }

  .avatar-preview {
    width: 34px;
    height: 34px;
  }

  .menu-group,
  .menu-group:first-of-type {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
    gap: 5px;
  }

  .menu-group:last-of-type {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .menu-choice > span {
    min-height: 35px;
    padding: 5px;
  }

  .menu-choice strong {
    font-size: 11px;
    line-height: 1.1;
  }

  .home-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .home-action-card {
    min-height: 38px;
    padding: 5px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 4px;
  }

  .home-action-icon {
    width: 22px;
    height: 22px;
  }

  .home-action-card strong {
    font-size: 10px;
  }

  .competition-entry {
    min-height: 0;
    padding: 7px;
    gap: 6px;
    display: grid;
    grid-template-columns: 1fr;
    align-content: stretch;
  }

  .competition-copy {
    display: grid;
    gap: 2px;
    align-items: center;
    justify-content: center;
    min-height: 0;
    text-align: center;
  }

  .online-kicker {
    margin: 0;
    font-size: 10px;
  }

  .home-highscore {
    min-width: 0;
    padding: 6px 8px;
  }

  .home-highscore span {
    font-size: 9px;
  }

  .home-highscore strong {
    font-size: 12px;
  }

  .online-entry-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
  }

  .online-entry-actions .info-button {
    min-height: 32px;
    padding: 0 72px 0 10px;
    font-size: 12px;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
  }

  .online-entry-actions .info-button:not(.premium-locked) {
    padding-right: 10px;
  }

  .start-game-button {
    min-height: 36px;
    font-size: 15px;
  }

  body.game-active .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(280px, 1fr) auto auto;
    gap: 4px;
  }

  body.game-active .variant-banner {
    display: none;
  }

  body.game-active .top-bar {
    padding: 5px 7px;
  }

  body.game-active .top-bar h1 {
    display: none;
  }

  body.game-active .score-board {
    grid-column: 1 / -1;
    padding: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(3, auto);
    gap: 4px;
  }

  body.game-active .score-board > div {
    padding: 4px 5px;
  }

  body.game-active #newGameButton,
  body.game-active #nextGameButton,
  body.game-active #lastTrickButton {
    min-height: 26px;
    padding: 0 5px;
    font-size: 10px;
  }

  body.game-active .bid-panel {
    padding: 5px 7px;
  }

  body.game-active .table {
    min-height: 300px;
  }

  body.game-active .hand-panel {
    padding: 4px 5px;
  }

  body.game-active .hand-heading {
    margin-bottom: 3px;
  }

  body.game-active .hand {
    min-height: 0;
    grid-template-columns: repeat(8, minmax(28px, 1fr));
    gap: 4px;
    align-items: end;
  }

  body.game-active .card {
    height: clamp(66px, 9vh, 78px);
    align-self: end;
  }

  body.game-active .card .suit {
    font-size: 24px;
  }

  body.game-active .table-chat {
    display: grid;
    grid-column: 1 / -1;
    height: 58px;
    min-height: 58px;
    max-height: 58px;
    padding: 5px;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.55fr);
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: 5px;
  }

  body.game-active .table-chat-header {
    display: none;
  }

  body.game-active .table-chat-header strong,
  body.game-active .table-chat-header small {
    display: none;
  }

  body.game-active .table-chat-log {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    min-height: 0;
    max-height: none;
    align-self: stretch;
    padding: 4px;
    font-size: 10px;
  }

  body.game-active .table-chat-message {
    margin-bottom: 3px;
    padding: 3px 5px;
  }

  body.game-active .table-chat-form {
    align-self: stretch;
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 4px;
  }

  body.game-active .table-chat-form input,
  body.game-active .table-chat-form button {
    min-height: 0;
    height: 100%;
    padding: 0 6px;
    font-size: 12px;
  }

  body.game-active .table-chat-form button {
    font-size: 10px;
  }

  body.game-active .table-chat-bubble {
    display: none !important;
  }

  body.game-active .message {
    left: 50%;
    right: auto;
    top: 8px;
    bottom: auto;
    width: min(300px, calc(100% - 24px));
    padding: 6px 10px;
    transform: translateX(-50%);
    font-size: 12px;
    line-height: 1.2;
  }
}

/* Absolute final small-table guard. Keep piles, points and collected cards on felt. */
@media (max-width: 430px) {
  body.game-active .trick-stack.stack-left {
    left: 18px !important;
    right: auto !important;
    top: auto !important;
    bottom: 34px !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    left: auto !important;
    right: 18px !important;
    top: auto !important;
    bottom: 34px !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 34px !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-stack.stack-partner {
    left: 50% !important;
    right: auto !important;
    top: 74px !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: 18px !important;
    right: auto !important;
    top: auto !important;
    bottom: 34px !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    left: auto !important;
    right: 18px !important;
    top: auto !important;
    bottom: 34px !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 34px !important;
    transform: translateX(-50%) scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    left: 50% !important;
    right: auto !important;
    top: 74px !important;
    bottom: auto !important;
    transform: translateX(-50%) scale(0.58) !important;
  }

  body.game-active .trick-points {
    min-width: 88px !important;
    max-width: 118px !important;
    padding: 4px 6px !important;
  }

  body.game-active .trick-points strong {
    font-size: 14px !important;
  }

  body.game-active .trick-points span {
    display: none !important;
  }

  body.game-active .trick-points.winner-left,
  body.game-active .trick-points.collecting.winner-left,
  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right {
    left: 50% !important;
    right: auto !important;
    top: 126px !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body.game-active .trick-stack.stack-left {
    left: 16px !important;
    top: 38px !important;
    right: auto !important;
    bottom: auto !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 16px !important;
    top: 38px !important;
    left: auto !important;
    bottom: auto !important;
  }

  body.game-active .trick-stack.stack-partner {
    left: calc(50% - 72px) !important;
    top: 38px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    left: calc(50% - 166px) !important;
    right: auto !important;
    top: 96px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    bottom: 8px !important;
    top: auto !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card,
  body.game-active .trick-area.collecting.winner-partner .played-card,
  body.game-active .trick-area.collecting.winner-left .played-card,
  body.game-active .trick-area.collecting.winner-right .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 8px !important;
    transform: translateX(-50%) scale(0.54) !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .trick-area {
    inset: 66px 112px 32px;
  }

  .played-card {
    width: 44px;
  }

  .played-card > span,
  .table-chat-bubble {
    display: none;
  }

  .played-card.seat-partner {
    top: 12px;
  }

  .played-card.seat-user {
    bottom: 4px;
  }

  .trick-stack {
    width: 54px;
    min-height: 42px;
    gap: 1px;
  }

  .trick-stack strong {
    padding: 1px 6px;
    font-size: 11px;
  }

  .trick-stack small {
    display: none;
  }

  .stack-cards {
    width: 38px;
    height: 24px;
  }

  .stack-cards span {
    width: 32px;
    height: 22px;
    border-radius: 4px;
  }

  .mini-card {
    width: 34px;
    height: 46px;
  }

  .mini-card .corner {
    top: 3px;
    left: 3px;
    font-size: 9px;
  }

  .mini-card .rank-center {
    top: 12px;
    font-size: 14px;
  }

  .mini-card .suit {
    inset: 23px 0 0;
    font-size: 18px;
  }

  .mini-card .trump-mark {
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    font-size: 7px;
  }

  .trick-stack.stack-partner {
    top: -34px;
    left: auto;
    right: 48px;
  }

  .trick-stack.stack-left {
    left: -24px;
    top: -34px;
    transform: none;
  }

  .trick-stack.stack-right {
    right: -24px;
    top: -34px;
    transform: none;
  }

  .trick-stack.stack-user {
    bottom: 8px;
  }

  .trick-area.collecting.winner-partner .played-card {
    top: -34px;
    left: auto;
    right: 48px;
    transform: scale(0.58);
  }

  .trick-area.collecting.winner-left .played-card {
    top: -34px;
    left: -24px;
    transform: scale(0.58);
  }

  .trick-area.collecting.winner-right .played-card {
    top: -34px;
    right: -24px;
    transform: scale(0.58);
  }

  .trick-area.collecting.winner-user .played-card {
    bottom: 8px;
    transform: translateX(-50%) scale(0.58);
  }
}

/* Final spacing pass for compact tables: keep cards, piles and point labels separated. */
@media (max-width: 430px) {
  body.game-active .played-card.seat-partner {
    top: 78px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: 54px !important;
  }

  body.game-active .played-card.seat-left {
    left: 4px !important;
  }

  body.game-active .played-card.seat-right {
    right: 4px !important;
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    left: calc(50% + 46px) !important;
    right: auto !important;
    top: auto !important;
    bottom: 86px !important;
    transform: none !important;
  }

  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    left: calc(50% + 46px) !important;
    right: auto !important;
    transform: none !important;
  }

  body.game-active .trick-points.winner-left,
  body.game-active .trick-points.collecting.winner-left,
  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right {
    left: 50% !important;
    right: auto !important;
    top: 176px !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body:not(.game-active) .start-menu-stage {
    align-items: stretch !important;
    grid-template-columns: minmax(96px, 0.16fr) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    padding: 10px !important;
  }

  body:not(.game-active) .brand-showcase,
  body:not(.game-active) .start-menu-panel {
    align-self: stretch !important;
    grid-row: 1 !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-column: 2 !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
    align-content: space-between !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .brand-showcase {
    grid-column: 1 !important;
    min-height: 0 !important;
  }

  body.game-active .app-shell {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: max(4px, var(--safe-top)) max(6px, var(--safe-right)) max(4px, var(--safe-bottom)) max(6px, var(--safe-left)) !important;
    gap: 4px !important;
    grid-template-columns: minmax(78px, 0.13fr) minmax(0, 1fr) minmax(84px, 0.14fr) !important;
    grid-template-rows: 30px minmax(0, 1fr) 100px !important;
  }

  body.game-active .top-bar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    min-height: 0 !important;
    padding: 3px 6px !important;
  }

  body.game-active .status-grid {
    width: 100%;
    grid-template-columns: minmax(120px, 1.35fr) repeat(2, minmax(62px, 0.8fr)) !important;
    gap: 4px !important;
  }

  body.game-active .status-pill {
    min-height: 0 !important;
    padding: 3px 6px !important;
  }

  body.game-active .status-pill span,
  body.game-active .score-board span,
  body.game-active .bid-panel p {
    display: none !important;
  }

  body.game-active .status-pill strong,
  body.game-active .score-board strong,
  body.game-active .bid-panel strong {
    margin: 0 !important;
    font-size: 11px !important;
  }

  body.game-active .trump-status-content {
    grid-template-columns: minmax(0, 1fr) 26px !important;
    gap: 5px !important;
  }

  body.game-active .trump-status-icon {
    width: 26px !important;
    height: 26px !important;
    font-size: 19px !important;
    border-radius: 6px !important;
  }

  body.game-active .bid-panel {
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-height: 0 !important;
    padding: 5px !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  body.game-active .bid-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
  }

  body.game-active .bid-button {
    min-height: 30px !important;
    padding: 0 5px !important;
    font-size: 11px !important;
  }

  body.game-active .score-board {
    grid-column: 3 !important;
    grid-row: 2 !important;
    align-self: stretch !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 5px !important;
    grid-template-columns: 1fr !important;
    align-content: start !important;
    gap: 4px !important;
  }

  body.game-active .score-board > div {
    min-height: 0 !important;
    padding: 4px 5px !important;
  }

  body.game-active #newGameButton,
  body.game-active #nextGameButton,
  body.game-active #lastTrickButton {
    min-height: 24px !important;
    padding: 0 4px !important;
    font-size: 9px !important;
  }

  body.game-active .table {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-width: 6px !important;
  }

  body.game-active .table::after {
    inset: 24px !important;
  }

  body.game-active .hand-panel {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    min-height: 0 !important;
    padding: 4px 6px !important;
    overflow: hidden !important;
  }

  body.game-active .hand-heading {
    display: none !important;
  }

  body.game-active .hand {
    min-height: 92px !important;
    grid-template-columns: repeat(8, minmax(46px, 1fr)) !important;
    gap: 5px !important;
    align-items: stretch !important;
  }

  body.game-active .card {
    height: 90px !important;
    max-height: 90px !important;
    min-height: 0 !important;
    border-radius: 7px !important;
  }

  body.game-active .card .corner {
    top: 6px !important;
    left: 6px !important;
    font-size: 12px !important;
  }

  body.game-active .card .suit {
    padding-top: 9px !important;
    font-size: 34px !important;
  }

  body.game-active .card .trump-mark {
    right: 5px !important;
    bottom: 5px !important;
    width: 16px !important;
    height: 16px !important;
    font-size: 9px !important;
  }

  body.game-active .trick-area {
    inset: 42px 62px 34px !important;
  }

  body.game-active .played-card {
    width: 52px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: 14px !important;
  }

  body.game-active .played-card.seat-partner {
    top: 14px !important;
  }

  body.game-active .mini-card {
    width: 46px !important;
    height: 64px !important;
  }

  body.game-active .table-chat {
    display: none !important;
  }

  body.game-active .trick-stack.stack-user {
    left: calc(50% - 124px) !important;
    right: auto !important;
    bottom: 8px !important;
    top: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 14px !important;
    right: auto !important;
    top: 56px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 16px !important;
    top: 74px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right,
  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    left: calc(50% - 166px) !important;
    right: auto !important;
    top: 96px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    left: calc(50% - 138px) !important;
    right: auto !important;
    top: 52px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .message {
    left: 12px !important;
    right: auto !important;
    top: 4px !important;
    bottom: auto !important;
    max-width: 140px !important;
    transform: none !important;
  }
}

/* Apple device polish: keep cards proportional and give tablets a larger real table. */
@media (orientation: portrait) and (max-width: 540px) {
  body.game-active .hand {
    min-height: auto !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  body.game-active .card {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 0.68 !important;
  }

  body.game-active .card .corner {
    top: 5px !important;
    left: 5px !important;
    font-size: clamp(10px, 3.1vw, 13px) !important;
  }

  body.game-active .card .suit {
    padding-top: 8px !important;
    font-size: clamp(22px, 7.2vw, 31px) !important;
  }

  body.game-active .card .trump-mark {
    right: 4px !important;
    bottom: 4px !important;
    width: 15px !important;
    height: 15px !important;
    font-size: 8px !important;
  }
}

/* Final mobile polish: keep points beside the message and fit every hand card. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .game-events {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) clamp(86px, 26vw, 112px) !important;
    align-items: center !important;
    gap: 7px !important;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding: 5px 8px !important;
    overflow: hidden !important;
  }

  body.game-active .game-events .message {
    grid-column: 1 !important;
    min-width: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 10px !important;
    overflow: hidden !important;
  }

  body.game-active .game-events > .trick-points {
    grid-column: 2 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    justify-self: end !important;
    align-self: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 112px !important;
    height: 42px !important;
    max-height: 42px !important;
    padding: 4px 6px !important;
    display: grid !important;
    place-items: center !important;
    align-content: center !important;
  }

  body.game-active .game-events > .trick-points strong {
    font-size: clamp(14px, 3.8vw, 17px) !important;
    line-height: 1 !important;
  }

  body.game-active .game-events > .trick-points span {
    width: 100% !important;
    font-size: clamp(8px, 2.3vw, 10px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
  }

  body.game-active .hand {
    width: 100% !important;
    height: 76px !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 4px !important;
    align-items: stretch !important;
    justify-items: center !important;
    overflow: hidden !important;
  }

  body.game-active .hand .card {
    width: 100% !important;
    max-width: 48px !important;
    min-width: 0 !important;
    height: 76px !important;
    max-height: 76px !important;
    justify-self: stretch !important;
  }
}

/* Pot review polish: wait feels calmer, and the overview uses the full popup width. */
.last-trick-dialog:has(.pot-review-list) {
  width: min(760px, calc(100vw - 16px)) !important;
  max-width: calc(100vw - 16px) !important;
}

.last-trick-dialog:has(.pot-review-list) .last-trick-cards {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row > div {
  display: grid !important;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row strong {
  justify-self: end !important;
  min-width: 0 !important;
  text-align: right !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row p,
.last-trick-dialog:has(.pot-review-list) .pot-review-row small {
  width: 100% !important;
  max-width: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

@media (orientation: portrait) and (max-width: 700px) {
  .last-trick-dialog:has(.pot-review-list) {
    width: calc(100vw - 16px) !important;
    max-height: 84dvh !important;
    padding: 14px !important;
  }

  .last-trick-dialog:has(.pot-review-list) .last-trick-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }

  .last-trick-dialog:has(.pot-review-list) .last-trick-summary {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .last-trick-dialog:has(.pot-review-list) .pot-review-list {
    max-height: 56dvh !important;
  }

  .last-trick-dialog:has(.pot-review-list) .pot-review-row {
    padding: 9px 10px !important;
  }
}

@media (orientation: landscape) and (min-width: 1024px) and (min-height: 700px) {
  body.game-active .app-shell {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: max(8px, var(--safe-top)) max(10px, var(--safe-right)) max(8px, var(--safe-bottom)) max(10px, var(--safe-left)) !important;
    gap: 8px !important;
    grid-template-columns: minmax(170px, 0.16fr) minmax(0, 1fr) minmax(170px, 0.16fr) !important;
    grid-template-rows: auto minmax(0, 1fr) minmax(142px, auto) 78px !important;
  }

  body.game-active .top-bar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  body.game-active .variant-banner {
    display: none !important;
  }

  body.game-active .bid-panel {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: stretch !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.game-active .score-board {
    grid-column: 3 !important;
    grid-row: 2 !important;
    align-self: stretch !important;
    min-height: 0 !important;
    overflow: hidden !important;
    grid-template-columns: 1fr !important;
    align-content: start !important;
  }

  body.game-active .table {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  body.game-active .hand-panel {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    min-height: 0 !important;
  }

  body.game-active .hand {
    min-height: 0 !important;
    grid-template-columns: repeat(8, minmax(72px, 1fr)) !important;
    gap: 10px !important;
  }

  body.game-active .card {
    height: 118px !important;
    max-height: 118px !important;
  }

  body.game-active .table-chat {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
  }
}

/* iPhone portrait final layout: full-height home, readable premium actions, calm table chat. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) {
    height: 100dvh;
    overflow: hidden;
  }

  body:not(.game-active) .start-menu {
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    place-items: stretch !important;
  }

  body:not(.game-active) .start-menu-stage {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    padding: 8px !important;
  }

  body:not(.game-active) .brand-showcase {
    position: absolute !important;
    top: 2px !important;
    left: 50% !important;
    z-index: 4 !important;
    width: 128px !important;
    min-height: 0 !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: 118px !important;
    margin: 0 auto !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 86px 10px 10px !important;
    gap: 6px !important;
    overflow: hidden !important;
    grid-template-rows: auto auto auto auto auto auto minmax(108px, 1fr) auto auto !important;
  }

  body:not(.game-active) .competition-entry {
    min-height: 0 !important;
    padding: 7px !important;
    gap: 6px !important;
    grid-template-columns: 1fr !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .competition-copy {
    display: grid !important;
    justify-items: center !important;
    min-height: 0 !important;
    text-align: center !important;
  }

  body:not(.game-active) .competition-copy strong,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .home-highscore {
    padding: 6px 8px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: 12px !important;
    white-space: normal !important;
  }

  body:not(.game-active) .online-entry-actions {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-height: 32px !important;
    padding: 0 72px 0 10px !important;
    font-size: 12px !important;
    text-align: left !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .online-entry-actions .info-button:not(.premium-locked) {
    padding-right: 10px !important;
  }

  body.game-active .hand {
    align-items: end !important;
  }

  body.game-active .card {
    align-self: end !important;
    transform: none !important;
  }

  body.game-active .card:hover:not(:disabled) {
    transform: none !important;
  }

  body.game-active .played-card.seat-user {
    bottom: 54px !important;
  }

  body.game-active .played-card.seat-left {
    left: 4px !important;
  }

  body.game-active .played-card.seat-right {
    right: 4px !important;
  }

  body.game-active .table-chat-bubble {
    display: none !important;
  }

  body.game-active .message {
    left: 50% !important;
    right: auto !important;
    top: 8px !important;
    bottom: auto !important;
    width: min(300px, calc(100% - 24px)) !important;
    padding: 6px 10px !important;
    transform: translateX(-50%) !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
  }

  body.game-active .table-chat {
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.55fr) !important;
  }

  body.game-active .app-shell {
    grid-template-rows: auto auto 76px minmax(0, 1fr) 58px auto !important;
  }

  body.game-active .top-bar {
    grid-row: 1 !important;
  }

  body.game-active .score-board {
    grid-row: 2 !important;
  }

  body.game-active .bid-panel {
    display: none !important;
  }

  body.game-active .bid-popup {
    align-items: start !important;
    padding-top: max(118px, env(safe-area-inset-top)) !important;
  }

  body.game-active .bid-popup-dialog {
    width: min(360px, calc(100vw - 28px)) !important;
    padding: 12px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }

  body.game-active .bid-popup-dialog > strong {
    font-size: 18px !important;
  }

  body.game-active .bid-popup-dialog > p {
    font-size: 12px !important;
  }

  body.game-active .bid-popup .bid-button {
    min-height: 44px !important;
  }

  body.game-active .table-chat {
    grid-row: 3 !important;
    grid-column: 1 / -1 !important;
    height: 76px !important;
    min-height: 76px !important;
    max-height: 76px !important;
  }

  body.game-active .table {
    grid-row: 4 !important;
    min-height: 0 !important;
  }

  body.game-active .game-events {
    grid-row: 5 !important;
    grid-column: 1 / -1 !important;
    min-height: 58px !important;
    max-height: 58px !important;
    padding: 5px !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  body.game-active .game-events .message {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 6px 8px !important;
    transform: none !important;
    font-size: 12px !important;
  }

  body.game-active .game-events .trick-points,
  body.game-active .game-events .roem-burst,
  body.game-active .game-events .nat-burst,
  body.game-active .game-events .roem-board {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    min-width: 0 !important;
    max-width: 42% !important;
    padding: 5px 7px !important;
  }

  body.game-active .game-events .trick-points strong,
  body.game-active .game-events .roem-burst strong,
  body.game-active .game-events .nat-burst strong {
    font-size: 15px !important;
  }

  body.game-active .game-events .trick-points span,
  body.game-active .game-events .roem-burst span,
  body.game-active .game-events .nat-burst span,
  body.game-active .game-events .roem-board p {
    display: block !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
  }

  body.game-active .hand-panel {
    grid-row: 6 !important;
    min-height: 106px !important;
  }

  body.game-active .trick-stack.stack-partner {
    top: 22px !important;
    bottom: auto !important;
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    top: 22px !important;
    bottom: auto !important;
  }

  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    top: 46px !important;
    bottom: auto !important;
  }
}

/* Final iPhone table bottom polish: user's played card and won pile sit lower. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-user {
    bottom: 18px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 8px !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 8px !important;
    transform: translateX(-50%) scale(0.58) !important;
  }
}

/* Absolute last layout correction for compact tables. This must stay at EOF. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-partner {
    top: 48px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: 6px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.9) !important;
  }

  body.game-active .trick-stack.stack-partner {
    left: calc(50% + 78px) !important;
    right: auto !important;
    top: 22px !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 8px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 8px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -2px !important;
    transform: translateX(-50%) scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    left: calc(50% + 78px) !important;
    right: auto !important;
    top: 22px !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: 8px !important;
    right: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    right: 8px !important;
    left: auto !important;
    top: calc(50% + 82px) !important;
    bottom: auto !important;
    transform: scale(0.58) !important;
  }

  body[data-declarer="partner"] .player-top::after,
  body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
  body[data-trick-winner="partner"] .player-top::after {
    right: calc(100% + 5px) !important;
  }
}
/* Absolute last event-bar and pot-review correction. */
body.game-active .game-events {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto) minmax(96px, 0.42fr) !important;
  align-items: stretch !important;
  gap: 6px !important;
}

body.game-active .game-events .message {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
}

body.game-active .game-events .trick-points {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  min-width: 72px !important;
  text-align: center !important;
}

body.game-active .game-events .roem-burst,
body.game-active .game-events .roem-board,
body.game-active .game-events .nat-burst {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  min-width: 0 !important;
  max-width: none !important;
}

body.game-active .game-events .roem-burst,
body.game-active .game-events .roem-board {
  padding: 6px 8px !important;
  border-radius: 8px !important;
}

body.game-active .game-events .roem-burst {
  animation: none !important;
}

body.game-active .game-events .roem-burst strong,
body.game-active .game-events .roem-board strong {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.05 !important;
}

body.game-active .game-events .roem-burst span,
body.game-active .game-events .roem-board p {
  margin-top: 2px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 9px !important;
  line-height: 1.05 !important;
}

@media (max-width: 430px) {
  body.game-active .game-events {
    grid-template-columns: minmax(0, 1fr) 58px 86px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    gap: 4px !important;
  }

  body.game-active .game-events .message {
    font-size: 11px !important;
    line-height: 1.15 !important;
  }

  body.game-active .game-events .trick-points {
    min-width: 58px !important;
    padding: 5px 6px !important;
  }
}
/* EOF final card and won-pile placement for iPhone portrait. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .played-card.seat-partner {
    top: 70px !important;
  }

  body.game-active .played-card.seat-left {
    top: 56% !important;
    left: 2px !important;
  }

  body.game-active .played-card.seat-right {
    top: 56% !important;
    right: 2px !important;
  }

  body.game-active .played-card.seat-user {
    bottom: -18px !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -24px !important;
    transform: translateX(-50%) scale(0.86) !important;
  }

  body.game-active .trick-stack.stack-left {
    left: -18px !important;
    right: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-stack.stack-right {
    right: -18px !important;
    left: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: none !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -24px !important;
    transform: translateX(-50%) scale(0.54) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: -18px !important;
    right: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: scale(0.54) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    right: -18px !important;
    left: auto !important;
    top: calc(50% + 112px) !important;
    bottom: auto !important;
    transform: scale(0.54) !important;
  }
}
/* Edge-safe won-pile placement: keep the table center clear without leaving the cloth. */
@media (orientation: portrait) and (max-width: 430px) {
  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 4px !important;
    transform: translateX(-50%) scale(0.84) !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 4px !important;
    right: auto !important;
    top: calc(50% + 118px) !important;
    bottom: auto !important;
    transform: scale(0.84) !important;
    transform-origin: left center !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 4px !important;
    left: auto !important;
    top: calc(50% + 118px) !important;
    bottom: auto !important;
    transform: scale(0.84) !important;
    transform-origin: right center !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 4px !important;
    transform: translateX(-50%) scale(0.52) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    left: 4px !important;
    right: auto !important;
    top: calc(50% + 118px) !important;
    bottom: auto !important;
    transform: scale(0.52) !important;
    transform-origin: left center !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    right: 4px !important;
    left: auto !important;
    top: calc(50% + 118px) !important;
    bottom: auto !important;
    transform: scale(0.52) !important;
    transform-origin: right center !important;
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 2px !important;
    transform: translateX(34px) scale(0.86) !important;
  }

  body.game-active .trick-points.winner-left,
  body.game-active .trick-points.collecting.winner-left {
    left: 54px !important;
    right: auto !important;
    top: calc(50% + 160px) !important;
    bottom: auto !important;
    transform: scale(0.82) !important;
  }

  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right {
    right: 54px !important;
    left: auto !important;
    top: calc(50% + 160px) !important;
    bottom: auto !important;
    transform: scale(0.82) !important;
  }
}
/* Compact event points so "+45" and "45 punten" fit in the bottom status bar. */
body.game-active .game-events .trick-points {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 5px 6px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
}

body.game-active .game-events .trick-points strong {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(13px, 3.2vw, 18px) !important;
  line-height: 1 !important;
}

body.game-active .game-events .trick-points span {
  max-width: 100% !important;
  margin-top: 1px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(8px, 2.2vw, 10px) !important;
  line-height: 1 !important;
}

@media (max-width: 430px) {
  body.game-active .game-events {
    grid-template-columns: minmax(0, 1fr) minmax(64px, 76px) minmax(78px, 86px) !important;
  }

  body.game-active .game-events .trick-points {
    min-width: 64px !important;
    padding-inline: 4px !important;
  }

  body.game-active .game-events .trick-points strong {
    font-size: 14px !important;
  }

  body.game-active .game-events .trick-points span {
    font-size: 8px !important;
  }
}
/* NAT is a game result popup, not an item in the bottom event bar. */
body.game-active .nat-popup,
body.game-active .pit-popup {
  position: fixed !important;
  z-index: 80 !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: min(360px, calc(100vw - 34px)) !important;
  max-width: calc(100vw - 34px) !important;
  padding: 18px 16px !important;
  display: grid !important;
  gap: 8px !important;
  place-items: center !important;
  text-align: center !important;
  transform: translate(-50%, -50%) !important;
  border: 2px solid rgba(255, 219, 112, 0.94) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(135deg, rgba(101, 20, 18, 0.96), rgba(32, 15, 12, 0.96)) !important;
  box-shadow:
    0 0 0 999px rgba(1, 8, 7, 0.28),
    0 18px 46px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(217, 170, 69, 0.32) !important;
  pointer-events: none !important;
}

body.game-active .nat-popup[hidden],
body.game-active .pit-popup[hidden] {
  display: none !important;
}

body.game-active .nat-popup strong,
body.game-active .pit-popup strong {
  display: block !important;
  color: #ffe6a3 !important;
  font-size: clamp(32px, 9vw, 48px) !important;
  line-height: 0.95 !important;
  letter-spacing: 0 !important;
}

body.game-active .nat-popup span,
body.game-active .pit-popup span {
  display: block !important;
  max-width: 100% !important;
  color: #fff4d4 !important;
  font-size: clamp(13px, 3.4vw, 16px) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

body.game-active .pit-popup {
  z-index: 82 !important;
  border-color: rgba(255, 238, 160, 1) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 245, 179, 0.38), transparent 45%),
    linear-gradient(135deg, rgba(129, 88, 13, 0.98), rgba(30, 24, 9, 0.97)) !important;
  box-shadow:
    0 0 0 999px rgba(1, 8, 7, 0.25),
    0 18px 50px rgba(0, 0, 0, 0.5),
    0 0 34px rgba(255, 220, 95, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
  animation: pitDoormarsGlow 0.95s ease-in-out infinite alternate !important;
}

body.game-active .pit-popup strong {
  color: #fff2b8 !important;
  text-shadow:
    0 2px 0 rgba(78, 45, 0, 0.75),
    0 0 18px rgba(255, 232, 120, 0.82) !important;
}

body.game-active .pit-popup::before,
body.game-active .pit-popup::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff5bd 0 18%, transparent 20%),
    conic-gradient(from 0deg, transparent 0 12%, rgba(255, 235, 142, 0.95) 13% 17%, transparent 18% 31%, rgba(255, 216, 80, 0.9) 32% 36%, transparent 37% 100%);
  opacity: 0.78;
  pointer-events: none;
}

body.game-active .pit-popup::before {
  left: 12px;
  top: 12px;
}

body.game-active .pit-popup::after {
  right: 12px;
  bottom: 12px;
  transform: rotate(22deg);
}

@keyframes pitDoormarsGlow {
  from {
    filter: brightness(1);
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    filter: brightness(1.13);
    transform: translate(-50%, -50%) scale(1.018);
  }
}
/* Automatic table collision guard: JS sets these values after measuring real positions. */
body.game-active .table .played-card > span,
body.game-active .table .player-info,
body.game-active .table .trick-stack,
body.game-active .table .trick-points,
body.game-active .table .roem-board,
body.game-active .table .table-chat-bubble {
  translate: var(--safe-shift-x, 0) var(--safe-shift-y, 0) !important;
}

body.game-active .table .played-card > span,
body.game-active .table .player-info,
body.game-active .table .trick-stack,
body.game-active .table .trick-points,
body.game-active .table .roem-board {
  max-width: min(150px, 42vw) !important;
  overflow-wrap: anywhere !important;
}
/* Final safeguard: event-bar points must never stretch the table away. */
body.game-active .game-events {
  min-height: 58px !important;
  height: auto !important;
  max-height: 64px !important;
  overflow: hidden !important;
  align-items: center !important;
}

body.game-active .game-events > .trick-points {
  position: static !important;
  min-height: 0 !important;
  height: min-content !important;
  max-height: 52px !important;
  aspect-ratio: auto !important;
  align-self: center !important;
  justify-self: stretch !important;
}

body.game-active .game-events > .trick-points strong,
body.game-active .game-events > .trick-points span {
  display: block !important;
  min-height: 0 !important;
}

@media (max-width: 430px) {
  body.game-active .game-events {
    max-height: 58px !important;
  }

  body.game-active .game-events > .trick-points {
    max-height: 48px !important;
  }
}
/* Final portrait game layout: keep the table visible and dominant on phones. */
@media (orientation: portrait) {
  body.game-active .app-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows:
      auto
      auto
      minmax(64px, 86px)
      minmax(300px, 1fr)
      minmax(58px, 64px)
      auto !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  body.game-active .variant-banner {
    display: none !important;
  }

  body.game-active .top-bar {
    grid-row: 1 !important;
    grid-column: 1 / -1 !important;
  }

  body.game-active .score-board {
    grid-row: 2 !important;
    grid-column: 1 / -1 !important;
  }

  body.game-active .table-chat {
    grid-row: 3 !important;
    grid-column: 1 / -1 !important;
    min-height: 64px !important;
    height: auto !important;
    max-height: 86px !important;
    overflow: hidden !important;
  }

  body.game-active .table {
    grid-row: 4 !important;
    grid-column: 1 / -1 !important;
    min-height: 300px !important;
    height: auto !important;
    overflow: hidden !important;
  }

  body.game-active .game-events {
    grid-row: 5 !important;
    grid-column: 1 / -1 !important;
    min-height: 58px !important;
    height: auto !important;
    max-height: 64px !important;
  }

  body.game-active .hand-panel {
    grid-row: 6 !important;
    grid-column: 1 / -1 !important;
    min-height: 132px !important;
    max-height: 210px !important;
    overflow: hidden !important;
  }
}
/* Phone table alignment: players, played cards and won piles follow one clean grid. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .table .player,
  body.game-active .table .played-card,
  body.game-active .table .trick-stack,
  body.game-active .table .trick-points {
    translate: 0 0 !important;
  }

  body.game-active .trick-area {
    inset: 0 !important;
  }

  body.game-active .player-top {
    top: 3.5% !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .player-left {
    top: 50% !important;
    left: 12px !important;
    right: auto !important;
    transform: translateY(-50%) !important;
  }

  body.game-active .player-right {
    top: 50% !important;
    right: 12px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
  }

  body.game-active .played-card.seat-partner {
    top: 31% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }

  body.game-active .played-card.seat-user {
    top: 73% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }

  body.game-active .played-card.seat-left {
    top: 53% !important;
    left: 28% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }

  body.game-active .played-card.seat-right {
    top: 53% !important;
    left: 72% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }

  body.game-active .trick-stack.stack-partner {
    top: 5.5% !important;
    left: 63% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-stack.stack-left {
    top: 71% !important;
    left: 10% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }

  body.game-active .trick-stack.stack-right {
    top: 71% !important;
    left: 90% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }

  body.game-active .trick-stack.stack-user {
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    bottom: 1.5% !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-points.winner-partner,
  body.game-active .trick-points.collecting.winner-partner {
    top: 11% !important;
    left: 63% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) scale(0.82) !important;
  }

  body.game-active .trick-points.winner-left,
  body.game-active .trick-points.collecting.winner-left {
    top: 76% !important;
    left: 10% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(0.82) !important;
  }

  body.game-active .trick-points.winner-right,
  body.game-active .trick-points.collecting.winner-right {
    top: 76% !important;
    left: 90% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(0.82) !important;
  }

  body.game-active .trick-points.winner-user,
  body.game-active .trick-points.collecting.winner-user {
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    bottom: 0 !important;
    transform: translate(34px, 0) scale(0.82) !important;
  }

  body.game-active .trick-area.collecting.winner-partner .played-card {
    top: 5.5% !important;
    left: 63% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) scale(0.54) !important;
  }

  body.game-active .trick-area.collecting.winner-left .played-card {
    top: 71% !important;
    left: 10% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(0.54) !important;
  }

  body.game-active .trick-area.collecting.winner-right .played-card {
    top: 71% !important;
    left: 90% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(0.54) !important;
  }

  body.game-active .trick-area.collecting.winner-user .played-card {
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    bottom: 1.5% !important;
    transform: translateX(-50%) scale(0.54) !important;
  }
}
/* Restore the phone bars around the table without changing table object positions. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .score-board {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    gap: 8px !important;
    padding: 8px !important;
    overflow: hidden !important;
  }

  body.game-active .score-board > .score-card {
    min-width: 0 !important;
    min-height: 52px !important;
    height: auto !important;
  }

  body.game-active .score-board > .score-actions {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 54px !important;
  }

  body.game-active .score-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px !important;
    height: 54px !important;
    white-space: nowrap !important;
  }

  body.game-active .table-chat {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 72px !important;
    gap: 8px !important;
    padding: 8px !important;
    min-height: 82px !important;
    max-height: 98px !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-log,
  body.game-active .table-chat-form {
    min-height: 0 !important;
    height: 100% !important;
  }

  body.game-active .table-chat-form {
    display: contents !important;
  }

  body.game-active .table-chat-form input {
    min-width: 0 !important;
    height: 100% !important;
  }

  body.game-active .table-chat-form button {
    width: 72px !important;
    min-width: 72px !important;
    height: 100% !important;
  }

  body.game-active .game-events {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(82px, 108px) !important;
    grid-auto-rows: 1fr !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px !important;
    min-height: 70px !important;
    max-height: 82px !important;
    overflow: hidden !important;
  }

  body.game-active .game-events .message {
    grid-column: 1 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }

  body.game-active .game-events > .trick-points {
    grid-column: 2 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 54px !important;
    align-self: center !important;
    justify-self: stretch !important;
  }

  body.game-active .game-events .roem-burst,
  body.game-active .game-events .roem-board,
  body.game-active .game-events .nat-burst {
    grid-column: 2 !important;
    max-height: 54px !important;
  }
}
/* Phone side-player fine tuning: avatars on the table circle, names just below. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-left .avatar,
  body.game-active .player-right .avatar {
    translate: 0 -22px !important;
  }

  body.game-active .player-left .player-info,
  body.game-active .player-right .player-info {
    translate: 0 14px !important;
  }
}
/* Phone partner label: keep name left of the avatar so top played cards stay clear. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top {
    display: grid !important;
    grid-template-columns: minmax(74px, max-content) auto !important;
    grid-template-areas: "info avatar" !important;
    align-items: center !important;
    justify-items: end !important;
    column-gap: 8px !important;
    min-width: 0 !important;
  }

  body.game-active .player-top .player-info {
    grid-area: info !important;
    justify-self: end !important;
    translate: 0 0 !important;
  }

  body.game-active .player-top .avatar {
    grid-area: avatar !important;
    justify-self: start !important;
    translate: 0 0 !important;
  }

  body.game-active .player-top span,
  body.game-active .player-top small {
    max-width: 92px !important;
  }
}
/* Phone pot-finished actions: three visible buttons must stay inside the score bar. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .score-board {
    min-height: 141px !important;
  }

  body.game-active .score-board > .score-actions:has(#nextGameButton:not([hidden])) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    min-height: 54px !important;
  }

  body.game-active .score-actions #newGameButton,
  body.game-active .score-actions #nextGameButton,
  body.game-active .score-actions #lastTrickButton {
    padding-inline: 5px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: clamp(12px, 3.15vw, 15px) !important;
    line-height: 1.05 !important;
  }

  body.game-active .score-actions #nextGameButton:not([hidden]) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.game-active .score-board:has(#nextGameButton:not([hidden])) + .table-chat {
    margin-top: 0 !important;
  }
}
/* Pot review modal: show the played pot as a neat closeable list. */
.last-trick-dialog:has(.pot-review-list) {
  width: min(620px, calc(100vw - 28px)) !important;
  max-height: min(82dvh, 720px) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

.pot-review-list {
  display: grid !important;
  gap: 8px !important;
  max-height: min(58dvh, 520px) !important;
  overflow: auto !important;
  padding-right: 4px !important;
}

.pot-review-row {
  display: grid !important;
  gap: 4px !important;
  padding: 9px 10px !important;
  border: 1px solid rgba(255, 235, 166, 0.16) !important;
  border-radius: 8px !important;
  background: rgba(13, 28, 23, 0.82) !important;
}

.pot-review-row > div {
  display: flex !important;
  justify-content: space-between !important;
  gap: 10px !important;
  align-items: baseline !important;
}

.pot-review-row span {
  color: var(--gold) !important;
  font-weight: 900 !important;
}

.pot-review-row strong {
  color: var(--text) !important;
  font-size: 14px !important;
}

.pot-review-row p,
.pot-review-row small {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  line-height: 1.28 !important;
}

@media (max-width: 430px) {
  .last-trick-dialog:has(.pot-review-list) {
    width: calc(100vw - 22px) !important;
    max-height: 78dvh !important;
  }

  .pot-review-list {
    max-height: 48dvh !important;
  }

  .pot-review-row {
    padding: 8px !important;
  }
}
/* Phone player label correction: partner icon centered, side names above icons. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 50px !important;
    display: block !important;
    min-width: 0 !important;
    transform: none !important;
  }

  body.game-active .player-top .avatar {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    transform: translateX(-50%) !important;
    translate: 0 0 !important;
  }

  body.game-active .player-top > span,
  body.game-active .player-top > small {
    position: absolute !important;
    right: calc(50% + 28px) !important;
    left: auto !important;
    width: max-content !important;
    max-width: 96px !important;
    text-align: center !important;
    translate: 0 0 !important;
  }

  body.game-active .player-top > span {
    top: 4px !important;
  }

  body.game-active .player-top > small {
    top: 30px !important;
  }

  body.game-active .player-left,
  body.game-active .player-right {
    width: 104px !important;
    height: 132px !important;
    display: block !important;
    min-width: 104px !important;
  }

  body.game-active .player-left .avatar,
  body.game-active .player-right .avatar {
    position: absolute !important;
    left: 50% !important;
    top: 66px !important;
    transform: translate(-50%, -50%) !important;
    translate: 0 0 !important;
  }

  body.game-active .player-left .player-info,
  body.game-active .player-right .player-info {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    transform: translateX(-50%) !important;
    translate: 0 0 !important;
    width: max-content !important;
    max-width: 104px !important;
  }
}
/* Final mobile top bar and modal layering polish. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .top-bar {
    display: grid !important;
    grid-template-columns: minmax(92px, 0.75fr) minmax(0, 1.85fr) !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 8px !important;
    min-height: 98px !important;
    max-height: 118px !important;
    overflow: hidden !important;
  }

  body.game-active .top-bar > div:first-child {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 0 4px !important;
  }

  body.game-active .top-bar .eyebrow {
    font-size: clamp(13px, 3.8vw, 18px) !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
  }

  body.game-active .top-bar h1 {
    display: none !important;
  }

  body.game-active .status-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.65fr) minmax(64px, 0.8fr) minmax(64px, 0.8fr) !important;
    gap: 7px !important;
    min-width: 0 !important;
    height: 100% !important;
  }

  body.game-active .status-pill {
    min-width: 0 !important;
    min-height: 78px !important;
    padding: 8px 8px !important;
    display: grid !important;
    align-content: center !important;
    overflow: hidden !important;
  }

  body.game-active .status-pill span {
    font-size: clamp(12px, 3.25vw, 16px) !important;
    line-height: 1.05 !important;
  }

  body.game-active .status-pill strong {
    margin-top: 5px !important;
    font-size: clamp(15px, 4.5vw, 22px) !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere !important;
  }

  body.game-active .trump-status-content {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 7px !important;
  }

  body.game-active .trump-status-icon {
    width: clamp(40px, 11vw, 54px) !important;
    height: clamp(40px, 11vw, 54px) !important;
    font-size: clamp(26px, 8vw, 38px) !important;
    border-radius: 10px !important;
  }
}

.last-trick-modal,
.last-trick-modal[open] {
  z-index: 140 !important;
}

.last-trick-dialog:has(.pot-review-list) {
  width: min(760px, calc(100vw - 18px)) !important;
  max-height: min(86dvh, 760px) !important;
  padding: 14px !important;
}

.last-trick-dialog:has(.pot-review-list) .last-trick-cards {
  min-width: 0 !important;
  width: 100% !important;
}

.pot-review-list {
  width: 100% !important;
  grid-template-columns: minmax(0, 1fr) !important;
  max-height: min(62dvh, 560px) !important;
  padding-right: 2px !important;
}

.pot-review-row {
  width: 100% !important;
  box-sizing: border-box !important;
}

.pot-review-row > div {
  width: 100% !important;
}

.pot-review-row p,
.pot-review-row small {
  width: 100% !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 430px) {
  .last-trick-dialog:has(.pot-review-list) {
    width: calc(100vw - 16px) !important;
    max-height: 82dvh !important;
    padding: 12px !important;
  }

.pot-review-list {
    max-height: 54dvh !important;
  }
}

/* Wide score action block: keep the action buttons readable in the right panel. */
@media (min-width: 701px) {
  body.game-active .score-board > .score-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: minmax(40px, auto) !important;
    gap: 8px !important;
    align-self: stretch !important;
    min-width: 180px !important;
    max-width: 260px !important;
  }

  body.game-active .score-board > .score-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: auto !important;
    justify-content: center !important;
    white-space: normal !important;
    line-height: 1.08 !important;
    padding-inline: 10px !important;
  }

  body.game-active .score-board > .score-actions #nextGameButton[hidden] {
    display: none !important;
  }
}

/* Compact table chat: one latest message in the bar, full history in a modal. */
.table-chat-log {
  cursor: pointer !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: stretch !important;
}

.table-chat-log:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.table-chat-log .chat-line.compact {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  display: grid !important;
  align-content: center !important;
  gap: 4px !important;
  overflow: hidden !important;
}

.table-chat-log .chat-line.compact strong,
.table-chat-log .chat-line.compact span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.table-chat-log .chat-line.compact span {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-history-modal,
.chat-history-modal[open] {
  z-index: 150 !important;
}

.chat-history-dialog {
  width: min(720px, calc(100vw - 20px));
  max-height: min(82dvh, 720px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(217, 170, 69, 0.46);
  border-radius: 8px;
  background: rgba(13, 28, 23, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

.chat-history-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chat-history-list {
  min-height: 0;
  max-height: min(58dvh, 540px);
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 2px;
}

.chat-history-list .chat-line {
  margin: 0 !important;
}

@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .table-chat-log {
    padding: 4px !important;
  }

  body.game-active .table-chat-log .chat-line.compact {
    padding: 6px 8px !important;
  }

  body.game-active .table-chat-log .chat-line.compact strong {
    font-size: 11px !important;
  }

  body.game-active .table-chat-log .chat-line.compact span {
    font-size: 12px !important;
    line-height: 1.18 !important;
  }

  .chat-history-dialog {
    width: calc(100vw - 18px) !important;
    max-height: 78dvh !important;
    padding: 12px !important;
  }

  .chat-history-list {
    max-height: 56dvh !important;
  }
}

/* Mobile viewport fit: keep full game, table and hand inside one iPhone screen. */
@media (orientation: portrait) and (max-width: 700px) {
  html,
  body {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }

  body.game-active {
    overflow: hidden !important;
  }

  body.game-active .app-shell {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows:
      76px
      104px
      50px
      minmax(0, 1fr)
      50px
      118px !important;
    gap: 4px !important;
    padding: max(6px, env(safe-area-inset-top)) 8px max(5px, env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
  }

  body.game-active .variant-banner,
  body.game-active .bid-panel {
    display: none !important;
  }

  body.game-active .top-bar,
  body.game-active .score-board,
  body.game-active .table-chat,
  body.game-active .table,
  body.game-active .game-events,
  body.game-active .hand-panel {
    min-height: 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  body.game-active .top-bar {
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(72px, 0.48fr) minmax(0, 1.92fr) !important;
    gap: 6px !important;
    padding: 6px !important;
    height: 76px !important;
    min-height: 76px !important;
    max-height: 76px !important;
  }

  body.game-active .top-bar .eyebrow {
    font-size: clamp(11px, 3.2vw, 14px) !important;
    line-height: 1.05 !important;
  }

  body.game-active .status-grid {
    grid-template-columns: minmax(0, 1.28fr) minmax(56px, 0.82fr) minmax(56px, 0.72fr) !important;
    gap: 5px !important;
    height: 100% !important;
  }

  body.game-active .status-pill {
    min-height: 0 !important;
    height: 100% !important;
    padding: 6px !important;
    border-radius: 8px !important;
  }

  body.game-active .status-pill span {
    font-size: clamp(11px, 3vw, 13px) !important;
  }

  body.game-active .status-pill strong {
    font-size: clamp(14px, 4vw, 18px) !important;
    line-height: 1.02 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.game-active .trump-status-content {
    gap: 5px !important;
  }

  body.game-active .trump-status-icon {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    font-size: 30px !important;
  }

  body.game-active .score-board {
    grid-row: 2 !important;
    height: 104px !important;
    min-height: 104px !important;
    max-height: 104px !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 45px 43px !important;
    gap: 6px !important;
    padding: 6px !important;
  }

  body.game-active .score-board > .score-card {
    min-height: 0 !important;
    height: 45px !important;
    padding: 6px !important;
    border-radius: 8px !important;
  }

  body.game-active .score-board span {
    font-size: clamp(10px, 2.7vw, 12px) !important;
    line-height: 1.05 !important;
  }

  body.game-active .score-board strong {
    margin-top: 2px !important;
    font-size: clamp(14px, 3.8vw, 17px) !important;
    line-height: 1.02 !important;
  }

  body.game-active .score-board > .score-actions,
  body.game-active .score-board > .score-actions:has(#nextGameButton:not([hidden])) {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    min-height: 0 !important;
    height: 43px !important;
  }

  body.game-active .score-actions #newGameButton,
  body.game-active .score-actions #nextGameButton,
  body.game-active .score-actions #lastTrickButton {
    height: 43px !important;
    min-height: 43px !important;
    padding: 0 4px !important;
    font-size: clamp(11px, 3vw, 14px) !important;
    line-height: 1 !important;
    white-space: normal !important;
  }

  body.game-active .table-chat {
    grid-row: 3 !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    display: grid !important;
    grid-template-columns: minmax(86px, 0.85fr) minmax(0, 1.45fr) 62px !important;
    gap: 5px !important;
    padding: 5px !important;
  }

  body.game-active .table-chat-log {
    padding: 3px !important;
  }

  body.game-active .table-chat-log .chat-line.compact {
    padding: 4px 6px !important;
    gap: 2px !important;
  }

  body.game-active .table-chat-log .chat-line.compact strong {
    font-size: 10px !important;
  }

  body.game-active .table-chat-log .chat-line.compact span {
    -webkit-line-clamp: 1;
    font-size: 11px !important;
    line-height: 1.05 !important;
  }

  body.game-active .table-chat-form {
    display: contents !important;
  }

  body.game-active .table-chat-form input {
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  body.game-active .table-chat-form button {
    width: 62px !important;
    min-width: 62px !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
  }

  body.game-active .table {
    grid-row: 4 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-width: 4px !important;
    border-radius: 8px !important;
  }

  body.game-active .game-events {
    grid-row: 5 !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(78px, 96px) !important;
    gap: 5px !important;
    padding: 5px !important;
  }

  body.game-active .game-events .message {
    font-size: clamp(12px, 3.4vw, 15px) !important;
    line-height: 1.12 !important;
    padding: 0 8px !important;
  }

  body.game-active .game-events > .trick-points {
    max-height: 40px !important;
    padding: 4px 6px !important;
  }

  body.game-active .game-events > .trick-points strong {
    font-size: 15px !important;
  }

  body.game-active .game-events > .trick-points span {
    font-size: 9px !important;
  }

  body.game-active .hand-panel {
    grid-row: 6 !important;
    height: 118px !important;
    min-height: 118px !important;
    max-height: 118px !important;
    padding: 6px !important;
    border-radius: 8px !important;
  }

  body.game-active .hand-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(88px, auto) !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 24px !important;
    margin-bottom: 4px !important;
  }

  body.game-active .your-player-label {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  body.game-active .your-player-label .avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 15px !important;
  }

  body.game-active .hand-heading h2 {
    font-size: 17px !important;
    line-height: 1 !important;
  }

  body.game-active .hand-heading p {
    font-size: 11px !important;
    line-height: 1.05 !important;
    text-align: right !important;
  }

  body.game-active .hand {
    min-height: 0 !important;
    height: 76px !important;
    display: flex !important;
    align-items: stretch !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  body.game-active .hand .card {
    flex: 0 1 48px !important;
    width: 48px !important;
    height: 76px !important;
    max-height: 76px !important;
    border-radius: 7px !important;
  }

  body.game-active .card .corner {
    top: 5px !important;
    left: 5px !important;
    font-size: 11px !important;
  }

  body.game-active .card .suit {
    padding-top: 9px !important;
    font-size: 28px !important;
  }

  body.game-active .card .trump-mark {
    right: 4px !important;
    bottom: 4px !important;
    width: 15px !important;
    height: 15px !important;
    font-size: 8px !important;
  }
}

/* Last mobile override: keep points beside the message and fit every hand card. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .game-events {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) clamp(86px, 26vw, 112px) !important;
    align-items: center !important;
    gap: 7px !important;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding: 5px 8px !important;
    overflow: hidden !important;
  }

  body.game-active .game-events .message {
    grid-column: 1 !important;
    min-width: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 10px !important;
    overflow: hidden !important;
  }

  body.game-active .game-events > .trick-points {
    grid-column: 2 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    justify-self: end !important;
    align-self: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 112px !important;
    height: 42px !important;
    max-height: 42px !important;
    padding: 4px 6px !important;
    display: grid !important;
    place-items: center !important;
    align-content: center !important;
  }

  body.game-active .game-events > .trick-points strong {
    font-size: clamp(14px, 3.8vw, 17px) !important;
    line-height: 1 !important;
  }

  body.game-active .game-events > .trick-points span {
    width: 100% !important;
    font-size: clamp(8px, 2.3vw, 10px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
  }

  body.game-active .hand {
    width: 100% !important;
    height: 76px !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 4px !important;
    align-items: stretch !important;
    justify-items: center !important;
    overflow: hidden !important;
  }

  body.game-active .hand .card {
    width: 100% !important;
    max-width: 48px !important;
    min-width: 0 !important;
    height: 76px !important;
    max-height: 76px !important;
    justify-self: stretch !important;
  }
}

/* Last pot review override: use the full popup width for every slag row. */
.last-trick-dialog:has(.pot-review-list) {
  width: min(760px, calc(100vw - 16px)) !important;
  max-width: calc(100vw - 16px) !important;
}

.last-trick-dialog:has(.pot-review-list) .last-trick-cards {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row > div {
  display: grid !important;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row strong {
  justify-self: end !important;
  min-width: 0 !important;
  text-align: right !important;
}

.last-trick-dialog:has(.pot-review-list) .pot-review-row p,
.last-trick-dialog:has(.pot-review-list) .pot-review-row small {
  width: 100% !important;
  max-width: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

@media (orientation: portrait) and (max-width: 700px) {
  .last-trick-dialog:has(.pot-review-list) {
    width: calc(100vw - 16px) !important;
    max-height: 84dvh !important;
    padding: 14px !important;
  }

  .last-trick-dialog:has(.pot-review-list) .last-trick-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }

  .last-trick-dialog:has(.pot-review-list) .last-trick-summary {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .last-trick-dialog:has(.pot-review-list) .pot-review-list {
    max-height: 56dvh !important;
  }

  .last-trick-dialog:has(.pot-review-list) .pot-review-row {
    padding: 9px 10px !important;
  }
}

/* Final phone table clarity: no event overlap, side avatars closer to the rail. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .game-events {
    grid-template-columns: minmax(0, 1fr) minmax(90px, 112px) !important;
  }

  body.game-active .game-events > .trick-points {
    display: none !important;
  }

  body.game-active .game-events .message {
    grid-column: 1 / -1 !important;
  }

  body.game-active .game-events:has(.roem-burst:not([hidden])) .message,
  body.game-active .game-events:has(.roem-board:not([hidden])) .message {
    grid-column: 1 !important;
  }

  body.game-active .game-events .roem-burst,
  body.game-active .game-events .roem-board {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    grid-column: 2 !important;
    align-self: center !important;
    justify-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 112px !important;
    height: 42px !important;
    max-height: 42px !important;
    padding: 4px 6px !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  body.game-active .game-events .roem-burst strong,
  body.game-active .game-events .roem-board strong {
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.game-active .game-events .roem-burst span,
  body.game-active .game-events .roem-board p {
    margin: 1px 0 0 !important;
    font-size: 8px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.game-active .player-left {
    left: 6px !important;
    width: 92px !important;
    min-width: 92px !important;
  }

  body.game-active .player-right {
    right: 6px !important;
    width: 92px !important;
    min-width: 92px !important;
  }

  body.game-active .player-left .avatar,
  body.game-active .player-right .avatar {
    top: 67px !important;
  }

  body.game-active .player-left .player-info,
  body.game-active .player-right .player-info {
    top: 0 !important;
    max-width: 86px !important;
  }

  body[data-declarer="left"] .player-left::after,
  body[data-trick-winner="left"] .player-left::after,
  body[data-bid-phase="bidding"].bid-passed-left .player-left::after {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    top: 98px !important;
    transform: none !important;
    z-index: 5 !important;
    max-width: 76px !important;
    padding: 3px 7px !important;
    white-space: nowrap !important;
  }

  body[data-declarer="right"] .player-right::after,
  body[data-trick-winner="right"] .player-right::after,
  body[data-bid-phase="bidding"].bid-passed-right .player-right::after {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: 98px !important;
    transform: none !important;
    z-index: 5 !important;
    max-width: 76px !important;
    padding: 3px 7px !important;
    white-space: nowrap !important;
  }
}

/* Next-round cue and partner declarer badge visibility. */
body.game-active.next-round-ready #nextGameButton:not([hidden]) {
  position: relative !important;
  border-color: rgba(255, 232, 142, 1) !important;
  background:
    linear-gradient(180deg, #ffe28a, #d9aa45) !important;
  color: #1d1607 !important;
  box-shadow:
    0 0 0 3px rgba(255, 226, 138, 0.28),
    0 0 22px rgba(255, 218, 99, 0.82),
    0 10px 24px rgba(0, 0, 0, 0.34) !important;
  animation: nextRoundGlow 1s ease-in-out infinite alternate !important;
}

@keyframes nextRoundGlow {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.16);
  }
}

@media (orientation: portrait) and (max-width: 700px) {
  body[data-declarer="partner"] .player-top::after,
  body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
  body[data-trick-winner="partner"] .player-top::after {
    position: absolute !important;
    left: calc(50% + 28px) !important;
    right: auto !important;
    top: 58px !important;
    z-index: 7 !important;
    transform: translateX(-50%) !important;
    display: block !important;
    width: max-content !important;
    max-width: 86px !important;
    padding: 3px 8px !important;
    white-space: nowrap !important;
    pointer-events: none !important;
  }

  body[data-declarer="partner"] .player-top::after {
    content: "Speelt" !important;
    background: rgba(217, 170, 69, 0.96) !important;
    color: #1d1607 !important;
  }

  body[data-bid-phase="bidding"].bid-passed-partner .player-top::after {
    content: "Past" !important;
  }

  body[data-trick-winner="partner"] .player-top::after {
    content: "Mijn slag" !important;
  }
}

/* Partner info plate: match left and right player design. */
.player-top .player-info {
  max-width: 104px;
  padding: 4px 9px;
  display: grid;
  justify-items: center;
  gap: 1px;
  border: 1px solid rgba(255, 235, 166, 0.18);
  border-radius: 10px;
  background: rgba(18, 24, 18, 0.72);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  text-shadow: 0 2px 5px var(--shadow);
}

.player-top .player-info span,
.player-top .player-info small {
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-top .player-info span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.player-top .player-info small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

body[data-current-turn="partner"] .player-top .player-info {
  border-color: rgba(255, 224, 122, 0.58);
  background: rgba(73, 52, 13, 0.82);
  box-shadow: 0 0 18px rgba(255, 214, 106, 0.34), 0 8px 20px rgba(0, 0, 0, 0.26);
}

@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top .player-info {
    grid-area: info !important;
    position: static !important;
    width: max-content !important;
    max-width: 92px !important;
    transform: none !important;
    translate: 0 0 !important;
  }
}

/* Home logo polish: cropped logo can use the full space above the menu again. */
body:not(.game-active) .brand-showcase img {
  width: min(82vw, 520px);
  aspect-ratio: auto;
  height: auto;
  max-height: 260px;
  margin-bottom: -34px;
  object-fit: contain;
}

body:not(.game-active) .start-menu-panel {
  padding-top: 72px;
}

@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .brand-showcase {
    top: 0 !important;
    width: min(88vw, 360px) !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(90vw, 376px) !important;
    max-height: 158px !important;
    margin: 0 auto -12px !important;
  }

  body:not(.game-active) .start-menu-panel {
    padding-top: 144px !important;
  }
}

/* Final home-logo visibility guard. */
body:not(.game-active) .start-menu-stage,
body:not(.game-active) .brand-showcase {
  overflow: visible !important;
}

@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .brand-showcase {
    top: -2px !important;
  }

  body:not(.game-active) .brand-showcase img {
    display: block !important;
    transform: translateY(-6px) !important;
  }
}

/* Partner label/logo final polish: keep the top seat clear of the play lane. */
body:not(.game-active) .brand-showcase {
  z-index: 8 !important;
}

body:not(.game-active) .brand-showcase img {
  width: min(88vw, 580px) !important;
  max-height: 300px !important;
  filter:
    drop-shadow(0 22px 32px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 18px rgba(217, 170, 69, 0.28)) !important;
}

@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top {
    left: 0 !important;
    right: 0 !important;
    top: 12px !important;
    width: 100% !important;
    height: 76px !important;
    min-width: 0 !important;
    transform: none !important;
    z-index: 8 !important;
  }

  body.game-active .player-top .avatar {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    width: 42px !important;
    height: 42px !important;
    transform: translateX(-50%) !important;
    translate: 0 0 !important;
    z-index: 9 !important;
  }

  body.game-active .player-top .player-info {
    position: absolute !important;
    left: calc(50% - 68px) !important;
    right: auto !important;
    top: 3px !important;
    width: max-content !important;
    max-width: 112px !important;
    transform: translateX(-100%) !important;
    translate: 0 0 !important;
    justify-items: center !important;
    z-index: 8 !important;
  }

  body.game-active .player-top .player-info span,
  body.game-active .player-top .player-info small {
    max-width: 92px !important;
  }

  body[data-declarer="partner"] .player-top::after,
  body[data-bid-phase="bidding"].bid-passed-partner .player-top::after,
  body[data-trick-winner="partner"] .player-top::after {
    left: calc(50% + 48px) !important;
    top: 40px !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
    max-width: 88px !important;
    padding: 4px 12px !important;
  }

  body:not(.game-active) .brand-showcase {
    top: -10px !important;
    z-index: 8 !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(94vw, 414px) !important;
    max-height: 186px !important;
    margin: 0 auto -18px !important;
    transform: translateY(-10px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    padding-top: 150px !important;
  }
}

/* Keep the partner seat the same visual size as the left and right seats. */
body:not(.game-active) .brand-showcase {
  position: relative !important;
  z-index: 18 !important;
  overflow: visible !important;
}

body:not(.game-active) .brand-showcase img {
  position: relative !important;
  z-index: 19 !important;
  width: min(88vw, 580px) !important;
  max-height: 360px !important;
  margin: -10px auto -30px !important;
  object-fit: contain !important;
  object-position: center top !important;
  transform: translateY(-8px) !important;
}

body:not(.game-active) .start-menu-panel {
  position: relative !important;
  z-index: 2 !important;
  padding-top: 76px !important;
}

@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .brand-showcase img {
    width: min(92vw, 390px) !important;
    max-height: 168px !important;
    margin: -6px auto -14px !important;
    transform: translateY(-6px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    padding-top: 138px !important;
  }
}

body.game-active .player-top .avatar {
  width: 46px !important;
  height: 46px !important;
}

body.game-active .player-top .player-info {
  max-width: 104px !important;
  padding: 4px 9px !important;
  border-radius: 10px !important;
}

body.game-active .player-top .player-info span,
body.game-active .player-top .player-info small {
  max-width: 100% !important;
}

body.game-active .player-top .player-info span {
  font-size: 13px !important;
}

body.game-active .player-top .player-info small {
  font-size: 11px !important;
}

@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top .avatar {
    width: 46px !important;
    height: 46px !important;
  }

  body.game-active .player-top .player-info {
    left: calc(50% - 72px) !important;
    max-width: 104px !important;
  }

  body.game-active .player-top .player-info span,
  body.game-active .player-top .player-info small {
    max-width: 86px !important;
  }
}

/* Restore the compact mobile home layout while keeping the cropped logo. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu {
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    place-items: stretch !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    align-content: stretch !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    padding: 8px !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .brand-showcase {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: clamp(74px, 11dvh, 104px) !important;
    min-height: 0 !important;
    display: grid !important;
    place-items: center !important;
    transform: none !important;
    z-index: 5 !important;
    pointer-events: none !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: auto !important;
    height: 100% !important;
    max-width: min(84vw, 258px) !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    position: relative !important;
    z-index: 12 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    gap: 6px !important;
    overflow: hidden !important;
    align-content: stretch !important;
    grid-template-rows: auto auto auto auto auto auto minmax(92px, 1fr) auto !important;
  }

  body:not(.game-active) .menu-field {
    position: relative !important;
    z-index: 30 !important;
    pointer-events: auto !important;
  }

  body:not(.game-active) .menu-field input {
    position: relative !important;
    z-index: 31 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-user-select: text !important;
    user-select: text !important;
  }

  body:not(.game-active) .avatar-upload-field {
    position: relative !important;
    z-index: 10 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .avatar-upload-field input {
    inset: auto 0 0 auto !important;
    width: 104px !important;
    height: 100% !important;
    max-width: 34% !important;
    z-index: 3 !important;
  }

  body:not(.game-active) .start-heading {
    gap: 2px !important;
  }

  body:not(.game-active) .start-heading h1,
  body:not(.game-active) .start-heading > p:not(.eyebrow),
  body:not(.game-active) .avatar-upload-field small,
  body:not(.game-active) .menu-choice small,
  body:not(.game-active) .home-action-card small {
    display: none !important;
  }

  body:not(.game-active) .menu-field,
  body:not(.game-active) .avatar-upload-field,
  body:not(.game-active) .menu-group,
  body:not(.game-active) .home-action-grid,
  body:not(.game-active) .competition-entry {
    margin: 0 !important;
  }

  body:not(.game-active) .menu-group {
    gap: 5px !important;
    padding: 6px !important;
  }

  body:not(.game-active) .menu-choice,
  body:not(.game-active) .home-action-card {
    min-height: 40px !important;
    padding: 7px 9px !important;
  }

  body:not(.game-active) .competition-entry {
    min-height: 0 !important;
    padding: 7px !important;
    gap: 6px !important;
  }

  body:not(.game-active) .start-game-button {
    min-height: 50px !important;
    padding: 10px !important;
  }
}

/* Final mobile partner size: same avatar and name plate scale as left/right seats. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top .avatar {
    width: 46px !important;
    height: 46px !important;
  }

  body.game-active .player-top .player-info {
    max-width: 86px !important;
    padding: 4px 9px !important;
  }

  body.game-active .player-top .player-info span,
  body.game-active .player-top .player-info small {
    max-width: 72px !important;
  }

  body.game-active .player-top .player-info span {
    font-size: 13px !important;
  }

  body.game-active .player-top .player-info small {
    font-size: 11px !important;
  }
}

/* Mobile start page redesign matching the supplied mockup. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) {
    height: 100dvh !important;
    overflow: hidden !important;
    background:
      radial-gradient(circle at 50% 16%, rgba(6, 70, 94, 0.72), transparent 34%),
      linear-gradient(180deg, #010b10, #02151d 52%, #01070a) !important;
  }

  body:not(.game-active) .start-menu {
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    overflow: hidden !important;
    place-items: stretch !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    padding: clamp(10px, 2.1dvh, 16px) 10px 10px !important;
    display: grid !important;
    grid-template-rows: clamp(138px, 20dvh, 184px) minmax(0, 1fr) !important;
    gap: 0 !important;
    overflow: hidden !important;
    border-color: rgba(217, 170, 69, 0.34) !important;
    border-radius: 18px !important;
    background:
      radial-gradient(circle at 50% 18%, rgba(7, 82, 110, 0.46), transparent 42%),
      linear-gradient(180deg, rgba(3, 31, 43, 0.94), rgba(2, 22, 31, 0.98)) !important;
  }

  body:not(.game-active) .brand-showcase {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    place-items: center !important;
    transform: none !important;
    z-index: 5 !important;
    pointer-events: none !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(92vw, 380px) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
    transform: none !important;
  }

  body:not(.game-active) .brand-showcase p,
  body:not(.game-active) .start-heading {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto !important;
    gap: clamp(7px, 1dvh, 10px) !important;
    overflow: hidden !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body:not(.game-active) .start-menu-panel::before,
  body:not(.game-active) .start-menu-panel::after {
    display: none !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .competition-entry {
    min-width: 0 !important;
    margin: 0 !important;
    padding: clamp(9px, 1.2dvh, 12px) !important;
    border: 1px solid rgba(217, 170, 69, 0.48) !important;
    border-radius: 13px !important;
    background:
      linear-gradient(145deg, rgba(3, 42, 57, 0.92), rgba(2, 23, 34, 0.9)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  }

  body:not(.game-active) .home-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .online-kicker {
    width: 100% !important;
    margin: 0 0 7px !important;
    padding: 0 !important;
    display: block !important;
    color: var(--gold) !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    letter-spacing: 0.05em !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-player-section {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "title title title"
      "avatar name photo" !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body:not(.game-active) .home-player-section h2 {
    grid-area: title !important;
    text-align: left !important;
    margin-bottom: 0 !important;
  }

  body:not(.game-active) .avatar-preview {
    grid-area: avatar !important;
    width: 48px !important;
    height: 48px !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 2px rgba(255, 235, 166, 0.18) !important;
  }

  body:not(.game-active) .player-name-field {
    grid-area: name !important;
    position: relative !important;
    z-index: 30 !important;
    display: block !important;
    min-width: 0 !important;
    pointer-events: auto !important;
  }

  body:not(.game-active) .player-name-field > span {
    display: none !important;
  }

  body:not(.game-active) .player-name-field input {
    min-height: 48px !important;
    padding: 0 10px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--text) !important;
    font-size: 19px !important;
    font-weight: 900 !important;
    pointer-events: auto !important;
    -webkit-user-select: text !important;
    user-select: text !important;
  }

  body:not(.game-active) .player-name-field input::placeholder {
    color: var(--text) !important;
    opacity: 1 !important;
  }

  body:not(.game-active) .player-photo-field {
    grid-area: photo !important;
    position: relative !important;
    z-index: 20 !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    border: 1px solid rgba(217, 170, 69, 0.7) !important;
    border-radius: 8px !important;
    background: rgba(217, 170, 69, 0.12) !important;
    color: #ffe7ac !important;
    cursor: pointer !important;
  }

  body:not(.game-active) .player-photo-field::after {
    display: none !important;
  }

  body:not(.game-active) .photo-button-icon {
    width: 19px !important;
    height: 19px !important;
    display: inline-grid !important;
    place-items: center !important;
  }

  body:not(.game-active) .photo-button-icon svg {
    width: 100% !important;
    height: 100% !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  body:not(.game-active) .player-photo-field strong {
    display: block !important;
    color: #ffe7ac !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .player-photo-field input {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
  }

  body:not(.game-active) .menu-group {
    display: grid !important;
    gap: 8px !important;
  }

  body:not(.game-active) .variant-group {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.game-active) .level-group,
  body:not(.game-active) .home-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body:not(.game-active) .menu-choice > span,
  body:not(.game-active) .home-action-card {
    min-height: 42px !important;
    padding: 8px !important;
    border-color: rgba(86, 156, 201, 0.34) !important;
    background: rgba(2, 25, 37, 0.74) !important;
    text-align: center !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    min-height: 56px !important;
  }

  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong {
    font-size: 13px !important;
    line-height: 1.1 !important;
  }

  body:not(.game-active) .menu-choice small,
  body:not(.game-active) .home-action-card small,
  body:not(.game-active) .competition-copy strong,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .home-action-card {
    grid-template-columns: 28px minmax(0, 1fr) !important;
    text-align: left !important;
  }

  body:not(.game-active) .competition-entry {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-content: start !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 38px !important;
    padding: 8px 10px !important;
    display: grid !important;
    align-items: center !important;
    border: 1px solid rgba(217, 170, 69, 0.34) !important;
    border-radius: 8px !important;
    background: rgba(13, 32, 30, 0.74) !important;
  }

  body:not(.game-active) .home-highscore small {
    display: none !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    gap: 0 !important;
    border: 1px solid rgba(86, 156, 201, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-height: 36px !important;
    justify-content: space-between !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(86, 156, 201, 0.22) !important;
    border-radius: 0 !important;
    background: rgba(2, 25, 37, 0.64) !important;
    text-align: left !important;
  }

  body:not(.game-active) .online-entry-actions .info-button::after {
    content: "›";
    margin-left: auto;
    color: #f0c461;
    font-size: 24px;
    line-height: 1;
  }

  body:not(.game-active) .online-entry-actions .info-button:last-child {
    border-bottom: 0 !important;
  }

  body:not(.game-active) .start-game-button {
    min-height: 48px !important;
    padding: 9px 12px !important;
    border-radius: 9px !important;
    font-size: 18px !important;
    font-weight: 900 !important;
  }
}

/* Final mobile home fit: match the mockup proportions without clipping. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .start-menu {
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)) !important;
  }

  body:not(.game-active) .start-menu-stage {
    grid-template-rows: clamp(116px, 17dvh, 158px) minmax(0, 1fr) !important;
    padding: 10px !important;
    border-radius: 18px !important;
  }

  body:not(.game-active) .brand-showcase {
    align-self: stretch !important;
    height: auto !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(86vw, 332px) !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: translateY(-2px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows: auto auto auto auto minmax(126px, 1fr) auto auto !important;
    gap: clamp(5px, 0.75dvh, 8px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .competition-entry {
    padding: clamp(7px, 0.85dvh, 10px) !important;
    border-radius: 12px !important;
  }

  body:not(.game-active) .home-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .online-kicker {
    margin-bottom: clamp(4px, 0.55dvh, 7px) !important;
    font-size: clamp(12px, 3vw, 13px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-player-section {
    grid-template-columns: 46px minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  body:not(.game-active) .avatar-preview {
    width: 44px !important;
    height: 44px !important;
  }

  body:not(.game-active) .player-name-field input {
    min-height: 42px !important;
    font-size: 18px !important;
  }

  body:not(.game-active) .player-photo-field {
    min-height: 38px !important;
    padding: 0 10px !important;
  }

  body:not(.game-active) .player-photo-field strong {
    font-size: 12px !important;
  }

  body:not(.game-active) .variant-group {
    gap: 7px !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    min-height: clamp(48px, 7dvh, 62px) !important;
  }

  body:not(.game-active) .level-group .menu-choice > span,
  body:not(.game-active) .home-action-card {
    min-height: clamp(38px, 5.8dvh, 48px) !important;
  }

  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong {
    font-size: clamp(12px, 3.15vw, 14px) !important;
    overflow-wrap: anywhere !important;
  }

  body:not(.game-active) .home-action-grid {
    gap: 6px !important;
  }

  body:not(.game-active) .home-action-card {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 6px !important;
    padding: 6px !important;
  }

  body:not(.game-active) .home-action-icon {
    width: 24px !important;
    height: 24px !important;
  }

  body:not(.game-active) .competition-entry {
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    gap: 6px !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 34px !important;
    padding: 6px 9px !important;
  }

  body:not(.game-active) .home-highscore span,
  body:not(.game-active) .home-highscore strong {
    font-size: 12px !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 0 !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-height: clamp(28px, 4.6dvh, 38px) !important;
    padding: 0 10px !important;
    font-size: clamp(13px, 3.4vw, 15px) !important;
  }

  body:not(.game-active) .start-game-button {
    min-height: clamp(42px, 6.2dvh, 52px) !important;
    padding: 8px 12px !important;
    font-size: clamp(18px, 4.6vw, 22px) !important;
  }
}

/* Mobile home design fit v2: keep the logo, controls and competition inside one screen. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: clamp(206px, 24dvh, 226px) minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  body:not(.game-active) .brand-showcase {
    align-items: start !important;
    justify-content: center !important;
    padding-top: 4px !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(86vw, 332px) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 214px !important;
    margin: 0 auto !important;
    transform: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows: auto auto auto auto minmax(114px, 1fr) auto auto !important;
    gap: 6px !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .competition-entry {
    padding: 7px !important;
  }

  body:not(.game-active) .home-player-section {
    min-height: 74px !important;
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
  }

  body:not(.game-active) .avatar-preview {
    width: 42px !important;
    height: 42px !important;
  }

  body:not(.game-active) .player-name-field input {
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 10px !important;
    font-size: 17px !important;
  }

  body:not(.game-active) .player-photo-field {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 9px !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    min-height: 46px !important;
    padding: 6px 8px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 34px !important;
    padding: 4px 6px !important;
  }

  body:not(.game-active) .home-action-card {
    min-height: 38px !important;
    padding: 5px 6px !important;
    grid-template-columns: 22px minmax(0, 1fr) !important;
  }

  body:not(.game-active) .home-action-icon {
    width: 22px !important;
    height: 22px !important;
  }

  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong {
    font-size: clamp(11px, 3vw, 13px) !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto 30px minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 30px !important;
    height: 30px !important;
    padding: 4px 8px !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-rows: repeat(3, minmax(28px, 1fr)) !important;
    gap: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 9px !important;
    font-size: clamp(12px, 3.25vw, 14px) !important;
    line-height: 1 !important;
    border-radius: 0 !important;
  }

  body:not(.game-active) .online-entry-actions .info-button:first-child {
    border-radius: 9px 9px 0 0 !important;
  }

  body:not(.game-active) .online-entry-actions .info-button:last-child {
    border-radius: 0 0 9px 9px !important;
  }

  body:not(.game-active) .start-game-button {
    min-height: 44px !important;
    height: 44px !important;
    padding: 6px 12px !important;
  }
}

/* Final competition winner strip: yesterday's daily winner above the competition buttons. */
.home-highscore {
  position: relative;
}

.home-highscore .hall-slide-copy {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  animation: hall-slide-in .42s ease both;
}

.home-highscore .hall-slide-copy > * { grid-area: auto !important; }

.home-highscore .hall-slide-copy strong,
.home-highscore .hall-slide-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-highscore .hall-slide-amsterdam .winner-label { color: #82d5a6 !important; }
.home-highscore .hall-slide-rotterdam .winner-label { color: #ff9b91 !important; }
.home-highscore .hall-trophy-rotterdam { border-color: rgba(196, 54, 43, .72) !important; }

.home-highscore .hall-slide-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 22px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f0ca75;
  font: 700 22px/1 Arial, sans-serif;
  cursor: pointer;
}

.home-highscore .hall-slide-prev { left: -7px; }
.home-highscore .hall-slide-next { right: -7px; }

.home-highscore .hall-slide-dots {
  position: absolute;
  right: 26px;
  bottom: 5px;
  display: flex;
  gap: 4px;
}

.home-highscore .hall-slide-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
}

.home-highscore .hall-slide-dots i.active { background: #f0ca75; }

@keyframes hall-slide-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .home-highscore .hall-slide-copy { animation: none; }
}

@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto 36px auto !important;
  }

  body:not(.game-active) .home-highscore {
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    grid-template-areas:
      "trophy label"
      "trophy name"
      "trophy score" !important;
    align-items: center !important;
    column-gap: 7px !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 3px 8px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-area: trophy !important;
    width: 28px !important;
    height: 28px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy svg {
    width: 17px !important;
    height: 17px !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    grid-area: label !important;
    display: block !important;
    color: var(--gold) !important;
    font-size: 8px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-highscore strong {
    grid-area: name !important;
    display: block !important;
    min-width: 0 !important;
    margin: 1px 0 !important;
    font-size: clamp(11px, 3vw, 13px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    grid-area: score !important;
    display: block !important;
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* Final mobile partner sizing: partner uses the exact compact seat scale of left/right. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top {
    height: 70px !important;
    min-width: 0 !important;
  }

  body.game-active .player-top .avatar {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }

  body.game-active .player-top .player-info {
    width: auto !important;
    min-width: 0 !important;
    max-width: 86px !important;
    padding: 4px 9px !important;
    border-radius: 10px !important;
    gap: 1px !important;
    justify-items: center !important;
  }

  body.game-active .player-top .player-info span,
  body.game-active .player-top .player-info small {
    max-width: 72px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.game-active .player-top .player-info span {
    font-size: 13px !important;
    line-height: 1.05 !important;
  }

  body.game-active .player-top .player-info small {
    font-size: 11px !important;
    line-height: 1.05 !important;
  }
}

/* Final mobile home responsiveness: keep the full menu visible on shorter iPhones. */
@media (orientation: portrait) and (max-width: 430px) and (max-height: 820px) {
  body:not(.game-active) .start-menu {
    padding: max(6px, env(safe-area-inset-top)) 10px max(6px, env(safe-area-inset-bottom)) !important;
  }

  body:not(.game-active) .start-menu-stage {
    grid-template-rows: clamp(154px, 20dvh, 170px) minmax(0, 1fr) !important;
    padding: 8px 10px !important;
  }

  body:not(.game-active) .brand-showcase {
    align-items: start !important;
    padding-top: 0 !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(78vw, 300px) !important;
    max-height: 166px !important;
    transform: translateY(-4px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows: auto auto auto auto minmax(96px, 1fr) auto auto !important;
    gap: 4px !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .competition-entry {
    padding: 5px 7px !important;
    border-radius: 11px !important;
  }

  body:not(.game-active) .home-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .online-kicker {
    margin-bottom: 3px !important;
    font-size: 11px !important;
  }

  body:not(.game-active) .home-player-section {
    min-height: 64px !important;
    grid-template-columns: 38px minmax(0, 1fr) auto !important;
    gap: 6px !important;
  }

  body:not(.game-active) .avatar-preview {
    width: 36px !important;
    height: 36px !important;
  }

  body:not(.game-active) .player-name-field input {
    min-height: 34px !important;
    height: 34px !important;
    font-size: 16px !important;
  }

  body:not(.game-active) .player-photo-field {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-action-grid {
    gap: 5px !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group {
    align-items: stretch !important;
  }

  body:not(.game-active) .menu-choice {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.game-active) .menu-choice input {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .menu-choice > span {
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    place-items: center !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    min-height: 41px !important;
    padding: 5px 6px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span,
  body:not(.game-active) .home-action-card {
    min-height: 32px !important;
    padding: 4px 5px !important;
  }

  body:not(.game-active) .home-action-icon {
    width: 19px !important;
    height: 19px !important;
  }

  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong {
    font-size: 11px !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto 32px auto !important;
    gap: 4px !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 32px !important;
    height: 32px !important;
    padding: 3px 7px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 24px !important;
    height: 24px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: 11px !important;
  }

  body:not(.game-active) .online-entry-actions {
    grid-template-rows: minmax(34px, auto) !important;
    gap: 5px !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-height: 34px !important;
    padding: 4px 3px 14px !important;
    border: 1px solid rgba(86, 156, 201, 0.28) !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    text-align: center !important;
    justify-content: center !important;
  }

  body:not(.game-active) .online-entry-actions .info-button:first-child,
  body:not(.game-active) .online-entry-actions .info-button:last-child {
    border-radius: 8px !important;
  }

  body:not(.game-active) .start-game-button {
    min-height: 39px !important;
    height: 39px !important;
    padding: 6px 10px !important;
    font-size: 17px !important;
  }
}

/* Final mobile competition layout: three actions beside each other, more space for the winner. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(42px, auto) minmax(38px, auto) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 42px !important;
    height: auto !important;
    padding: 5px 8px !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    column-gap: 8px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 30px !important;
    height: 30px !important;
  }

  body:not(.game-active) .home-highscore .winner-label,
  body:not(.game-active) .home-highscore small {
    display: block !important;
    font-size: 8px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: clamp(12px, 3.2vw, 14px) !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(38px, auto) !important;
    gap: 6px !important;
    width: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  body:not(.game-active) .online-entry-actions .info-button,
  body:not(.game-active) .online-entry-actions .info-button:first-child,
  body:not(.game-active) .online-entry-actions .info-button:last-child {
    min-height: 38px !important;
    height: auto !important;
    padding: 5px 3px 15px !important;
    border: 1px solid rgba(86, 156, 201, 0.32) !important;
    border-radius: 8px !important;
    background: rgba(2, 25, 37, 0.74) !important;
    display: grid !important;
    place-items: center !important;
    justify-content: center !important;
    color: var(--text) !important;
    font-size: clamp(10px, 2.7vw, 12px) !important;
    line-height: 1.05 !important;
    text-align: center !important;
    white-space: normal !important;
  }

  body:not(.game-active) .online-entry-actions .info-button::after {
    content: none !important;
  }

  body:not(.game-active) .online-entry-actions .info-button.premium-locked::after {
    content: "Premium" !important;
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 3px !important;
    transform: translateX(-50%) !important;
    padding: 1px 5px !important;
    border-radius: 999px !important;
    background: rgba(217, 170, 69, 0.96) !important;
    color: #1d1607 !important;
    font-size: 7px !important;
    font-weight: 950 !important;
    letter-spacing: 0.03em !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
  }
}

@media (orientation: portrait) and (max-width: 430px) and (max-height: 820px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto 40px 36px !important;
    gap: 5px !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 40px !important;
    height: 40px !important;
  }

  body:not(.game-active) .online-entry-actions {
    grid-template-rows: 36px !important;
    gap: 5px !important;
  }

  body:not(.game-active) .online-entry-actions .info-button,
  body:not(.game-active) .online-entry-actions .info-button:first-child,
  body:not(.game-active) .online-entry-actions .info-button:last-child {
    min-height: 36px !important;
    padding: 4px 3px 14px !important;
  }
}

@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
  }

  body:not(.game-active) #openOnlineButton {
    grid-column: 1 !important;
  }

  body:not(.game-active) #openDailyButton {
    grid-column: 2 !important;
  }

  body:not(.game-active) #openRankingsButton {
    grid-column: 3 !important;
  }
}

/* Demo coach fixed sizing: draggable, bounded, and compact when hidden. */
.demo-coach {
  width: min(380px, calc(100vw - 28px)) !important;
  height: 230px !important;
  min-height: 230px !important;
  max-height: 230px !important;
  overflow: hidden !important;
  touch-action: none !important;
}

.demo-coach > div:first-child {
  min-height: 0 !important;
  overflow: hidden !important;
}

.demo-coach p {
  max-height: 88px !important;
  overflow: auto !important;
}

.demo-coach.collapsed {
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  gap: 8px !important;
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  padding: 8px 10px !important;
}

.demo-coach.collapsed > div:first-child {
  min-width: 0 !important;
}

.demo-coach.collapsed p,
.demo-coach.collapsed #demoStepLabel {
  display: none !important;
}

.demo-coach.collapsed strong {
  max-width: 100% !important;
  overflow: hidden !important;
  font-size: 14px !important;
  line-height: 1.12 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.demo-coach.collapsed .demo-actions {
  width: auto !important;
  grid-template-columns: 34px 34px 82px !important;
  gap: 5px !important;
}

.demo-coach.collapsed .demo-actions button {
  min-height: 34px !important;
  padding: 0 7px !important;
  font-size: 11px !important;
}

.demo-coach.collapsed #restartDemoButton,
.demo-coach.collapsed #stopDemoButton {
  display: none !important;
}

/* Demo navigation polish: clear backward/forward arrows inside the movable coach panel. */
.demo-actions #prevDemoButton,
.demo-actions #nextDemoButton {
  display: inline-grid !important;
  place-items: center !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.demo-actions #prevDemoButton {
  border-color: rgba(217, 170, 69, 0.36) !important;
  background:
    linear-gradient(180deg, rgba(36, 43, 31, 0.96), rgba(13, 23, 23, 0.96)) !important;
  color: rgba(255, 239, 198, 0.88) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 170, 0.16),
    0 5px 10px rgba(0, 0, 0, 0.28) !important;
}

.demo-actions #nextDemoButton {
  border-color: rgba(255, 226, 136, 0.92) !important;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 246, 187, 0.9), rgba(238, 186, 68, 0.95) 48%, rgba(172, 105, 23, 0.98)) !important;
  color: #1d1205 !important;
  box-shadow:
    0 0 0 2px rgba(240, 199, 106, 0.16),
    0 0 13px rgba(240, 199, 106, 0.44),
    0 6px 12px rgba(0, 0, 0, 0.3) !important;
}

.demo-actions #prevDemoButton:disabled,
.demo-actions #nextDemoButton:disabled {
  opacity: 0.38 !important;
  filter: saturate(0.7) !important;
  box-shadow: none !important;
}

.demo-coach.collapsed .demo-actions #prevDemoButton,
.demo-coach.collapsed .demo-actions #nextDemoButton {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  font-size: 19px !important;
}

@media (max-width: 720px) {
  .demo-coach {
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    width: calc(100vw - 20px) !important;
    height: 184px !important;
    min-height: 184px !important;
    max-height: 184px !important;
    cursor: grab !important;
    touch-action: none !important;
  }

  .demo-coach strong {
    font-size: 16px !important;
  }

  .demo-coach p {
    max-height: 50px !important;
    overflow: auto !important;
  }

  .demo-coach.collapsed {
    width: calc(100vw - 20px) !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    padding: 7px 9px !important;
  }

  .demo-coach.collapsed .demo-actions {
    grid-template-columns: 32px 32px 74px !important;
    gap: 4px !important;
  }

  .demo-coach.collapsed .demo-actions button {
    min-height: 32px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
  }
}

/* Home balance and bidding clarity: use the lower home space and light the actual hand cards. */
body[data-bid-phase="bidding"][data-current-turn="user"] .hand-panel {
  border-color: rgba(255, 224, 122, 0.72) !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 214, 106, 0.64),
    0 0 28px rgba(255, 214, 106, 0.2) !important;
}

body[data-bid-phase="bidding"][data-current-turn="user"] .hand .card {
  opacity: 1 !important;
  filter: brightness(1.12) saturate(1.08);
  transform: translateY(-4px);
  box-shadow:
    0 0 0 2px rgba(255, 224, 122, 0.82),
    0 0 18px rgba(255, 214, 106, 0.58),
    0 14px 28px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7) !important;
}

@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    align-content: stretch !important;
    grid-template-rows: auto minmax(0, 1fr) minmax(38px, auto) !important;
  }

  body:not(.game-active) .home-highscore {
    align-self: stretch !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 10px !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    column-gap: 10px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 34px !important;
    height: 34px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy svg {
    width: 20px !important;
    height: 20px !important;
  }

  body:not(.game-active) .home-highscore .winner-label,
  body:not(.game-active) .home-highscore small {
    font-size: 9px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: clamp(13px, 3.5vw, 16px) !important;
  }
}

@media (orientation: portrait) and (max-width: 430px) and (max-height: 820px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(0, 1fr) 36px !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 0 !important;
    height: auto !important;
    padding: 6px 8px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Rules layout polish: readable columns, no clipped text, consistent on web/iOS/Android. */
.info-dialog.rules-dialog {
  width: min(920px, calc(100vw - 24px)) !important;
  height: min(780px, calc(100dvh - 28px)) !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.rules-dialog .info-content {
  min-height: 0 !important;
  overflow: hidden !important;
}

.rules-guide {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  gap: 10px !important;
  overflow: hidden !important;
}

.rules-hero {
  min-width: 0 !important;
  padding: 12px 14px !important;
}

.rules-hero h2,
.rules-hero p {
  max-width: 100% !important;
  overflow-wrap: normal !important;
}

.rules-tabs {
  min-width: 0 !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.rules-tabs button {
  min-width: 0 !important;
  padding: 0 6px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.rules-panel {
  min-height: 0 !important;
  height: 100% !important;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)) !important;
  grid-auto-rows: minmax(min-content, max-content) !important;
  align-content: start !important;
  gap: 10px !important;
  padding: 2px 6px 10px 2px !important;
  overflow: auto !important;
  scrollbar-width: thin !important;
}

.rules-panel:not(.active) {
  display: none !important;
}

.rules-panel.active {
  display: grid !important;
}

.rule-card,
.rule-card.wide,
.rule-summary {
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: auto !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.rule-card.wide {
  grid-column: 1 / -1 !important;
}

.rule-summary {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: start !important;
}

.rule-card strong,
.rule-card p,
.rule-card li {
  max-width: 100% !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  hyphens: auto !important;
}

.rule-card p,
.rule-card ul {
  margin-top: 0 !important;
}

.rule-card ul {
  padding-left: 18px !important;
}

.rank-strip {
  max-width: 100% !important;
  grid-template-columns: repeat(8, minmax(22px, 1fr)) !important;
  overflow: hidden !important;
}

.rank-strip span {
  min-width: 0 !important;
  padding: 0 2px !important;
}

@media (max-width: 720px) {
  .info-dialog.rules-dialog {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    padding: 9px !important;
  }

  .rules-guide {
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
    gap: 7px !important;
  }

  .rules-hero {
    padding: 9px 10px !important;
  }

  .rules-hero h2 {
    font-size: 18px !important;
    line-height: 1.1 !important;
  }

  .rules-hero p {
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .rules-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  .rules-tabs button {
    min-height: 32px !important;
    padding: 0 2px !important;
    font-size: clamp(9px, 2.55vw, 11px) !important;
  }

  .rules-panel,
  .rules-panel.active {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    padding: 1px 2px 10px 1px !important;
  }

  .rule-card {
    padding: 10px !important;
  }

  .rule-summary {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 9px !important;
  }

  .rule-number {
    width: 30px !important;
    height: 30px !important;
    font-size: 13px !important;
  }

  .rule-card strong {
    font-size: 14px !important;
    line-height: 1.12 !important;
  }

  .rule-card p,
  .rule-card li {
    font-size: 12px !important;
    line-height: 1.28 !important;
  }

  .rank-strip {
    gap: 3px !important;
  }

  .rank-strip span {
    min-height: 24px !important;
    font-size: 11px !important;
  }
}

/* Final partner seat equality: top teammate matches the left/right player scale on small screens. */
@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .player-top .avatar {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 0 !important;
    border-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.game-active .player-top .player-info {
    width: auto !important;
    min-width: 0 !important;
    max-width: 86px !important;
    padding: 4px 9px !important;
    border-radius: 10px !important;
    gap: 1px !important;
    justify-items: center !important;
    box-sizing: border-box !important;
  }

  body.game-active .player-top .player-info span,
  body.game-active .player-top .player-info small {
    max-width: 72px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.game-active .player-top .player-info span {
    font-size: 13px !important;
    line-height: 1.05 !important;
  }

  body.game-active .player-top .player-info small {
    font-size: 11px !important;
    line-height: 1.05 !important;
  }
}

/* Browser home scalability: keep the start menu proportional and the photo icon readable. */
body:not(.game-active) .start-menu-stage {
  --home-scale: min(1, calc((100dvh - 18px) / 930));
}

body:not(.game-active) .photo-button-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #ffe8a3;
  filter: drop-shadow(0 0 8px rgba(236, 181, 72, 0.45));
}

body:not(.game-active) .photo-button-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:not(.game-active) .photo-button-icon svg circle,
body:not(.game-active) .photo-button-icon svg path {
  fill: none !important;
  stroke: currentColor !important;
}

@media (orientation: portrait) and (max-width: 700px) {
  body:not(.game-active) .start-menu {
    min-height: 100dvh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)) !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(100%, 430px) !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-rows: minmax(138px, clamp(146px, 20dvh, 205px)) minmax(0, 1fr) !important;
    gap: clamp(5px, 0.9dvh, 10px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .brand-showcase {
    min-height: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    align-items: end !important;
    justify-content: center !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(88vw, 360px) !important;
    max-height: clamp(132px, 20dvh, 205px) !important;
    object-fit: contain !important;
    object-position: center bottom !important;
    transform: none !important;
  }

  body:not(.game-active) .brand-showcase p,
  body:not(.game-active) .start-heading {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    min-height: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows:
      minmax(66px, 0.74fr)
      minmax(88px, 1fr)
      minmax(68px, 0.78fr)
      minmax(62px, 0.72fr)
      minmax(116px, 1.42fr)
      auto
      minmax(44px, 0.56fr) !important;
    gap: clamp(5px, 0.8dvh, 8px) !important;
    padding: clamp(8px, 1.1dvh, 12px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .competition-entry {
    min-height: 0 !important;
    padding: clamp(6px, 0.9dvh, 9px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .online-kicker {
    font-size: clamp(11px, 2.85vw, 14px) !important;
    line-height: 1 !important;
    margin: 0 !important;
  }

  body:not(.game-active) .home-player-section {
    grid-template-columns: clamp(38px, 10vw, 46px) minmax(0, 1fr) minmax(94px, auto) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "title title title"
      "avatar name photo" !important;
    align-items: center !important;
    column-gap: clamp(7px, 2vw, 12px) !important;
    row-gap: 4px !important;
  }

  body:not(.game-active) .avatar-preview {
    width: clamp(38px, 10vw, 46px) !important;
    height: clamp(38px, 10vw, 46px) !important;
    font-size: clamp(15px, 4vw, 18px) !important;
  }

  body:not(.game-active) .player-name-field {
    min-width: 0 !important;
  }

  body:not(.game-active) .player-name-field > span {
    display: none !important;
  }

  body:not(.game-active) .player-name-field input {
    height: clamp(34px, 5.1dvh, 42px) !important;
    min-height: 0 !important;
    padding: 0 10px !important;
    font-size: clamp(16px, 4.2vw, 20px) !important;
  }

  body:not(.game-active) .player-photo-field {
    height: clamp(34px, 5.1dvh, 42px) !important;
    min-height: 0 !important;
    padding: 0 10px !important;
    gap: 7px !important;
  }

  body:not(.game-active) .photo-button-icon {
    width: clamp(18px, 5vw, 22px) !important;
    height: clamp(18px, 5vw, 22px) !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group {
    grid-template-columns: repeat(var(--choice-count, 2), minmax(0, 1fr)) !important;
  }

  body:not(.game-active) .level-group {
    --choice-count: 3;
  }

  body:not(.game-active) .menu-choice > span,
  body:not(.game-active) .home-action-card {
    min-height: 0 !important;
    height: 100% !important;
    padding: clamp(5px, 0.75dvh, 8px) clamp(6px, 1.7vw, 10px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    align-content: center !important;
  }

  body:not(.game-active) .level-group .menu-choice > span,
  body:not(.game-active) .home-action-card {
    align-items: center !important;
  }

  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong {
    font-size: clamp(11px, 3vw, 15px) !important;
    line-height: 1.08 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }

  body:not(.game-active) .menu-choice small,
  body:not(.game-active) .home-action-card small,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .home-action-grid {
    height: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(5px, 1.5vw, 8px) !important;
  }

  body:not(.game-active) .home-action-card {
    grid-template-columns: clamp(22px, 6vw, 28px) minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(22px, 6vw, 28px) !important;
    height: clamp(22px, 6vw, 28px) !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(34px, 0.42fr) minmax(42px, 0.58fr) !important;
    gap: clamp(5px, 0.7dvh, 8px) !important;
  }

  body:not(.game-active) .competition-copy strong {
    display: none !important;
  }

  body:not(.game-active) .home-highscore {
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 8px !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: clamp(5px, 1.5vw, 8px) !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 5px !important;
    border-radius: 9px !important;
    font-size: clamp(10px, 2.75vw, 13px) !important;
    line-height: 1.05 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions .info-button span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .start-game-button {
    min-height: 0 !important;
    height: clamp(42px, 6.4dvh, 54px) !important;
    padding: 0 12px !important;
    font-size: clamp(19px, 5vw, 24px) !important;
  }
}

@media (orientation: portrait) and (max-width: 390px), (orientation: portrait) and (max-height: 760px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(122px, clamp(126px, 17dvh, 166px)) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .brand-showcase img {
    max-height: clamp(120px, 17dvh, 166px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(60px, 0.7fr)
      minmax(76px, 0.88fr)
      minmax(58px, 0.68fr)
      minmax(54px, 0.62fr)
      minmax(94px, 1.1fr)
      auto
      40px !important;
    gap: 4px !important;
    padding: 7px !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .competition-entry {
    padding: 5px !important;
  }
}

/* Landscape home: wide table-style menu inspired by the desktop mockup. */
@media (orientation: landscape) and (min-width: 720px) {
  body:not(.game-active) .start-menu {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: clamp(8px, 1.6dvh, 18px) clamp(10px, 1.4vw, 22px) !important;
    overflow: hidden !important;
    background:
      radial-gradient(ellipse at 50% 48%, rgba(10, 84, 71, 0.34), transparent 36%),
      linear-gradient(180deg, rgba(2, 12, 15, 0.1), rgba(2, 10, 12, 0.84)),
      repeating-linear-gradient(90deg, transparent 0 78px, rgba(255, 255, 255, 0.018) 78px 79px),
      linear-gradient(135deg, #020a0e, #052332 48%, #02090d);
  }

  body:not(.game-active) .start-menu-stage {
    width: min(100%, 1480px) !important;
    height: min(100%, 760px) !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(250px, 29%) minmax(300px, 1fr) minmax(270px, 30%) !important;
    grid-template-rows: minmax(0, 1fr) clamp(58px, 10.5dvh, 86px) !important;
    gap: clamp(10px, 1.25vw, 18px) !important;
    padding: clamp(16px, 2.6dvh, 28px) clamp(18px, 2.1vw, 34px) !important;
    border-radius: 0 !important;
    border: 1px solid rgba(217, 170, 69, 0.42) !important;
    background:
      linear-gradient(180deg, rgba(2, 12, 13, 0.26), rgba(2, 10, 10, 0.54)),
      url("./assets/achtergrond-landscape.png") center / cover no-repeat,
      linear-gradient(135deg, rgba(2, 16, 22, 0.98), rgba(5, 28, 34, 0.98));
    box-shadow:
      0 0 0 1px rgba(255, 235, 166, 0.13),
      0 0 42px rgba(217, 170, 69, 0.18),
      0 30px 90px rgba(0, 0, 0, 0.62),
      inset 0 1px 0 rgba(255, 245, 205, 0.1) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage::before {
    inset: 10px !important;
    border-radius: 0 !important;
    border-color: rgba(217, 170, 69, 0.22) !important;
  }

  body:not(.game-active) .start-menu-stage::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    border-radius: 0 !important;
    border: 0 !important;
    background:
      radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 0 44%, rgba(0, 0, 0, 0.12) 68%, rgba(0, 0, 0, 0.26) 100%),
      linear-gradient(90deg, rgba(1, 9, 10, 0.28), rgba(1, 9, 10, 0) 20%, rgba(1, 9, 10, 0) 80%, rgba(1, 9, 10, 0.28)),
      linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.12));
    box-shadow:
      inset 0 0 0 1px rgba(217, 170, 69, 0.12),
      inset 0 0 70px rgba(0, 0, 0, 0.45) !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: center !important;
    z-index: 4 !important;
    width: min(100%, 610px) !important;
    height: clamp(176px, 33dvh, 302px) !important;
    padding: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(45vw, 610px) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: clamp(172px, 34dvh, 302px) !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    margin: 0 !important;
    transform: translateY(clamp(-4px, -0.7dvh, 0px)) !important;
    border-radius: 0 !important;
    filter:
      drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5))
      drop-shadow(0 0 20px rgba(217, 170, 69, 0.18)) !important;
  }

  body:not(.game-active) .brand-showcase p,
  body:not(.game-active) .start-heading {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    z-index: 2 !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(250px, 29%) minmax(300px, 1fr) minmax(270px, 30%) !important;
    grid-template-rows: minmax(118px, 0.78fr) minmax(164px, 1.05fr) minmax(86px, 0.56fr) clamp(58px, 10.5dvh, 86px) !important;
    grid-template-areas:
      "player center options"
      "variant center competition"
      "level center competition"
      ". start ." !important;
    gap: clamp(10px, 1.25vw, 18px) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-panel::before,
  body:not(.game-active) .start-menu-panel::after {
    display: none !important;
  }

  body:not(.game-active) .home-player-section {
    grid-area: player !important;
  }

  body:not(.game-active) .variant-group {
    grid-area: variant !important;
  }

  body:not(.game-active) .level-group {
    grid-area: level !important;
  }

  body:not(.game-active) .home-options-section {
    grid-area: options !important;
  }

  body:not(.game-active) .competition-entry {
    grid-area: competition !important;
  }

  body:not(.game-active) .start-game-button {
    grid-area: start !important;
  }

  body:not(.game-active) .menu-error {
    grid-area: start !important;
    align-self: start !important;
    justify-self: center !important;
    z-index: 5 !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .menu-group,
  body:not(.game-active) .competition-entry {
    min-height: 0 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(217, 170, 69, 0.34) !important;
    background:
      linear-gradient(180deg, rgba(4, 31, 38, 0.76), rgba(3, 20, 25, 0.82)),
      radial-gradient(circle at 50% 0%, rgba(16, 95, 108, 0.24), transparent 58%) !important;
    backdrop-filter: blur(2px) saturate(1.08) !important;
    box-shadow:
      0 18px 30px rgba(0, 0, 0, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .online-kicker {
    color: var(--gold) !important;
    font-size: clamp(13px, 1.55vw, 20px) !important;
    font-weight: 950 !important;
    letter-spacing: 0.08em !important;
    line-height: 1 !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-player-section {
    padding: clamp(12px, 2dvh, 18px) !important;
    display: grid !important;
    grid-template-columns: clamp(52px, 5.4vw, 78px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    grid-template-areas:
      "title title"
      "avatar name"
      ". photo" !important;
    align-items: center !important;
    gap: clamp(8px, 1.4dvh, 14px) clamp(12px, 1.4vw, 20px) !important;
  }

  body:not(.game-active) .home-player-section h2 {
    grid-area: title !important;
    justify-self: start !important;
    text-align: left !important;
  }

  body:not(.game-active) .avatar-preview {
    grid-area: avatar !important;
    width: clamp(52px, 5.4vw, 78px) !important;
    height: clamp(52px, 5.4vw, 78px) !important;
    font-size: clamp(20px, 2vw, 30px) !important;
    box-shadow: 0 0 0 3px rgba(255, 235, 166, 0.16), 0 8px 18px rgba(0, 0, 0, 0.38) !important;
  }

  body:not(.game-active) .player-name-field {
    grid-area: name !important;
    min-width: 0 !important;
  }

  body:not(.game-active) .player-name-field > span {
    display: none !important;
  }

  body:not(.game-active) .player-name-field input {
    min-height: 0 !important;
    height: clamp(38px, 6dvh, 58px) !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff6de !important;
    font-size: clamp(22px, 2.35vw, 38px) !important;
    font-weight: 950 !important;
  }

  body:not(.game-active) .player-photo-field {
    grid-area: photo !important;
    justify-self: stretch !important;
    min-height: 0 !important;
    height: clamp(32px, 5.4dvh, 44px) !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    border: 1px solid rgba(217, 170, 69, 0.72) !important;
    border-radius: 9px !important;
    background: linear-gradient(180deg, rgba(6, 36, 41, 0.78), rgba(4, 22, 28, 0.9)) !important;
    color: #ffe6a4 !important;
  }

  body:not(.game-active) .player-photo-field::after {
    display: none !important;
  }

  body:not(.game-active) .player-photo-field strong {
    color: #ffe6a4 !important;
    font-size: clamp(12px, 1.15vw, 16px) !important;
    text-transform: none !important;
  }

  body:not(.game-active) .photo-button-icon {
    width: clamp(16px, 1.55vw, 22px) !important;
    height: clamp(16px, 1.55vw, 22px) !important;
  }

  body:not(.game-active) .variant-group {
    padding: clamp(10px, 1.6dvh, 16px) !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 1vw, 14px) !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    min-height: 0 !important;
    height: 100% !important;
    padding: clamp(8px, 1.3dvh, 14px) !important;
    align-content: end !important;
    border-color: rgba(217, 170, 69, 0.34) !important;
    border-radius: 11px !important;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(1, 11, 14, 0.76)),
      var(--city-image) center / cover no-repeat !important;
    box-shadow: inset 0 0 0 1px rgba(255, 239, 190, 0.09), 0 10px 18px rgba(0, 0, 0, 0.28) !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(1) > span {
    --city-image: url("./assets/amsterdam-canals.png");
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(2) > span {
    --city-image: url("./assets/rotterdam-harbor.png");
  }

  body:not(.game-active) .variant-group .menu-choice input:checked + span {
    border-color: #f5c45a !important;
    box-shadow:
      inset 0 0 0 2px #f5c45a,
      0 0 18px rgba(217, 170, 69, 0.32),
      0 12px 22px rgba(0, 0, 0, 0.38) !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    color: #fff6de !important;
    font-size: clamp(15px, 1.52vw, 23px) !important;
    line-height: 1.05 !important;
    text-shadow: 0 2px 7px rgba(0, 0, 0, 0.85) !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: block !important;
    color: #fff3c9 !important;
    font-size: clamp(10px, 0.95vw, 14px) !important;
    font-weight: 900 !important;
    line-height: 1.05 !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 7px rgba(0, 0, 0, 0.88) !important;
  }

  body:not(.game-active) .level-group {
    padding: clamp(10px, 1.5dvh, 15px) !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(7px, 0.9vw, 12px) !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 8px !important;
    place-items: center !important;
    border-radius: 9px !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: clamp(11px, 1.1vw, 16px) !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .level-group .menu-choice small,
  body:not(.game-active) .home-action-card small,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .home-options-section {
    padding: clamp(12px, 2dvh, 20px) !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(9px, 1.4dvh, 15px) !important;
  }

  body:not(.game-active) .home-action-grid {
    height: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(9px, 1vw, 16px) !important;
  }

  body:not(.game-active) .home-action-card {
    min-height: 0 !important;
    height: 100% !important;
    padding: clamp(8px, 1.3dvh, 14px) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(48px, 1fr) auto !important;
    place-items: center !important;
    text-align: center !important;
    border-color: rgba(217, 170, 69, 0.4) !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, rgba(5, 35, 42, 0.9), rgba(3, 19, 24, 0.92)) !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(52px, 4.8vw, 78px) !important;
    height: clamp(52px, 4.8vw, 78px) !important;
    border-radius: 50% !important;
    color: #ffe4a0 !important;
    background:
      radial-gradient(circle at 42% 30%, rgba(255, 237, 169, 0.34), rgba(217, 170, 69, 0.16) 54%, rgba(4, 28, 34, 0.48)) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255, 237, 169, 0.22),
      0 0 18px rgba(217, 170, 69, 0.22) !important;
  }

  body:not(.game-active) .home-action-icon svg {
    width: 74% !important;
    height: 74% !important;
    stroke-width: 1.9 !important;
  }

  body:not(.game-active) .home-action-card strong {
    font-size: clamp(10px, 1.05vw, 15px) !important;
    line-height: 1.05 !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .competition-entry {
    padding: clamp(14px, 2.2dvh, 22px) !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    gap: clamp(10px, 1.6dvh, 18px) !important;
  }

  body:not(.game-active) .competition-copy {
    display: grid !important;
    gap: 8px !important;
    justify-items: center !important;
    text-align: center !important;
  }

  body:not(.game-active) .competition-copy strong {
    display: block !important;
    color: #fff2cf !important;
    font-size: clamp(13px, 1.55vw, 22px) !important;
    font-weight: 950 !important;
    letter-spacing: 0.04em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.58) !important;
  }

  body:not(.game-active) .home-highscore {
    align-self: center !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: clamp(10px, 1.8dvh, 18px) !important;
    display: grid !important;
    grid-template-columns: clamp(42px, 4.8vw, 70px) minmax(0, 1fr) !important;
    grid-template-areas:
      "trophy label"
      "trophy name"
      "trophy score" !important;
    align-items: center !important;
    column-gap: clamp(12px, 1.4vw, 20px) !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-area: trophy !important;
    width: clamp(42px, 4.8vw, 70px) !important;
    height: clamp(42px, 4.8vw, 70px) !important;
  }

  body:not(.game-active) .home-highscore .home-trophy svg {
    width: 58% !important;
    height: 58% !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    grid-area: label !important;
    color: var(--gold) !important;
    font-size: clamp(11px, 1.15vw, 16px) !important;
    font-weight: 950 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-highscore strong {
    grid-area: name !important;
    font-size: clamp(16px, 1.9vw, 27px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    grid-area: score !important;
    color: var(--muted) !important;
    font-size: clamp(10px, 1vw, 14px) !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(8px, 1vw, 14px) !important;
    min-height: clamp(78px, 13dvh, 112px) !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-height: 0 !important;
    height: 100% !important;
    padding: clamp(6px, 1dvh, 10px) 7px !important;
    display: grid !important;
    grid-template-rows: minmax(30px, 1fr) auto auto !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 4px !important;
    border-radius: 10px !important;
    border-color: rgba(217, 170, 69, 0.34) !important;
    background: linear-gradient(180deg, rgba(5, 35, 42, 0.9), rgba(3, 19, 24, 0.92)) !important;
    color: #fff2cf !important;
    font-size: clamp(9px, 0.92vw, 13px) !important;
    font-weight: 950 !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: clamp(34px, 3.2vw, 50px) !important;
    height: clamp(34px, 3.2vw, 50px) !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 50% !important;
    color: #ffe4a0 !important;
    background:
      radial-gradient(circle at 42% 30%, rgba(255, 237, 169, 0.32), rgba(217, 170, 69, 0.14) 56%, rgba(4, 28, 34, 0.5)) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255, 237, 169, 0.2),
      0 0 16px rgba(217, 170, 69, 0.18) !important;
  }

  body:not(.game-active) .premium-action-icon svg {
    width: 72% !important;
    height: 72% !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.9 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    filter: drop-shadow(0 0 6px rgba(217, 170, 69, 0.22)) !important;
  }

  body:not(.game-active) .online-entry-actions .info-button .premium-action-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .online-entry-actions .info-button small {
    display: inline-grid !important;
    min-width: 0 !important;
    padding: 2px 6px !important;
    border: 1px solid rgba(245, 196, 90, 0.46) !important;
    border-radius: 999px !important;
    color: #f5c45a !important;
    background: rgba(217, 170, 69, 0.1) !important;
    font-size: clamp(7px, 0.72vw, 10px) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .start-game-button {
    align-self: stretch !important;
    justify-self: center !important;
    width: min(100%, 620px) !important;
    min-height: 0 !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: 0 !important;
    background:
      url("./assets/button-start-normal.png") center / 100% auto no-repeat !important;
    color: transparent !important;
    font-size: clamp(24px, 2.85vw, 42px) !important;
    font-weight: 950 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    text-shadow: none !important;
    box-shadow: none !important;
    filter: saturate(1.04) contrast(1.02) !important;
    overflow: visible !important;
  }

  body:not(.game-active) .start-game-button:active,
  body:not(.game-active) .start-game-button.pressed {
    background:
      url("./assets/button-start-normal.png") center / 100% auto no-repeat !important;
    color: #fffdf3 !important;
    transform: translateY(2px) scale(0.992) !important;
    text-shadow:
      0 0 8px rgba(255, 255, 255, 0.72),
      0 2px 3px rgba(70, 38, 0, 0.7) !important;
    filter: brightness(1.04) saturate(1.06) contrast(1.02) !important;
  }

  body:not(.game-active) .start-game-button:focus-visible {
    outline: 2px solid rgba(255, 245, 190, 0.86) !important;
    outline-offset: 3px !important;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  body:not(.game-active) .start-menu {
    padding: 6px 8px !important;
  }

  body:not(.game-active) .start-menu-stage {
    grid-template-columns: minmax(220px, 28%) minmax(270px, 1fr) minmax(235px, 29%) !important;
    grid-template-rows: minmax(0, 1fr) 54px !important;
    gap: 8px !important;
    padding: 12px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-columns: minmax(220px, 28%) minmax(270px, 1fr) minmax(235px, 29%) !important;
    grid-template-rows: minmax(88px, 0.72fr) minmax(122px, 0.98fr) minmax(62px, 0.5fr) 54px !important;
    gap: 8px !important;
  }

  body:not(.game-active) .brand-showcase {
    height: 168px !important;
  }

  body:not(.game-active) .brand-showcase img {
    max-height: 168px !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .menu-group,
  body:not(.game-active) .competition-entry {
    padding: 8px !important;
  }

  body:not(.game-active) .home-player-section {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    grid-template-rows: 17px minmax(0, 1fr) 28px !important;
    grid-template-areas:
      "title title"
      "avatar name"
      ". photo" !important;
    gap: 3px 9px !important;
  }

  body:not(.game-active) .home-player-section h2 {
    align-self: center !important;
    font-size: 12px !important;
    line-height: 1 !important;
    overflow: visible !important;
  }

  body:not(.game-active) .avatar-preview {
    width: 38px !important;
    height: 38px !important;
    font-size: 15px !important;
  }

  body:not(.game-active) .player-name-field input {
    height: 28px !important;
    font-size: 19px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .player-photo-field {
    height: 28px !important;
    padding: 0 8px !important;
    gap: 6px !important;
  }

  body:not(.game-active) .player-photo-field strong {
    font-size: 11px !important;
  }

  body:not(.game-active) .photo-button-icon {
    width: 14px !important;
    height: 14px !important;
  }

  body:not(.game-active) .variant-group {
    grid-template-rows: 18px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    padding: 5px !important;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(1, 11, 14, 0.58)),
      var(--city-image) center / cover no-repeat !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: 12px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .level-group {
    grid-template-rows: 18px minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: 10px !important;
  }

  body:not(.game-active) .home-options-section {
    grid-template-rows: 18px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .home-action-card strong {
    font-size: 9px !important;
  }

  body:not(.game-active) .home-action-icon {
    width: 34px !important;
    height: 34px !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: 34px minmax(0, 1fr) 62px !important;
    gap: 6px !important;
  }

  body:not(.game-active) .competition-copy {
    gap: 3px !important;
  }

  body:not(.game-active) .competition-copy strong {
    font-size: 11px !important;
  }

  body:not(.game-active) .home-highscore {
    padding: 6px !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    font-size: 9px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: 13px !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 62px !important;
    gap: 6px !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    grid-template-rows: 24px auto auto !important;
    gap: 2px !important;
    padding: 4px !important;
    font-size: 8.5px !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: 24px !important;
    height: 24px !important;
  }

  body:not(.game-active) .online-entry-actions .info-button .premium-action-text {
    white-space: normal !important;
    text-overflow: clip !important;
  }

  body:not(.game-active) .online-entry-actions .info-button small {
    padding: 1px 4px !important;
    font-size: 6.8px !important;
  }

  body:not(.game-active) .variant-group .menu-choice small,
  body:not(.game-active) .home-highscore small {
    display: none !important;
  }
}

@media (orientation: landscape) and (min-width: 720px) {
  body:not(.game-active) .online-entry-actions {
    width: 100% !important;
    justify-self: stretch !important;
  }

  body:not(.game-active) .home-action-card,
  body:not(.game-active) .online-entry-actions .info-button {
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-card span:last-child,
  body:not(.game-active) .premium-action-text {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
  }

  body:not(.game-active) .premium-action-text {
    line-height: 1.05 !important;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  body:not(.game-active) .home-action-card {
    grid-template-rows: minmax(18px, 1fr) auto !important;
    padding: 3px !important;
    gap: 1px !important;
  }

  body:not(.game-active) .home-action-icon {
    width: 22px !important;
    height: 22px !important;
  }

  body:not(.game-active) .home-action-card strong {
    font-size: 8px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    grid-template-rows: 22px auto auto !important;
    min-width: 0 !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: 22px !important;
    height: 22px !important;
  }

  body:not(.game-active) .premium-action-text {
    font-size: 7.8px !important;
  }

  body:not(.game-active) .home-action-card small {
    display: none !important;
  }
}

/* Final home fit guard: automatic portrait/landscape, no manual screen-mode controls. */
body:not(.game-active) .start-menu {
  max-width: 100vw !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

body:not(.game-active) .start-menu-stage,
body:not(.game-active) .start-menu-panel {
  max-width: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body:not(.game-active) .online-entry-actions .premium-action {
  min-width: 0 !important;
  overflow: hidden !important;
}

body:not(.game-active) .online-entry-actions .premium-action-icon {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  min-width: var(--premium-icon-size, 26px) !important;
  width: var(--premium-icon-size, 26px) !important;
  height: var(--premium-icon-size, 26px) !important;
  overflow: visible !important;
  color: #ffe4a0 !important;
}

body:not(.game-active) .online-entry-actions .premium-action-icon svg {
  display: block !important;
  width: 72% !important;
  height: 72% !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

body:not(.game-active) .online-entry-actions .premium-action-text {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.game-active) .online-entry-actions .premium-action small {
  display: inline-grid !important;
  place-items: center !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

@media (orientation: portrait) and (max-width: 700px) {
  body:not(.game-active) .start-menu {
    height: 100dvh !important;
    padding: max(6px, env(safe-area-inset-top)) 10px max(6px, env(safe-area-inset-bottom)) !important;
  }

  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(128px, clamp(132px, 18.5dvh, 188px)) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .brand-showcase img {
    max-height: clamp(124px, 18.5dvh, 188px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(62px, 0.74fr)
      minmax(82px, 0.98fr)
      minmax(60px, 0.72fr)
      minmax(58px, 0.7fr)
      minmax(116px, 1.4fr)
      auto
      minmax(42px, 0.52fr) !important;
    gap: clamp(4px, 0.7dvh, 7px) !important;
    padding: clamp(7px, 0.95dvh, 10px) !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(30px, 0.34fr) minmax(62px, 0.74fr) !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: clamp(5px, 1.4vw, 7px) !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(18px, 5vw, 24px);
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: var(--premium-icon-size) auto auto !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 2px !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 4px 3px !important;
    border: 1px solid rgba(217, 170, 69, 0.34) !important;
    border-radius: 8px !important;
    background: linear-gradient(180deg, rgba(5, 35, 42, 0.88), rgba(3, 19, 24, 0.92)) !important;
    color: #fff2cf !important;
    text-align: center !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon {
    margin: 0 !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text {
    color: #fff2cf !important;
    font-size: clamp(8px, 2.25vw, 10.5px) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action small {
    padding: 1px 4px !important;
    border: 1px solid rgba(245, 196, 90, 0.46) !important;
    border-radius: 999px !important;
    color: #f5c45a !important;
    background: rgba(217, 170, 69, 0.1) !important;
    font-size: clamp(6px, 1.8vw, 8px) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
  }
}

@media (orientation: portrait) and (max-width: 390px), (orientation: portrait) and (max-height: 780px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(112px, clamp(116px, 16dvh, 150px)) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .brand-showcase img {
    max-height: clamp(110px, 16dvh, 150px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(56px, 0.68fr)
      minmax(72px, 0.88fr)
      minmax(52px, 0.62fr)
      minmax(50px, 0.58fr)
      minmax(96px, 1.1fr)
      auto
      38px !important;
  }
}

@media (orientation: landscape) and (min-width: 720px) {
  body:not(.game-active) .online-entry-actions {
    width: 100% !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(24px, 3.2vw, 46px);
  }

  body:not(.game-active) .online-entry-actions .premium-action-text {
    width: 100% !important;
    font-size: clamp(8px, 0.74vw, 9.5px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action small {
    font-size: clamp(6px, 0.66vw, 8.5px) !important;
  }
}

/* Landscape menu readability: short labels and city cards that keep their image shape. */
@media (orientation: landscape) {
  body:not(.game-active) .online-entry-actions .premium-action {
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text {
    font-size: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    content: attr(data-short-label);
    display: block !important;
    width: 100% !important;
    overflow: hidden !important;
    color: #fff2cf !important;
    font-size: clamp(8px, 0.82vw, 12px) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .variant-group .menu-choice {
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    align-items: stretch !important;
    height: 100% !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(1) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(2) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    min-width: 0 !important;
    min-height: 0 !important;
    background-size: cover !important;
    background-position: center !important;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows: minmax(78px, 0.62fr) minmax(138px, 1.1fr) minmax(48px, 0.38fr) 54px !important;
  }

  body:not(.game-active) .variant-group {
    grid-template-rows: 18px minmax(0, 1fr) !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    height: 100% !important;
    padding: 6px !important;
    align-content: end !important;
    border-radius: 11px !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(10px, 1.22vw, 13px) !important;
    line-height: 1.02 !important;
    overflow-wrap: normal !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    font-size: clamp(7.5px, 0.86vw, 9.5px) !important;
  }
}

@media (orientation: landscape) and (max-height: 430px) {
  body:not(.game-active) .variant-group .menu-choice > span {
    background-size: cover !important;
    background-position: center !important;
  }
}

/* Landscape polish: keep the start artwork uncropped and make level choices easier to hit/read. */
@media (orientation: landscape) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(104px, 0.68fr)
      minmax(138px, 0.92fr)
      minmax(86px, 0.58fr)
      clamp(88px, 13.8dvh, 128px) !important;
  }

  body:not(.game-active) .level-group {
    align-content: stretch !important;
    grid-template-rows: auto minmax(50px, 1fr) !important;
    padding: clamp(12px, 1.8dvh, 18px) !important;
    gap: clamp(8px, 1.2dvh, 13px) !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    min-height: 0 !important;
    display: grid !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: clamp(44px, 8.2dvh, 68px) !important;
    height: 100% !important;
    padding: 0 clamp(10px, 1.1vw, 18px) !important;
    border-radius: 999px !important;
    background:
      linear-gradient(180deg, rgba(7, 42, 48, 0.98), rgba(2, 21, 27, 0.98)) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255, 234, 171, 0.09),
      0 8px 16px rgba(0, 0, 0, 0.26) !important;
  }

  body:not(.game-active) .level-group .menu-choice input:checked + span {
    border-color: #f5c45a !important;
    background:
      linear-gradient(180deg, rgba(68, 80, 47, 0.98), rgba(15, 49, 38, 0.98)) !important;
    box-shadow:
      inset 0 0 0 2px #f5c45a,
      0 0 18px rgba(245, 196, 90, 0.26),
      0 10px 20px rgba(0, 0, 0, 0.3) !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: clamp(15px, 1.34vw, 22px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .start-game-button {
    width: min(74vw, 720px) !important;
    height: 100% !important;
    min-height: clamp(82px, 12.8dvh, 122px) !important;
    background:
      url("./assets/button-start-normal.png") center / contain no-repeat !important;
    overflow: visible !important;
  }

  body:not(.game-active) .start-game-button:active,
  body:not(.game-active) .start-game-button.pressed {
    background:
      url("./assets/button-start-normal.png") center / contain no-repeat !important;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(76px, 0.58fr)
      minmax(126px, 0.96fr)
      minmax(66px, 0.5fr)
      clamp(74px, 18dvh, 92px) !important;
  }

  body:not(.game-active) .level-group {
    grid-template-rows: 17px minmax(42px, 1fr) !important;
    gap: 6px !important;
    padding: 8px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 40px !important;
    padding: 0 8px !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: clamp(12px, 1.65vw, 16px) !important;
  }

  body:not(.game-active) .start-game-button {
    width: min(72vw, 520px) !important;
    min-height: 72px !important;
  }
}

/* Mobile game top seat and variant mark: partner matches side players; top-left shows the ruleset visually. */
.top-variant-thumb {
  display: none;
}

body[data-game-variant="amsterdam"] .top-variant-thumb {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(1, 11, 14, 0.42)),
    url("./assets/amsterdam-canals.png");
}

body[data-game-variant="rotterdam"] .top-variant-thumb {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(1, 11, 14, 0.42)),
    url("./assets/rotterdam-harbor.png");
}

@media (orientation: portrait) and (max-width: 700px) {
  body.game-active .top-bar {
    grid-template-columns: minmax(84px, 0.62fr) minmax(0, 1.88fr) !important;
  }

  body.game-active .top-bar > div:first-child {
    min-width: 0 !important;
    display: grid !important;
    grid-template-rows: auto 1fr !important;
    align-content: center !important;
    gap: 4px !important;
    padding: 0 3px !important;
  }

  body.game-active .top-bar .eyebrow {
    max-width: 100% !important;
    font-size: clamp(9px, 2.65vw, 12px) !important;
    line-height: 1.08 !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

  body.game-active .top-variant-thumb {
    display: block !important;
    width: 100% !important;
    min-height: 28px !important;
    border: 1px solid rgba(217, 170, 69, 0.46) !important;
    border-radius: 8px !important;
    background-position: center !important;
    background-size: cover !important;
    box-shadow:
      inset 0 0 0 1px rgba(255, 238, 174, 0.08),
      0 6px 12px rgba(0, 0, 0, 0.22) !important;
  }

  body.game-active .player-top .avatar,
  body.game-active .player-left .avatar,
  body.game-active .player-right .avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    font-size: 16px !important;
    border-width: 0 !important;
    outline-width: 0 !important;
    outline-offset: 0 !important;
  }

  body[data-current-turn="partner"] .player-top .avatar,
  body[data-current-turn="left"] .player-left .avatar,
  body[data-current-turn="right"] .player-right .avatar {
    border: 2px solid rgba(255, 224, 122, 0.98) !important;
    outline: 2px solid rgba(255, 214, 106, 0.56) !important;
    outline-offset: 2px !important;
    box-shadow:
      0 0 0 4px rgba(255, 214, 106, 0.13),
      0 0 20px rgba(255, 214, 106, 0.54),
      0 7px 16px var(--shadow) !important;
  }

  body.game-active .player-top .player-info,
  body.game-active .player-left .player-info,
  body.game-active .player-right .player-info {
    max-width: 82px !important;
    padding: 4px 8px !important;
    border-radius: 9px !important;
    gap: 1px !important;
  }

  body.game-active .player-top .player-info span,
  body.game-active .player-top .player-info small,
  body.game-active .player-left .player-info span,
  body.game-active .player-left .player-info small,
  body.game-active .player-right .player-info span,
  body.game-active .player-right .player-info small {
    max-width: 66px !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.game-active .player-top .player-info span,
  body.game-active .player-left .player-info span,
  body.game-active .player-right .player-info span {
    font-size: 12px !important;
    line-height: 1.05 !important;
  }

  body.game-active .player-top .player-info small,
  body.game-active .player-left .player-info small,
  body.game-active .player-right .player-info small {
    font-size: 10px !important;
    line-height: 1.05 !important;
  }

  body.game-active .player-top {
    height: 58px !important;
  }

  body.game-active .player-top .avatar {
    top: 0 !important;
    left: 50% !important;
  }

  body.game-active .player-top .player-info {
    left: calc(50% - 60px) !important;
    top: 4px !important;
    transform: translateX(-100%) !important;
  }
}

/* Mobile home competition: give the daily winner its own readable row. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      auto
      auto
      auto
      auto
      minmax(0, 1fr)
      auto
      auto !important;
  }

  body:not(.game-active) .competition-entry {
    min-height: clamp(202px, 26dvh, 250px) !important;
    padding: clamp(10px, 1.35dvh, 14px) !important;
    display: grid !important;
    grid-template-rows: auto minmax(86px, 1fr) minmax(72px, 0.88fr) !important;
    gap: clamp(8px, 1.1dvh, 12px) !important;
    align-content: stretch !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-copy {
    min-height: 0 !important;
    display: grid !important;
    place-items: center !important;
  }

  body:not(.game-active) .competition-copy .online-kicker {
    margin: 0 !important;
    font-size: clamp(13px, 3.45vw, 15px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 86px !important;
    height: 100% !important;
    padding: 11px 14px !important;
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    grid-template-areas:
      "trophy label"
      "trophy name"
      "trophy score" !important;
    column-gap: 14px !important;
    row-gap: 4px !important;
    align-items: center !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-area: trophy !important;
    width: 56px !important;
    height: 56px !important;
    align-self: center !important;
  }

  body:not(.game-active) .home-highscore .home-trophy svg {
    width: 60% !important;
    height: 60% !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    grid-area: label !important;
    display: block !important;
    margin: 0 !important;
    color: var(--gold) !important;
    font-size: clamp(12px, 3.2vw, 14px) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore strong {
    grid-area: name !important;
    display: block !important;
    max-width: 100% !important;
    color: #fff2cf !important;
    font-size: clamp(18px, 5.15vw, 23px) !important;
    font-weight: 950 !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    grid-area: score !important;
    display: block !important;
    color: var(--muted) !important;
    font-size: clamp(10px, 2.85vw, 12px) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 72px !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: 7px !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    min-height: 72px !important;
    height: 100% !important;
    padding: 7px 5px !important;
    display: grid !important;
    grid-template-rows: 22px auto auto !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 3px !important;
    border: 1px solid rgba(86, 156, 201, 0.34) !important;
    border-radius: 9px !important;
    text-align: center !important;
  }

  body:not(.game-active) .online-entry-actions .info-button::after {
    display: none !important;
  }
}

/* Compact mobile landscape home: keep every menu block readable inside the viewport. */
@media (orientation: landscape) and (min-width: 720px) and (max-height: 520px) {
  body:not(.game-active) .start-menu {
    padding: clamp(5px, 1.15dvh, 9px) clamp(10px, 1.7vw, 18px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: 100% !important;
    height: 100% !important;
    padding: clamp(10px, 2dvh, 14px) clamp(14px, 2vw, 22px) !important;
    grid-template-columns: minmax(238px, 29%) minmax(300px, 1fr) minmax(256px, 29%) !important;
    grid-template-rows: minmax(0, 1fr) clamp(50px, 12.5dvh, 64px) !important;
    gap: clamp(8px, 1.2vw, 12px) !important;
  }

  body:not(.game-active) .start-menu-stage::before {
    inset: 8px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-columns: minmax(238px, 29%) minmax(300px, 1fr) minmax(256px, 29%) !important;
    grid-template-rows:
      minmax(82px, 0.67fr)
      minmax(116px, 0.95fr)
      minmax(58px, 0.48fr)
      clamp(50px, 12.5dvh, 64px) !important;
    gap: clamp(8px, 1.2vw, 12px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .brand-showcase {
    width: min(36vw, 440px) !important;
    height: clamp(118px, 29dvh, 150px) !important;
    transform: translateY(-2px) !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: min(36vw, 440px) !important;
    max-height: clamp(118px, 29dvh, 150px) !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .menu-group,
  body:not(.game-active) .competition-entry {
    border-radius: 12px !important;
  }

  body:not(.game-active) .home-player-section {
    padding: 10px 12px !important;
    grid-template-columns: clamp(42px, 5vw, 56px) minmax(0, 1fr) !important;
    grid-template-rows: 18px minmax(0, 1fr) 34px !important;
    gap: 5px 10px !important;
  }

  body:not(.game-active) .home-player-section h2,
  body:not(.game-active) .home-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .online-kicker {
    font-size: clamp(11px, 1.35vw, 15px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .avatar-preview {
    width: clamp(42px, 5vw, 56px) !important;
    height: clamp(42px, 5vw, 56px) !important;
    font-size: clamp(17px, 1.9vw, 24px) !important;
  }

  body:not(.game-active) .player-name-field input {
    height: 32px !important;
    font-size: clamp(20px, 2.35vw, 30px) !important;
  }

  body:not(.game-active) .player-photo-field {
    height: 32px !important;
    padding: 0 10px !important;
  }

  body:not(.game-active) .variant-group {
    padding: 9px 10px !important;
    grid-template-rows: 17px minmax(0, 1fr) !important;
    gap: 7px 10px !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    padding: 7px 9px !important;
    align-content: end !important;
    background-size: cover !important;
    background-position: center !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    max-width: 100% !important;
    font-size: clamp(11px, 1.28vw, 14px) !important;
    line-height: 1.06 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .level-group {
    padding: 8px 10px !important;
    grid-template-rows: 16px minmax(0, 1fr) !important;
    gap: 6px 10px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 36px !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: clamp(12px, 1.45vw, 16px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-options-section {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  body:not(.game-active) .home-action-grid {
    gap: 10px !important;
  }

  body:not(.game-active) .home-action-card {
    padding: 7px !important;
    grid-template-rows: minmax(30px, 1fr) auto !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(34px, 4.1vw, 48px) !important;
    height: clamp(34px, 4.1vw, 48px) !important;
  }

  body:not(.game-active) .home-action-card strong {
    font-size: clamp(9px, 1vw, 12px) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .competition-entry {
    padding: 12px !important;
    grid-template-rows: auto minmax(62px, 0.88fr) minmax(78px, 1fr) !important;
    gap: 9px !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .competition-copy {
    gap: 4px !important;
  }

  body:not(.game-active) .competition-copy strong {
    font-size: clamp(13px, 1.45vw, 17px) !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 62px !important;
    padding: 8px 10px !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    column-gap: 10px !important;
    row-gap: 2px !important;
    border: 1px solid rgba(255, 245, 190, 0.16) !important;
    background: rgba(8, 32, 31, 0.34) !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 44px !important;
    height: 44px !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    font-size: clamp(10px, 1.02vw, 12px) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: clamp(15px, 1.65vw, 20px) !important;
  }

  body:not(.game-active) .home-highscore small {
    display: block !important;
    font-size: clamp(8px, 0.9vw, 10px) !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 78px !important;
    gap: 8px !important;
  }

  body:not(.game-active) .online-entry-actions .info-button {
    grid-template-rows: 28px auto auto !important;
    gap: 3px !important;
    padding: 6px 5px !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: 28px !important;
    height: 28px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    font-size: clamp(8px, 0.95vw, 11px) !important;
  }

  body:not(.game-active) .online-entry-actions .info-button small {
    font-size: 7px !important;
    padding: 1px 5px !important;
  }

  body:not(.game-active) .start-game-button {
    width: min(46vw, 430px) !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    background:
      url("./assets/button-start-normal.png") center / contain no-repeat !important;
    transform: none !important;
  }
}

/* True final menu polish: portrait premium icons, landscape premium package, and landscape rules readability. */
@media (orientation: portrait) and (max-width: 430px) {
  body:not(.game-active) .competition-entry {
    min-height: clamp(224px, 29dvh, 278px) !important;
    grid-template-rows: auto minmax(96px, 1fr) minmax(86px, 0.9fr) !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 96px !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    padding: 12px 14px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 64px !important;
    height: 64px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: clamp(20px, 5.4vw, 25px) !important;
  }

  body:not(.game-active) .online-entry-actions,
  body:not(.game-active) .online-entry-actions .premium-action {
    min-height: 86px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(30px, 8.4vw, 40px) !important;
    grid-template-rows: var(--premium-icon-size) auto auto !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon {
    width: var(--premium-icon-size) !important;
    height: var(--premium-icon-size) !important;
  }
}

@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(58px, 0.72fr) minmax(92px, 1fr) !important;
    gap: 8px !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 92px !important;
    gap: 9px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action {
    --premium-icon-size: clamp(31px, 3.7vw, 42px) !important;
    min-height: 92px !important;
    grid-template-rows: var(--premium-icon-size) minmax(14px, auto) minmax(13px, auto) !important;
    gap: 4px !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-icon {
    width: var(--premium-icon-size) !important;
    height: var(--premium-icon-size) !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action-text::before {
    content: attr(data-short-label) !important;
    font-size: clamp(8.5px, 1vw, 12px) !important;
    white-space: nowrap !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .info-dialog.rules-dialog {
    width: min(94vw, 1040px) !important;
    height: min(90dvh, 430px) !important;
    max-height: 90dvh !important;
    overflow: hidden !important;
  }

  .rules-guide {
    height: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(180px, 0.78fr) minmax(0, 1.55fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "hero tabs"
      "hero panel" !important;
    gap: 10px 12px !important;
    overflow: hidden !important;
  }

  .rules-hero {
    grid-area: hero !important;
    min-height: 0 !important;
    padding: 13px !important;
  }

  .rules-tabs {
    grid-area: tabs !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .rules-tabs button {
    min-height: 36px !important;
    font-size: clamp(10px, 1.15vw, 13px) !important;
    white-space: nowrap !important;
  }

  .rules-panel.active {
    grid-area: panel !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    overflow-y: auto !important;
  }

  .rules-panel:not(.active) {
    display: none !important;
  }

  .rule-card,
  .rule-card.wide {
    min-width: 0 !important;
    padding: 12px !important;
  }
}

/* File-end override: landscape Niveau and Opties buttons stay readable. */
@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(94px, 0.74fr)
      minmax(108px, 0.92fr)
      minmax(72px, 0.58fr)
      clamp(48px, 11.6dvh, 62px) !important;
  }

  body:not(.game-active) .home-options-section {
    padding: 10px 12px !important;
    grid-template-rows: 18px minmax(58px, 1fr) !important;
    gap: 8px !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .level-group legend {
    font-size: clamp(13px, 1.55vw, 18px) !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-action-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 7px 6px !important;
    grid-template-rows: minmax(34px, 1fr) auto !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(36px, 4.3vw, 52px) !important;
    height: clamp(36px, 4.3vw, 52px) !important;
  }

  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .level-group .menu-choice strong {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-action-card strong {
    font-size: clamp(10px, 1.16vw, 14px) !important;
  }

  body:not(.game-active) .level-group {
    padding: 9px 11px !important;
    grid-template-rows: 17px minmax(44px, 1fr) !important;
    gap: 7px 10px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 44px !important;
    height: 100% !important;
    padding: 0 9px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: clamp(13px, 1.48vw, 18px) !important;
  }
}

/* File-end override: use supplied artwork for landscape level buttons. */
@media (orientation: landscape) and (min-width: 720px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(90px, 0.7fr)
      minmax(104px, 0.88fr)
      minmax(92px, 0.74fr)
      clamp(48px, 11.6dvh, 62px) !important;
  }

  body:not(.game-active) .level-group {
    padding: 8px 10px 10px !important;
    grid-template-rows: 16px minmax(64px, 1fr) !important;
    gap: 5px 10px !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 64px !important;
    height: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    box-shadow: none !important;
    filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.42)) saturate(1.04) !important;
    overflow: visible !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(1) > span {
    background-image: url("./assets/level-beginner-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(2) > span {
    background-image: url("./assets/level-normal-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(3) > span {
    background-image: url("./assets/level-expert-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice strong,
  body:not(.game-active) .level-group .menu-choice small {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .level-group .menu-choice input:checked + span {
    filter:
      drop-shadow(0 0 10px rgba(245, 196, 90, 0.9))
      drop-shadow(0 9px 12px rgba(0, 0, 0, 0.46))
      saturate(1.12)
      brightness(1.05) !important;
    transform: translateY(-1px) scale(1.04) !important;
  }

  body:not(.game-active) .level-group .menu-choice input:focus-visible + span {
    outline: 2px solid rgba(255, 245, 190, 0.9) !important;
    outline-offset: 2px !important;
    border-radius: 14px !important;
  }
}

/* File-end rules modal fix: readable rules, no start/demo button inside the rules window. */
.info-dialog.rules-dialog .info-demo-start,
.info-dialog.rules-dialog #startDemoButton {
  display: none !important;
}

.info-dialog.rules-dialog {
  width: min(94vw, 980px) !important;
  max-height: min(90dvh, 760px) !important;
  padding: clamp(14px, 2.2vw, 24px) !important;
  overflow: hidden !important;
}

.rules-dialog .info-content {
  min-height: 0 !important;
  overflow: hidden !important;
}

.rules-guide {
  min-height: 0 !important;
  max-height: calc(90dvh - 110px) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: 12px !important;
  overflow: hidden !important;
}

.rules-hero {
  padding: clamp(12px, 2vw, 18px) !important;
  border-radius: 12px !important;
}

.rules-hero h2 {
  font-size: clamp(22px, 4vw, 34px) !important;
  line-height: 1.05 !important;
}

.rules-hero p {
  max-width: 70ch !important;
  font-size: clamp(14px, 2.1vw, 17px) !important;
  line-height: 1.38 !important;
}

.rules-tabs {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
}

.rules-tabs button {
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 10px !important;
  font-size: clamp(12px, 1.8vw, 15px) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.rules-panel,
.rules-panel.active {
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  padding: 2px 6px 8px 0 !important;
  align-content: start !important;
}

.rules-panel.active {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)) !important;
  gap: 12px !important;
}

.rules-panel:not(.active) {
  display: none !important;
}

.rule-card,
.rule-card.wide {
  min-width: 0 !important;
  min-height: auto !important;
  padding: clamp(13px, 2vw, 18px) !important;
  border-radius: 12px !important;
  overflow: visible !important;
}

.rule-card.wide {
  grid-column: 1 / -1 !important;
}

.rule-card strong {
  font-size: clamp(16px, 2.35vw, 21px) !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere !important;
}

.rule-card p,
.rule-card li {
  font-size: clamp(14px, 2vw, 17px) !important;
  line-height: 1.42 !important;
  overflow-wrap: anywhere !important;
}

.rule-card ul {
  padding-left: 1.1em !important;
}

@media (orientation: portrait) and (max-width: 430px) {
  .info-dialog.rules-dialog {
    width: calc(100vw - 22px) !important;
    height: min(88dvh, 720px) !important;
    max-height: 88dvh !important;
    padding: 12px !important;
  }

  .rules-dialog .last-trick-header {
    gap: 8px !important;
    margin-bottom: 8px !important;
  }

  .rules-dialog #infoTitle {
    font-size: 26px !important;
    line-height: 1 !important;
  }

  .rules-guide {
    max-height: calc(88dvh - 82px) !important;
    gap: 10px !important;
  }

  .rules-hero {
    padding: 12px !important;
  }

  .rules-hero h2 {
    font-size: 21px !important;
  }

  .rules-hero p {
    font-size: 14px !important;
  }

  .rules-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .rules-tabs button {
    min-height: 36px !important;
    padding: 0 4px !important;
    font-size: clamp(10px, 2.75vw, 12px) !important;
  }

  .rules-panel.active {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .rule-card,
  .rule-card.wide {
    padding: 12px !important;
  }

  .rule-card strong {
    font-size: 16px !important;
  }

  .rule-card p,
  .rule-card li {
    font-size: 14px !important;
    line-height: 1.36 !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .info-dialog.rules-dialog {
    width: min(95vw, 1040px) !important;
    height: min(90dvh, 430px) !important;
    max-height: 90dvh !important;
    padding: 12px !important;
  }

  .rules-dialog .last-trick-header {
    margin-bottom: 6px !important;
  }

  .rules-dialog #infoTitle {
    font-size: clamp(22px, 2.9vw, 30px) !important;
  }

  .rules-guide {
    max-height: calc(90dvh - 62px) !important;
    grid-template-columns: minmax(170px, 0.72fr) minmax(0, 1.6fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "hero tabs"
      "hero panel" !important;
    gap: 10px !important;
  }

  .rules-hero {
    grid-area: hero !important;
    padding: 12px !important;
  }

  .rules-hero h2 {
    font-size: clamp(18px, 2.25vw, 24px) !important;
  }

  .rules-hero p {
    font-size: clamp(12px, 1.35vw, 14px) !important;
    line-height: 1.28 !important;
  }

  .rules-tabs {
    grid-area: tabs !important;
    gap: 6px !important;
  }

  .rules-tabs button {
    min-height: 34px !important;
    font-size: clamp(10px, 1.2vw, 13px) !important;
  }

  .rules-panel.active {
    grid-area: panel !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .rule-card,
  .rule-card.wide {
    padding: 11px !important;
  }

  .rule-card strong {
    font-size: clamp(13px, 1.45vw, 16px) !important;
  }

  .rule-card p,
  .rule-card li {
    font-size: clamp(11px, 1.22vw, 14px) !important;
    line-height: 1.3 !important;
  }
}

/* Final wide-screen home fit: center the landscape menu and protect the start button. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 620px) {
  body:not(.game-active) .start-menu {
    display: grid !important;
    place-items: center !important;
    width: 100vw !important;
    min-height: 100dvh !important;
    padding: clamp(18px, 2.6dvh, 34px) clamp(20px, 3vw, 48px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(94vw, 1420px) !important;
    height: min(88dvh, 790px) !important;
    min-height: 650px !important;
    margin: auto !important;
    align-self: center !important;
    justify-self: center !important;
    padding: clamp(18px, 2.2dvh, 28px) clamp(22px, 2.4vw, 38px) clamp(30px, 3.4dvh, 48px) !important;
    overflow: visible !important;
    transform: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(270px, 28%) minmax(410px, 1fr) minmax(310px, 29%) !important;
    grid-template-rows: minmax(150px, 0.74fr) minmax(250px, 1.16fr) minmax(130px, 0.62fr) minmax(112px, 0.48fr) !important;
    gap: clamp(14px, 1.2vw, 20px) !important;
    align-items: stretch !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase {
    width: min(43vw, 600px) !important;
    height: clamp(230px, 34dvh, 340px) !important;
    align-self: start !important;
    justify-self: center !important;
    z-index: 3 !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-actions-panel,
  body:not(.game-active) .competition-panel {
    min-width: 0 !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .start-game-button {
    grid-column: 2 !important;
    grid-row: 4 !important;
    align-self: center !important;
    justify-self: center !important;
    width: min(44vw, 650px) !important;
    height: clamp(94px, 12dvh, 126px) !important;
    min-height: 94px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: url("./assets/button-start-normal.png") center / contain no-repeat !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: none !important;
  }
}

/* True file-end wide-screen polish: direct fieldset children get usable width. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 620px) {
  body:not(.game-active) .level-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    column-gap: clamp(14px, 1.15vw, 20px) !important;
    row-gap: 14px !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    display: block !important;
  }

  body:not(.game-active) .level-group .menu-choice span {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 66px !important;
    height: 100% !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 10px !important;
    font-size: clamp(14px, 0.95vw, 18px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-align: center !important;
    background-image: none !important;
  }

  body:not(.game-active) .level-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .home-options-section {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    gap: clamp(12px, 1vw, 18px) !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .home-options-section legend {
    grid-column: 1 / -1 !important;
  }

  body:not(.game-active) .home-options-section .menu-choice {
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  body:not(.game-active) .home-options-section .menu-choice span {
    width: 100% !important;
    min-height: 96px !important;
    display: grid !important;
    grid-template-rows: 1fr auto !important;
    place-items: center !important;
    gap: 7px !important;
    padding: 10px 8px !important;
    font-size: clamp(12px, 0.78vw, 15px) !important;
    line-height: 1.05 !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  body:not(.game-active) .home-options-section .menu-choice small {
    display: none !important;
  }
}

/* True file-end correction v2: readable wide landscape controls without clipping. */
@media (orientation: landscape) and (min-width: 1100px) and (min-height: 620px) {
  body:not(.game-active) .level-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(64px, 1fr) !important;
    gap: 14px !important;
  }

  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  body:not(.game-active) .level-group .menu-choice span {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 64px !important;
    padding: 0 6px !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
    text-align: center !important;
    background-image: none !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    display: block !important;
    max-width: 100% !important;
    font-size: clamp(12px, 0.78vw, 14px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
    overflow: visible !important;
    text-transform: none !important;
  }

  body:not(.game-active) .level-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .home-options-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: clamp(16px, 1.8dvh, 22px) clamp(18px, 1.7vw, 24px) !important;
  }

  body:not(.game-active) .home-options-section h2 {
    margin: 0 !important;
    text-align: center !important;
  }

  body:not(.game-active) .home-action-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(12px, 1vw, 18px) !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .home-action-card {
    min-width: 0 !important;
    min-height: 104px !important;
    padding: 10px 8px !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    place-items: center !important;
    gap: 7px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon,
  body:not(.game-active) .home-action-card svg {
    width: clamp(38px, 2.7vw, 50px) !important;
    height: clamp(38px, 2.7vw, 50px) !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    font-size: clamp(11px, 0.74vw, 14px) !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    text-align: center !important;
  }

  body:not(.game-active) .home-action-card small {
    display: none !important;
  }
}

/* True file-end mobile browser height fit: account for Safari/Chrome bars and keep Start visible. */
@media (orientation: portrait) and (max-width: 700px) {
  html,
  body {
    min-height: var(--app-visible-height, 100dvh) !important;
    height: var(--app-visible-height, 100dvh) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu {
    width: 100vw !important;
    height: var(--app-visible-height, 100dvh) !important;
    min-height: 0 !important;
    padding: max(7px, env(safe-area-inset-top)) 10px max(7px, env(safe-area-inset-bottom)) !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(500px, calc(100vw - 18px)) !important;
    height: calc(var(--app-visible-height, 100dvh) - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))) !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: clamp(7px, 1.35dvh, 12px) clamp(10px, 3vw, 18px) !important;
    overflow: hidden !important;
    display: grid !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .brand-showcase {
    height: clamp(96px, 16.5dvh, 168px) !important;
    min-height: 0 !important;
    margin: 0 auto !important;
  }

  body:not(.game-active) .brand-showcase img {
    max-height: 100% !important;
    object-fit: contain !important;
  }

  body:not(.game-active) .start-menu-panel {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows:
      clamp(74px, 10.2dvh, 100px)
      clamp(92px, 12.2dvh, 120px)
      clamp(76px, 9.5dvh, 96px)
      clamp(84px, 10dvh, 104px)
      minmax(128px, 1fr)
      clamp(58px, 7.8dvh, 76px) !important;
    gap: clamp(5px, 0.8dvh, 9px) !important;
    overflow: hidden !important;
    align-content: stretch !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    min-height: 0 !important;
    margin: 0 !important;
    padding: clamp(8px, 1.2dvh, 12px) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-player-row {
    min-height: 0 !important;
    height: 100% !important;
    gap: 10px !important;
  }

  body:not(.game-active) .menu-avatar-preview {
    width: clamp(48px, 11vw, 68px) !important;
    height: clamp(48px, 11vw, 68px) !important;
    flex: 0 0 auto !important;
  }

  body:not(.game-active) .variant-group {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    gap: 7px !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .variant-group .menu-choice,
  body:not(.game-active) .level-group .menu-choice {
    min-width: 0 !important;
    margin: 0 !important;
  }

  body:not(.game-active) .variant-group .menu-choice span,
  body:not(.game-active) .level-group .menu-choice span {
    min-height: 0 !important;
    height: 100% !important;
    padding: 5px 7px !important;
    display: grid !important;
    place-items: center !important;
    text-align: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group .menu-choice small,
  body:not(.game-active) .level-group .menu-choice small,
  body:not(.game-active) .home-action-card small {
    display: none !important;
  }

  body:not(.game-active) .level-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto 1fr !important;
    gap: 7px !important;
  }

  body:not(.game-active) .home-options-section {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
    gap: 6px !important;
  }

  body:not(.game-active) .home-options-section h2 {
    margin: 0 !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-action-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .home-action-card {
    min-height: 0 !important;
    height: 100% !important;
    padding: 6px 5px !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .home-action-card svg {
    width: clamp(28px, 6.8vw, 42px) !important;
    height: clamp(28px, 6.8vw, 42px) !important;
  }

  body:not(.game-active) .competition-entry {
    display: grid !important;
    grid-template-rows: auto minmax(54px, 0.74fr) minmax(62px, 0.9fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .competition-copy {
    min-height: 0 !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-copy .trophy-icon,
  body:not(.game-active) .competition-copy svg {
    width: clamp(44px, 13vw, 72px) !important;
    height: clamp(44px, 13vw, 72px) !important;
    flex: 0 0 auto !important;
  }

  body:not(.game-active) .competition-copy strong {
    font-size: clamp(18px, 5.2vw, 27px) !important;
    line-height: 1.03 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .competition-copy p,
  body:not(.game-active) .competition-copy .online-kicker {
    font-size: clamp(10px, 2.7vw, 14px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .competition-actions {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body:not(.game-active) .competition-action {
    min-height: 0 !important;
    height: 100% !important;
    padding: 5px 4px !important;
    gap: 3px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-action svg {
    width: clamp(24px, 6vw, 34px) !important;
    height: clamp(24px, 6vw, 34px) !important;
  }

  body:not(.game-active) .competition-action span:not(.premium-pill) {
    font-size: clamp(10px, 2.65vw, 13px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .premium-pill {
    font-size: clamp(9px, 2.3vw, 12px) !important;
    line-height: 1 !important;
    padding: 2px 6px !important;
  }

  body:not(.game-active) .start-game-button {
    width: min(92%, 430px) !important;
    height: 100% !important;
    min-height: 0 !important;
    align-self: end !important;
    justify-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: url("./assets/button-start-normal.png") center / contain no-repeat !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
}

/* True file-end mobile browser fit v2: explicit home grid areas keep the start button inside view. */
@media (orientation: portrait) and (max-width: 700px) {
  body:not(.game-active) .start-heading,
  body:not(.game-active) .menu-error {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-areas:
      "player"
      "variant"
      "level"
      "options"
      "competition"
      "start" !important;
    grid-template-rows:
      clamp(70px, 9.6dvh, 96px)
      clamp(84px, 11dvh, 112px)
      clamp(68px, 8.7dvh, 88px)
      clamp(76px, 9.3dvh, 96px)
      minmax(112px, 1fr)
      clamp(44px, 6.1dvh, 58px) !important;
    gap: clamp(4px, 0.62dvh, 7px) !important;
  }

  body:not(.game-active) .home-player-section {
    grid-area: player !important;
  }

  body:not(.game-active) .variant-group {
    grid-area: variant !important;
  }

  body:not(.game-active) .level-group {
    grid-area: level !important;
  }

  body:not(.game-active) .home-options-section {
    grid-area: options !important;
  }

  body:not(.game-active) .competition-entry {
    grid-area: competition !important;
  }

  body:not(.game-active) .start-game-button {
    grid-area: start !important;
    grid-column: auto !important;
    grid-row: auto !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 58px !important;
    width: min(82%, 360px) !important;
    align-self: center !important;
    justify-self: center !important;
  }

  body:not(.game-active) .brand-showcase {
    height: clamp(82px, 14dvh, 142px) !important;
  }

  body:not(.game-active) .start-menu-stage {
    height: calc(var(--app-visible-height, 100dvh) - max(22px, env(safe-area-inset-top)) - max(22px, env(safe-area-inset-bottom))) !important;
    padding-top: clamp(6px, 1dvh, 10px) !important;
    padding-bottom: clamp(6px, 1dvh, 10px) !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(46px, 0.68fr) minmax(54px, 0.82fr) !important;
  }
}

/* True file-end mobile browser fit v3: prevent compact competition/start overlap. */
@media (orientation: portrait) and (max-width: 700px) {
  body:not(.game-active) .competition-entry,
  body:not(.game-active) .competition-copy,
  body:not(.game-active) .competition-actions,
  body:not(.game-active) .competition-action {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(58px, 1fr) minmax(44px, 0.56fr) !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .competition-copy {
    align-items: center !important;
    padding: 7px 10px !important;
    z-index: 1 !important;
  }

  body:not(.game-active) .competition-actions {
    z-index: 2 !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .competition-action {
    display: grid !important;
    grid-template-rows: 1fr auto !important;
    place-items: center !important;
    min-height: 0 !important;
    padding: 4px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-action svg {
    width: clamp(22px, 5.5vw, 30px) !important;
    height: clamp(22px, 5.5vw, 30px) !important;
  }

  body:not(.game-active) .competition-action span:not(.premium-pill) {
    display: none !important;
  }

  body:not(.game-active) .premium-pill {
    display: inline-grid !important;
    place-items: center !important;
    max-width: 100% !important;
    font-size: clamp(8px, 2.05vw, 10px) !important;
    padding: 1px 5px !important;
  }

  body:not(.game-active) .start-game-button {
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-shadow: none !important;
    z-index: 4 !important;
  }
}

/* True file-end mobile start fallback: always visible in browser chrome constrained height. */
@media (orientation: portrait) and (max-width: 700px) {
  body:not(.game-active) .start-game-button {
    background: linear-gradient(180deg, #f7c84e 0%, #dfa82e 56%, #b77a16 100%) !important;
    border: 2px solid rgba(255, 224, 111, 0.92) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 2px 0 rgba(255, 255, 210, 0.35), 0 7px 16px rgba(0, 0, 0, 0.38) !important;
    color: #201403 !important;
    font-size: clamp(22px, 6.4vw, 31px) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-shadow: 0 1px 0 rgba(255, 239, 173, 0.52) !important;
    display: grid !important;
    place-items: center !important;
    text-transform: none !important;
  }
}

/* True file-end mobile compact competition cleanup. */
@media (orientation: portrait) and (max-width: 700px) and (max-height: 760px) {
  body:not(.game-active) .competition-copy p:not(.online-kicker) {
    display: none !important;
  }
}

/* True file-end phone landscape game: playable full feature layout. */
@media (orientation: landscape) and (max-height: 540px) and (max-width: 980px) {
  html,
  body {
    height: var(--app-visible-height, 100dvh) !important;
    min-height: var(--app-visible-height, 100dvh) !important;
    overflow: hidden !important;
  }

  body.game-active .app-shell {
    width: 100vw !important;
    height: var(--app-visible-height, 100dvh) !important;
    max-width: none !important;
    margin: 0 !important;
    padding: max(5px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)) !important;
    display: grid !important;
    grid-template-columns: minmax(150px, 0.78fr) minmax(330px, 1.8fr) minmax(190px, 0.96fr) !important;
    grid-template-rows: minmax(46px, 0.26fr) minmax(0, 1fr) minmax(74px, 0.38fr) !important;
    grid-template-areas:
      "top top score"
      "chat table hand"
      "events table hand" !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  body.game-active .variant-banner,
  body.game-active .bid-panel {
    display: none !important;
  }

  body.game-active .top-bar {
    grid-area: top !important;
    min-height: 0 !important;
    padding: 5px 7px !important;
    display: grid !important;
    grid-template-columns: minmax(92px, 0.55fr) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 7px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
  }

  body.game-active .top-bar > div:first-child {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 48px !important;
    align-items: center !important;
    gap: 5px !important;
  }

  body.game-active .top-bar .eyebrow {
    margin: 0 !important;
    font-size: clamp(9px, 1.55vw, 12px) !important;
    line-height: 1.05 !important;
    white-space: normal !important;
  }

  body.game-active .top-bar h1 {
    display: none !important;
  }

  body.game-active .top-variant-thumb {
    display: block !important;
    width: 48px !important;
    height: 32px !important;
    border: 1px solid rgba(217, 170, 69, 0.48) !important;
    border-radius: 7px !important;
    background-position: center !important;
    background-size: cover !important;
  }

  body.game-active .status-grid {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(82px, 1.1fr) minmax(64px, 0.78fr) minmax(56px, 0.62fr) !important;
    gap: 5px !important;
  }

  body.game-active .status-pill {
    min-height: 0 !important;
    padding: 4px 6px !important;
    border-radius: 7px !important;
    overflow: hidden !important;
  }

  body.game-active .status-pill span,
  body.game-active .score-board span {
    font-size: clamp(9px, 1.42vw, 11px) !important;
    line-height: 1 !important;
  }

  body.game-active .status-pill strong,
  body.game-active .score-board strong {
    margin-top: 2px !important;
    font-size: clamp(12px, 1.9vw, 16px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.game-active .trump-status {
    min-height: 0 !important;
  }

  body.game-active .trump-status-content {
    grid-template-columns: minmax(0, 1fr) 34px !important;
    gap: 4px !important;
  }

  body.game-active .trump-status-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    font-size: 25px !important;
  }

  body.game-active .score-board {
    grid-area: score !important;
    min-height: 0 !important;
    padding: 5px !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(32px, 1fr) minmax(32px, 1fr) !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  body.game-active .score-board > .score-card {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 4px 6px !important;
    border-radius: 7px !important;
  }

  body.game-active .score-board > .score-actions,
  body.game-active .score-board > .score-actions:has(#nextGameButton:not([hidden])) {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  body.game-active .score-actions button {
    min-width: 0 !important;
    min-height: 30px !important;
    height: 100% !important;
    padding: 0 5px !important;
    border-radius: 7px !important;
    font-size: clamp(10px, 1.45vw, 12px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.game-active .table-chat {
    grid-area: chat !important;
    min-height: 0 !important;
    padding: 6px !important;
    display: grid !important;
    grid-template-rows: auto minmax(34px, 1fr) minmax(34px, auto) !important;
    gap: 5px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
  }

  body.game-active .table-chat-header {
    display: block !important;
    min-height: 0 !important;
  }

  body.game-active .table-chat-header strong {
    display: none !important;
  }

  body.game-active .table-chat-header span {
    font-size: 11px !important;
    line-height: 1 !important;
  }

  body.game-active .table-chat-header small {
    display: none !important;
  }

  body.game-active .table-chat-log {
    min-height: 0 !important;
    padding: 6px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
  }

  body.game-active .chat-line,
  body.game-active .chat-line.compact {
    font-size: clamp(10px, 1.55vw, 12px) !important;
    line-height: 1.15 !important;
  }

  body.game-active .table-chat-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    gap: 4px !important;
  }

  body.game-active .table-chat-form input,
  body.game-active .table-chat-form button {
    min-width: 0 !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 6px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
  }

  body.game-active .game-events {
    grid-area: events !important;
    min-height: 0 !important;
    padding: 6px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(52px, auto) !important;
    align-items: center !important;
    gap: 5px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
  }

  body.game-active .game-events .message {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 6px 8px !important;
    font-size: clamp(12px, 1.75vw, 15px) !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow: hidden !important;
  }

  body.game-active .game-events .trick-points {
    min-width: 56px !important;
    padding: 5px 8px !important;
    border-radius: 8px !important;
  }

  body.game-active .game-events .trick-points strong {
    font-size: 16px !important;
  }

  body.game-active .game-events .trick-points span {
    font-size: 9px !important;
  }

  body.game-active .table {
    grid-area: table !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    border-radius: 11px !important;
    overflow: hidden !important;
  }

  body.game-active .table::before {
    inset: 7px !important;
    border-radius: 9px !important;
  }

  body.game-active .trick-area {
    inset: 0 !important;
  }

  body.game-active .player-top .avatar,
  body.game-active .player-left .avatar,
  body.game-active .player-right .avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    font-size: 14px !important;
  }

  body.game-active .player-info {
    max-width: 78px !important;
    padding: 3px 6px !important;
    border-radius: 8px !important;
  }

  body.game-active .player-info span {
    font-size: 11px !important;
    line-height: 1.05 !important;
  }

  body.game-active .player-info small {
    font-size: 9px !important;
    line-height: 1.05 !important;
  }

  body.game-active .player-top {
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .player-left {
    left: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  body.game-active .player-right {
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  body.game-active .mini-card {
    width: clamp(42px, 7.7vw, 58px) !important;
    height: clamp(62px, 11.2vw, 84px) !important;
    border-radius: 8px !important;
  }

  body.game-active .mini-card .corner {
    font-size: clamp(11px, 1.7vw, 14px) !important;
  }

  body.game-active .mini-card .rank-center {
    font-size: clamp(24px, 4.4vw, 34px) !important;
  }

  body.game-active .played-card.seat-partner {
    top: 21% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .played-card.seat-user {
    top: 62% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .played-card.seat-left {
    top: 50% !important;
    left: 28% !important;
    transform: translate(-50%, -50%) !important;
  }

  body.game-active .played-card.seat-right {
    top: 50% !important;
    right: 28% !important;
    transform: translate(50%, -50%) !important;
  }

  body.game-active .trick-stack {
    transform: scale(0.72) !important;
    transform-origin: center !important;
  }

  body.game-active .trick-stack.stack-partner {
    top: 6px !important;
    left: calc(50% + 54px) !important;
  }

  body.game-active .trick-stack.stack-user {
    bottom: 5px !important;
    left: 50% !important;
  }

  body.game-active .trick-stack.stack-left {
    left: 5px !important;
    top: calc(50% + 54px) !important;
  }

  body.game-active .trick-stack.stack-right {
    right: 5px !important;
    top: calc(50% + 54px) !important;
  }

  body.game-active .hand-panel {
    grid-area: hand !important;
    min-height: 0 !important;
    padding: 6px !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 6px !important;
    overflow: hidden !important;
    border-radius: 9px !important;
  }

  body.game-active .hand-heading {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 3px !important;
  }

  body.game-active .your-player-label {
    min-width: 0 !important;
    gap: 6px !important;
  }

  body.game-active .user-avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 13px !important;
  }

  body.game-active .hand-heading h2 {
    font-size: clamp(14px, 2.1vw, 18px) !important;
    line-height: 1 !important;
  }

  body.game-active .hand-heading p {
    font-size: clamp(10px, 1.55vw, 12px) !important;
    line-height: 1.08 !important;
  }

  body.game-active .hand {
    min-height: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    gap: 5px !important;
    align-content: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  body.game-active .hand .card,
  body.game-active .card {
    width: 100% !important;
    max-width: 48px !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 0.68 !important;
    border-radius: 8px !important;
  }

  body.game-active .card .corner {
    font-size: clamp(10px, 1.7vw, 13px) !important;
  }

  body.game-active .card .rank-center {
    font-size: clamp(22px, 4.2vw, 31px) !important;
  }

  body.game-active .card .suit {
    font-size: clamp(21px, 4vw, 30px) !important;
  }

  body.game-active .card .trump-mark {
    width: 18px !important;
    height: 18px !important;
    right: 4px !important;
    bottom: 4px !important;
    font-size: 11px !important;
  }

  body.game-active .bid-popup {
    padding: 8px !important;
  }

  body.game-active .bid-popup-dialog {
    width: min(360px, calc(100vw - 24px)) !important;
    max-height: calc(var(--app-visible-height, 100dvh) - 20px) !important;
    padding: 12px !important;
    gap: 8px !important;
  }

  body.game-active .bid-popup-dialog strong {
    font-size: 18px !important;
  }

  body.game-active .bid-popup-dialog p {
    font-size: 12px !important;
  }

  body.game-active .last-trick-modal,
  body.game-active .chat-history-modal {
    padding: 10px !important;
  }

  body.game-active .last-trick-dialog,
  body.game-active .chat-history-dialog {
    width: min(92vw, 760px) !important;
    max-height: calc(var(--app-visible-height, 100dvh) - 20px) !important;
  }
}

/* True file-end phone landscape cleanup: keep chat and action controls usable. */
@media (orientation: landscape) and (max-height: 540px) and (max-width: 980px) {
  body.game-active .table-chat {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) 32px !important;
  }

  body.game-active .table-chat-header {
    display: none !important;
  }

  body.game-active .table-chat-log,
  body.game-active .table-chat-form {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: static !important;
  }

  body.game-active .table-chat-log {
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
  }

  body.game-active .table-chat-form {
    height: 32px !important;
    min-height: 32px !important;
  }

  body.game-active .score-board .score-actions button {
    min-height: 0 !important;
    height: 24px !important;
    max-height: 24px !important;
    margin: 0 !important;
    padding: 0 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: clamp(8px, 1.2vw, 10px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.game-active .score-board > .score-actions {
    align-items: start !important;
    height: 26px !important;
    max-height: 26px !important;
    overflow: hidden !important;
  }

  body.game-active .app-shell {
    grid-template-rows: 78px minmax(0, 1fr) 64px !important;
  }

  body.game-active .top-bar,
  body.game-active .score-board {
    height: 78px !important;
    max-height: 78px !important;
  }

  body.game-active .score-board {
    grid-template-rows: 34px 30px !important;
    align-content: center !important;
  }

  body.game-active .score-board > .score-card {
    height: 34px !important;
  }
}

/* True file-end menu readability: soften heavy labels so the home screen reads calmly. */
body:not(.game-active) .start-menu-panel strong,
body:not(.game-active) .start-menu-panel h1,
body:not(.game-active) .start-menu-panel h2,
body:not(.game-active) .start-menu-panel legend,
body:not(.game-active) .start-menu-panel .eyebrow,
body:not(.game-active) .start-menu-panel .online-kicker,
body:not(.game-active) .start-menu-panel .winner-label,
body:not(.game-active) .start-menu-panel .premium-action-text,
body:not(.game-active) .start-menu-panel .start-game-button {
  font-weight: 700 !important;
}

body:not(.game-active) .start-menu-panel h2,
body:not(.game-active) .start-menu-panel legend,
body:not(.game-active) .start-menu-panel .online-kicker {
  font-size: clamp(13px, 1.8vw, 19px) !important;
  line-height: 1.05 !important;
}

body:not(.game-active) .menu-choice strong,
body:not(.game-active) .home-action-card strong,
body:not(.game-active) .competition-action span:not(.premium-pill),
body:not(.game-active) .premium-action-text {
  font-size: clamp(13px, 1.65vw, 18px) !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
}

body:not(.game-active) .home-highscore strong,
body:not(.game-active) .competition-copy strong {
  font-size: clamp(15px, 2vw, 22px) !important;
  line-height: 1.08 !important;
  font-weight: 700 !important;
}

body:not(.game-active) .start-game-button {
  font-size: clamp(22px, 4.1vw, 40px) !important;
  letter-spacing: 0 !important;
}

@media (max-width: 760px) and (orientation: portrait) {
  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .competition-action span:not(.premium-pill),
  body:not(.game-active) .premium-action-text {
    font-size: clamp(12px, 3.15vw, 17px) !important;
  }

  body:not(.game-active) .home-highscore strong,
  body:not(.game-active) .competition-copy strong {
    font-size: clamp(18px, 4.8vw, 28px) !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .competition-action span:not(.premium-pill),
  body:not(.game-active) .premium-action-text {
    font-size: clamp(10px, 1.35vw, 15px) !important;
  }

  body:not(.game-active) .start-menu-panel h2,
  body:not(.game-active) .start-menu-panel legend,
  body:not(.game-active) .start-menu-panel .online-kicker {
    font-size: clamp(11px, 1.55vw, 16px) !important;
  }
}

/* True file-end landscape menu calm text: smaller, lighter labels and a modest player avatar. */
@media (orientation: landscape) and (max-height: 760px) {
  body:not(.game-active) .start-menu-panel,
  body:not(.game-active) .start-menu-panel strong,
  body:not(.game-active) .start-menu-panel h1,
  body:not(.game-active) .start-menu-panel h2,
  body:not(.game-active) .start-menu-panel legend,
  body:not(.game-active) .start-menu-panel .eyebrow,
  body:not(.game-active) .start-menu-panel .online-kicker,
  body:not(.game-active) .start-menu-panel .winner-label,
  body:not(.game-active) .start-menu-panel .premium-action-text,
  body:not(.game-active) .start-menu-panel .start-game-button {
    font-weight: 600 !important;
  }

  body:not(.game-active) .home-player-section .avatar-preview,
  body:not(.game-active) .menu-avatar-preview,
  body:not(.game-active) #menuAvatarPreview {
    width: clamp(38px, 4.6vw, 62px) !important;
    height: clamp(38px, 4.6vw, 62px) !important;
    min-width: clamp(38px, 4.6vw, 62px) !important;
    min-height: clamp(38px, 4.6vw, 62px) !important;
    font-size: clamp(15px, 2vw, 24px) !important;
    border-width: 2px !important;
  }

  body:not(.game-active) .home-player-section .player-name-field input,
  body:not(.game-active) .home-player-section .player-name-display,
  body:not(.game-active) .home-player-section .player-name-field,
  body:not(.game-active) .home-player-section .player-photo-field {
    font-size: clamp(13px, 1.55vw, 19px) !important;
    font-weight: 600 !important;
  }

  body:not(.game-active) .menu-choice strong,
  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .competition-action span:not(.premium-pill),
  body:not(.game-active) .premium-action-text {
    font-size: clamp(10px, 1.18vw, 15px) !important;
    font-weight: 600 !important;
    line-height: 1.12 !important;
    text-shadow: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(11px, 1.25vw, 16px) !important;
  }

  body:not(.game-active) .start-menu-panel h2,
  body:not(.game-active) .start-menu-panel legend,
  body:not(.game-active) .start-menu-panel .online-kicker {
    font-size: clamp(10px, 1.28vw, 15px) !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
  }

  body:not(.game-active) .home-highscore strong,
  body:not(.game-active) .competition-copy strong {
    font-size: clamp(13px, 1.55vw, 18px) !important;
    font-weight: 600 !important;
  }

  body:not(.game-active) .menu-choice small,
  body:not(.game-active) .home-action-card small,
  body:not(.game-active) .competition-copy p,
  body:not(.game-active) .home-highscore small {
    font-size: clamp(8px, 0.95vw, 12px) !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
  }

  body:not(.game-active) .start-game-button {
    font-size: clamp(21px, 3.05vw, 36px) !important;
    font-weight: 600 !important;
  }
}

/* True file-end desktop game chat: keep the latest chat message inside the tafelchat bar. */
@media (min-width: 1000px) and (min-height: 620px) {
  body.game-active .table-chat {
    position: relative !important;
    z-index: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(210px, 0.18fr) minmax(360px, 1fr) minmax(340px, 0.42fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 12px !important;
    height: 116px !important;
    min-height: 116px !important;
    max-height: 116px !important;
    padding: 10px 14px !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-header,
  body.game-active .table-chat-log,
  body.game-active .table-chat-form {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
  }

  body.game-active .table-chat-header {
    grid-column: 1 !important;
    grid-row: 1 !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-log {
    grid-column: 2 !important;
    grid-row: 1 !important;
    padding: 8px 10px !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-log .chat-line.compact {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 8px 10px !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-log .chat-line.compact strong {
    margin-bottom: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.game-active .table-chat-log .chat-line.compact span {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.game-active .table-chat-form {
    grid-column: 3 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 110px !important;
    gap: 10px !important;
  }

  body.game-active .table-chat-form input,
  body.game-active .table-chat-form button {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
  }
}

/* True file-end desktop game table: keep chat, turn messages, and the user's pile in their own lanes. */
@media (min-width: 1000px) and (min-height: 620px) {
  body.game-active .table-chat {
    height: 82px !important;
    min-height: 82px !important;
    max-height: 82px !important;
    padding: 8px 14px !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-header {
    align-content: center !important;
    gap: 2px !important;
  }

  body.game-active .table-chat-header strong {
    font-size: 13px !important;
    line-height: 1.08 !important;
  }

  body.game-active .table-chat-header span,
  body.game-active .table-chat-header small {
    font-size: 10px !important;
    line-height: 1.08 !important;
  }

  body.game-active .table-chat-log {
    padding: 6px 8px !important;
  }

  body.game-active .table-chat-log .chat-line.compact {
    padding: 6px 8px !important;
    gap: 2px !important;
  }

  body.game-active .table-chat-log .chat-line.compact span {
    -webkit-line-clamp: 1 !important;
  }

  body.game-active .table-chat-form {
    align-self: center !important;
    height: 48px !important;
  }

  body.game-active .table-chat-form input,
  body.game-active .table-chat-form button {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
  }

  body.game-active .game-events {
    position: relative !important;
    z-index: 3 !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    margin-top: 0 !important;
    overflow: hidden !important;
  }

  body.game-active .game-events .message {
    height: 100% !important;
    min-height: 0 !important;
    align-content: center !important;
  }

  body.game-active .game-events > .trick-points {
    align-self: stretch !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }

  body.game-active .table {
    overflow: hidden !important;
  }

  body.game-active .played-card.seat-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 96px !important;
    transform: translateX(-50%) !important;
  }

  body.game-active .trick-stack.stack-user {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 18px !important;
    transform: translateX(-50%) !important;
    z-index: 8 !important;
  }
}

/* True file-end phone landscape menu fit: keep every panel inside the viewport. */
@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body:not(.game-active) .start-menu {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 6px 14px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: calc(100vw - 28px) !important;
    height: calc(100dvh - 12px) !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: 10px 18px 12px !important;
    display: grid !important;
    grid-template-columns: minmax(215px, 30%) minmax(250px, 1fr) minmax(215px, 30%) !important;
    grid-template-rows: minmax(0, 1fr) 56px !important;
    gap: 9px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .start-menu-stage::before {
    inset: 8px !important;
  }

  body:not(.game-active) .brand-showcase {
    width: min(34vw, 330px) !important;
    height: 112px !important;
    align-self: start !important;
    justify-self: center !important;
    overflow: visible !important;
    z-index: 4 !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-height: 112px !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(215px, 30%) minmax(250px, 1fr) minmax(215px, 30%) !important;
    grid-template-rows: 92px 122px 86px 56px !important;
    grid-template-areas:
      "player center options"
      "variant center competition"
      "level center competition"
      ". start ." !important;
    gap: 9px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .menu-group,
  body:not(.game-active) .competition-entry {
    border-radius: 13px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-player-section {
    grid-area: player !important;
    padding: 8px 11px !important;
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    grid-template-rows: 17px 38px 27px !important;
    grid-template-areas:
      "title title"
      "avatar name"
      ". photo" !important;
    align-items: center !important;
    gap: 3px 9px !important;
  }

  body:not(.game-active) .home-player-section h2 {
    grid-area: title !important;
    align-self: start !important;
    justify-self: start !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    letter-spacing: 0.08em !important;
    z-index: 2 !important;
  }

  body:not(.game-active) .home-player-section .avatar-preview,
  body:not(.game-active) #menuAvatarPreview {
    grid-area: avatar !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    font-size: 17px !important;
    align-self: center !important;
    justify-self: center !important;
  }

  body:not(.game-active) .home-player-section .player-name-field {
    grid-area: name !important;
    min-width: 0 !important;
  }

  body:not(.game-active) .home-player-section .player-name-field input {
    height: 34px !important;
    min-height: 34px !important;
    font-size: clamp(17px, 3.1dvh, 24px) !important;
    line-height: 1 !important;
    padding: 0 !important;
  }

  body:not(.game-active) .home-player-section .player-photo-field {
    grid-area: photo !important;
    height: 27px !important;
    min-height: 27px !important;
    padding: 0 8px !important;
    justify-self: stretch !important;
    gap: 6px !important;
  }

  body:not(.game-active) .home-player-section .player-photo-field strong {
    font-size: 12px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .home-player-section .photo-button-icon,
  body:not(.game-active) .home-player-section .photo-button-icon svg {
    width: 14px !important;
    height: 14px !important;
  }

  body:not(.game-active) .variant-group {
    grid-area: variant !important;
    padding: 9px 10px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body:not(.game-active) .variant-group legend {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    height: 100% !important;
    min-height: 0 !important;
    padding: 9px !important;
    align-content: end !important;
    border-radius: 11px !important;
    background-size: cover !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(13px, 3dvh, 17px) !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .level-group {
    grid-area: level !important;
    padding: 7px 10px 9px !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body:not(.game-active) .level-group legend {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    box-shadow: none !important;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.42)) !important;
    transform: none !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(1) > span,
  body:not(.game-active) .level-group .menu-choice:nth-of-type(1) input:checked + span {
    background-image: url("./assets/level-beginner-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(2) > span,
  body:not(.game-active) .level-group .menu-choice:nth-of-type(2) input:checked + span {
    background-image: url("./assets/level-normal-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(3) > span,
  body:not(.game-active) .level-group .menu-choice:nth-of-type(3) input:checked + span {
    background-image: url("./assets/level-expert-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice input:checked + span {
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    background-color: transparent !important;
    filter:
      drop-shadow(0 0 8px rgba(245, 196, 90, 0.72))
      drop-shadow(0 5px 8px rgba(0, 0, 0, 0.44)) !important;
  }

  body:not(.game-active) .level-group .menu-choice strong,
  body:not(.game-active) .level-group .menu-choice small {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .home-options-section {
    grid-area: options !important;
    padding: 8px 10px !important;
    display: grid !important;
    grid-template-rows: 18px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .home-options-section h2 {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-action-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    min-height: 0 !important;
    height: 100% !important;
  }

  body:not(.game-active) .home-action-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 5px 4px !important;
    display: grid !important;
    grid-template-rows: 32px 1fr !important;
    place-items: center !important;
    gap: 4px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .home-action-card svg {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    max-width: 100% !important;
    font-size: 10px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
  }

  body:not(.game-active) .home-action-card small {
    display: none !important;
  }

  body:not(.game-active) .competition-entry {
    grid-area: competition !important;
    padding: 9px 10px !important;
    display: grid !important;
    grid-template-rows: 40px minmax(68px, 1fr) 76px !important;
    gap: 8px !important;
  }

  body:not(.game-active) .competition-copy {
    min-height: 0 !important;
    display: grid !important;
    place-items: center !important;
    text-align: center !important;
  }

  body:not(.game-active) .competition-copy .online-kicker {
    font-size: 14px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .competition-copy > strong,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .home-highscore {
    min-height: 0 !important;
    height: 100% !important;
    padding: 7px 9px !important;
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 9px !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-trophy {
    grid-row: 1 / 3 !important;
    width: 42px !important;
    height: 42px !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: 14px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    display: none !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body:not(.game-active) .premium-action {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 5px 3px !important;
    display: grid !important;
    grid-template-rows: 28px auto 14px !important;
    place-items: center !important;
    gap: 2px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .premium-action-icon,
  body:not(.game-active) .premium-action-icon svg {
    width: 27px !important;
    height: 27px !important;
  }

  body:not(.game-active) .premium-action-text {
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .premium-action-text::before {
    content: attr(data-short-label) !important;
  }

  body:not(.game-active) .premium-action-text {
    font-size: 0 !important;
  }

  body:not(.game-active) .premium-action-text::before {
    font-size: 10px !important;
  }

  body:not(.game-active) .premium-action small,
  body:not(.game-active) .premium-pill {
    height: 13px !important;
    min-height: 13px !important;
    padding: 1px 5px !important;
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .online-entry-actions .premium-action small,
  body:not(.game-active) .premium-action small {
    display: none !important;
  }

  body:not(.game-active) .start-game-button {
    grid-area: start !important;
    width: min(300px, 36vw) !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: url("./assets/button-start-normal.png") center / contain no-repeat !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    color: #1d1607 !important;
    font-size: clamp(18px, 4.2dvh, 26px) !important;
    line-height: 1 !important;
    transform: none !important;
  }
}

/* True file-end account modal: stacked fields and no oversized home start artwork. */
#onlineModal:not([hidden]) {
  z-index: 1000 !important;
}

#onlineModal:not([hidden]) ~ script,
body:has(#onlineModal:not([hidden])) #startGameButton {
  z-index: 0 !important;
  pointer-events: none !important;
}

body:has(#onlineModal:not([hidden])) .start-menu-panel > #startGameButton {
  display: none !important;
}

.online-dialog {
  width: min(96vw, 980px) !important;
  max-height: min(92dvh, 720px) !important;
  padding: 16px !important;
  border-radius: 10px !important;
  background: rgba(30, 42, 31, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62) !important;
  overflow: hidden !important;
}

#onlineContent {
  max-height: calc(min(92dvh, 720px) - 86px) !important;
  overflow: auto !important;
  padding-right: 4px !important;
}

#onlineContent .account-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

#onlineContent .account-form {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  align-content: start !important;
  min-width: 0 !important;
  padding: 14px !important;
}

#onlineContent .account-form input {
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 14px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

#onlineContent .account-form .start-game-button,
#onlineContent .account-form .info-button {
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(217, 170, 69, 0.42) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(33, 65, 46, 0.96), rgba(14, 43, 30, 0.96)) !important;
  color: #fff4d5 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-transform: none !important;
  box-shadow: none !important;
  transform: none !important;
  overflow: hidden !important;
}

#onlineContent #registerForm .start-game-button {
  background: linear-gradient(180deg, #f2c24d, #c98919) !important;
  color: #241706 !important;
}

#onlineContent .account-form small {
  max-width: 62ch !important;
  margin-top: 2px !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

@media (orientation: landscape) and (max-height: 540px) {
  .online-dialog {
    width: min(92vw, 900px) !important;
    max-height: 88dvh !important;
    padding: 12px !important;
  }

  #onlineContent {
    max-height: calc(88dvh - 62px) !important;
  }

  #onlineContent .premium-hero {
    padding: 10px 12px !important;
  }

  #onlineContent .premium-hero h2 {
    font-size: 20px !important;
    line-height: 1.1 !important;
  }

  #onlineContent .premium-hero p {
    font-size: 13px !important;
    line-height: 1.28 !important;
  }

  #onlineContent .account-grid {
    gap: 10px !important;
  }

  #onlineContent .account-form {
    padding: 12px !important;
    gap: 8px !important;
  }

  #onlineContent .account-form input,
  #onlineContent .account-form .start-game-button,
  #onlineContent .account-form .info-button {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 720px) {
  #onlineContent .account-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Popup/menu herstel: premium kleuren, avatar upload en klassement weer strak zichtbaar. */
#onlineModal:not([hidden]),
.last-trick-modal:not([hidden]),
.chat-history-modal:not([hidden]),
.bid-popup:not([hidden]) {
 /* background:
    radial-gradient(circle at 50% 10%, rgba(202, 154, 57, 0.16), transparent 34%),
    rgba(3, 8, 6, 0.78) !important;
  backdrop-filter: blur(7px) saturate(1.1);
  */
}

.online-dialog,
.last-trick-dialog,
.boom-dialog,
.info-dialog,
.settings-dialog,
.chat-history-dialog,
.bid-popup-dialog {
  border-color: rgba(214, 165, 68, 0.62) !important;
  background:
    linear-gradient(180deg, rgba(31, 49, 34, 0.98), rgba(13, 25, 17, 0.99)) !important;
  color: #fff3d4 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 173, 0.14),
    0 24px 90px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(82, 54, 18, 0.75) !important;
}

.online-dialog {
  width: min(96vw, 1040px) !important;
  max-height: min(96dvh, 860px) !important;
  padding: clamp(12px, 1.5vw, 18px) !important;
}

.online-dialog:has(#registerForm),
.online-dialog:has(#loginForm) {
  width: min(96vw, 1120px) !important;
  max-height: min(97dvh, 900px) !important;
}

#onlineContent {
  max-height: calc(min(96dvh, 860px) - 74px) !important;
}

.online-dialog:has(#registerForm) #onlineContent,
.online-dialog:has(#loginForm) #onlineContent {
  max-height: calc(min(97dvh, 900px) - 68px) !important;
  overflow: auto !important;
}

#onlineContent .premium-hero,
#onlineContent .online-card,
#onlineContent .daily-hero,
#onlineContent .ranking-columns > section,
#onlineContent .verify-card {
  border-color: rgba(214, 165, 68, 0.36) !important;
  background:
    radial-gradient(circle at 10% 0%, rgba(214, 165, 68, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(34, 55, 38, 0.92), rgba(13, 28, 18, 0.94)) !important;
}

#onlineContent .premium-hero {
  padding: clamp(10px, 1.4vw, 14px) !important;
}

#onlineContent .premium-hero h2 {
  margin: 2px 0 4px !important;
  font-size: clamp(22px, 2vw, 30px) !important;
  line-height: 1.08 !important;
}

#onlineContent .premium-hero p {
  margin: 4px 0 0 !important;
  font-size: clamp(13px, 1.2vw, 15px) !important;
  line-height: 1.32 !important;
}

#onlineContent .account-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: clamp(10px, 1.3vw, 16px) !important;
}

#onlineContent .account-form {
  gap: 8px !important;
  padding: clamp(12px, 1.3vw, 16px) !important;
}

#onlineContent .account-form input {
  height: 44px !important;
  min-height: 44px !important;
  background: rgba(5, 15, 10, 0.9) !important;
  border-color: rgba(214, 165, 68, 0.28) !important;
  color: #fff5da !important;
}

#onlineContent .account-form small {
  font-size: 12px !important;
  line-height: 1.28 !important;
}

#onlineContent .ranking-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

#onlineContent .ranking-columns-variants .ranking-global {
  grid-column: 1 / -1;
}

#onlineContent .ranking-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#onlineContent .ranking-heading h2 { margin-bottom: 3px !important; }

#onlineContent .ranking-own-position {
  margin: 0;
  color: #f1d28d;
  font: 700 13px/1.3 Arial, sans-serif;
}

#onlineContent .ranking-show-all {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid rgba(214, 165, 68, .58);
  border-radius: 8px;
  background: rgba(8, 34, 20, .82);
  color: #f5d786;
  font: 800 12px/1 Arial, sans-serif;
  cursor: pointer;
}

#onlineContent .ranking-columns-variants .ranking-amsterdam {
  border-top: 3px solid #238052 !important;
}

#onlineContent .ranking-columns-variants .ranking-rotterdam {
  border-top: 3px solid #a22a22 !important;
}

#onlineContent .ranking-columns-variants h2 {
  font-family: Arial, sans-serif !important;
}

#onlineContent .ranking-winner {
  min-height: 20px;
  margin: -2px 0 10px;
  color: #f1d28d;
  font: 700 13px/1.3 Arial, sans-serif;
}

#onlineContent .leaderboard-table {
  gap: 6px !important;
}

#onlineContent .leaderboard-row {
  grid-template-columns: 34px minmax(0, 1fr) minmax(62px, auto) minmax(88px, auto) !important;
  border: 1px solid rgba(214, 165, 68, 0.18) !important;
  background: rgba(2, 13, 9, 0.44) !important;
  color: #fff3d4 !important;
}

#onlineContent .leaderboard-row > span,
#onlineContent .leaderboard-row > strong {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.game-active) .home-player-section {
  pointer-events: auto !important;
}

body:not(.game-active) .home-player-section .avatar-preview,
body:not(.game-active) #menuAvatarPreview {
  background-size: cover !important;
  background-position: center !important;
}

body:not(.game-active) .home-player-section .avatar-preview.has-image,
body:not(.game-active) #menuAvatarPreview.has-image {
  color: transparent !important;
  text-shadow: none !important;
}

body:not(.game-active) .home-player-section .player-photo-field,
body:not(.game-active) .avatar-upload-field {
  position: relative !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

body:not(.game-active) .avatar-upload-field input[type="file"],
body:not(.game-active) #menuAvatarInput {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 4 !important;
}

@media (max-width: 760px) {
  .online-dialog:has(#registerForm),
  .online-dialog:has(#loginForm) {
    width: min(96vw, 520px) !important;
    max-height: 97dvh !important;
    padding: 12px !important;
  }

  #onlineContent .account-grid,
  #onlineContent .ranking-columns {
    grid-template-columns: 1fr !important;
  }

  #onlineContent .account-form input,
  #onlineContent .account-form .start-game-button,
  #onlineContent .account-form .info-button {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }

  #onlineContent .leaderboard-row {
    grid-template-columns: 30px minmax(0, 1fr) 62px 78px !important;
    font-size: 12px !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .online-dialog:has(#registerForm),
  .online-dialog:has(#loginForm) {
    width: min(94vw, 980px) !important;
    max-height: 96dvh !important;
    padding: 10px !important;
  }

  .online-dialog:has(#registerForm) #onlineContent,
  .online-dialog:has(#loginForm) #onlineContent {
    max-height: calc(96dvh - 56px) !important;
  }

  #onlineContent .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #onlineContent .premium-hero {
    padding: 8px 10px !important;
  }

  #onlineContent .premium-hero h2 {
    font-size: 19px !important;
  }

  #onlineContent .premium-hero p,
  #onlineContent .account-form small {
    font-size: 11px !important;
  }

  #onlineContent .account-form input,
  #onlineContent .account-form .start-game-button,
  #onlineContent .account-form .info-button {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    font-size: 13px !important;
  }
}

/* Landscape home player scale: smaller avatar and player name only. */
@media (orientation: landscape) {
  body:not(.game-active) .home-player-section .avatar-preview,
  body:not(.game-active) #menuAvatarPreview {
    width: clamp(32px, 3.2vw, 46px) !important;
    height: clamp(32px, 3.2vw, 46px) !important;
    min-width: clamp(32px, 3.2vw, 46px) !important;
    min-height: clamp(32px, 3.2vw, 46px) !important;
    font-size: clamp(13px, 1.45vw, 18px) !important;
  }

  body:not(.game-active) .home-player-section .player-name-field input {
    height: clamp(26px, 5dvh, 38px) !important;
    min-height: 0 !important;
    font-size: clamp(15px, 2.1vw, 23px) !important;
    line-height: 1 !important;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body:not(.game-active) .home-player-section .avatar-preview,
  body:not(.game-active) #menuAvatarPreview {
    width: clamp(30px, 7.5dvh, 40px) !important;
    height: clamp(30px, 7.5dvh, 40px) !important;
    min-width: clamp(30px, 7.5dvh, 40px) !important;
    min-height: clamp(30px, 7.5dvh, 40px) !important;
  }

  body:not(.game-active) .home-player-section .player-name-field input {
    height: clamp(24px, 6dvh, 32px) !important;
    font-size: clamp(14px, 4.3dvh, 20px) !important;
  }
}

/* Landscape mobile menu fit: keep start and option labels inside the viewport. */
@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body:not(.game-active) .start-menu {
    padding: max(4px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)) !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(100%, calc(100vw - 36px)) !important;
    height: min(100%, calc(100dvh - 10px)) !important;
    padding: 7px 16px 8px !important;
    grid-template-rows: minmax(0, 1fr) clamp(34px, 10dvh, 44px) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-columns: minmax(188px, 28%) minmax(220px, 1fr) minmax(188px, 28%) !important;
    grid-template-rows: clamp(70px, 20dvh, 84px) clamp(94px, 26dvh, 112px) clamp(64px, 18dvh, 76px) clamp(34px, 10dvh, 44px) !important;
    gap: 7px !important;
  }

  body:not(.game-active) .home-options-section {
    padding: 7px 8px !important;
    grid-template-rows: 15px minmax(0, 1fr) !important;
    gap: 4px !important;
  }

  body:not(.game-active) .home-options-section h2 {
    font-size: clamp(11px, 3dvh, 13px) !important;
  }

  body:not(.game-active) .home-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-card {
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 4px 3px 5px !important;
    grid-template-rows: minmax(22px, 1fr) 13px !important;
    gap: 2px !important;
    align-items: center !important;
    justify-items: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .home-action-card svg {
    width: clamp(20px, 7dvh, 28px) !important;
    height: clamp(20px, 7dvh, 28px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .home-action-card strong {
    width: 100% !important;
    font-size: clamp(8px, 2.8dvh, 10px) !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    text-align: center !important;
  }

  body:not(.game-active) .start-game-button {
    width: min(270px, 34vw) !important;
    height: clamp(34px, 10dvh, 44px) !important;
    min-height: 0 !important;
    max-height: 44px !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background-size: contain !important;
    overflow: hidden !important;
    font-size: clamp(15px, 4dvh, 22px) !important;
  }
}

/* Landscape mobile game event bar: points above the status text for more readable messages. */
@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body.game-active .game-events {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(24px, auto) minmax(0, 1fr) !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    gap: 4px !important;
  }

  body.game-active .game-events .trick-points {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    align-self: start !important;
    min-width: 72px !important;
    max-width: min(120px, 64%) !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
  }

  body.game-active .game-events .trick-points strong {
    font-size: clamp(13px, 3.6dvh, 17px) !important;
    line-height: 1 !important;
  }

  body.game-active .game-events .trick-points span {
    font-size: clamp(8px, 2.4dvh, 10px) !important;
    line-height: 1 !important;
  }

  body.game-active .game-events .message {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 5px 8px !important;
    display: flex !important;
    align-items: center !important;
  }
}

/* Landscape mobile table cards: match the portrait table-card design exactly. */
@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body.game-active .trick-area .played-card {
    width: 58px !important;
    min-width: 58px !important;
    height: 89px !important;
    min-height: 89px !important;
    display: grid !important;
    justify-items: center !important;
    align-content: start !important;
    overflow: visible !important;
  }

  body.game-active .trick-area .played-card .mini-card {
    width: 52px !important;
    height: 72px !important;
    min-width: 52px !important;
    min-height: 72px !important;
    max-width: 52px !important;
    max-height: 72px !important;
    border-radius: 8px !important;
  }

  body.game-active .trick-area .played-card .mini-card .corner {
    top: 5px !important;
    left: 5px !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }

  body.game-active .trick-area .played-card .mini-card .rank-center {
    top: 18px !important;
    font-size: 17px !important;
    line-height: 1.4 !important;
  }

  body.game-active .trick-area .played-card .mini-card .suit {
    inset: 34px 0 0 !important;
    font-size: 25px !important;
    line-height: 1 !important;
  }

  body.game-active .trick-area .played-card .mini-card .trump-mark {
    right: 5px !important;
    bottom: 5px !important;
    width: 17px !important;
    height: 17px !important;
    font-size: 9px !important;
  }

  body.game-active .trick-area .played-card > span {
    margin-top: 0 !important;
    max-width: 76px !important;
    font-size: 10px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
  }
}

/* Landscape home premium buttons: keep a single Premium label. */
@media (orientation: landscape) {
  body:not(.game-active) .online-entry-actions .premium-action.premium-locked::after,
  body:not(.game-active) .online-entry-actions .info-button.premium-locked::after {
    content: none !important;
    display: none !important;
  }
}

/* Landscape mobile menu repair: player photo, variant labels, level glow, start button and competition space. */
@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-stage {
    padding: 8px 20px 8px !important;
    grid-template-rows: minmax(0, 1fr) clamp(38px, 10dvh, 46px) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-columns: minmax(210px, 30%) minmax(230px, 1fr) minmax(210px, 30%) !important;
    grid-template-rows: 86px 118px 92px clamp(38px, 10dvh, 46px) !important;
    grid-template-areas:
      "player center options"
      "variant center competition"
      "level center competition"
      ". start ." !important;
    gap: 7px !important;
  }

  body:not(.game-active) .home-player-section {
    padding: 7px 10px !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    grid-template-rows: 14px 30px 27px !important;
    gap: 3px 8px !important;
  }

  body:not(.game-active) .home-player-section h2 {
    font-size: 12px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-player-section .avatar-preview,
  body:not(.game-active) #menuAvatarPreview {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    font-size: 14px !important;
  }

  body:not(.game-active) .home-player-section .player-name-field input {
    height: 30px !important;
    min-height: 30px !important;
    font-size: clamp(16px, 4.3dvh, 20px) !important;
    padding: 0 4px !important;
  }

  body:not(.game-active) .home-player-section .player-photo-field {
    height: 27px !important;
    min-height: 27px !important;
    padding: 0 10px !important;
    align-self: end !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-player-section .player-photo-field strong {
    font-size: 11px !important;
  }

  body:not(.game-active) .variant-group {
    padding: 10px 14px !important;
    gap: 12px !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    padding: 8px 7px !important;
    display: grid !important;
    align-content: end !important;
    justify-items: center !important;
    text-align: center !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    max-width: 100% !important;
    font-size: clamp(10px, 3.1dvh, 12px) !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    text-align: center !important;
  }

  body:not(.game-active) .level-group {
    padding: 7px 12px 8px !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  body:not(.game-active) .level-group .menu-choice > span,
  body:not(.game-active) .level-group .menu-choice input:checked + span {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background-color: transparent !important;
  }

  body:not(.game-active) .level-group .menu-choice input:checked + span {
    filter:
      drop-shadow(0 0 7px rgba(255, 211, 98, 0.95))
      drop-shadow(0 0 16px rgba(245, 175, 41, 0.6))
      drop-shadow(0 5px 8px rgba(0, 0, 0, 0.45)) !important;
  }

  body:not(.game-active) .competition-entry {
    padding: 10px 12px !important;
    grid-template-rows: 32px minmax(64px, 0.92fr) minmax(82px, 1fr) !important;
    gap: 7px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-copy .online-kicker {
    font-size: 12px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .home-highscore {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    padding: 7px 9px !important;
    column-gap: 8px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: 13px !important;
  }

  body:not(.game-active) .online-entry-actions {
    gap: 7px !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .premium-action {
    grid-template-rows: minmax(24px, 1fr) 13px 12px !important;
    padding: 4px 3px !important;
    gap: 2px !important;
  }

  body:not(.game-active) .premium-action-icon,
  body:not(.game-active) .premium-action-icon svg {
    width: clamp(22px, 7.5dvh, 30px) !important;
    height: clamp(22px, 7.5dvh, 30px) !important;
  }

  body:not(.game-active) .premium-action-text::before {
    font-size: 9px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .premium-action small {
    display: inline-grid !important;
    place-items: center !important;
    height: 11px !important;
    min-height: 11px !important;
    padding: 0 5px !important;
    font-size: 7px !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    width: min(245px, 31vw) !important;
    height: clamp(36px, 9.5dvh, 44px) !important;
    min-height: 0 !important;
    max-height: 44px !important;
    overflow: visible !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-shadow: none !important;
    background: url("./assets/button-start-normal.png") center / contain no-repeat !important;
  }
}

/* Landscape menu readability: variant title top, explanation bottom, softer type. */
@media (orientation: landscape) {
  body:not(.game-active) .start-menu-panel h2,
  body:not(.game-active) .start-menu-panel legend,
  body:not(.game-active) .start-menu-panel strong,
  body:not(.game-active) .start-menu-panel button,
  body:not(.game-active) .start-menu-panel input,
  body:not(.game-active) .start-menu-panel small,
  body:not(.game-active) .start-menu-panel span {
    font-weight: 500 !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    align-content: stretch !important;
    text-align: left !important;
    gap: 4px !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    align-self: start !important;
    justify-self: start !important;
    max-width: 100% !important;
    font-weight: 500 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: block !important;
    align-self: end !important;
    justify-self: start !important;
    max-width: 100% !important;
    color: rgba(244, 241, 232, 0.9) !important;
    font-weight: 400 !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body:not(.game-active) .variant-group .menu-choice > span {
    padding: 8px 8px 7px !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(10px, 2.75dvh, 12px) !important;
    line-height: 1.08 !important;
    text-align: left !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    max-height: 28px !important;
    font-size: clamp(7px, 1.95dvh, 9px) !important;
    line-height: 1.08 !important;
    text-align: left !important;
  }
}

/* Landscape mobile menu: keep the start button fully inside the visible frame. */
@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-panel > .start-game-button {
    align-self: start !important;
    transform: translateY(-10px) !important;
  }
}

/* Trick points now behave as a short table popup, never as an initial +0 event. */
body.game-active .table > .trick-points,
body.game-active .table > .trick-points.winner-user,
body.game-active .table > .trick-points.winner-partner,
body.game-active .table > .trick-points.winner-left,
body.game-active .table > .trick-points.winner-right,
body.game-active .table > .trick-points.collecting,
body.game-active .table > .trick-points.collecting.winner-user,
body.game-active .table > .trick-points.collecting.winner-partner,
body.game-active .table > .trick-points.collecting.winner-left,
body.game-active .table > .trick-points.collecting.winner-right,
body.game-active .table > .roem-burst {
  position: absolute !important;
  z-index: 18 !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  display: grid !important;
  place-items: center !important;
  width: clamp(118px, 24%, 180px) !important;
  min-width: 0 !important;
  max-width: min(180px, calc(100% - 28px)) !important;
  min-height: 58px !important;
  padding: 8px 12px !important;
  translate: none !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none !important;
  border-color: rgba(245, 198, 82, 0.9) !important;
  background: rgba(17, 24, 18, 0.94) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), 0 0 22px rgba(245, 198, 82, 0.22) !important;
  opacity: 0 !important;
  animation: none !important;
}

body.game-active .table > .trick-points.burst-active,
body.game-active .table > .roem-burst.burst-active {
  animation: trickPointsTablePop 2000ms ease both !important;
}

body.game-active .table > .trick-points.burst-active,
body.game-active .table > .trick-points.burst-active.winner-user,
body.game-active .table > .trick-points.burst-active.winner-partner,
body.game-active .table > .trick-points.burst-active.winner-left,
body.game-active .table > .trick-points.burst-active.winner-right,
body.game-active .table > .trick-points.burst-active.collecting,
body.game-active .table > .roem-burst.burst-active {
  inset: auto !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  margin: 0 !important;
  translate: none !important;
}

body.game-active .table > .roem-burst {
  top: calc(50% + 64px) !important;
  width: clamp(134px, 26%, 196px) !important;
  min-height: 52px !important;
  border-color: rgba(255, 184, 63, 0.92) !important;
  background: rgba(48, 30, 9, 0.94) !important;
  color: #fff4cf !important;
}

body.game-active .table > .roem-burst.burst-active {
  top: calc(50% + 64px) !important;
}

body.game-active .table > .trick-points[hidden],
body.game-active .table > .roem-burst[hidden] {
  display: none !important;
}

body.game-active .table > .trick-points strong,
body.game-active .table > .roem-burst strong {
  font-size: clamp(22px, 4.2vw, 34px) !important;
  line-height: 1 !important;
  margin: 0 !important;
}

body.game-active .table > .trick-points span,
body.game-active .table > .roem-burst span {
  max-width: 100% !important;
  margin-top: 3px !important;
  font-size: clamp(10px, 1.8vw, 13px) !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
}

@keyframes trickPointsTablePop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  12%,
  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
}

/* Desktop/tablet game score sidebar: keep cards and action buttons inside the right rail. */
@media (min-width: 981px) {
  body.game-active .app-shell {
    grid-template-columns: minmax(170px, 0.2fr) minmax(0, 1fr) minmax(220px, 0.27fr) !important;
  }

  body.game-active .table {
    grid-column: 2 !important;
    grid-row: 2 !important;
	
  }

  body.game-active .hand-panel {
    grid-column: 1 / 3 !important;
    grid-row: 3 !important;
  }

  body.game-active .score-board {
    grid-column: 3 !important;
    grid-row: 2 / 4 !important;
    align-self: stretch !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(3, minmax(58px, auto)) minmax(0, 1fr) !important;
    align-content: stretch !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 12px !important;
    gap: 10px !important;
    overflow: hidden !important;
  }

  body.game-active .score-board > .score-card,
  body.game-active .score-board > .score-actions {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.game-active .score-board > .score-card {
    min-height: 58px !important;
    padding: 10px 12px !important;
  }

  body.game-active .score-board > .score-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: minmax(44px, auto) !important;
    gap: 10px !important;
    align-content: start !important;
    justify-items: stretch !important;
    align-items: stretch !important;
    overflow: visible !important;
  }

  body.game-active .score-board > .score-actions button {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-inline: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* Wide desktop hand: keep the player's cards grouped around the center. */
@media (min-width: 1280px) {
  body.game-active #playerHand.hand {
    width: max-content !important;
    max-width: min(980px, 100%) !important;
    margin-inline: auto !important;
    justify-content: center !important;
    justify-items: center !important;
    gap: clamp(10px, 1.15vw, 20px) !important;
  }
}

@media (min-width: 1700px) {
  body.game-active #playerHand.hand {
    max-width: 1040px !important;
    gap: 22px !important;
  }
}

/* Keep the table action buttons above decorative/table layers and reliably tappable. */
body.game-active .score-board,
body.game-active .score-board > .score-actions,
body.game-active .score-board > .score-actions button {
  position: relative;
  pointer-events: auto !important;
}

body.game-active .score-board {
  z-index: 80;
}

body.game-active .score-board > .score-actions,
body.game-active .score-board > .score-actions button {
  z-index: 81;
}

body.game-active #newGameButton {
  touch-action: manipulation;
  cursor: pointer;
}

.lobby-seat-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "top top" "left right" "bottom bottom";
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 2px solid rgba(80, 185, 112, 0.48);
  border-radius: 40%;
  background: radial-gradient(circle, rgba(30, 105, 60, 0.42), rgba(7, 36, 22, 0.8));
}

.lobby-seat { min-height: 76px; display: grid; place-items: center; gap: 3px; border-radius: 14px; }
.lobby-seat-partner { grid-area: top; width: min(260px, 70%); justify-self: center; }
.lobby-seat-left { grid-area: left; }
.lobby-seat-right { grid-area: right; }
.lobby-seat-user { grid-area: bottom; width: min(260px, 70%); justify-self: center; }
.lobby-seat span, .lobby-seat small { display: block; }
.lobby-seat.free:not(:disabled) { border: 2px dashed #42d47a; background: rgba(22, 117, 60, 0.3); color: #fff; cursor: pointer; }
.lobby-seat.free:not(:disabled):active { transform: scale(0.97); }
.lobby-seat.occupied { border: 1px solid rgba(255, 216, 120, 0.5); background: rgba(25, 35, 27, 0.92); color: #fff3d4; opacity: 1; }
.lobby-seat.own { box-shadow: 0 0 0 2px #2fd26f, 0 0 22px rgba(47, 210, 111, 0.38); }

@media (max-width: 520px) {
  .lobby-seat-map { padding: 10px; gap: 7px; border-radius: 30%; }
  .lobby-seat { min-height: 68px; padding: 7px; font-size: 12px; }
  .lobby-seat-partner, .lobby-seat-user { width: min(230px, 78%); }
}

/* Phone popups: center against the visible screen, including asymmetric safe areas. */
@media (max-width: 768px) {
  .last-trick-modal,
  .chat-history-modal,
  .bid-popup {
    position: fixed !important;
    inset: 0 !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    height: var(--app-visible-height, 100dvh) !important;
    margin: 0 !important;
    padding-top: max(12px, env(safe-area-inset-top)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    place-items: center !important;
    transform: none !important;
  }

  .last-trick-modal[hidden],
  .bid-popup[hidden] {
    display: none !important;
  }

  .online-dialog,
  .last-trick-dialog,
  .boom-dialog,
  .info-dialog,
  .settings-dialog,
  .chat-history-dialog,
  .bid-popup-dialog {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: auto !important;
    margin-left: auto !important;
    box-sizing: border-box !important;
    justify-self: center !important;
    transform: none !important;
  }

  #settingsModal .settings-dialog {
    width: min(100%, calc(100dvw - max(24px, env(safe-area-inset-left) + env(safe-area-inset-right)))) !important;
    max-width: 100% !important;
    padding: 14px !important;
    overflow-x: hidden !important;
  }

  #settingsModal .settings-content,
  #settingsModal .settings-toggle,
  #settingsModal .settings-field,
  #settingsModal .settings-field select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #settingsModal .settings-toggle > span {
    min-width: 0 !important;
    overflow-wrap: anywhere;
  }

  #settingsModal .settings-field select {
    text-overflow: ellipsis;
  }
}

/* Final mobile landscape game layout: keep chat, table, events and hand in fixed lanes. */
@media (orientation: landscape) and (max-width: 980px) and (max-height: 540px) {
  body.game-active .app-shell {
    width: 100vw !important;
    height: var(--app-visible-height, 100dvh) !important;
    max-height: var(--app-visible-height, 100dvh) !important;
    padding: max(4px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)) !important;
    display: grid !important;
    grid-template-columns: clamp(140px, 22vw, 205px) minmax(260px, 1fr) clamp(150px, 24vw, 233px) !important;
    grid-template-rows: clamp(62px, 18dvh, 78px) minmax(0, 1fr) clamp(58px, 17dvh, 70px) !important;
    grid-template-areas:
      "top top score"
      "chat table hand"
      "events table hand" !important;
    gap: 6px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body.game-active .top-bar {
    grid-area: top !important;
  }

  body.game-active .score-board {
    grid-area: score !important;
  }

  body.game-active .table {
    grid-area: table !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body.game-active .table-chat {
    grid-area: chat !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) 32px !important;
    gap: 5px !important;
    padding: 6px !important;
    position: relative !important;
    z-index: 2 !important;
  }

  body.game-active .table-chat-header {
    display: none !important;
  }

  body.game-active .table-chat-log {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    padding: 6px !important;
  }

  body.game-active .table-chat-log .chat-line.compact {
    max-height: 100% !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-log .chat-line.compact span {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  body.game-active .table-chat-form {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 32px !important;
    min-width: 0 !important;
    min-height: 32px !important;
    max-width: 100% !important;
    max-height: 32px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    gap: 4px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    position: static !important;
  }

  body.game-active .table-chat-form input,
  body.game-active .table-chat-form button {
    width: 100% !important;
    height: 32px !important;
    min-width: 0 !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
  }

  body.game-active .game-events {
    grid-area: events !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    padding: 6px !important;
    position: relative !important;
    z-index: 2 !important;
  }

  body.game-active .game-events .message {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    padding: 6px 8px !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body.game-active .hand-panel {
    grid-area: hand !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 5px !important;
    padding: 6px !important;
  }

  body.game-active .hand-heading {
    min-width: 0 !important;
    min-height: 0 !important;
    gap: 3px !important;
  }

  body.game-active #playerHand.hand {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    gap: 5px !important;
    place-items: center !important;
    align-content: center !important;
    justify-content: center !important;
  }
}

/* Vertical premium menu v1: PNG-led home redesign while preserving existing controls. */
body:not(.game-active) .start-menu {
  --home-gold: #f2c866;
  --home-gold-soft: #ffe4a4;
  --home-bronze: #6b3b18;
  --home-ink: #fff5d8;
  --home-muted: rgba(255, 239, 199, 0.74);
  --home-panel: rgba(7, 29, 31, 0.88);
  --home-panel-strong: rgba(9, 36, 39, 0.94);
  --home-line: rgba(238, 190, 92, 0.55);
  width: 100vw !important;
  min-height: var(--app-visible-height, 100dvh) !important;
  height: var(--app-visible-height, 100dvh) !important;
  overflow: hidden !important;
  padding: 0 !important;
  background:
    radial-gradient(circle at 50% 12%, rgba(252, 198, 93, 0.15), transparent 27%),
    linear-gradient(180deg, rgba(1, 9, 10, 0.25), rgba(1, 6, 7, 0.62)),
    url("./assets/vertical-menu/background-staand.png") center / cover no-repeat !important;
  color: var(--home-ink) !important;
}

body:not(.game-active) .start-menu-stage {
  width: min(100vw, 980px) !important;
  height: var(--app-visible-height, 100dvh) !important;
  max-height: var(--app-visible-height, 100dvh) !important;
  margin: 0 auto !important;
  padding: max(10px, env(safe-area-inset-top)) clamp(12px, 3.3vw, 28px) max(10px, env(safe-area-inset-bottom)) !important;
  display: grid !important;
  grid-template-rows: clamp(96px, 18dvh, 184px) minmax(0, 1fr) !important;
  gap: clamp(7px, 1.2dvh, 14px) !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body:not(.game-active) .start-menu-stage::before {
  content: "" !important;
  position: absolute !important;
  inset: clamp(8px, 1.4vw, 18px) !important;
  border: 1px solid rgba(244, 200, 105, 0.26) !important;
  border-radius: clamp(20px, 4vw, 34px) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 233, 169, 0.08),
    0 0 34px rgba(0, 0, 0, 0.52) !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

body:not(.game-active) .brand-showcase {
  grid-row: 1 !important;
  display: grid !important;
  place-items: center !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  position: relative !important;
  z-index: 2 !important;
}

body:not(.game-active) .brand-showcase img {
  width: min(86vw, 560px) !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.78)) drop-shadow(0 0 16px rgba(246, 191, 83, 0.26)) !important;
}

body:not(.game-active) .brand-showcase p,
body:not(.game-active) .start-heading,
body:not(.game-active) .home-action-card small,
body:not(.game-active) .menu-choice small,
body:not(.game-active) .competition-copy p,
body:not(.game-active) .online-kicker,
body:not(.game-active) .competition-copy > strong {
  display: none !important;
}

body:not(.game-active) .start-menu-panel {
  grid-row: 2 !important;
  width: min(100%, 760px) !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 auto !important;
  padding: clamp(8px, 1.25dvh, 13px) clamp(10px, 2.5vw, 18px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows:
    clamp(66px, 10dvh, 92px)
    clamp(82px, 12dvh, 118px)
    clamp(68px, 10dvh, 96px)
    clamp(66px, 10dvh, 94px)
    minmax(122px, 1fr)
    clamp(52px, 8.2dvh, 76px) !important;
  gap: clamp(7px, 1.15dvh, 11px) !important;
  border: 1px solid var(--home-line) !important;
  border-radius: clamp(18px, 3.5vw, 30px) !important;
  background:
    linear-gradient(180deg, rgba(7, 36, 42, 0.82), rgba(5, 19, 20, 0.92)),
    radial-gradient(circle at 50% 0%, rgba(244, 200, 104, 0.14), transparent 42%) !important;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 241, 191, 0.12),
    inset 0 0 38px rgba(3, 12, 12, 0.46) !important;
  overflow: hidden !important;
  position: relative !important;
  z-index: 1 !important;
  box-sizing: border-box !important;
}

body:not(.game-active) .start-menu-panel::before,
body:not(.game-active) .start-menu-panel::after {
  content: none !important;
}

body:not(.game-active) .home-section,
body:not(.game-active) .menu-group,
body:not(.game-active) .competition-entry {
  min-width: 0 !important;
  min-height: 0 !important;
  border: 1px solid rgba(239, 191, 92, 0.5) !important;
  border-radius: clamp(13px, 2.4vw, 22px) !important;
  background:
    linear-gradient(135deg, rgba(5, 35, 42, 0.74), rgba(5, 17, 18, 0.72)),
    radial-gradient(circle at 18% 0%, rgba(244, 204, 119, 0.12), transparent 36%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 193, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.27) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body:not(.game-active) .home-player-section,
body:not(.game-active) .variant-group,
body:not(.game-active) .level-group,
body:not(.game-active) .home-options-section,
body:not(.game-active) .competition-entry {
  width: 100% !important;
  margin: 0 !important;
  padding: clamp(7px, 1.2dvh, 11px) clamp(8px, 2vw, 14px) !important;
}

body:not(.game-active) .home-player-section {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  column-gap: clamp(10px, 2.6vw, 20px) !important;
  row-gap: 3px !important;
  align-items: center !important;
}

body:not(.game-active) .home-player-section h2,
body:not(.game-active) .menu-group legend,
body:not(.game-active) .home-options-section h2,
body:not(.game-active) .competition-entry::before {
  color: var(--home-gold) !important;
  font-family: inherit !important;
  font-size: clamp(12px, 2.9vw, 18px) !important;
  font-weight: 700 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.65) !important;
}

body:not(.game-active) .home-player-section h2 {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  margin: 0 !important;
}

body:not(.game-active) .avatar-preview {
  grid-column: 1 !important;
  grid-row: 2 !important;
  width: clamp(45px, 10vw, 70px) !important;
  height: clamp(45px, 10vw, 70px) !important;
  border: 3px solid rgba(255, 225, 156, 0.88) !important;
  border-radius: 50% !important;
  background:
    radial-gradient(circle at 35% 25%, #fff8d8, #dac180 58%, #6a431c 100%) !important;
  color: #16221a !important;
  font-size: clamp(22px, 5.5vw, 34px) !important;
  font-weight: 800 !important;
  display: grid !important;
  place-items: center !important;
  box-shadow:
    0 5px 0 rgba(0, 0, 0, 0.28),
    0 0 0 4px rgba(14, 50, 50, 0.65),
    0 0 18px rgba(249, 205, 102, 0.24) !important;
}

body:not(.game-active) .avatar-preview.has-image {
  background-size: cover !important;
  background-position: center !important;
}

body:not(.game-active) .player-name-field {
  grid-column: 2 !important;
  grid-row: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body:not(.game-active) .player-name-field span {
  display: none !important;
}

body:not(.game-active) .player-name-field input {
  width: 100% !important;
  height: clamp(42px, 7.8dvh, 56px) !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #fff7dd !important;
  font-size: clamp(22px, 5.3vw, 34px) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65) !important;
}

body:not(.game-active) .player-name-field input:focus {
  outline: 2px solid rgba(245, 199, 91, 0.75) !important;
  outline-offset: 4px !important;
}

body:not(.game-active) .player-photo-field {
  grid-column: 3 !important;
  grid-row: 2 !important;
  width: clamp(118px, 30vw, 170px) !important;
  height: clamp(42px, 7.6dvh, 58px) !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border: 1px solid rgba(248, 199, 94, 0.82) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(50, 42, 25, 0.92), rgba(12, 41, 42, 0.86)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 235, 176, 0.15), 0 5px 12px rgba(0, 0, 0, 0.34) !important;
  cursor: pointer !important;
}

body:not(.game-active) .player-photo-field strong {
  color: #fff0c6 !important;
  font-size: clamp(14px, 3.25vw, 20px) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body:not(.game-active) .photo-button-icon,
body:not(.game-active) .photo-button-icon svg {
  width: clamp(18px, 4.5vw, 26px) !important;
  height: clamp(18px, 4.5vw, 26px) !important;
  color: #ffe6a6 !important;
  stroke: currentColor !important;
  fill: none !important;
}

body:not(.game-active) .avatar-upload-field input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
}

body:not(.game-active) .menu-group {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: clamp(6px, 1dvh, 10px) !important;
}

body:not(.game-active) .menu-group legend,
body:not(.game-active) .home-options-section h2 {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
}

body:not(.game-active) .variant-group {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-items: stretch !important;
}

body:not(.game-active) .variant-group legend {
  grid-column: 1 / -1 !important;
}

body:not(.game-active) .variant-group .menu-choice,
body:not(.game-active) .level-group .menu-choice {
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  display: block !important;
  position: relative !important;
}

body:not(.game-active) .menu-choice > span {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 8px !important;
  border: 1px solid rgba(91, 150, 166, 0.45) !important;
  border-radius: 12px !important;
  background: rgba(0, 23, 31, 0.72) !important;
  color: #fff5d9 !important;
  display: grid !important;
  place-items: center !important;
  text-align: center !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 5px 12px rgba(0, 0, 0, 0.24) !important;
  box-sizing: border-box !important;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease !important;
}

body:not(.game-active) .menu-choice input:checked + span {
  border-color: rgba(255, 203, 91, 0.95) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 237, 168, 0.18),
    0 0 18px rgba(243, 193, 78, 0.32),
    0 6px 16px rgba(0, 0, 0, 0.36) !important;
  filter: saturate(1.08) brightness(1.08) !important;
}

body:not(.game-active) .menu-choice:active > span,
body:not(.game-active) .home-action-card:active,
body:not(.game-active) .premium-action:active,
body:not(.game-active) .start-game-button:active {
  transform: translateY(2px) scale(0.985) !important;
}

body:not(.game-active) .variant-group .menu-choice > span {
  justify-items: start !important;
  align-items: end !important;
  padding: clamp(8px, 1.5dvh, 12px) !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

body:not(.game-active) .variant-group .menu-choice:nth-of-type(1) > span {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 19, 24, 0.68)),
    url("./assets/amsterdam-canals.png") center / cover no-repeat !important;
}

body:not(.game-active) .variant-group .menu-choice:nth-of-type(2) > span {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 19, 24, 0.68)),
    url("./assets/rotterdam-harbor.png") center / cover no-repeat !important;
}

body:not(.game-active) .variant-group .menu-choice strong {
  max-width: 100% !important;
  color: #fff7df !important;
  font-size: clamp(13px, 3.3vw, 19px) !important;
  font-weight: 650 !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  overflow-wrap: anywhere !important;
  text-shadow: 0 2px 5px #000 !important;
}

body:not(.game-active) .level-group {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}

body:not(.game-active) .level-group legend {
  grid-column: 1 / -1 !important;
}

body:not(.game-active) .level-group .menu-choice strong {
  font-size: clamp(13px, 3.2vw, 19px) !important;
  font-weight: 650 !important;
  line-height: 1 !important;
}

body:not(.game-active) .home-options-section {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: clamp(6px, 1dvh, 10px) !important;
}

body:not(.game-active) .home-action-grid {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(7px, 1.8vw, 14px) !important;
}

body:not(.game-active) .home-action-card {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 1px solid rgba(86, 152, 170, 0.48) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(7, 39, 47, 0.86), rgba(1, 22, 28, 0.92)) !important;
  color: #fff5d6 !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, auto) !important;
  place-content: center !important;
  align-items: center !important;
  gap: clamp(5px, 1.6vw, 10px) !important;
  padding: 6px !important;
  box-shadow: inset 0 1px 0 rgba(255, 241, 196, 0.08), 0 7px 13px rgba(0, 0, 0, 0.27) !important;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease !important;
}

body:not(.game-active) .home-action-card:hover,
body:not(.game-active) .home-action-card:focus-visible,
body:not(.game-active) .player-photo-field:hover,
body:not(.game-active) .premium-action:hover,
body:not(.game-active) .premium-action:focus-visible {
  border-color: rgba(255, 207, 103, 0.9) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 170, 0.15), 0 0 18px rgba(243, 191, 82, 0.24) !important;
}

body:not(.game-active) .home-action-icon {
  width: clamp(31px, 7vw, 54px) !important;
  height: clamp(31px, 7vw, 54px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: center / contain no-repeat !important;
  box-shadow: none !important;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.55)) !important;
}

body:not(.game-active) .home-action-card svg {
  display: none !important;
}

body:not(.game-active) .home-action-card[data-info="rules"] .home-action-icon {
  background-image: url("./assets/vertical-menu/icon-klaver.png") !important;
}

body:not(.game-active) #startDemoHomeButton .home-action-icon {
  background-image: url("./assets/vertical-menu/icon-speel-nu.png") !important;
}

body:not(.game-active) #openSettingsButton .home-action-icon {
  background-image: url("./assets/vertical-menu/icon-instellingen.png") !important;
}

body:not(.game-active) .home-action-card strong {
  font-size: clamp(13px, 3.25vw, 19px) !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body:not(.game-active) .competition-entry {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto clamp(68px, 9.5dvh, 92px) clamp(70px, 10.5dvh, 96px) !important;
  gap: clamp(6px, 1dvh, 10px) !important;
  align-content: start !important;
}

body:not(.game-active) .competition-entry::before {
  content: "Competitie" !important;
  display: block !important;
  text-align: center !important;
}

body:not(.game-active) .competition-copy {
  display: none !important;
}

body:not(.game-active) .home-highscore {
  grid-row: 2 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: clamp(7px, 1.3dvh, 12px) clamp(10px, 2.2vw, 16px) !important;
  border: 1px solid rgba(232, 190, 97, 0.5) !important;
  border-radius: 13px !important;
  background: linear-gradient(90deg, rgba(28, 58, 43, 0.86), rgba(7, 35, 37, 0.78)) !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  column-gap: clamp(9px, 2.2vw, 17px) !important;
  row-gap: 3px !important;
  align-items: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body:not(.game-active) .home-highscore .home-trophy {
  grid-column: 1 !important;
  grid-row: 1 / -1 !important;
  width: clamp(44px, 10vw, 74px) !important;
  height: clamp(44px, 10vw, 74px) !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background:
    radial-gradient(circle at 35% 28%, #ffe9a8, #cf9128 66%, #5a3511 100%) !important;
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.35), 0 7px 13px rgba(0, 0, 0, 0.36) !important;
}

body:not(.game-active) .home-highscore .home-trophy svg {
  width: 54% !important;
  height: 54% !important;
  fill: #2b1a09 !important;
}

body:not(.game-active) .home-highscore .winner-label {
  grid-column: 2 !important;
  color: var(--home-gold) !important;
  font-size: clamp(10px, 2.4vw, 14px) !important;
  font-weight: 750 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:not(.game-active) .home-highscore strong {
  grid-column: 2 !important;
  color: #fff7dd !important;
  font-size: clamp(16px, 4.25vw, 28px) !important;
  font-weight: 720 !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:not(.game-active) .home-highscore small {
  display: none !important;
}

body:not(.game-active) .online-entry-actions {
  grid-row: 3 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(6px, 1.7vw, 12px) !important;
  align-self: start !important;
}

body:not(.game-active) .premium-action {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 5px !important;
  border: 1px solid rgba(82, 151, 172, 0.5) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(5, 43, 52, 0.9), rgba(2, 25, 31, 0.94)) !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto auto !important;
  place-items: center !important;
  gap: 2px !important;
  color: #fff5d8 !important;
  box-shadow: inset 0 1px 0 rgba(255, 242, 193, 0.08), 0 6px 12px rgba(0, 0, 0, 0.24) !important;
}

body:not(.game-active) .premium-action-icon {
  width: clamp(28px, 6.6vw, 48px) !important;
  height: clamp(28px, 6.6vw, 48px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: center / contain no-repeat !important;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.55)) !important;
}

body:not(.game-active) .premium-action svg {
  display: none !important;
}

body:not(.game-active) #openOnlineButton .premium-action-icon {
  background-image: url("./assets/vertical-menu/icon-online.png") !important;
}

body:not(.game-active) #openDailyButton .premium-action-icon {
  background-image: url("./assets/vertical-menu/icon-daguitdaging.png") !important;
}

body:not(.game-active) #openRankingsButton .premium-action-icon {
  background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
}

body:not(.game-active) .premium-action-text {
  max-width: 100% !important;
  color: #fff2c8 !important;
  font-size: clamp(11px, 2.8vw, 16px) !important;
  font-weight: 650 !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:not(.game-active) .premium-action small {
  display: block !important;
  width: fit-content !important;
  max-width: 100% !important;
  padding: 1px 7px !important;
  border: 1px solid rgba(239, 192, 82, 0.85) !important;
  border-radius: 999px !important;
  color: var(--home-gold) !important;
  font-size: clamp(9px, 2.2vw, 12px) !important;
  font-weight: 760 !important;
  line-height: 1.1 !important;
  text-transform: uppercase !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:not(.game-active) .menu-error {
  position: absolute !important;
  inset-inline: 16px !important;
  bottom: calc(clamp(52px, 8.2dvh, 76px) + 12px) !important;
  z-index: 5 !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  background: rgba(54, 13, 9, 0.92) !important;
  color: #ffe2cb !important;
  text-align: center !important;
  font-size: 13px !important;
}

body:not(.game-active) .start-menu-panel > .start-game-button {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 15px !important;
  background:
    linear-gradient(180deg, rgba(255, 221, 96, 0.97), rgba(208, 139, 24, 0.98)) !important;
  color: #211100 !important;
  font-size: clamp(24px, 6.2vw, 46px) !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-shadow: 0 1px 0 rgba(255, 237, 156, 0.72) !important;
  box-shadow:
    inset 0 2px 0 rgba(255, 245, 179, 0.74),
    inset 0 -4px 0 rgba(105, 55, 9, 0.5),
    0 9px 16px rgba(0, 0, 0, 0.42) !important;
  position: relative !important;
  z-index: 1 !important;
  overflow: hidden !important;
}

body:not(.game-active) .start-menu-panel > .start-game-button::before {
  content: "" !important;
  display: inline-block !important;
  width: clamp(28px, 7vw, 48px) !important;
  height: clamp(28px, 7vw, 48px) !important;
  margin-right: clamp(8px, 2vw, 16px) !important;
  vertical-align: middle !important;
  background: url("./assets/vertical-menu/icon-speel-nu.png") center / contain no-repeat !important;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.32)) !important;
}

body:not(.game-active) .start-menu-panel > .start-game-button:hover,
body:not(.game-active) .start-menu-panel > .start-game-button:focus-visible {
  filter: brightness(1.06) saturate(1.05) !important;
}

@media (orientation: portrait) and (max-width: 520px) {
  body:not(.game-active) .start-menu-stage {
    width: 100vw !important;
    padding-inline: clamp(10px, 2.8vw, 16px) !important;
    grid-template-rows: clamp(106px, 19dvh, 174px) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: 100% !important;
    grid-template-rows:
      clamp(64px, 9.2dvh, 86px)
      clamp(78px, 11dvh, 108px)
      clamp(64px, 9.2dvh, 86px)
      clamp(62px, 8.8dvh, 82px)
      minmax(116px, 1fr)
      clamp(52px, 7.4dvh, 68px) !important;
  }
}

@media (orientation: portrait) and (max-height: 760px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: clamp(82px, 15dvh, 124px) minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      58px
      72px
      56px
      56px
      minmax(102px, 1fr)
      48px !important;
    gap: 5px !important;
    padding-block: 7px !important;
  }

  body:not(.game-active) .home-section,
  body:not(.game-active) .menu-group,
  body:not(.game-active) .competition-entry {
    padding-block: 6px !important;
  }

  body:not(.game-active) .home-player-section h2,
  body:not(.game-active) .menu-group legend,
  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before {
    font-size: 11px !important;
  }

  body:not(.game-active) .avatar-preview {
    width: 42px !important;
    height: 42px !important;
    font-size: 22px !important;
  }

  body:not(.game-active) .player-name-field input {
    height: 38px !important;
    font-size: 21px !important;
  }

  body:not(.game-active) .player-photo-field {
    width: 112px !important;
    height: 38px !important;
  }

  body:not(.game-active) .player-photo-field strong,
  body:not(.game-active) .variant-group .menu-choice strong,
  body:not(.game-active) .level-group .menu-choice strong,
  body:not(.game-active) .home-action-card strong {
    font-size: 12px !important;
  }

  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .premium-action-icon {
    width: 28px !important;
    height: 28px !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    width: 44px !important;
    height: 44px !important;
  }

  body:not(.game-active) .home-highscore strong {
    font-size: 17px !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    font-size: 22px !important;
  }
}

@media (min-width: 860px) and (orientation: portrait) {
  body:not(.game-active) .start-menu-stage {
    width: min(100vw, 840px) !important;
    grid-template-rows: minmax(150px, 22dvh) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: min(100%, 760px) !important;
  }
}

/* UI polish v2: modal buttons, portrait premium menu, desktop table lanes. */
body:not(.game-active) .start-menu {
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

body:not(.game-active) .start-menu-stage {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

#onlineContent > .start-game-button,
#onlineContent .premium-hero + .start-game-button,
#onlineContent #startDailyButton,
#onlineContent #testOpenOnlineButton,
#onlineContent #webPaidButton,
#onlineContent #findMatchButton,
#onlineContent #readyButton,
#onlineContent #buyPremiumButton,
#onlineContent #devUnlockPremiumButton {
  width: auto !important;
  min-width: 168px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin: 12px 0 0 !important;
  padding: 0 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(218, 172, 78, 0.62) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #f1c157, #b8761e) !important;
  color: #211305 !important;
  font-size: 16px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-shadow: 0 1px 0 rgba(255, 238, 174, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 244, 196, 0.48), 0 8px 18px rgba(0, 0, 0, 0.28) !important;
  overflow: hidden !important;
  transform: none !important;
}

#onlineContent #devUnlockPremiumButton {
  background: linear-gradient(180deg, rgba(32, 70, 58, 0.96), rgba(15, 43, 38, 0.98)) !important;
  color: #fff2c8 !important;
  text-shadow: none !important;
}

body:not(.game-active) .start-menu-panel > .start-game-button:active,
body:not(.game-active) .start-menu-panel > .start-game-button.pressed {
  color: #211100 !important;
  text-shadow: 0 1px 0 rgba(255, 237, 156, 0.72) !important;
  -webkit-text-fill-color: #211100 !important;
}

@media (orientation: landscape) {
  body:not(.game-active) .start-menu-panel > .start-game-button,
  body:not(.game-active) .start-menu-panel > .start-game-button:active,
  body:not(.game-active) .start-menu-panel > .start-game-button.pressed {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
  }
}

@media (min-width: 1000px) and (min-height: 620px) {
  body.game-active .played-card.seat-user {
    bottom: -22px !important;
  }

  body.game-active .trick-stack.stack-user {
    bottom: -14px !important;
  }

  body.game-active .table .trick-stack.stack-user {
    bottom: -14px !important;
  }
}

@media (orientation: portrait) {
  body:not(.game-active) .start-menu {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.64)),
      url("./assets/vertical-menu/background-staand.png") center / cover no-repeat !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(100vw, 720px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: max(8px, env(safe-area-inset-top)) clamp(10px, 2.8vw, 22px) max(8px, env(safe-area-inset-bottom)) !important;
    grid-template-rows: minmax(252px, 44dvh) minmax(0, 1fr) !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-menu-stage::before {
    content: none !important;
  }

  body:not(.game-active) .brand-showcase {
    position: relative !important;
    z-index: 3 !important;
    align-self: end !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase img {
    display: none !important;
  }

  body:not(.game-active) .brand-showcase::before {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    bottom: clamp(-54px, -5.7dvh, -24px) !important;
    width: min(118vw, 800px) !important;
    height: min(52dvh, 482px) !important;
    transform: translateX(-50%) !important;
    background: url("./assets/vertical-menu/table-menu.png") center bottom / contain no-repeat !important;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.78)) !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    align-self: start !important;
    width: min(94vw, 500px) !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    padding: clamp(8px, 1.1dvh, 12px) !important;
    grid-template-rows:
      repeat(6, minmax(48px, 1fr))
      minmax(76px, 1.28fr) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: clamp(5px, 0.75dvh, 8px) !important;
    border: 1px solid rgba(211, 148, 70, 0.74) !important;
    border-radius: 18px !important;
    background:
      linear-gradient(180deg, rgba(77, 43, 18, 0.94), rgba(26, 13, 6, 0.98)),
      radial-gradient(circle at 50% 0%, rgba(252, 204, 105, 0.18), transparent 45%) !important;
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.7),
      inset 0 0 0 2px rgba(29, 13, 5, 0.82),
      inset 0 1px 0 rgba(255, 230, 165, 0.18) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group {
    display: none !important;
  }

  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    display: contents !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before,
  body:not(.game-active) .competition-copy,
  body:not(.game-active) .menu-error {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    grid-row: 1 !important;
    grid-column: 1 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 229, 132, 0.74) !important;
    background:
      linear-gradient(180deg, rgba(70, 132, 35, 0.98), rgba(25, 84, 22, 0.98)),
      radial-gradient(circle at 50% 0%, rgba(255, 240, 153, 0.2), transparent 60%) !important;
    color: #fff4c8 !important;
    -webkit-text-fill-color: #fff4c8 !important;
    font-size: clamp(20px, 4.6vw, 28px) !important;
    font-weight: 650 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 190, 0.22),
      inset 0 -4px 0 rgba(5, 34, 8, 0.55),
      0 5px 10px rgba(0, 0, 0, 0.42) !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::before {
    width: 28px !important;
    height: 28px !important;
    margin-right: 12px !important;
  }

  body:not(.game-active) .home-action-grid,
  body:not(.game-active) .online-entry-actions {
    display: contents !important;
  }

  body:not(.game-active) .home-action-card,
  body:not(.game-active) .premium-action {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 clamp(14px, 4vw, 24px) !important;
    border: 1px solid rgba(190, 112, 45, 0.8) !important;
    border-radius: 10px !important;
    background:
      linear-gradient(180deg, rgba(112, 61, 25, 0.98), rgba(60, 28, 10, 0.98)),
      linear-gradient(90deg, rgba(255, 220, 136, 0.1), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.22)) !important;
    color: #fff0c4 !important;
    display: grid !important;
    grid-template-columns: clamp(34px, 8vw, 46px) minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    place-items: center start !important;
    gap: clamp(12px, 3vw, 18px) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 220, 145, 0.18),
      inset 0 -3px 0 rgba(27, 10, 4, 0.55),
      0 4px 8px rgba(0, 0, 0, 0.42) !important;
  }

  body:not(.game-active) .home-action-card[data-info="rules"] {
    grid-row: 2 !important;
    grid-column: 1 !important;
  }

  body:not(.game-active) #startDemoHomeButton {
    grid-row: 3 !important;
    grid-column: 1 !important;
  }

  body:not(.game-active) #openSettingsButton {
    grid-row: 4 !important;
    grid-column: 1 !important;
  }

  body:not(.game-active) .premium-action {
    display: none !important;
  }

  body:not(.game-active) #openRankingsButton {
    display: grid !important;
    grid-row: 5 !important;
    grid-column: 1 !important;
  }

  body:not(.game-active) #openDailyButton {
    display: grid !important;
    grid-row: 6 !important;
    grid-column: 1 !important;
  }

  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .premium-action-icon {
    width: clamp(32px, 8vw, 44px) !important;
    height: clamp(32px, 8vw, 44px) !important;
    justify-self: center !important;
  }

  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .premium-action-text {
    color: #fff0c4 !important;
    font-size: clamp(19px, 4.8vw, 28px) !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0.015em !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.72) !important;
  }

  body:not(.game-active) #startDemoHomeButton strong::after {
    content: " starten" !important;
  }

  body:not(.game-active) #openSettingsButton strong {
    font-size: 0 !important;
  }

  body:not(.game-active) #openSettingsButton strong::after {
    content: "Setup" !important;
    font-size: clamp(19px, 4.8vw, 28px) !important;
  }

  body:not(.game-active) .home-highscore {
    grid-row: 7 !important;
    grid-column: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 76px !important;
    min-height: 0 !important;
    padding: clamp(7px, 1.2dvh, 12px) clamp(12px, 3.6vw, 18px) !important;
    border: 1px solid rgba(194, 112, 48, 0.82) !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, rgba(65, 35, 16, 0.98), rgba(35, 16, 7, 0.98)) !important;
    grid-template-columns: clamp(42px, 11vw, 64px) clamp(42px, 11vw, 64px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    column-gap: clamp(10px, 2.7vw, 16px) !important;
    row-gap: 1px !important;
    align-items: center !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    width: clamp(42px, 11vw, 64px) !important;
    height: clamp(42px, 11vw, 64px) !important;
  }

  body:not(.game-active) .home-highscore::before {
    content: "" !important;
    grid-column: 2 !important;
    grid-row: 1 / -1 !important;
    width: clamp(42px, 11vw, 64px) !important;
    height: clamp(42px, 11vw, 64px) !important;
    border-radius: 50% !important;
    background:
      radial-gradient(circle at 35% 25%, #ffe8ad, #236b3b 62%, #0d2518 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 8px rgba(0, 0, 0, 0.38) !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    grid-column: 3 !important;
    grid-row: 1 !important;
    color: #f6d08c !important;
    font-size: clamp(10px, 2.65vw, 14px) !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-highscore strong {
    grid-column: 3 !important;
    grid-row: 2 !important;
    color: #fff5d9 !important;
    font-size: clamp(18px, 4.6vw, 25px) !important;
    font-weight: 600 !important;
    line-height: 1.05 !important;
  }

  body:not(.game-active) .home-highscore small {
    display: block !important;
    grid-column: 3 !important;
    grid-row: 3 !important;
    color: rgba(255, 238, 194, 0.9) !important;
    font-size: clamp(11px, 2.9vw, 15px) !important;
    font-weight: 450 !important;
    line-height: 1.1 !important;
  }
}

@media (orientation: portrait) and (max-height: 780px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(214px, 40dvh) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .brand-showcase::before {
    height: min(47dvh, 396px) !important;
    bottom: clamp(-44px, -5.1dvh, -20px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      repeat(6, minmax(38px, 1fr))
      minmax(64px, 1.25fr) !important;
    gap: 4px !important;
    padding: 7px !important;
  }

  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .premium-action-text {
    font-size: 18px !important;
  }
}

@media (orientation: portrait) {
  body:not(.game-active) #openDailyButton,
  body:not(.game-active) #openRankingsButton {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-columns: clamp(34px, 8vw, 46px) minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) #openDailyButton small,
  body:not(.game-active) #openRankingsButton small {
    display: none !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-icon,
  body:not(.game-active) #openRankingsButton .premium-action-icon {
    align-self: center !important;
  }
}

/* Portrait menu v4: follow supplied vertical premium mockup more closely. */
@media (orientation: portrait) {
  body:not(.game-active) .start-menu {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.68)),
      url("./assets/vertical-menu/background-staand.png") center / cover no-repeat !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(100vw, 640px) !important;
    grid-template-rows: minmax(310px, 52dvh) minmax(0, 1fr) !important;
    padding: max(8px, env(safe-area-inset-top)) clamp(8px, 2.4vw, 16px) max(8px, env(safe-area-inset-bottom)) !important;
  }

  body:not(.game-active) .brand-showcase {
    align-self: stretch !important;
    height: 100% !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase::before {
    bottom: 0 !important;
    width: min(122vw, 760px) !important;
    height: min(56dvh, 560px) !important;
    max-height: 100% !important;
    background: url("./assets/vertical-menu/table-menu.png") center bottom / contain no-repeat !important;
  }

  body:not(.game-active) .start-menu-panel {
    position: relative !important;
    z-index: 3 !important;
    width: min(83vw, 430px) !important;
    border-radius: 16px !important;
    background:
      linear-gradient(180deg, rgba(74, 38, 15, 0.96), rgba(29, 13, 5, 0.99)),
      radial-gradient(circle at 50% 0%, rgba(251, 199, 104, 0.16), transparent 48%) !important;
    grid-template-rows:
      repeat(6, minmax(43px, 1fr))
      minmax(68px, 1.26fr) !important;
    gap: clamp(4px, 0.62dvh, 7px) !important;
    padding: clamp(7px, 0.95dvh, 11px) !important;
  }

  body:not(.game-active) .home-action-card,
  body:not(.game-active) .premium-action,
  body:not(.game-active) .home-highscore,
  body:not(.game-active) .start-menu-panel > .start-game-button {
    border-color: rgba(210, 137, 62, 0.9) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 220, 145, 0.2),
      inset 0 -3px 0 rgba(22, 8, 3, 0.58),
      0 4px 9px rgba(0, 0, 0, 0.48) !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    background:
      linear-gradient(180deg, rgba(64, 135, 30, 0.98), rgba(22, 83, 20, 0.98)),
      radial-gradient(circle at 50% 0%, rgba(255, 238, 146, 0.22), transparent 62%) !important;
  }

  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .premium-action-icon {
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)) !important;
  }

  body:not(.game-active) .home-action-icon svg,
  body:not(.game-active) .premium-action-icon svg,
  body:not(.game-active) .home-trophy svg {
    display: none !important;
  }

  body:not(.game-active) .home-action-card[data-info="rules"] .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-tafels.png") !important;
  }

  body:not(.game-active) #startDemoHomeButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-vrienden.png") !important;
  }

  body:not(.game-active) #openSettingsButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-instellingen.png") !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-daguitdaging.png") !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    background: url("./assets/vertical-menu/icon-ranglijst.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .home-highscore::before {
    background:
      radial-gradient(circle at 35% 28%, #ffe6a9, #1d6a3a 62%, #092010 100%) !important;
  }
}

@media (orientation: portrait) and (max-height: 820px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(250px, 45dvh) minmax(0, 1fr) !important;
  }

  body:not(.game-active) .brand-showcase::before {
    height: min(49dvh, 440px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    width: min(86vw, 420px) !important;
    grid-template-rows:
      repeat(6, minmax(37px, 1fr))
      minmax(58px, 1.18fr) !important;
    gap: 4px !important;
  }
}

/* Landscape menu v5: rebuild the menu as one stable game-board layout. */
@media (orientation: landscape) and (min-width: 700px) {
  body:not(.game-active) .start-menu {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.56)),
      url("./assets/achtergrond-landscape.png") center / cover no-repeat !important;
  }

  body:not(.game-active) .start-menu-stage {
    position: relative !important;
    width: min(100vw, 1920px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 auto !important;
    padding: clamp(8px, 1.4dvh, 18px) clamp(14px, 2.2vw, 38px) !important;
    display: block !important;
    overflow: hidden !important;
    background: none !important;
  }

  body:not(.game-active) .start-menu-stage::before,
  body:not(.game-active) .start-menu-stage::after,
  body:not(.game-active) .start-menu-panel::before,
  body:not(.game-active) .start-menu-panel::after {
    content: none !important;
  }

  body:not(.game-active) .brand-showcase {
    position: absolute !important;
    z-index: 2 !important;
    left: 50% !important;
    top: clamp(8px, 2dvh, 22px) !important;
    width: clamp(260px, 32vw, 560px) !important;
    height: clamp(92px, 22dvh, 230px) !important;
    min-height: 0 !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    pointer-events: none !important;
    overflow: visible !important;
  }

  body:not(.game-active) .brand-showcase::before {
    content: none !important;
  }

  body:not(.game-active) .brand-showcase img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.74)) !important;
  }

  body:not(.game-active) .brand-showcase p {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel {
    position: relative !important;
    z-index: 3 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: clamp(10px, 1.8dvh, 22px) clamp(12px, 2vw, 30px) !important;
    display: grid !important;
    grid-template-columns: minmax(270px, 29%) minmax(280px, 1fr) minmax(300px, 29%) !important;
    grid-template-rows: minmax(82px, 20%) minmax(116px, 29%) minmax(82px, 20%) minmax(64px, 1fr) !important;
    grid-template-areas:
      "player logo options"
      "variant center competition"
      "level center competition"
      ". start ." !important;
    gap: clamp(8px, 1.5dvh, 18px) clamp(12px, 2vw, 28px) !important;
    border: 1px solid rgba(155, 105, 43, 0.48) !important;
    border-radius: 0 !important;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.48)),
      radial-gradient(ellipse at 50% 45%, rgba(15, 80, 47, 0.24), transparent 38%) !important;
    box-shadow:
      inset 0 0 0 2px rgba(0, 0, 0, 0.45),
      inset 0 0 0 4px rgba(197, 145, 54, 0.16) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .start-heading,
  body:not(.game-active) .menu-error {
    display: none !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: clamp(8px, 1.4dvh, 16px) !important;
    display: grid !important;
    border: 1px solid rgba(202, 157, 70, 0.45) !important;
    border-radius: clamp(12px, 1.5vw, 22px) !important;
    background:
      linear-gradient(135deg, rgba(4, 38, 43, 0.9), rgba(5, 25, 25, 0.84)),
      radial-gradient(circle at 15% 10%, rgba(247, 205, 115, 0.09), transparent 45%) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 235, 170, 0.1) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .home-player-section {
    grid-area: player !important;
    grid-template-columns: clamp(42px, 5.4vw, 78px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    column-gap: clamp(8px, 1.2vw, 18px) !important;
    align-items: center !important;
  }

  body:not(.game-active) .home-player-section h2 {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    color: #e5b14f !important;
    font-size: clamp(14px, 1.65vw, 26px) !important;
    font-weight: 600 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .avatar-preview {
    grid-column: 1 !important;
    grid-row: 2 / 4 !important;
    width: clamp(42px, 5.4vw, 78px) !important;
    height: clamp(42px, 5.4vw, 78px) !important;
    font-size: clamp(20px, 2.4vw, 34px) !important;
  }

  body:not(.game-active) .player-name-field {
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  body:not(.game-active) .player-name-field span {
    display: none !important;
  }

  body:not(.game-active) .player-name-field input {
    width: 100% !important;
    height: clamp(30px, 5.4dvh, 46px) !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff4d8 !important;
    font-size: clamp(18px, 2.35vw, 38px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    padding: 0 !important;
  }

  body:not(.game-active) .player-photo-field {
    grid-column: 2 !important;
    grid-row: 3 !important;
    width: 100% !important;
    height: clamp(28px, 5.2dvh, 42px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 clamp(8px, 1vw, 14px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-radius: 9px !important;
  }

  body:not(.game-active) .player-photo-field strong {
    font-size: clamp(13px, 1.55vw, 22px) !important;
    font-weight: 560 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .variant-group {
    grid-area: variant !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: clamp(8px, 1.2vw, 16px) !important;
    padding: clamp(10px, 1.8dvh, 18px) !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend {
    position: absolute !important;
    left: 50% !important;
    top: clamp(5px, 0.8dvh, 10px) !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    padding: 0 10px !important;
    color: #e4b152 !important;
    font-size: clamp(12px, 1.45vw, 22px) !important;
    font-weight: 560 !important;
    letter-spacing: 0.09em !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.game-active) .variant-group .menu-choice,
  body:not(.game-active) .level-group .menu-choice {
    min-width: 0 !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: clamp(8px, 1.5dvh, 16px) !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    background-size: cover !important;
    background-position: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(1) > span {
    background-image: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.72)), url("./assets/amsterdam-canals.png") !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(2) > span {
    background-image: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.72)), url("./assets/rotterdam-harbor.png") !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    max-width: 100% !important;
    color: #fff3d2 !important;
    font-size: clamp(12px, 1.55vw, 22px) !important;
    font-weight: 560 !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    max-width: 100% !important;
    color: rgba(255, 241, 199, 0.86) !important;
    font-size: clamp(8px, 1vw, 13px) !important;
    font-weight: 440 !important;
    line-height: 1.05 !important;
    white-space: normal !important;
  }

  body:not(.game-active) .level-group {
    grid-area: level !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: clamp(8px, 1.3vw, 18px) !important;
    padding: clamp(10px, 1.8dvh, 18px) !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 12px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    box-shadow: none !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(1) > span,
  body:not(.game-active) .level-group .menu-choice:nth-of-type(1) input:checked + span {
    background-image: url("./assets/level-beginner-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(2) > span,
  body:not(.game-active) .level-group .menu-choice:nth-of-type(2) input:checked + span {
    background-image: url("./assets/level-normal-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(3) > span,
  body:not(.game-active) .level-group .menu-choice:nth-of-type(3) input:checked + span {
    background-image: url("./assets/level-expert-landscape.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice input:checked + span {
    filter: drop-shadow(0 0 12px rgba(255, 210, 90, 0.52)) brightness(1.08) !important;
    outline: none !important;
  }

  body:not(.game-active) .level-group .menu-choice strong,
  body:not(.game-active) .level-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .home-options-section {
    grid-area: options !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(7px, 1.2dvh, 14px) !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before {
    display: block !important;
    margin: 0 !important;
    color: #e4b152 !important;
    text-align: center !important;
    font-size: clamp(15px, 1.8vw, 30px) !important;
    font-weight: 560 !important;
    letter-spacing: 0.12em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-action-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(8px, 1.3vw, 18px) !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .home-action-card {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: clamp(6px, 1.1dvh, 12px) !important;
    border-radius: 12px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    place-items: center !important;
    gap: 4px !important;
    background: linear-gradient(180deg, rgba(5, 43, 52, 0.93), rgba(2, 25, 31, 0.96)) !important;
  }

  body:not(.game-active) .home-action-icon {
    width: clamp(34px, 4.8vw, 78px) !important;
    height: clamp(34px, 4.8vw, 78px) !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) .home-action-card[data-info="rules"] .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-klaver.png") !important;
  }

  body:not(.game-active) #startDemoHomeButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-speel-nu.png") !important;
  }

  body:not(.game-active) #openSettingsButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-instellingen.png") !important;
  }

  body:not(.game-active) .home-action-card svg {
    display: none !important;
  }

  body:not(.game-active) .home-action-card strong {
    max-width: 100% !important;
    color: #fff0c4 !important;
    font-size: clamp(11px, 1.35vw, 19px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-action-card small,
  body:not(.game-active) #startDemoHomeButton strong::after {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) .competition-entry {
    grid-area: competition !important;
    grid-template-rows: auto minmax(76px, 1fr) minmax(86px, 1fr) !important;
    gap: clamp(8px, 1.4dvh, 16px) !important;
  }

  body:not(.game-active) .competition-copy {
    display: none !important;
  }

  body:not(.game-active) .home-highscore {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: clamp(8px, 1.5dvh, 16px) !important;
    display: grid !important;
    grid-template-columns: clamp(48px, 5.7vw, 92px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-content: center !important;
    column-gap: clamp(10px, 1.6vw, 22px) !important;
    background: linear-gradient(90deg, rgba(26, 56, 43, 0.9), rgba(7, 35, 37, 0.84)) !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-row: 1 / -1 !important;
    width: clamp(48px, 5.7vw, 92px) !important;
    height: clamp(48px, 5.7vw, 92px) !important;
    background: url("./assets/vertical-menu/icon-ranglijst.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .home-highscore svg {
    display: none !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    color: #e4b152 !important;
    font-size: clamp(10px, 1.25vw, 17px) !important;
    font-weight: 560 !important;
    letter-spacing: 0.08em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore strong {
    color: #fff5d7 !important;
    font-size: clamp(15px, 1.9vw, 29px) !important;
    font-weight: 560 !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    display: block !important;
    color: rgba(255, 238, 194, 0.82) !important;
    font-size: clamp(9px, 1.05vw, 14px) !important;
    font-weight: 460 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .online-entry-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(7px, 1.2vw, 16px) !important;
    min-height: 0 !important;
  }

  body:not(.game-active) .premium-action {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: clamp(5px, 1dvh, 10px) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) auto auto !important;
    place-items: center !important;
    gap: 3px !important;
    border-radius: 12px !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: clamp(32px, 4.4vw, 70px) !important;
    height: clamp(32px, 4.4vw, 70px) !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-online.png") !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-daguitdaging.png") !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
  }

  body:not(.game-active) .premium-action svg {
    display: none !important;
  }

  body:not(.game-active) .premium-action-text {
    max-width: 100% !important;
    color: #fff0c4 !important;
    font-size: clamp(10px, 1.2vw, 18px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-text {
    font-size: 0 !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-text::after {
    content: "Online" !important;
    font-size: clamp(10px, 1.2vw, 18px) !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-text {
    font-size: 0 !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-text::after {
    content: "Dagspel" !important;
    font-size: clamp(10px, 1.2vw, 18px) !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-text {
    font-size: 0 !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-text::after {
    content: "Stand" !important;
    font-size: clamp(10px, 1.2vw, 18px) !important;
  }

  body:not(.game-active) .premium-action small {
    display: block !important;
    padding: 1px 7px !important;
    border: 1px solid rgba(238, 190, 82, 0.78) !important;
    border-radius: 999px !important;
    color: #f1c760 !important;
    font-size: clamp(8px, 0.95vw, 12px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    grid-area: start !important;
    justify-self: center !important;
    align-self: center !important;
    width: min(38vw, 520px) !important;
    height: clamp(50px, 12dvh, 118px) !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: url("./assets/button-start-normal.png") center / contain no-repeat !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::before {
    content: none !important;
  }
}

@media (orientation: landscape) and (min-width: 700px) and (max-height: 540px) {
  body:not(.game-active) .start-menu-stage {
    padding: clamp(6px, 1.4dvh, 12px) clamp(12px, 2vw, 22px) !important;
  }

  body:not(.game-active) .brand-showcase {
    width: clamp(210px, 28vw, 360px) !important;
    height: clamp(72px, 20dvh, 132px) !important;
    top: clamp(6px, 1.6dvh, 12px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-columns: minmax(220px, 31%) minmax(180px, 1fr) minmax(240px, 31%) !important;
    grid-template-rows: minmax(62px, 22%) minmax(96px, 31%) minmax(72px, 25%) minmax(48px, 1fr) !important;
    gap: clamp(6px, 1.25dvh, 10px) clamp(8px, 1.4vw, 16px) !important;
    padding: clamp(7px, 1.5dvh, 12px) clamp(9px, 1.7vw, 16px) !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: clamp(6px, 1.2dvh, 10px) !important;
    border-radius: 12px !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend {
    display: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(11px, 1.55vw, 15px) !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    font-size: clamp(7px, 0.9vw, 10px) !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(56px, 1fr) minmax(66px, 1fr) !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before {
    font-size: clamp(13px, 1.65vw, 18px) !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    width: min(32vw, 360px) !important;
    height: clamp(42px, 11dvh, 70px) !important;
  }
}

/* Browser menu v6: readable functional desktop/tablet layout. */
@media (min-width: 900px) and (min-height: 560px) {
  body:not(.game-active) .start-menu {
    width: 100vw !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    background:
      radial-gradient(circle at 50% 38%, rgba(15, 68, 53, 0.48), rgba(2, 13, 14, 0.9) 64%),
      #061416 !important;
  }

  body:not(.game-active) .start-menu-stage {
    position: relative !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 560px !important;
    padding: clamp(16px, 2.2vh, 28px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .start-menu-panel {
    position: relative !important;
    z-index: 1 !important;
    width: min(1180px, calc(100vw - 48px)) !important;
    height: min(700px, calc(100dvh - 40px)) !important;
    max-width: 1180px !important;
    max-height: 700px !important;
    min-height: 520px !important;
    margin: 0 auto !important;
    padding: clamp(16px, 2vh, 24px) !important;
    display: grid !important;
    grid-template-columns: minmax(280px, 330px) minmax(320px, 1fr) minmax(300px, 350px) !important;
    grid-template-rows: minmax(112px, 140px) minmax(180px, 1fr) minmax(120px, 160px) minmax(76px, 98px) !important;
    grid-template-areas:
      "player logo options"
      "variant center competition"
      "level center competition"
      ". start ." !important;
    gap: clamp(12px, 1.8vh, 18px) clamp(16px, 2vw, 28px) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(213, 168, 76, 0.48) !important;
    border-radius: 0 !important;
    background:
      linear-gradient(180deg, rgba(3, 8, 8, 0.1), rgba(0, 0, 0, 0.68)),
      url("./assets/achtergrond-landscape.png") center / cover no-repeat !important;
    box-shadow: inset 0 0 0 1px rgba(255, 220, 128, 0.16), 0 24px 70px rgba(0, 0, 0, 0.54) !important;
  }

  body:not(.game-active) .start-menu-panel::before,
  body:not(.game-active) .start-menu-panel::after,
  body:not(.game-active) .start-heading,
  body:not(.game-active) .menu-error {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) .brand-showcase {
    position: absolute !important;
    z-index: 4 !important;
    left: 50% !important;
    top: clamp(26px, 5.3vh, 58px) !important;
    width: clamp(330px, 31vw, 500px) !important;
    height: clamp(120px, 22vh, 220px) !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase::before,
  body:not(.game-active) .brand-showcase p {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) .brand-showcase img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.7)) !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    position: relative !important;
    z-index: 2 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: clamp(12px, 1.7vh, 18px) !important;
    border: 1px solid rgba(218, 172, 80, 0.42) !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg, rgba(3, 31, 35, 0.9), rgba(7, 21, 18, 0.78)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 235, 169, 0.08), 0 12px 26px rgba(0, 0, 0, 0.32) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .home-player-section {
    grid-area: player !important;
    display: grid !important;
    grid-template-columns: clamp(54px, 5vw, 74px) minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    column-gap: clamp(10px, 1.4vw, 18px) !important;
    align-items: center !important;
  }

  body:not(.game-active) .home-player-section h2 {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    color: #e4b152 !important;
    font-size: clamp(17px, 1.6vw, 25px) !important;
    font-weight: 560 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
  }

body:not(.game-active) .home-player-section .avatar-preview {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: clamp(54px, 5vw, 74px) !important;
    height: clamp(54px, 5vw, 74px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    font-size: clamp(20px, 2vw, 30px) !important;
  }

  body:not(.game-active) .home-player-section .player-name-field {
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    display: block !important;
  }

  body:not(.game-active) .home-player-section .player-name-field span {
    display: none !important;
  }

  body:not(.game-active) .home-player-section .player-name-field input {
    width: 100% !important;
    height: clamp(44px, 5.5vh, 58px) !important;
    padding: 0 clamp(12px, 1.3vw, 18px) !important;
    color: #fff5d8 !important;
    font-size: clamp(20px, 2.2vw, 32px) !important;
    font-weight: 520 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-player-section .player-photo-field {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    height: clamp(34px, 4.4vh, 46px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    border-radius: 10px !important;
  }

  body:not(.game-active) .photo-button-icon,
  body:not(.game-active) .photo-button-icon svg {
    width: 20px !important;
    height: 20px !important;
    color: #ffe7a7 !important;
    stroke: currentColor !important;
  }

  body:not(.game-active) .variant-group {
    grid-area: variant !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend {
    grid-column: 1 / -1 !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #e4b152 !important;
    font-size: clamp(16px, 1.45vw, 22px) !important;
    font-weight: 520 !important;
    letter-spacing: 0.08em !important;
    line-height: 1 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    overflow: visible !important;
    clip: auto !important;
  }

  body:not(.game-active) .variant-group .menu-choice {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: clamp(10px, 1.2vh, 14px) !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group .menu-choice span {
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62)) !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    display: block !important;
    color: #fff4d1 !important;
    font-size: clamp(15px, 1.45vw, 22px) !important;
    font-weight: 520 !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: block !important;
    margin-top: 4px !important;
    color: rgba(255, 235, 196, 0.86) !important;
    font-size: clamp(10px, 0.9vw, 13px) !important;
    font-weight: 430 !important;
    line-height: 1.15 !important;
  }

  body:not(.game-active) .level-group {
    grid-area: level !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
  }

  body:not(.game-active) .level-group .menu-choice span {
    min-width: 0 !important;
    text-align: center !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    display: block !important;
    color: #fff2cd !important;
    font-size: clamp(13px, 1.15vw, 17px) !important;
    font-weight: 520 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .level-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .home-options-section {
    grid-area: options !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before {
    margin: 0 !important;
    color: #e4b152 !important;
    font-size: clamp(18px, 1.7vw, 26px) !important;
    font-weight: 540 !important;
    letter-spacing: 0.1em !important;
    line-height: 1 !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-action-grid {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body:not(.game-active) .home-action-card {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: clamp(8px, 1.2vh, 12px) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(38px, 1fr) auto !important;
    justify-items: center !important;
    align-items: center !important;
    border-radius: 12px !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon {
    width: clamp(42px, 4.4vw, 70px) !important;
    height: clamp(42px, 4.4vw, 70px) !important;
    margin: 0 !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) .home-action-card span:last-child {
    min-width: 0 !important;
    max-width: 100% !important;
    text-align: center !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    color: #fff0c4 !important;
    font-size: clamp(12px, 1.1vw, 16px) !important;
    font-weight: 520 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .home-action-card:first-child strong {
    font-size: 0 !important;
  }

  body:not(.game-active) .home-action-card:first-child strong::after {
    content: "Regels" !important;
    font-size: clamp(12px, 1.1vw, 16px) !important;
  }

  body:not(.game-active) .home-action-card small {
    display: none !important;
  }

  body:not(.game-active) .competition-entry {
    grid-area: competition !important;
    display: grid !important;
    grid-template-rows: auto minmax(120px, 1fr) minmax(120px, 1fr) !important;
    gap: clamp(12px, 1.8vh, 18px) !important;
  }

  body:not(.game-active) .competition-entry::before {
    content: "Competitie" !important;
    display: block !important;
  }

  body:not(.game-active) .competition-copy {
    display: none !important;
  }

  body:not(.game-active) .home-highscore {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: clamp(12px, 1.7vh, 18px) !important;
    display: grid !important;
    grid-template-columns: clamp(58px, 5.8vw, 88px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-content: center !important;
    column-gap: clamp(12px, 1.5vw, 20px) !important;
    border-radius: 14px !important;
    background: linear-gradient(90deg, rgba(29, 55, 40, 0.92), rgba(10, 33, 34, 0.82)) !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-row: 1 / -1 !important;
    width: clamp(58px, 5.8vw, 88px) !important;
    height: clamp(58px, 5.8vw, 88px) !important;
    background: url("./assets/vertical-menu/icon-ranglijst.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .home-highscore svg {
    display: none !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    color: #e5b252 !important;
    font-size: clamp(12px, 1.1vw, 16px) !important;
    font-weight: 520 !important;
    letter-spacing: 0.06em !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore strong {
    color: #fff5d8 !important;
    font-size: clamp(19px, 2vw, 30px) !important;
    font-weight: 540 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    color: rgba(255, 236, 198, 0.82) !important;
    font-size: clamp(11px, 1vw, 15px) !important;
    font-weight: 440 !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .online-entry-actions {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body:not(.game-active) .premium-action {
    min-width: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 9px !important;
    display: grid !important;
    grid-template-rows: minmax(38px, 1fr) auto auto !important;
    place-items: center !important;
    gap: 5px !important;
    border-radius: 12px !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: clamp(40px, 4.5vw, 66px) !important;
    height: clamp(40px, 4.5vw, 66px) !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) .premium-action-text,
  body:not(.game-active) #openOnlineButton .premium-action-text::after,
  body:not(.game-active) #openDailyButton .premium-action-text::after,
  body:not(.game-active) #openRankingsButton .premium-action-text::after {
    color: #fff0c4 !important;
    font-size: clamp(11px, 1vw, 15px) !important;
    font-weight: 520 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
  }

  body:not(.game-active) .premium-action small {
    padding: 2px 8px !important;
    font-size: clamp(9px, 0.85vw, 12px) !important;
    font-weight: 520 !important;
    line-height: 1 !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    grid-area: start !important;
    justify-self: center !important;
    align-self: center !important;
    width: min(460px, 42vw) !important;
    height: clamp(64px, 10vh, 92px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: url("./assets/button-start-normal.png") center / contain no-repeat !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    font-size: 0 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::before,
  body:not(.game-active) .start-menu-panel > .start-game-button::after {
    display: none !important;
    content: none !important;
  }
}

/* Browser menu v8: prevent old compact button rules from leaking into desktop. */
@media (min-width: 900px) and (min-height: 560px) {
  body:not(.game-active) .home-options-section .home-action-grid {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(82px, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: stretch !important;
    justify-items: stretch !important;
  }

  body:not(.game-active) .home-options-section .home-action-grid > .home-action-card {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(42px, 1fr) auto !important;
    place-items: center !important;
    gap: 6px !important;
    text-align: center !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-options-section .home-action-card .home-action-icon,
  body:not(.game-active) .home-options-section .home-action-card .home-action-icon svg {
    width: clamp(38px, 4vw, 58px) !important;
    height: clamp(38px, 4vw, 58px) !important;
    flex: 0 0 auto !important;
  }

  body:not(.game-active) .home-options-section .home-action-card span:last-child {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.game-active) .home-options-section .home-action-card strong,
  body:not(.game-active) .home-options-section .home-action-card:first-child strong::after {
    max-width: 100% !important;
    font-size: clamp(10px, 0.92vw, 14px) !important;
    font-weight: 470 !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .competition-entry .premium-action .premium-action-icon svg,
  body:not(.game-active) .competition-entry .premium-action svg {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
  }

  body:not(.game-active) .competition-entry .premium-action .premium-action-icon {
    display: block !important;
    width: clamp(42px, 4.2vw, 62px) !important;
    height: clamp(42px, 4.2vw, 62px) !important;
    margin: 0 auto !important;
    flex: 0 0 auto !important;
  }

  body:not(.game-active) .competition-entry .premium-action .premium-action-text {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-entry #openOnlineButton .premium-action-text::after {
    content: "Online" !important;
  }

  body:not(.game-active) .competition-entry #openDailyButton .premium-action-text::after {
    content: "Dagspel" !important;
  }

  body:not(.game-active) .competition-entry #openRankingsButton .premium-action-text::after {
    content: "Stand" !important;
  }

  body:not(.game-active) .competition-entry #openOnlineButton .premium-action-text::after,
  body:not(.game-active) .competition-entry #openDailyButton .premium-action-text::after,
  body:not(.game-active) .competition-entry #openRankingsButton .premium-action-text::after {
    display: block !important;
    width: 100% !important;
    color: #fff0c4 !important;
    -webkit-text-fill-color: #fff0c4 !important;
    font-size: clamp(10px, 0.9vw, 14px) !important;
    font-weight: 470 !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-transform: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(12px, 1.05vw, 16px) !important;
    font-weight: 470 !important;
    line-height: 1.12 !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    font-size: clamp(8px, 0.72vw, 11px) !important;
    line-height: 1.15 !important;
  }
}

@media (min-width: 900px) and (min-height: 560px) and (max-height: 680px) {
  body:not(.game-active) .start-menu-panel {
    height: calc(100dvh - 28px) !important;
    grid-template-rows: minmax(92px, 118px) minmax(142px, 1fr) minmax(104px, 128px) minmax(58px, 72px) !important;
    gap: 10px 18px !important;
    padding: 14px !important;
  }

  body:not(.game-active) .brand-showcase {
    top: 18px !important;
    width: clamp(270px, 29vw, 410px) !important;
    height: clamp(92px, 20vh, 150px) !important;
  }

  body:not(.game-active) .home-player-section,
  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: 10px !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: none !important;
  }

  body:not(.game-active) .competition-entry {
    grid-template-rows: auto minmax(92px, 1fr) minmax(88px, 1fr) !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    width: min(360px, 36vw) !important;
    height: clamp(48px, 9.5vh, 68px) !important;
  }
}

/* Browser menu v7: clean desktop labels, icons and card text. */
@media (min-width: 900px) and (min-height: 560px) {
  body:not(.game-active) .variant-group {
    grid-template-rows: auto minmax(0, 1fr) !important;
    align-items: stretch !important;
  }

  body:not(.game-active) .variant-group .menu-choice {
    position: relative !important;
    padding: 0 !important;
    isolation: isolate !important;
  }

  body:not(.game-active) .variant-group .menu-choice > span {
    position: absolute !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-height: calc(100% - 20px) !important;
    padding: 10px 10px 9px !important;
    display: grid !important;
    align-content: end !important;
    gap: 4px !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.72)) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    font-size: clamp(13px, 1.18vw, 18px) !important;
    font-weight: 480 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    text-wrap: balance !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    max-height: 2.4em !important;
    font-size: clamp(9px, 0.78vw, 12px) !important;
    font-weight: 400 !important;
    line-height: 1.18 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group {
    gap: 12px !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body:not(.game-active) .level-group .menu-choice > span {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 8px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(229, 183, 91, 0.44) !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, rgba(9, 40, 43, 0.92), rgba(3, 18, 20, 0.94)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 241, 184, 0.12) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group .menu-choice input:checked + span {
    border-color: rgba(255, 207, 88, 0.95) !important;
    background: linear-gradient(180deg, rgba(57, 78, 42, 0.96), rgba(14, 37, 27, 0.96)) !important;
    box-shadow: 0 0 0 1px rgba(255, 210, 89, 0.35), 0 0 18px rgba(238, 190, 82, 0.22) !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    font-size: clamp(12px, 1vw, 15px) !important;
    font-weight: 480 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
  }

  body:not(.game-active) .home-action-card {
    padding: 8px !important;
    gap: 5px !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon {
    width: clamp(38px, 4vw, 62px) !important;
    height: clamp(38px, 4vw, 62px) !important;
  }

  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .home-action-card:first-child strong::after {
    font-size: clamp(11px, 0.95vw, 14px) !important;
    font-weight: 480 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body:not(.game-active) .premium-action svg {
    display: none !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-online.png") !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-daguitdaging.png") !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
  }

  body:not(.game-active) .premium-action-text {
    font-size: 0 !important;
    line-height: 0 !important;
  }

  body:not(.game-active) .premium-action-text::before {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-text::after {
    content: "Online" !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-text::after {
    content: "Dagspel" !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-text::after {
    content: "Stand" !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-text::after,
  body:not(.game-active) #openDailyButton .premium-action-text::after,
  body:not(.game-active) #openRankingsButton .premium-action-text::after {
    display: block !important;
    color: #fff0c4 !important;
    font-size: clamp(11px, 0.95vw, 14px) !important;
    font-weight: 480 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .premium-action small {
    display: block !important;
    width: max-content !important;
    max-width: 100% !important;
    padding: 2px 8px !important;
    font-size: clamp(8px, 0.72vw, 11px) !important;
    font-weight: 480 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* Portrait design v2 final cascade: supplied premium vertical menu wins over older fixes. */
@media (orientation: portrait) {
  body:not(.game-active) .start-menu {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.34) 58%, rgba(0, 0, 0, 0.74)),
      url("./assets/vertical-menu/background-staand.png") center / cover no-repeat !important;
  }

  body:not(.game-active) .start-menu-stage {
    width: min(100vw, 620px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 auto !important;
    padding: max(8px, env(safe-area-inset-top)) clamp(10px, 2.8vw, 18px) max(8px, env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(260px, 41dvh) minmax(0, 1fr) !important;
    gap: clamp(6px, 1dvh, 10px) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: none !important;
  }

  body:not(.game-active) .start-menu-stage::before,
  body:not(.game-active) .start-menu-stage::after,
  body:not(.game-active) .start-menu-panel::before,
  body:not(.game-active) .start-menu-panel::after,
  body:not(.game-active) .start-heading,
  body:not(.game-active) .menu-error {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) .brand-showcase {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
    pointer-events: none !important;
  }

  body:not(.game-active) .brand-showcase img,
  body:not(.game-active) .brand-showcase p {
    display: none !important;
  }

  body:not(.game-active) .brand-showcase::before {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    bottom: clamp(-10px, -1.3dvh, 0px) !important;
    width: min(112vw, 690px) !important;
    height: min(43dvh, 430px) !important;
    max-height: 100% !important;
    transform: translateX(-50%) !important;
    background: url("./assets/vertical-menu/table-menu.png") center bottom / contain no-repeat !important;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.86)) !important;
  }

  body:not(.game-active) .start-menu-panel {
    position: relative !important;
    z-index: 3 !important;
    width: min(100%, 540px) !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows:
      minmax(82px, 1.05fr)
      minmax(78px, 0.92fr)
      minmax(76px, 0.9fr)
      minmax(112px, 1.34fr)
      minmax(58px, 0.72fr) !important;
    gap: clamp(8px, 1.18dvh, 13px) !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .home-player-section {
    display: none !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: clamp(10px, 1.35dvh, 14px) clamp(10px, 2.8vw, 16px) !important;
    border: 1px solid rgba(211, 145, 55, 0.84) !important;
    border-radius: clamp(10px, 2.4vw, 16px) !important;
    background:
      linear-gradient(180deg, rgba(33, 20, 11, 0.82), rgba(9, 7, 5, 0.86)),
      radial-gradient(circle at 50% 0%, rgba(238, 179, 84, 0.11), transparent 56%) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 225, 150, 0.16),
      0 8px 16px rgba(0, 0, 0, 0.36) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .variant-group {
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 2.1vw, 12px) !important;
  }

  body:not(.game-active) .level-group {
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 2.1vw, 12px) !important;
  }

  body:not(.game-active) .home-options-section {
    grid-row: 3 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(7px, 1dvh, 10px) !important;
  }

  body:not(.game-active) .competition-entry {
    grid-row: 4 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.02fr) minmax(82px, 0.68fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: clamp(8px, 2vw, 12px) !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    grid-row: 5 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 clamp(14px, 4vw, 24px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: clamp(10px, 3vw, 16px) !important;
    border: 1px solid rgba(255, 204, 84, 0.9) !important;
    border-radius: clamp(10px, 2.6vw, 16px) !important;
    background:
      linear-gradient(180deg, rgba(28, 112, 30, 0.98), rgba(10, 69, 22, 0.99)),
      radial-gradient(circle at 50% 0%, rgba(255, 242, 154, 0.22), transparent 64%) !important;
    color: #efd194 !important;
    -webkit-text-fill-color: #efd194 !important;
    font-size: clamp(28px, 7.4vw, 45px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.74) !important;
    box-shadow:
      inset 0 2px 0 rgba(255, 238, 157, 0.3),
      inset 0 -4px 0 rgba(0, 41, 11, 0.58),
      0 8px 18px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .variant-group legend,
  body:not(.game-active) .level-group legend,
  body:not(.game-active) .home-options-section h2,
  body:not(.game-active) .competition-entry::before {
    grid-column: 1 / -1 !important;
    position: absolute !important;
    left: clamp(18px, 5vw, 32px) !important;
    top: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 clamp(8px, 2vw, 12px) !important;
    transform: translateY(-52%) !important;
    clip: auto !important;
    overflow: visible !important;
    background: linear-gradient(90deg, rgba(16, 11, 6, 0.94), rgba(33, 22, 10, 0.94)) !important;
    color: #e3a93c !important;
    font-size: clamp(12px, 3vw, 18px) !important;
    font-weight: 560 !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    text-align: left !important;
    border-radius: 999px !important;
  }

  body:not(.game-active) .variant-group legend { font-size: 0 !important; }
  body:not(.game-active) .variant-group legend::after {
    content: "Speelvariant" !important;
    font-size: clamp(12px, 3vw, 18px) !important;
  }

  body:not(.game-active) .level-group legend { font-size: 0 !important; }
  body:not(.game-active) .level-group legend::after {
    content: "AI-niveau" !important;
    font-size: clamp(12px, 3vw, 18px) !important;
  }

  body:not(.game-active) .home-options-section h2 { font-size: 0 !important; }
  body:not(.game-active) .home-options-section h2::after {
    content: "Opties" !important;
    font-size: clamp(12px, 3vw, 18px) !important;
  }

  body:not(.game-active) .competition-entry::before {
    content: "Competitie" !important;
    display: block !important;
  }

  body:not(.game-active) .variant-group .menu-choice,
  body:not(.game-active) .level-group .menu-choice,
  body:not(.game-active) .home-action-card,
  body:not(.game-active) .premium-action,
  body:not(.game-active) .home-highscore,
  body:not(.game-active) .competition-copy {
    position: relative !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    border: 1px solid rgba(208, 137, 48, 0.72) !important;
    border-radius: clamp(8px, 2vw, 13px) !important;
    background:
      linear-gradient(180deg, rgba(45, 28, 13, 0.94), rgba(12, 10, 7, 0.94)),
      radial-gradient(circle at 50% 0%, rgba(241, 198, 103, 0.12), transparent 60%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 226, 156, 0.15), 0 4px 9px rgba(0, 0, 0, 0.34) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body:not(.game-active) .variant-group .menu-choice {
    padding: clamp(8px, 1.2dvh, 12px) clamp(10px, 2.3vw, 15px) !important;
    display: grid !important;
    grid-template-columns: clamp(34px, 8.2vw, 52px) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: clamp(8px, 2vw, 12px) !important;
  }

  body:not(.game-active) .variant-group .menu-choice::before {
    content: "" !important;
    width: clamp(31px, 7.2vw, 46px) !important;
    height: clamp(31px, 7.2vw, 46px) !important;
    justify-self: center !important;
    background: url("./assets/vertical-menu/icon-tafels.png") center / contain no-repeat !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.56)) !important;
  }

  body:not(.game-active) .variant-group .menu-choice:nth-of-type(2)::before {
    background-image: url("./assets/vertical-menu/icon-statistieken.png") !important;
  }

  body:not(.game-active) .variant-group .menu-choice:has(input:checked),
  body:not(.game-active) .level-group .menu-choice:has(input:checked) {
    border-color: rgba(255, 211, 93, 0.96) !important;
    background:
      linear-gradient(180deg, rgba(28, 99, 39, 0.96), rgba(13, 55, 24, 0.96)),
      radial-gradient(circle at 50% 0%, rgba(255, 233, 138, 0.24), transparent 62%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 236, 170, 0.2), 0 0 0 1px rgba(255, 207, 77, 0.36), 0 0 18px rgba(255, 202, 69, 0.2) !important;
  }

  body:not(.game-active) .variant-group .menu-choice input:checked + span,
  body:not(.game-active) .level-group .menu-choice input:checked + span {
    box-shadow: none !important;
  }

  body:not(.game-active) .variant-group .menu-choice span,
  body:not(.game-active) .level-group .menu-choice span {
    min-width: 0 !important;
    padding: 0 !important;
    display: block !important;
    background: none !important;
    text-align: left !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong,
  body:not(.game-active) .level-group .menu-choice strong,
  body:not(.game-active) .home-action-card strong,
  body:not(.game-active) .competition-copy strong,
  body:not(.game-active) .home-highscore strong,
  body:not(.game-active) .premium-action-text {
    color: #fff0c8 !important;
    font-weight: 520 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.74) !important;
  }

  body:not(.game-active) .variant-group .menu-choice strong {
    display: block !important;
    font-size: clamp(12px, 3.1vw, 19px) !important;
    line-height: 1.08 !important;
    white-space: normal !important;
  }

  body:not(.game-active) .variant-group .menu-choice small {
    display: block !important;
    margin-top: 3px !important;
    color: rgba(255, 229, 178, 0.88) !important;
    font-size: clamp(8px, 2.25vw, 13px) !important;
    font-weight: 390 !important;
    line-height: 1.14 !important;
    max-height: 2.35em !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .level-group .menu-choice {
    padding: clamp(7px, 1dvh, 10px) clamp(6px, 1.6vw, 10px) !important;
    display: grid !important;
    grid-template-columns: clamp(24px, 6vw, 38px) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: clamp(5px, 1.2vw, 8px) !important;
  }

  body:not(.game-active) .level-group .menu-choice::before {
    content: "" !important;
    width: clamp(24px, 6vw, 38px) !important;
    height: clamp(24px, 6vw, 38px) !important;
    justify-self: center !important;
    background: url("./assets/vertical-menu/icon-tafels.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(2)::before {
    background-image: url("./assets/vertical-menu/icon-eenvoudig.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice:nth-of-type(3)::before {
    background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
  }

  body:not(.game-active) .level-group .menu-choice strong {
    display: block !important;
    font-size: clamp(11px, 2.85vw, 17px) !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .level-group .menu-choice small {
    display: block !important;
    margin-top: 2px !important;
    max-height: 2.15em !important;
    color: rgba(255, 231, 188, 0.84) !important;
    font-size: clamp(7px, 1.95vw, 11px) !important;
    font-weight: 380 !important;
    line-height: 1.08 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-action-grid {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(8px, 2vw, 12px) !important;
  }

  body:not(.game-active) .home-action-card {
    padding: clamp(7px, 1dvh, 10px) clamp(6px, 1.8vw, 10px) !important;
    display: grid !important;
    grid-template-columns: clamp(28px, 6.5vw, 40px) minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: clamp(5px, 1.4vw, 8px) !important;
    text-align: left !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon {
    width: clamp(28px, 6.5vw, 40px) !important;
    height: clamp(28px, 6.5vw, 40px) !important;
    margin: 0 !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) .home-action-card .home-action-icon svg {
    display: none !important;
  }

  body:not(.game-active) .home-action-card[data-info="rules"] .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-tafels.png") !important;
  }

  body:not(.game-active) #startDemoHomeButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-speel-nu.png") !important;
  }

  body:not(.game-active) #openSettingsButton .home-action-icon {
    background-image: url("./assets/vertical-menu/icon-instellingen.png") !important;
  }

  body:not(.game-active) .home-action-card span:last-child {
    min-width: 0 !important;
  }

  body:not(.game-active) .home-action-card strong {
    display: block !important;
    font-size: clamp(11px, 2.85vw, 17px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-action-card small {
    display: block !important;
    margin-top: 2px !important;
    color: rgba(255, 230, 188, 0.86) !important;
    font-size: clamp(7px, 1.9vw, 11px) !important;
    font-weight: 380 !important;
    line-height: 1.12 !important;
    max-height: 2.25em !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .competition-copy {
    grid-column: 1 !important;
    grid-row: 2 !important;
    height: 100% !important;
    padding: clamp(9px, 1.3dvh, 13px) clamp(8px, 2vw, 12px) !important;
    display: grid !important;
    grid-template-columns: clamp(30px, 7.2vw, 46px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    column-gap: clamp(7px, 1.8vw, 11px) !important;
    align-content: center !important;
  }

  body:not(.game-active) .competition-copy::before {
    content: "" !important;
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    width: clamp(30px, 7.2vw, 46px) !important;
    height: clamp(30px, 7.2vw, 46px) !important;
    align-self: start !important;
    background: url("./assets/vertical-menu/icon-ranglijst.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .competition-copy .online-kicker {
    display: none !important;
  }

  body:not(.game-active) .competition-copy strong {
    grid-column: 2 !important;
    font-size: clamp(12px, 3.05vw, 18px) !important;
    line-height: 1.1 !important;
  }

  body:not(.game-active) .competition-copy p {
    grid-column: 2 !important;
    margin: 3px 0 0 !important;
    color: rgba(255, 230, 187, 0.88) !important;
    font-size: clamp(8px, 2.15vw, 12px) !important;
    font-weight: 380 !important;
    line-height: 1.18 !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .home-highscore {
    grid-column: 2 !important;
    grid-row: 2 !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: clamp(9px, 1.3dvh, 13px) clamp(8px, 2vw, 12px) !important;
    display: grid !important;
    grid-template-columns: clamp(30px, 7.2vw, 46px) minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    column-gap: clamp(7px, 1.8vw, 11px) !important;
    align-content: center !important;
  }

  body:not(.game-active) .home-highscore .home-trophy {
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    width: clamp(30px, 7.2vw, 46px) !important;
    height: clamp(30px, 7.2vw, 46px) !important;
    background: url("./assets/vertical-menu/icon-daguitdaging.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .home-highscore .home-trophy svg,
  body:not(.game-active) .home-highscore::before {
    display: none !important;
    content: none !important;
  }

  body:not(.game-active) .home-highscore .winner-label {
    grid-column: 2 !important;
    color: #e8ae42 !important;
    font-size: clamp(8px, 2.05vw, 12px) !important;
    font-weight: 520 !important;
    line-height: 1.1 !important;
    letter-spacing: 0.035em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore strong {
    grid-column: 2 !important;
    font-size: clamp(13px, 3.45vw, 21px) !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .home-highscore small {
    grid-column: 2 !important;
    color: #e8ae42 !important;
    font-size: clamp(8px, 2.05vw, 12px) !important;
    font-weight: 500 !important;
    line-height: 1.12 !important;
    text-transform: uppercase !important;
    overflow: hidden !important;
  }

  body:not(.game-active) .online-entry-actions {
    grid-column: 3 !important;
    grid-row: 2 !important;
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(5px, 0.75dvh, 8px) !important;
  }

  body:not(.game-active) .premium-action {
    height: 100% !important;
    padding: 0 clamp(5px, 1.5vw, 9px) !important;
    display: grid !important;
    grid-template-columns: clamp(23px, 5.8vw, 34px) minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: clamp(4px, 1.1vw, 7px) !important;
  }

  body:not(.game-active) .premium-action svg {
    display: none !important;
  }

  body:not(.game-active) .premium-action-icon {
    width: clamp(23px, 5.8vw, 34px) !important;
    height: clamp(23px, 5.8vw, 34px) !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }

  body:not(.game-active) #openOnlineButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-online.png") !important;
  }

  body:not(.game-active) #openDailyButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-daguitdaging.png") !important;
  }

  body:not(.game-active) #openRankingsButton .premium-action-icon {
    background-image: url("./assets/vertical-menu/icon-ranglijst.png") !important;
  }

  body:not(.game-active) .premium-action-text {
    display: block !important;
    width: 100% !important;
    font-size: clamp(10px, 2.55vw, 15px) !important;
    line-height: 1.06 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.game-active) .premium-action small {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::before {
    content: "" !important;
    flex: 0 0 auto !important;
    width: clamp(28px, 7vw, 44px) !important;
    height: clamp(28px, 7vw, 44px) !important;
    margin: 0 !important;
    background: url("./assets/vertical-menu/icon-speel-nu.png") center / contain no-repeat !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button::after {
    display: none !important;
    content: none !important;
  }
}

@media (orientation: portrait) and (max-height: 820px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(214px, 37dvh) minmax(0, 1fr) !important;
    padding-top: max(6px, env(safe-area-inset-top)) !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom)) !important;
  }

  body:not(.game-active) .brand-showcase::before {
    height: min(38dvh, 348px) !important;
    width: min(110vw, 620px) !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(68px, 1fr)
      minmax(62px, 0.86fr)
      minmax(58px, 0.78fr)
      minmax(96px, 1.24fr)
      minmax(48px, 0.62fr) !important;
    gap: 6px !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: 9px 10px !important;
  }

  body:not(.game-active) .variant-group .menu-choice small,
  body:not(.game-active) .level-group .menu-choice small,
  body:not(.game-active) .home-action-card small,
  body:not(.game-active) .competition-copy p {
    display: none !important;
  }

  body:not(.game-active) .start-menu-panel > .start-game-button {
    font-size: clamp(22px, 6.2vw, 34px) !important;
  }
}

@media (orientation: portrait) and (max-width: 390px), (orientation: portrait) and (max-height: 720px) {
  body:not(.game-active) .start-menu-stage {
    grid-template-rows: minmax(188px, 34dvh) minmax(0, 1fr) !important;
    padding-inline: 8px !important;
  }

  body:not(.game-active) .start-menu-panel {
    grid-template-rows:
      minmax(60px, 1fr)
      minmax(54px, 0.86fr)
      minmax(52px, 0.82fr)
      minmax(84px, 1.18fr)
      minmax(44px, 0.58fr) !important;
    gap: 5px !important;
  }

  body:not(.game-active) .variant-group,
  body:not(.game-active) .level-group,
  body:not(.game-active) .home-options-section,
  body:not(.game-active) .competition-entry {
    padding: 8px !important;
  }

  body:not(.game-active) .level-group .menu-choice,
  body:not(.game-active) .home-action-card,
  body:not(.game-active) .premium-action {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    text-align: center !important;
  }

  body:not(.game-active) .level-group .menu-choice::before,
  body:not(.game-active) .home-action-icon,
  body:not(.game-active) .premium-action-icon {
    display: none !important;
  }
}
/* Online popup avatar: keep the fallback initial centred like the menu avatar. */
.online-profile .online-profile-player > .online-avatar {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 48px !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.online-profile .online-profile-player > .online-avatar img {
  display: block !important;
  margin: 0 !important;
}
