:root {
  --bg: #f3efe8;
  --bg-soft: #f8f5ef;
  --ink: #2d2a26;
  --ink-mute: #6e655f;
  --card: rgba(252, 249, 242, 0.86);
  --line: rgba(108, 100, 94, 0.22);
  --sage: #009688;
  --sage-dark: #007a70;
  --purple: #9370DB;
  --purple-dark: #7e5fc2;
  --terracotta: #d6846f;
  --mustard: #d9b46e;
  --tile-coral: #ee8a68;
  --tile-coral-dark: #c96f55;
  --tile-cream: #fff8e7;
  --tile-red: #a73d3a;
  --miami-pink: #ef5cb2;
  --miami-teal: #20c9c3;
  --miami-jade: #4fcf7a;
  --miami-lilac: #b96be4;
  --card-meta-blue: #23466f;
  --shadow: 0 12px 34px rgba(73, 61, 50, 0.14);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --button-font: "Merriweather Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

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

/* Covers the page until main.js has decided the first screen, so the game
   never flashes before the sign-in gate. Lifts itself after 8s in case the
   scripts never load. */
body.app-booting::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: #f7f3ea;
  animation: app-boot-timeout 0s 8s forwards;
}

@keyframes app-boot-timeout {
  to {
    visibility: hidden;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: #f7f3ea;
  color: var(--ink);
  font-family: "Merriweather", serif;
  overflow-x: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Merriweather Sans", sans-serif;
  letter-spacing: -0.03em;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  z-index: 0;
  opacity: 0.35;
  filter: blur(2px);
  display: none;
}

.bg-shape-a {
  width: 460px;
  height: 460px;
  background: #e8d8bf;
  top: -180px;
  right: -140px;
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  background: #d8e7de;
  bottom: -130px;
  left: -120px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1300px, 100% - 2rem);
  margin: 0 auto 2rem;
  padding-bottom: 0.8rem;
  display: grid;
  gap: 1rem;
}

.card-surface {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.top-bar {
  position: relative;
  overflow: visible;
  z-index: 80;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0.52rem max(1rem, calc((100vw - 1300px) / 2 + 1rem)) 0.56rem;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 0.95rem;
  background: linear-gradient(135deg, rgba(251, 247, 239, 0.98), rgba(244, 236, 222, 0.96));
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.top-bar::before {
  content: "";
  position: absolute;
  left: -22%;
  right: -22%;
  top: 0;
  height: 48%;
  background: linear-gradient(90deg, rgba(44, 106, 88, 0.14), rgba(218, 181, 110, 0.08), rgba(44, 106, 88, 0.06));
  transform: rotate(-3deg) translateY(-20%);
  pointer-events: none;
}

.top-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(44, 106, 88, 0.16), rgba(132, 112, 88, 0.28), rgba(218, 181, 110, 0.14));
}

.top-bar > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #6f665f;
  font-size: 0.67rem;
  font-weight: 700;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.header-brand-logo {
  display: block;
  width: clamp(255px, 27vw, 380px);
  height: auto;
  max-height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 120, 110, 0.13));
}

.brand-lockup h1 {
  letter-spacing: 0.01em;
  line-height: 1.01;
  font-size: clamp(2.1rem, 3.2vw, 3.35rem);
  color: #23201d;
}

.brand-tagline {
  font-size: 1rem;
  color: #3f6f66;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.2rem;
}

.ribbon-chip {
  margin: 0;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  border: none;
  background: rgba(255, 255, 255, 0.74);
  color: #4b6257;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(95, 126, 112, 0.14);
}

.ribbon-live {
  background: linear-gradient(90deg, rgba(32, 201, 195, 0.22), rgba(32, 201, 195, 0.1));
}

.ribbon-live span {
  color: #0e6f6b;
  margin-left: 0.3rem;
}

.ribbon-step {
  background: linear-gradient(90deg, rgba(239, 92, 178, 0.17), rgba(239, 92, 178, 0.07));
  color: #8d2f66;
}

.ribbon-soft {
  background: linear-gradient(90deg, rgba(217, 180, 110, 0.22), rgba(217, 180, 110, 0.1));
  color: #7a5a2f;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 0.58rem;
  align-self: center;
}

.status-pill {
  min-width: 84px;
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.44rem 0.58rem;
  display: grid;
  gap: 0.12rem;
  justify-items: start;
  box-shadow: inset 0 0 0 1px rgba(93, 84, 78, 0.13);
}

.status-pill > p:last-child {
  font-family: "Merriweather Sans", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #2f2a26;
}

.label {
  color: #6e655f;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.top-cta {
  align-self: center;
  justify-self: end;
  padding: 0.72rem 1.22rem;
  font-size: 0.95rem;
  box-shadow: 0 8px 15px rgba(45, 92, 76, 0.18);
}

.top-actions {
  align-self: center;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.46rem, 0.9vw, 0.82rem);
  padding: 0;
}

.top-nav-tab {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #586560;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: clamp(0.78rem, 0.9vw, 0.92rem);
  font-weight: 900;
  white-space: nowrap;
  padding: 0.42rem 0.14rem;
  transition: color 140ms ease, transform 140ms ease;
}

.top-nav-tab:hover {
  color: var(--sage-dark);
  transform: translateY(-1px);
}

.top-nav-tab.active {
  color: var(--ink);
}

.top-nav-tab.active::after {
  content: "";
  position: absolute;
  left: 0.12rem;
  right: 0.12rem;
  bottom: 0.12rem;
  height: 0.16rem;
  border-radius: 999px;
  background: var(--sage);
}

.top-nav-action {
  margin-left: 0;
  border-radius: 999px;
  padding: 0.48rem 0.92rem;
  color: #ffffff;
  background: linear-gradient(180deg, var(--sage) 0%, var(--sage-dark) 100%);
  box-shadow: 0 10px 18px rgba(0, 120, 110, 0.18);
}

.top-nav-action:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 120, 110, 0.22);
}

a.top-nav-tab,
a.mahjong-101-close,
a.mahjong-101-finale-btn,
a.support-modal-close,
a.support-modal-skip-btn,
a.profile-support-link {
  text-decoration: none;
}

.support-page-shell {
  width: min(1080px, 100%);
}

/* The support card is already a complete modal surface. When it is shown in
   the in-app overlay, let the game backdrop show around that card instead of
   drawing a second page-sized panel behind it. */
.support-page-body.page-embedded {
  background: transparent;
}

.support-page-body.page-embedded::before {
  display: none;
}

.support-page-status {
  margin: 0;
  color: #385f61;
  font-weight: 700;
}

.top-nav-support {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--sage-dark);
}

.top-nav-support span[aria-hidden="true"] {
  color: var(--tile-red);
  font-size: 1.06em;
  line-height: 1;
}

.return-to-game-btn {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  border: 1px solid rgba(0, 119, 111, 0.3);
  border-radius: 999px;
  padding: 0.48rem 0.82rem;
  color: #fffdf8;
  background: linear-gradient(180deg, rgba(0, 150, 136, 0.95), rgba(0, 119, 111, 0.96));
  box-shadow: 0 10px 18px rgba(0, 120, 110, 0.18);
  cursor: pointer;
  font-family: var(--button-font);
  font-size: clamp(0.76rem, 0.86vw, 0.88rem);
  font-weight: 900;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.return-to-game-btn:hover,
.return-to-game-btn:focus-visible {
  background: linear-gradient(180deg, rgba(0, 137, 124, 0.98), rgba(0, 107, 100, 0.98));
  box-shadow: 0 12px 22px rgba(0, 120, 110, 0.23);
  transform: translateY(-1px);
}

.return-to-game-btn span[aria-hidden="true"] {
  font-size: 1.06em;
  line-height: 1;
}

.learn-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.learn-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.22rem;
  pointer-events: auto;
}

.learn-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.learn-dropdown {
  position: absolute;
  top: calc(100% + 0.16rem);
  right: 0;
  z-index: 130;
  min-width: 13.2rem;
  display: grid;
  gap: 0.32rem;
  padding: 0.46rem;
  border: 1px solid rgba(0, 119, 111, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 16px 34px rgba(77, 92, 94, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.3rem);
  transition: opacity 150ms ease, transform 150ms ease;
}

.learn-menu.open .learn-dropdown,
.learn-menu:hover .learn-dropdown,
.learn-menu:focus-within .learn-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.learn-menu.open .account-caret,
.learn-menu:hover .account-caret,
.learn-menu:focus-within .account-caret {
  color: var(--sage-dark);
  transform: translateY(-0.02rem) rotate(180deg);
}

.learn-menu-btn {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #385f61;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: left;
  padding: 0.52rem 0.68rem;
}

a.learn-menu-btn {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  text-decoration: none;
}

.learn-menu-btn:hover,
.learn-menu-btn:focus-visible {
  background: rgba(0, 150, 136, 0.09);
  color: var(--sage-dark);
  outline: none;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.52rem, 1.1vw, 0.94rem);
  min-width: 0;
}

.account-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.account-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: max(100%, 11.25rem);
  height: 0.62rem;
}

.account-summary-btn,
.account-menu-btn {
  border: 1px solid rgba(0, 119, 111, 0.18);
  background: rgba(255, 253, 248, 0.72);
  color: #385f61;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.account-summary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: auto;
  min-width: 0;
  padding: 0.42rem 0.14rem;
  border: 0;
  border-radius: 0;
  color: #586560;
  background: transparent;
  box-shadow: none;
  transition: transform 140ms ease, color 140ms ease;
}

.account-summary-btn:hover,
.account-summary-btn:focus-visible {
  color: var(--sage-dark);
  background: transparent;
  box-shadow: none;
  transform: translateY(-1px);
}

.signout-btn {
  min-width: 0;
  min-height: auto;
  padding: 0.42rem 0.14rem;
  border: 0;
  border-radius: 0;
  color: #586560;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 140ms ease, color 140ms ease;
}

.signout-btn:hover,
.signout-btn:focus-visible {
  color: var(--sage-dark);
  background: transparent;
  box-shadow: none;
  transform: translateY(-1px);
}

.account-avatar-mini {
  width: 1.38rem;
  aspect-ratio: 1;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fffdf8;
  background: var(--sage);
  font-size: 0.68rem;
}

.account-caret {
  display: inline-block;
  color: #7b8b85;
  font-size: 0.84em;
  line-height: 1;
  transform: translateY(-0.02rem);
  transition: transform 140ms ease, color 140ms ease;
}

.account-menu.open .account-caret,
.account-menu:focus-within .account-caret,
.account-menu:hover .account-caret {
  color: var(--sage-dark);
  transform: translateY(-0.02rem) rotate(180deg);
}

.account-menu-btn {
  min-height: 2.1rem;
  padding: 0.46rem 0.68rem;
  border-radius: 8px;
  text-align: left;
}

.account-menu-btn-muted {
  color: #6b625c;
  background: rgba(255, 255, 255, 0.5);
}

.account-menu-btn[aria-disabled="true"] {
  opacity: 0.78;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 120;
  min-width: 11.25rem;
  display: grid;
  gap: 0.32rem;
  padding: 0.46rem;
  border: 1px solid rgba(0, 119, 111, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 16px 34px rgba(77, 92, 94, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.3rem);
  transition: opacity 150ms ease, transform 150ms ease;
}

.account-menu.open .account-dropdown,
.account-menu:hover .account-dropdown,
.account-menu:focus-within .account-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.account-dropdown .account-menu-btn {
  width: 100%;
  border-radius: 8px;
  background: transparent;
  border-color: transparent;
}

.account-dropdown .account-menu-btn:hover,
.account-dropdown .account-menu-btn:focus-visible {
  background: rgba(0, 150, 136, 0.09);
  color: var(--sage-dark);
}

.profile-tab-btn {
  padding: 0.68rem 1rem;
  font-size: 0.88rem;
  color: #ffffff;
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-dark) 100%);
}

.app-view.hidden {
  display: none !important;
}

.tab-view {
  min-height: min(640px, calc(100vh - 180px));
  padding: clamp(1rem, 2.2vw, 1.6rem);
  display: grid;
  align-content: start;
  gap: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.94), rgba(246, 251, 251, 0.9)),
    var(--card);
}

.tab-view-copy {
  display: grid;
  gap: 0.28rem;
  max-width: 760px;
}

.tab-view-copy h2 {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.profile-page-stats {
  max-width: 720px;
}

.profile-page-stats span {
  padding: 0.6rem 0.78rem;
  font-size: 0.92rem;
}

.profile-view {
  gap: clamp(1rem, 2vw, 1.35rem);
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(246, 251, 251, 0.92)),
    var(--card);
}

.profile-page-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.profile-page-copy {
  max-width: 680px;
}

.profile-page-copy h2 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  letter-spacing: 0;
}

.profile-dashboard {
  display: grid;
  gap: 0.78rem;
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(280px, 0.68fr);
  gap: 0.78rem;
}

.profile-identity-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(108, 100, 94, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 28px rgba(77, 92, 94, 0.08);
}

.profile-avatar-wrap {
  display: grid;
  justify-items: center;
  gap: 0.34rem;
}

.profile-avatar {
  width: 5.2rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(0, 150, 136, 0.18), rgba(150, 106, 220, 0.16)),
    rgba(255, 255, 255, 0.88);
  color: var(--teal-deep);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 121, 107, 0.16);
}

.profile-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: #006f67;
  font-family: var(--button-font);
  font-size: 0.7rem;
  font-weight: 900;
}

.profile-status-dot::before {
  content: "";
  width: 0.42rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.13);
}

.profile-identity-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
}

.profile-identity-fields div {
  min-width: 0;
}

.profile-identity-fields span {
  display: block;
  color: #48645f;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-identity-fields strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.05;
}

.profile-identity-fields p {
  margin: 0;
  color: #63716b;
  font-size: 0.88rem;
  font-weight: 700;
}

.profile-account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.48rem;
}

.profile-account-actions button,
.profile-support-link {
  min-height: 2.2rem;
  border: 1px solid rgba(0, 119, 111, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  color: #385f61;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.profile-account-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.54rem 0.85rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.profile-account-actions button:not([aria-disabled="true"]):hover,
.profile-account-actions button:not([aria-disabled="true"]):focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 119, 111, 0.14);
}

.profile-action-primary {
  background: var(--sage) !important;
  border-color: rgba(0, 119, 111, 0.36) !important;
  color: #fffdf8 !important;
  box-shadow: 0 10px 18px rgba(0, 119, 111, 0.12);
}

.profile-action-secondary {
  background: rgba(255, 253, 248, 0.58) !important;
  border-color: rgba(122, 111, 105, 0.2) !important;
  color: #655f5b !important;
}

.profile-support-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.78rem, 2vw, 1.2rem);
  padding: clamp(0.82rem, 1.8vw, 1.12rem);
  border: 1px solid rgba(0, 150, 136, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 7% 18%, rgba(0, 150, 136, 0.18), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(147, 112, 219, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.86), rgba(247, 253, 255, 0.86)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 28px rgba(77, 92, 94, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.profile-support-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(12rem, 22vw, 19rem);
  min-height: 7.8rem;
  padding: 0.7rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 42% 30%, rgba(255, 253, 248, 0.94), transparent 42%),
    linear-gradient(145deg, rgba(0, 150, 136, 0.13), rgba(147, 112, 219, 0.1)),
    rgba(255, 253, 248, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.16),
    0 16px 26px rgba(0, 92, 86, 0.08);
}

.profile-support-visual img {
  position: relative;
  z-index: 1;
  width: 94%;
  height: auto;
}

.profile-support-copy {
  min-width: 0;
}

.profile-support-copy span,
.profile-support-copy strong {
  display: block;
}

.profile-support-copy span {
  color: #006f67;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-support-copy strong {
  margin-top: 0.28rem;
  color: var(--ink);
  font-family: var(--button-font);
  font-size: clamp(1.18rem, 2.2vw, 1.58rem);
  line-height: 1;
}

.profile-support-copy p {
  margin: 0.42rem 0 0;
  color: #56645f;
  font-size: clamp(0.86rem, 1.2vw, 0.98rem);
  font-weight: 700;
  line-height: 1.34;
}

.profile-support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  justify-self: start;
  padding: 0.52rem 0.86rem;
  color: #fffdf8;
  background: var(--sage);
  border-color: rgba(0, 119, 111, 0.34);
  box-shadow: 0 10px 20px rgba(0, 119, 111, 0.12);
  white-space: nowrap;
}

.profile-support-link-icon {
  width: 1.05rem;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 0.28rem 0.28rem 0.48rem 0.48rem;
  position: relative;
}

.profile-support-link-icon::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  right: -0.38rem;
  width: 0.36rem;
  height: 0.46rem;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.profile-support-link-disabled {
  opacity: 0.72;
}

.profile-account-actions button[aria-disabled="true"] {
  opacity: 0.78;
  cursor: default;
}

.profile-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-metric-card,
.profile-detail-grid article {
  border: 1px solid rgba(108, 100, 94, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 28px rgba(77, 92, 94, 0.08);
}

.profile-metric-card {
  min-height: 8.8rem;
  padding: 0.85rem;
  display: grid;
  align-content: space-between;
  gap: 0.65rem;
}

.profile-metric-card.primary {
  background:
    linear-gradient(145deg, rgba(0, 150, 136, 0.14), rgba(255, 255, 255, 0.86)),
    rgba(255, 255, 255, 0.82);
}

.profile-card-progress {
  display: grid;
  gap: 0.42rem;
}

.profile-card-progress-track {
  width: 100%;
  height: 0.54rem;
  border: 1px solid rgba(0, 119, 111, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  overflow: hidden;
}

.profile-card-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #008577, #8f68d8);
}

.profile-metric-card span,
.profile-detail-grid span {
  color: #48645f;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-metric-card strong {
  color: var(--ink);
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0;
}

.profile-metric-card p,
.profile-detail-grid p {
  margin: 0;
  color: #56645f;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.28;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-detail-grid article {
  padding: 0.74rem 0.82rem;
  display: grid;
  gap: 0.18rem;
}

.profile-metric-grid-quiet {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.profile-points-card {
  grid-column: span 2;
  gap: 0.78rem;
}

.profile-streak-card {
  background:
    linear-gradient(145deg, rgba(218, 165, 32, 0.1), rgba(255, 255, 255, 0.84)),
    rgba(255, 255, 255, 0.78);
}

.profile-points-breakdown {
  display: grid;
  gap: 0.38rem;
}

.profile-points-breakdown p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.38rem;
  border-top: 1px solid rgba(0, 119, 111, 0.15);
}

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

.profile-points-breakdown strong {
  font-size: 1.3rem;
  line-height: 1;
}

.profile-recent-card {
  border: 1px solid rgba(108, 100, 94, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  padding: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.profile-recent-card h3 {
  font-size: 1rem;
  letter-spacing: 0;
}

.profile-recent-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.42rem;
}

.profile-recent-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  border-top: 1px solid rgba(108, 100, 94, 0.12);
  padding-top: 0.42rem;
  color: #4f5f5c;
  font-size: 0.86rem;
  font-weight: 750;
}

.profile-recent-card li:first-child {
  border-top: 0;
  padding-top: 0;
}

.profile-recent-card li span {
  color: #61706a;
  white-space: nowrap;
}

.profile-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.78rem;
}

@media (max-width: 980px) {
  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .account-menu {
    padding-left: 0;
    border-left: 0;
  }

  .account-dropdown .account-menu-btn {
    display: block;
  }

  .profile-overview-grid,
  .profile-lower-grid {
    grid-template-columns: 1fr;
  }

  .profile-support-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

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

  .profile-identity-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .assist-mode-grid {
    grid-template-columns: 1fr;
  }

  .profile-page-hero {
    align-items: start;
  }

  .profile-metric-grid,
  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-identity-card {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-support-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-support-link {
    grid-column: 2;
  }

  .profile-account-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .profile-avatar {
    width: 4.4rem;
    font-size: 1.45rem;
  }

  .profile-metric-card {
    min-height: 7.8rem;
  }

  .profile-points-card {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .profile-identity-card {
    grid-template-columns: 1fr;
  }

  .profile-support-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .profile-support-link {
    grid-column: auto;
  }

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

/* My Table profile dashboard */
.profile-view {
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(0, 150, 136, 0.07), transparent 22rem),
    radial-gradient(circle at 88% 82%, rgba(147, 112, 219, 0.08), transparent 24rem),
    linear-gradient(rgba(94, 64, 37, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 64, 37, 0.034) 1px, transparent 1px),
    #fffaf3;
  background-size: auto, auto, 88px 88px, 88px 88px, auto;
  box-shadow: none;
}

.profile-dashboard {
  width: min(100%, 1500px);
  margin: 0 auto;
  display: grid;
  gap: clamp(0.78rem, 1.15vw, 1.05rem);
}

.profile-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  gap: clamp(0.78rem, 1.15vw, 1.05rem);
}

.profile-page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(420px, 0.88fr);
  gap: clamp(0.78rem, 1.15vw, 1.05rem);
}

.profile-identity-card,
.profile-next-step-card,
.profile-support-card,
.profile-metric-card,
.profile-progress-band,
.profile-detail-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(108, 88, 61, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 10%, rgba(0, 150, 136, 0.07), transparent 17rem),
    rgba(255, 253, 248, 0.82);
  box-shadow:
    0 18px 34px rgba(66, 50, 34, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.profile-next-step-card {
  min-height: clamp(14.8rem, 16.8vw, 17.6rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(0.9rem, 1.7vw, 1.4rem);
  padding: clamp(1.2rem, 2vw, 1.85rem);
  border-color: rgba(0, 150, 136, 0.24);
  background:
    radial-gradient(circle at 87% 14%, rgba(147, 112, 219, 0.12), transparent 14rem),
    radial-gradient(circle at 12% 90%, rgba(0, 150, 136, 0.13), transparent 13rem),
    rgba(255, 253, 248, 0.86);
}

.profile-next-step-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.72rem;
  max-width: 37rem;
}

.profile-next-step-copy strong {
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(2rem, 3.2vw, 3.35rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0;
}

.profile-next-step-copy .profile-snapshot-list strong {
  font-family: var(--button-font);
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  line-height: 1.12;
}

.profile-next-step-copy p {
  max-width: 34rem;
  margin: 0;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.98rem, 1.15vw, 1.12rem);
  line-height: 1.45;
}

.profile-next-step-copy .profile-snapshot-list p {
  max-width: none;
  padding: 0.54rem 0.62rem;
  font-family: var(--button-font);
  line-height: 1.1;
}

.profile-next-step-meta {
  width: fit-content;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(0, 150, 136, 0.22);
  border-radius: 999px;
  color: #006f67;
  background: rgba(239, 252, 250, 0.78);
  font-family: var(--button-font);
  font-size: 0.82rem;
  font-weight: 900;
}

.profile-next-step-card .profile-action-btn {
  position: relative;
  z-index: 2;
  justify-self: end;
  white-space: nowrap;
}

.profile-snapshot-card {
  grid-template-columns: clamp(5.2rem, 7vw, 6.6rem) minmax(0, 1fr);
  grid-template-areas:
    "avatar copy"
    "avatar action";
  align-items: center;
  column-gap: clamp(0.95rem, 1.7vw, 1.35rem);
  row-gap: 0.72rem;
}

.profile-snapshot-avatar {
  grid-area: avatar;
  width: clamp(5.2rem, 7vw, 6.6rem);
  border-radius: 18px;
  font-size: clamp(2rem, 3vw, 2.85rem);
}

.profile-snapshot-copy {
  grid-area: copy;
  max-width: none;
}

.profile-snapshot-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.34rem;
  max-width: 32rem;
}

.profile-snapshot-list p {
  display: grid;
  grid-template-columns: minmax(6.6rem, 0.42fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.7rem;
  margin: 0;
  padding: 0.18rem 0;
  border: 0;
  border-bottom: 1px solid rgba(108, 88, 61, 0.11);
  background: transparent;
  font-family: var(--button-font);
  line-height: 1.2;
}

.profile-snapshot-list p:last-child {
  border-bottom: 0;
}

.profile-snapshot-list span {
  display: inline;
  margin: 0;
  color: #6c6258;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-snapshot-list strong {
  display: block;
  overflow-wrap: anywhere;
  color: #242424;
  font-family: var(--button-font);
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  font-weight: 900;
  line-height: 1.12;
}

.profile-snapshot-action {
  grid-area: action;
  justify-self: start;
  min-height: 2.55rem;
  min-width: 9.4rem;
  border-radius: 999px;
  padding: 0.5rem 0.94rem;
  color: #ffffff !important;
  background: linear-gradient(180deg, var(--sage) 0%, var(--sage-dark) 100%) !important;
  border-color: rgba(0, 119, 111, 0.34) !important;
  box-shadow: 0 10px 18px rgba(0, 120, 110, 0.18);
}

.profile-next-step-art {
  position: absolute;
  right: clamp(1rem, 2vw, 1.7rem);
  top: clamp(0.8rem, 1.7vw, 1.35rem);
  display: flex;
  align-items: flex-end;
  gap: 0.42rem;
  opacity: 0.22;
  pointer-events: none;
}

.profile-next-step-art img {
  width: clamp(3.6rem, 5.5vw, 5rem);
  filter: drop-shadow(0 12px 10px rgba(64, 43, 24, 0.12));
}

.profile-next-step-art img:first-child {
  transform: rotate(-8deg) translateY(0.25rem);
}

.profile-next-step-art img:last-child {
  transform: rotate(8deg);
}

.profile-identity-card {
  min-height: clamp(14.8rem, 16.8vw, 17.6rem);
  display: grid;
  grid-template-columns: clamp(8.2rem, 12.5vw, 11rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.15rem, 2.25vw, 2.3rem);
  padding: clamp(1.15rem, 2vw, 1.85rem);
}

.profile-card-ghost-tiles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.profile-card-ghost-tiles img {
  position: absolute;
  width: clamp(3.5rem, 5.5vw, 5.1rem);
  opacity: 0.16;
  filter: saturate(0.9);
}

.profile-card-ghost-tiles img:nth-child(1) {
  left: -0.35rem;
  top: 24%;
  transform: rotate(-14deg);
}

.profile-card-ghost-tiles img:nth-child(2) {
  left: 4.2rem;
  bottom: 7%;
  transform: rotate(13deg);
}

.profile-card-ghost-tiles img:nth-child(3) {
  right: 10%;
  top: 13%;
  transform: rotate(9deg);
}

.profile-card-ghost-tiles img:nth-child(4) {
  left: 32%;
  top: 8%;
  transform: rotate(-8deg);
}

.profile-card-ghost-tiles img:nth-child(5) {
  right: 24%;
  bottom: 11%;
  transform: rotate(11deg);
}

.profile-avatar-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.profile-avatar {
  width: clamp(7rem, 10.3vw, 9.4rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #242424;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.86), transparent 34%),
    linear-gradient(145deg, rgba(0, 150, 136, 0.12), rgba(147, 112, 219, 0.26)),
    #f7fbfb;
  border: 1px solid rgba(0, 150, 136, 0.18);
  box-shadow: 0 20px 28px rgba(62, 50, 34, 0.14);
  font-family: var(--button-font);
  font-size: clamp(2.55rem, 4.2vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 0;
}

.profile-identity-fields {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.68rem;
  min-width: 0;
}

.profile-card-kicker,
.profile-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: #0b6f6d;
  font-family: var(--button-font);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
}

.profile-card-kicker svg,
.profile-metric-label svg,
.profile-action-btn svg,
.profile-support-link svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.profile-purple-label {
  color: var(--purple);
}

.profile-identity-fields span:not(.profile-card-kicker):not(.profile-status-dot) {
  display: block;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.9rem, 1.2vw, 1.08rem);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.profile-identity-fields strong {
  display: block;
  overflow-wrap: anywhere;
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(2.6rem, 4.65vw, 4.35rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.98;
}

.profile-identity-fields p {
  margin: 0;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.9rem, 1.08vw, 1.02rem);
  line-height: 1.4;
}

.profile-card-rule {
  height: 1px;
  background: rgba(108, 88, 61, 0.18);
}

.profile-identity-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #242424;
  font-family: var(--button-font);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.profile-status-dot::before {
  content: "";
  width: 0.72rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 5px rgba(0, 150, 136, 0.13);
}

.profile-account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
}

.profile-action-btn {
  min-height: 3rem;
  min-width: 8.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 12px;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(0, 119, 111, 0.28);
  background: rgba(255, 253, 248, 0.82);
  color: #242424;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.92rem;
  font-weight: 900;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.profile-action-btn:not([aria-disabled="true"]):hover,
.profile-action-btn:not([aria-disabled="true"]):focus-visible,
.profile-support-link:not([aria-disabled="true"]):hover,
.profile-support-link:not([aria-disabled="true"]):focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 119, 111, 0.18);
}

.profile-action-primary {
  color: #fffdf8 !important;
  background: linear-gradient(180deg, #009688, #007a70) !important;
  border-color: rgba(0, 119, 111, 0.36) !important;
}

.profile-action-secondary {
  color: #242424 !important;
  background: rgba(255, 253, 248, 0.82) !important;
  border-color: rgba(0, 119, 111, 0.34) !important;
}

.profile-support-card {
  min-height: clamp(14.8rem, 16.8vw, 17.6rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.9fr);
  grid-template-rows: 1fr auto;
  gap: 0.8rem 1rem;
  padding: clamp(1.1rem, 1.65vw, 1.55rem);
  border-color: rgba(0, 150, 136, 0.22);
  background:
    radial-gradient(circle at 92% 80%, rgba(0, 150, 136, 0.11), transparent 14rem),
    radial-gradient(circle at 68% 18%, rgba(147, 112, 219, 0.08), transparent 15rem),
    rgba(246, 253, 252, 0.78);
}

.profile-support-copy {
  min-width: 0;
  align-self: start;
}

.profile-support-copy span {
  display: block;
  color: #0b6f6d;
  font-family: var(--button-font);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-support-copy strong {
  display: block;
  margin-top: 0.5rem;
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(1.55rem, 2.05vw, 2.12rem);
  font-weight: 700;
  line-height: 1.05;
}

.profile-support-copy p {
  width: min(100%, 23rem);
  margin: 0.78rem 0 0;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.88rem, 1vw, 0.98rem);
  line-height: 1.42;
}

.profile-support-visual {
  position: relative;
  align-self: center;
  justify-self: end;
  display: grid;
  place-items: center;
  width: min(100%, 20rem);
  min-height: 8.8rem;
  padding: 0.72rem;
}

.profile-support-logo {
  width: min(100%, 18.5rem);
  height: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 92, 86, 0.12));
}

.profile-support-link {
  grid-column: 1;
  align-self: end;
  justify-self: start;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 12px;
  padding: 0.72rem 1.15rem;
  color: #fffdf8;
  background: linear-gradient(180deg, #009688, #007a70);
  border: 1px solid rgba(0, 119, 111, 0.34);
  box-shadow: 0 12px 22px rgba(0, 119, 111, 0.15);
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
}

.profile-support-link svg {
  fill: none;
}

.profile-support-link-disabled {
  opacity: 1;
  cursor: default;
}

.profile-metric-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 1.6fr) repeat(4, minmax(12rem, 1fr));
  gap: clamp(0.72rem, 1.05vw, 0.95rem);
}

.profile-metric-card {
  min-height: 11.3rem;
  padding: clamp(1rem, 1.35vw, 1.25rem);
  display: grid;
  align-content: start;
  gap: 0.78rem;
}

.profile-metric-card.primary {
  color: #fffdf8;
  border-color: rgba(0, 119, 111, 0.18);
  background:
    radial-gradient(circle at 70% 78%, rgba(255, 255, 255, 0.1), transparent 10rem),
    linear-gradient(145deg, #008f83, #006f67);
}

.profile-points-card {
  grid-column: auto;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.profile-points-card > .profile-metric-label,
.profile-points-card > strong {
  padding-inline: clamp(1rem, 1.35vw, 1.25rem);
}

.profile-points-card > .profile-metric-label {
  padding-top: 1.35rem;
  color: #fffdf8;
}

.profile-points-card > strong {
  padding-bottom: 1rem;
  color: #fffdf8;
}

.profile-metric-card .profile-metric-label {
  color: #0b6f6d;
}

.profile-metric-card strong,
.profile-detail-card strong {
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(2.35rem, 3.25vw, 3.35rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

.profile-points-card > strong {
  font-size: clamp(3rem, 4.4vw, 4.45rem);
}

.profile-metric-card p,
.profile-detail-card p {
  margin: 0;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.84rem, 0.98vw, 0.94rem);
  line-height: 1.35;
}

.profile-points-breakdown {
  display: grid;
  gap: 0;
  margin-top: auto;
  padding: 0.85rem clamp(1.25rem, 1.7vw, 1.55rem);
  background: rgba(255, 253, 248, 0.96);
}

.profile-points-breakdown p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.52rem 0;
  border-top: 1px solid rgba(108, 88, 61, 0.16);
}

.profile-points-breakdown p:first-child {
  border-top: 0;
}

.profile-points-breakdown span {
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.profile-points-breakdown strong {
  color: #242424;
  font-size: 1.4rem;
  line-height: 1;
}

.profile-card-progress {
  display: grid;
  gap: 0.62rem;
}

.profile-card-progress-track {
  position: relative;
  width: 100%;
  height: 0.62rem;
  border: 1px solid rgba(147, 112, 219, 0.2);
  border-radius: 999px;
  background: rgba(94, 64, 37, 0.08);
  overflow: hidden;
}

.profile-card-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
}

.profile-progress-band {
  display: grid;
  grid-template-columns: minmax(13rem, 0.9fr) minmax(11rem, 0.62fr) minmax(11rem, 0.68fr) minmax(21rem, 1fr);
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  min-height: 11.4rem;
  padding: clamp(1.15rem, 1.9vw, 1.7rem);
  background:
    linear-gradient(90deg, rgba(255, 253, 248, 0.96), rgba(255, 253, 248, 0.84)),
    rgba(255, 253, 248, 0.9);
}

.profile-progress-heading,
.profile-progress-stat,
.profile-progress-mastery {
  position: relative;
  min-width: 0;
}

.profile-progress-heading {
  display: grid;
  gap: 0.36rem;
}

.profile-progress-heading strong {
  color: #00786f;
  font-family: "Merriweather", serif;
  font-size: clamp(3.25rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 0.9;
}

.profile-progress-heading p,
.profile-progress-stat p,
.profile-progress-mastery p {
  margin: 0;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.96rem, 1.1vw, 1.08rem);
  line-height: 1.35;
}

.profile-progress-stat {
  min-height: 5.2rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  padding-left: clamp(0.9rem, 1.5vw, 1.45rem);
  border-left: 1px solid rgba(108, 88, 61, 0.16);
}

.profile-progress-stat strong {
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(1.8rem, 2.7vw, 3rem);
  line-height: 1;
}

.profile-progress-icon,
.profile-progress-tile {
  display: grid;
  place-items: center;
  width: clamp(3.6rem, 4.8vw, 4.7rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.72), transparent 32%),
    rgba(147, 112, 219, 0.13);
  color: rgba(52, 92, 89, 0.45);
  font-family: var(--button-font);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 900;
}

.profile-progress-tile {
  border-radius: 18px;
  background: rgba(0, 150, 136, 0.1);
}

.profile-progress-tile img {
  width: 62%;
  filter: drop-shadow(0 8px 7px rgba(64, 43, 24, 0.12));
}

.profile-progress-mastery {
  display: grid;
  gap: 0.55rem;
  padding-left: clamp(0.9rem, 1.5vw, 1.45rem);
  border-left: 1px solid rgba(108, 88, 61, 0.16);
}

.profile-progress-mastery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.profile-progress-mastery-head strong {
  color: #00786f;
  font-family: "Merriweather", serif;
  font-size: clamp(1.7rem, 2.7vw, 2.8rem);
  line-height: 1;
}

.profile-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.76fr);
  gap: clamp(0.78rem, 1.15vw, 1.05rem);
}

.profile-unlock-card {
  align-content: start;
  gap: 1rem;
}

.profile-unlock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.72rem, 1vw, 0.95rem);
}

.profile-unlock-item {
  position: relative;
  display: grid;
  gap: 0.5rem;
  min-height: 10.4rem;
  padding: clamp(0.9rem, 1.2vw, 1.05rem);
  border: 1px solid rgba(108, 88, 61, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 20%, rgba(147, 112, 219, 0.12), transparent 6rem),
    rgba(255, 253, 248, 0.72);
}

.profile-unlock-icon {
  width: 4.25rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 34%, rgba(147, 112, 219, 0.62) 35% 40%, transparent 41%),
    rgba(147, 112, 219, 0.14);
}

.profile-unlock-icon.streak {
  background:
    radial-gradient(circle at 50% 36%, rgba(147, 112, 219, 0.68) 0 16%, transparent 17%),
    linear-gradient(145deg, rgba(147, 112, 219, 0.16), rgba(0, 150, 136, 0.08));
  clip-path: polygon(50% 0, 69% 32%, 100% 38%, 76% 62%, 81% 100%, 50% 80%, 19% 100%, 24% 62%, 0 38%, 31% 32%);
}

.profile-unlock-icon.wall {
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(147, 112, 219, 0.58) 0 18%, transparent 18% 28%, rgba(147, 112, 219, 0.58) 28% 46%, transparent 46% 56%, rgba(147, 112, 219, 0.58) 56% 74%, transparent 74% 84%, rgba(147, 112, 219, 0.58) 84%),
    rgba(147, 112, 219, 0.12);
}

.profile-unlock-item strong {
  color: #00786f;
  font-family: "Merriweather", serif;
  font-size: clamp(1.35rem, 1.8vw, 1.85rem);
  font-weight: 700;
  line-height: 1.05;
}

.profile-unlock-item p,
.profile-unlock-item small,
.profile-unlock-note {
  margin: 0;
  color: #504a45;
  font-family: "Merriweather", serif;
  line-height: 1.38;
}

.profile-unlock-item p {
  font-size: 1rem;
  font-weight: 700;
}

.profile-unlock-item small {
  color: #6b625b;
  font-size: 0.86rem;
}

.profile-unlock-note {
  justify-self: center;
  color: #6b625b;
  font-size: 0.98rem;
  text-align: center;
}

.profile-activity-summary-card {
  min-height: 16rem;
  align-content: start;
  background:
    radial-gradient(circle at 92% 80%, rgba(147, 112, 219, 0.12), transparent 10rem),
    rgba(255, 253, 248, 0.82);
}

.profile-table-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.72fr);
  gap: clamp(0.78rem, 1.12vw, 1rem);
  align-items: stretch;
  min-height: min(690px, calc(100dvh - 176px));
}

.profile-progress-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(0.82rem, 1.2vw, 1.08rem);
  min-width: 0;
  min-height: 0;
  padding: clamp(1rem, 1.45vw, 1.35rem);
  border: 1px solid rgba(108, 88, 61, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 8%, rgba(0, 150, 136, 0.1), transparent 18rem),
    radial-gradient(circle at 94% 88%, rgba(147, 112, 219, 0.1), transparent 20rem),
    rgba(255, 253, 248, 0.86);
  box-shadow:
    0 18px 34px rgba(66, 50, 34, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.profile-progress-panel-head {
  display: grid;
  grid-template-columns: minmax(10.5rem, 0.62fr) minmax(0, 1fr);
  grid-template-areas:
    "kicker split"
    "total split";
  align-items: end;
  gap: 0.75rem 1rem;
  padding-bottom: clamp(0.78rem, 1.15vw, 1rem);
  border-bottom: 1px solid rgba(108, 88, 61, 0.14);
}

.profile-progress-panel-head .profile-card-kicker {
  grid-area: kicker;
}

.profile-total-points {
  grid-area: total;
  display: grid;
  gap: 0.12rem;
}

.profile-total-points strong {
  color: #00786f;
  font-family: "Merriweather", serif;
  font-size: clamp(3.2rem, 5vw, 5.45rem);
  font-weight: 700;
  line-height: 0.86;
}

.profile-total-points span {
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.92rem, 1vw, 1.05rem);
  font-weight: 700;
}

.profile-points-split {
  grid-area: split;
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.profile-points-split p {
  display: grid;
  align-content: center;
  gap: 0.2rem;
  margin: 0;
  min-height: 0;
  padding: 0.16rem 0;
  border: 0;
  background: none;
}

.profile-points-split span {
  color: #0b6f6d;
  font-family: var(--button-font);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-points-split strong {
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(1.65rem, 2.55vw, 2.65rem);
  line-height: 1;
}

.profile-stat-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(6.25rem, auto);
  gap: clamp(0.62rem, 0.9vw, 0.82rem);
  min-height: 0;
}

.profile-stat-summary-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 150, 136, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 18%, rgba(0, 150, 136, 0.1), transparent 10rem),
    radial-gradient(circle at 92% 90%, rgba(147, 112, 219, 0.1), transparent 10rem),
    rgba(255, 253, 248, 0.72);
}

.profile-stat-summary-item {
  display: grid;
  align-content: center;
  gap: 0.28rem;
  min-height: clamp(5.7rem, 7vw, 7.2rem);
  padding: clamp(0.72rem, 1vw, 0.95rem);
  border-left: 1px solid rgba(108, 88, 61, 0.13);
}

.profile-stat-summary-item:first-child {
  border-left: 0;
}

.profile-stat-summary-item strong {
  color: #00786f;
  font-family: "Merriweather", serif;
  font-size: clamp(2.1rem, 3.6vw, 3.55rem);
  font-weight: 700;
  line-height: 0.95;
}

.profile-stat-summary-item span {
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.78rem, 0.95vw, 0.92rem);
  font-weight: 700;
  line-height: 1.2;
}

.profile-stat-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.74rem;
  min-width: 0;
  padding: clamp(0.68rem, 1vw, 0.85rem);
  border: 1px solid rgba(108, 88, 61, 0.13);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.68);
}

.profile-stat-tile strong {
  display: block;
  overflow-wrap: anywhere;
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(1.35rem, 2vw, 2.1rem);
  font-weight: 700;
  line-height: 1;
}

.profile-stat-tile p {
  margin: 0.28rem 0 0;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: clamp(0.78rem, 0.92vw, 0.9rem);
  line-height: 1.25;
}

.profile-time-copy {
  display: grid;
  gap: 0.16rem;
  align-content: center;
  min-width: 0;
}

.profile-stat-icon {
  display: grid;
  place-items: center;
  width: clamp(3rem, 4.2vw, 4rem);
  aspect-ratio: 1;
  border-radius: 16px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.72), transparent 32%),
    rgba(147, 112, 219, 0.13);
  color: rgba(52, 92, 89, 0.5);
  font-family: var(--button-font);
  font-size: clamp(1.7rem, 2.4vw, 2.5rem);
  font-weight: 900;
}

.profile-stat-icon svg {
  width: 58%;
  height: 58%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-stat-icon-streak {
  color: #7a57c9;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.72), transparent 32%),
    rgba(147, 112, 219, 0.14);
}

.profile-stat-icon-time {
  color: #00877c;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.72), transparent 32%),
    rgba(0, 150, 136, 0.12);
}

.profile-stat-tile-mastery {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 0.46rem;
}

.profile-stat-mastery-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.profile-stat-mastery-row strong {
  color: #00786f;
  font-size: clamp(1.55rem, 2.4vw, 2.5rem);
}

.profile-side-stack {
  display: grid;
  grid-template-rows: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: clamp(0.78rem, 1.12vw, 1rem);
  min-height: 0;
}

.profile-side-stack .profile-next-step-card {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: end;
  padding: clamp(0.98rem, 1.45vw, 1.32rem);
}

.profile-side-stack .profile-next-step-copy {
  gap: 0.48rem;
}

.profile-side-stack .profile-next-step-copy strong {
  max-width: 19rem;
  font-size: clamp(1.65rem, 2.35vw, 2.35rem);
  line-height: 1.04;
}

.profile-side-stack .profile-next-step-copy p {
  max-width: 22rem;
  font-size: clamp(0.82rem, 0.98vw, 0.95rem);
  line-height: 1.35;
}

.profile-side-stack .profile-next-step-meta {
  padding: 0.34rem 0.62rem;
  font-size: 0.76rem;
}

.profile-side-stack .profile-action-btn {
  min-height: 2.7rem;
  min-width: 7.6rem;
  border-radius: 999px;
  padding: 0.62rem 0.88rem;
  font-size: 0.84rem;
}

.profile-side-stack .profile-next-step-art img {
  width: clamp(3rem, 4vw, 4rem);
}

.profile-side-stack .profile-support-card {
  min-height: 0;
  grid-template-columns: minmax(17rem, 0.82fr) minmax(15rem, 0.78fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "copy visual"
    "action visual";
  align-content: center;
  align-items: center;
  column-gap: clamp(1.4rem, 4.8vw, 3.4rem);
  row-gap: clamp(0.9rem, 1.5vw, 1.2rem);
  padding: clamp(1.45rem, 2.8vw, 2.35rem);
}

.profile-side-stack .profile-support-copy {
  grid-area: copy;
  align-self: end;
  justify-self: start;
  width: min(100%, 25rem);
  text-align: left;
}

.profile-side-stack .profile-support-copy span {
  font-size: 0.78rem;
}

.profile-side-stack .profile-support-copy strong {
  max-width: 20rem;
  margin-inline: 0;
  font-size: clamp(1.5rem, 2vw, 2.15rem);
}

.profile-side-stack .profile-support-copy p {
  width: min(100%, 24rem);
  margin-top: 0.7rem;
  margin-inline: 0;
  font-size: clamp(0.82rem, 0.95vw, 0.96rem);
  line-height: 1.38;
}

.profile-side-stack .profile-support-visual {
  grid-area: visual;
  align-self: center;
  justify-self: start;
  width: min(100%, 18.6rem);
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.profile-side-stack .profile-support-logo {
  width: min(100%, 18.2rem);
  max-height: 18.2rem;
  object-fit: contain;
}

.profile-side-stack .profile-support-link {
  grid-area: action;
  align-self: start;
  justify-self: start;
  width: fit-content;
  min-height: 2.7rem;
  min-width: 9.4rem;
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  color: #8f3151;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 247, 245, 0.9));
  border-color: rgba(184, 86, 116, 0.32);
  box-shadow: 0 10px 20px rgba(143, 49, 81, 0.1);
  font-size: 0.84rem;
}

.profile-side-stack .profile-support-link svg {
  width: 1.08rem;
  height: 1.08rem;
  color: #c85d75;
  stroke-width: 2.4;
}

.profile-side-stack .profile-support-link:not([aria-disabled="true"]):hover,
.profile-side-stack .profile-support-link:not([aria-disabled="true"]):focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 250, 248, 0.98), rgba(255, 239, 242, 0.94));
  box-shadow: 0 14px 24px rgba(143, 49, 81, 0.15);
}

.profile-side-stack .profile-support-link-disabled {
  color: #8f3151;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 247, 245, 0.9));
  border-color: rgba(184, 86, 116, 0.32);
  box-shadow: 0 10px 20px rgba(143, 49, 81, 0.1);
}

.profile-streak-card {
  background:
    radial-gradient(circle at 18% 92%, rgba(147, 112, 219, 0.16), transparent 10rem),
    rgba(255, 253, 248, 0.82);
}

.profile-lower-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(24rem, 1fr) minmax(24rem, 1.1fr);
  gap: clamp(0.72rem, 1.05vw, 0.95rem);
}

.profile-detail-card {
  min-height: 9.2rem;
  padding: clamp(1rem, 1.35vw, 1.25rem);
  display: grid;
  align-content: center;
  gap: 1rem;
}

.profile-time-card {
  background:
    radial-gradient(circle at 82% 48%, rgba(0, 150, 136, 0.08), transparent 7rem),
    rgba(255, 253, 248, 0.82);
}

.profile-milestone-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.profile-milestone-card strong {
  display: block;
  margin-top: 1rem;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.15;
}

.profile-milestone-card p {
  margin-top: 0.55rem;
  color: var(--purple);
  font-family: var(--button-font);
  font-size: clamp(1rem, 1.45vw, 1.25rem);
  font-weight: 900;
}

.profile-milestone-art {
  position: relative;
  width: clamp(5rem, 8vw, 7rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.8), transparent 32%),
    rgba(147, 112, 219, 0.2);
  box-shadow: inset 0 0 0 1px rgba(147, 112, 219, 0.18);
}

.profile-milestone-art img {
  width: 54%;
  height: auto;
  filter: drop-shadow(0 10px 8px rgba(64, 43, 24, 0.16));
}

.profile-activity-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.profile-activity-copy,
.profile-activity-lines,
.profile-recent-list {
  grid-column: 1;
}

.profile-activity-copy {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.profile-activity-lines {
  display: grid;
  gap: 0.25rem;
}

.profile-activity-lines p {
  font-size: clamp(1.1rem, 1.5vw, 1.45rem);
}

.profile-activity-lines strong {
  display: inline-block;
  min-width: 1.4rem;
  color: #242424;
  font-size: inherit;
}

.profile-recent-list {
  list-style: none;
  display: grid;
  gap: 0.38rem;
  margin: 0.1rem 0 0;
  max-height: clamp(3.2rem, 9dvh, 6.2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.28rem 0 0;
  scrollbar-gutter: stable;
}

.profile-recent-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  color: #504a45;
  font-family: "Merriweather", serif;
  font-size: 0.9rem;
}

.profile-recent-list li strong {
  font-family: "Merriweather", serif;
  font-size: 0.94rem;
  line-height: 1.25;
}

.profile-recent-list li span {
  color: #6b625b;
}

.profile-activity-tiles {
  grid-column: 2;
  align-self: end;
  display: flex;
  align-items: flex-end;
  gap: 0.28rem;
  padding-left: 0.8rem;
}

.profile-activity-tiles img {
  width: clamp(2.4rem, 3.7vw, 3.4rem);
  height: auto;
  filter: drop-shadow(0 9px 7px rgba(64, 43, 24, 0.14));
}

.profile-activity-tiles img:first-child {
  transform: rotate(-3deg);
}

.profile-activity-tiles img:last-child {
  transform: rotate(5deg);
}

@media (max-width: 1180px) {
  .profile-table-dashboard,
  .profile-focus-grid,
  .profile-overview-grid,
  .profile-lower-grid,
  .profile-bottom-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .profile-side-stack {
    grid-template-rows: auto auto;
  }

  .profile-progress-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-progress-mastery {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid rgba(108, 88, 61, 0.16);
    padding: 1rem 0 0;
  }

  .profile-support-card {
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.65fr);
  }

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

@media (max-width: 760px) {
  .profile-view {
    padding: 0.8rem;
  }

  .profile-progress-panel-head,
  .profile-points-split,
  .profile-stat-tile-grid,
  .profile-stat-summary-bar,
  .profile-side-stack .profile-next-step-card,
  .profile-side-stack .profile-support-card {
    grid-template-columns: 1fr;
  }

  .profile-stat-summary-item {
    border-left: 0;
    border-top: 1px solid rgba(108, 88, 61, 0.13);
  }

  .profile-stat-summary-item:first-child {
    border-top: 0;
  }

  .profile-progress-panel-head {
    grid-template-areas:
      "kicker"
      "total"
      "split";
  }

  .profile-identity-card {
    grid-template-columns: 1fr;
  }

  .profile-avatar-wrap {
    justify-items: start;
  }

  .profile-identity-fields strong {
    font-size: clamp(2.5rem, 13vw, 4.2rem);
  }

  .profile-support-card,
  .profile-next-step-card,
  .profile-progress-band,
  .profile-metric-grid,
  .profile-lower-grid,
  .profile-bottom-grid,
  .profile-milestone-card,
  .profile-activity-card {
    grid-template-columns: 1fr;
  }

  .profile-next-step-card .profile-action-btn {
    justify-self: start;
  }

  .profile-side-stack .profile-snapshot-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "copy"
      "action";
  }

  .profile-side-stack .profile-snapshot-list {
    grid-template-columns: 1fr;
  }

  .profile-progress-stat,
  .profile-progress-mastery {
    border-left: 0;
    border-top: 1px solid rgba(108, 88, 61, 0.16);
    padding: 1rem 0 0;
  }

  .profile-unlock-grid {
    grid-template-columns: 1fr;
  }

  .profile-support-visual {
    justify-self: stretch;
    width: 100%;
    min-height: 8.5rem;
  }

  .profile-side-stack .profile-support-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "visual"
      "copy"
      "action";
    justify-items: center;
  }

  .profile-side-stack .profile-support-copy {
    align-self: center;
    justify-self: center;
    text-align: center;
  }

  .profile-side-stack .profile-support-visual {
    justify-self: center;
    width: min(100%, 16.5rem);
  }

  .profile-side-stack .profile-support-link {
    justify-self: center;
  }

  .profile-support-link,
  .profile-activity-tiles {
    grid-column: auto;
  }

  .profile-activity-tiles {
    padding-left: 0;
  }
}

@media (max-width: 520px) {
  .profile-account-actions {
    width: 100%;
    justify-content: stretch;
  }

  .profile-action-btn {
    flex: 1 1 100%;
  }

  .profile-metric-card,
  .profile-detail-card {
    min-height: auto;
  }
}

.rules-view {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  min-height: 0;
  overflow: visible;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
}

.rules-view.card-surface {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.rules-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  border-bottom: 1px solid rgba(47, 45, 42, 0.16);
  padding-bottom: 0.85rem;
}

.rules-header h2 {
  margin: 0.08rem 0 0.18rem;
  font-size: clamp(1.8rem, 3.3vw, 2.55rem);
  line-height: 1.05;
}

.rules-header p:not(.pre-game-label) {
  max-width: none;
  color: #53605b;
  font-weight: 700;
  line-height: 1.35;
}

.rules-search {
  display: grid;
  gap: 0.3rem;
  max-width: 30rem;
  color: #2f2d2a;
  font-weight: 850;
}

.rules-search input {
  width: 100%;
  border: 1px solid rgba(47, 45, 42, 0.22);
  border-radius: 6px;
  background: #fffdf8;
  padding: 0.68rem 0.75rem;
  color: #262b2a;
  font: inherit;
  font-weight: 700;
  outline: none;
  box-shadow: none;
}

.rules-search input:focus {
  border-color: #00796f;
  box-shadow: 0 0 0 2px rgba(0, 150, 136, 0.14);
}

.rules-jump-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.7rem;
  align-items: center;
}

.rules-jump-list a {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  border-radius: 0;
  padding: 0;
  font-weight: 800;
  text-decoration: none;
  line-height: 1;
}

.rules-jump-list {
  border: 0;
  border-bottom: 1px solid rgba(47, 45, 42, 0.12);
  border-radius: 0;
  background: transparent;
  padding: 0.45rem 0;
  box-shadow: none;
}

.rules-jump-list a {
  color: #23446e;
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 0.16rem;
}

.rules-jump-list a:hover,
.rules-jump-list a:focus-visible {
  color: #00796f;
}

.rules-search-status {
  min-height: 1.2rem;
  color: #5d6763;
  font-size: 0.86rem;
  font-weight: 750;
}

.rules-search-hit {
  border-radius: 3px;
  background: rgba(246, 199, 93, 0.46);
  color: inherit;
  padding: 0 0.08em;
}

.rules-manual {
  display: grid;
  gap: 0;
}

.rules-section {
  border: 0;
  border-bottom: 1px solid rgba(47, 45, 42, 0.14);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.rules-section[hidden] {
  display: none;
}

.rules-section summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  cursor: default;
  margin-top: 0.9rem;
  padding: 0.78rem 0 0.78rem 0.82rem;
  border-left: 5px solid #00796f;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0, 150, 136, 0.12), rgba(255, 253, 248, 0));
  list-style: none;
}

.rules-section summary::-webkit-details-marker {
  display: none;
}

.rules-section:first-child summary {
  margin-top: 0;
}

.rules-section summary::after {
  content: none;
}

.rules-section summary span {
  display: block;
  color: #17406a;
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1.1;
}

.rules-section summary small {
  display: block;
  margin-top: 0.22rem;
  color: #5d6763;
  font-weight: 700;
}

.rules-section-body {
  display: grid;
  gap: 0.72rem;
  border-top: 1px solid rgba(47, 45, 42, 0.08);
  padding: 0.8rem 0 1.1rem;
}

.rules-columns,
.rules-action-grid {
  display: block;
}

.rules-note-card,
.rules-action-grid article {
  border: 0;
  border-bottom: 1px solid rgba(47, 45, 42, 0.08);
  border-radius: 0;
  background: transparent;
  padding: 0 0 0.74rem;
  margin: 0 0 0.74rem;
}

.rules-note-card:last-child,
.rules-action-grid article:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rules-note-card h3,
.rules-action-grid h3 {
  margin: 0 0 0.34rem;
  color: #23446e;
  font-size: 0.96rem;
  line-height: 1.15;
}

.rules-note-card p,
.rules-note-card li,
.rules-action-grid p,
.rules-action-grid small,
.rules-color-list p {
  color: #4f5a56;
  font-weight: 700;
  line-height: 1.42;
}

.rules-note-card ul,
.rules-note-card ol {
  display: grid;
  gap: 0.22rem;
  margin: 0;
  padding-left: 1.15rem;
}

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

.rules-action-grid article {
  display: grid;
  gap: 0.22rem;
}

.rules-action-grid small {
  font-size: 0.8rem;
}

.rules-tile-table,
.rules-state-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.18rem;
}

.rules-tile-table div,
.rules-state-list span {
  border: 0;
  border-left: 3px solid rgba(0, 150, 136, 0.24);
  border-radius: 0;
  background: transparent;
  padding: 0.24rem 0 0.24rem 0.62rem;
}

.rules-tile-table strong {
  display: block;
  color: #00796f;
  font-size: 1.08rem;
  font-weight: 900;
}

.rules-tile-table span,
.rules-state-list span {
  color: #3c4747;
  font-weight: 750;
  line-height: 1.25;
}

.rules-audit-note {
  border-color: rgba(47, 45, 42, 0.16);
  background: #ffffff;
}

.rules-color-list {
  display: grid;
  gap: 0.42rem;
}

.rule-color-chip {
  display: inline-flex;
  align-items: center;
  min-width: 3.1rem;
  border-radius: 4px;
  padding: 0.05rem 0.32rem;
  color: #2f2d2a;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.25;
}

.rule-color-purple {
  background: rgba(147, 112, 219, 0.18);
}

.rule-color-blue {
  background: rgba(0, 150, 136, 0.16);
}

.rule-color-gold {
  background: rgba(218, 165, 32, 0.22);
  color: #2d2a26;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

#phase-banner {
  font-weight: 700;
}

#phase-helper {
  color: var(--ink-mute);
  font-size: 0.93rem;
}

.panel {
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.6rem;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

.hero-hand-panel {
  position: relative;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.95);
  border-width: 1px;
  border-color: rgba(149, 192, 203, 0.42);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 24px rgba(67, 53, 44, 0.1);
  grid-template-columns: minmax(260px, 1fr) auto;
  grid-template-areas:
    "exposure exposure"
    "hand hand"
    "actions actions";
  grid-template-rows: minmax(0, auto) minmax(0, auto) auto;
  align-content: stretch;
  align-items: center;
  gap: 0.42rem;
}

.action-focus {
  border-color: rgba(32, 201, 195, 0.62);
  box-shadow: 0 0 0 2px rgba(32, 201, 195, 0.2), 0 12px 24px rgba(33, 104, 108, 0.15);
}

.drop-active {
  border-color: rgba(239, 92, 178, 0.64);
  box-shadow: 0 0 0 3px rgba(239, 92, 178, 0.2), 0 12px 26px rgba(116, 40, 90, 0.16);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.hand-sort-utility {
  position: absolute;
  top: 0.72rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.14rem;
  padding: 0.18rem;
  border: 1px solid rgba(0, 150, 136, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 8px 18px rgba(33, 104, 108, 0.1);
  backdrop-filter: blur(10px);
}

.hand-sort-utility {
  right: 0.82rem;
}

.sort-utility-label {
  padding: 0 0.28rem 0 0.38rem;
  color: #5d6b66;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.sort-utility-btn {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 0.26rem 0.62rem;
  background: transparent;
  color: #006f66;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.sort-utility-btn.active {
  background: rgba(0, 150, 136, 0.16);
  color: #005c55;
}

.sort-utility-btn:not(:disabled):hover {
  background: rgba(147, 112, 219, 0.16);
  color: #5a3faf;
}

.sort-utility-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.hand-sort-utility {
  gap: 0.34rem;
  padding: 0.22rem 0.34rem;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.48);
  box-shadow: none;
}

.sort-utility-label {
  padding: 0 0.12rem 0 0;
  color: #6b746f;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sort-utility-btn {
  position: relative;
  padding: 0.22rem 0.2rem 0.34rem;
  border-radius: 0;
  color: #2f6963;
  background: transparent;
}

.sort-utility-btn.active {
  color: #004f49;
  background: transparent;
}

.sort-utility-btn.active::after {
  content: "";
  position: absolute;
  left: 0.16rem;
  right: 0.16rem;
  bottom: 0.08rem;
  height: 0.17rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #009688, #6d5fd1);
}

.sort-utility-btn:not(:disabled):hover {
  color: #5a3faf;
  background: transparent;
}

.sort-utility-btn:disabled {
  color: #8ca29d;
  opacity: 0.62;
}

.claim-inline-actions {
  align-items: center;
}

.hero-hand-panel.charleston-actions-first {
  grid-template-areas:
    "exposure exposure"
    "hand hand"
    "actions actions";
}

.hero-hand-panel.charleston-actions-first #next-action-panel {
  display: none;
}

.endgame-panel {
  grid-area: endgame;
  justify-self: center;
  width: min(720px, calc(100% - 1rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(150px, auto);
  align-items: stretch;
  justify-items: stretch;
  gap: clamp(0.72rem, 2vw, 1.2rem);
  margin: clamp(0.35rem, 1.2cqw, 0.85rem) auto 0;
  text-align: left;
  animation: endgame-message-rise 520ms ease both;
  position: relative;
  z-index: 6;
}

.endgame-panel.hidden {
  display: none;
}

.endgame-panel h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(1.85rem, 3.4vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.endgame-summary-column,
.endgame-action-column {
  display: grid;
  align-content: center;
  gap: 0.5rem;
  min-width: 0;
}

.endgame-summary-column {
  justify-items: start;
}

.endgame-action-column {
  justify-items: center;
}

.endgame-panel-divider {
  width: 1px;
  min-height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(0, 150, 136, 0),
    rgba(0, 150, 136, 0.28),
    rgba(147, 112, 219, 0.22),
    rgba(0, 150, 136, 0)
  );
}

.endgame-panel .inline-help {
  margin: 0;
  color: #5f554c;
  font-size: clamp(0.96rem, 1.2vw, 1.12rem);
  font-weight: 850;
}

.endgame-panel .soft-btn {
  margin-top: 0.1rem;
  min-width: 150px;
  justify-content: center;
}

.endgame-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  width: 100%;
  margin-top: 0.16rem;
}

.endgame-stat {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.58rem 0.62rem;
  border: 1px solid rgba(0, 150, 136, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  text-align: left;
}

.endgame-stat-wide {
  grid-column: 1 / -1;
}

.endgame-stat span {
  color: #69736c;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.endgame-stat strong {
  color: #2f2d2a;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(1rem, 1.8cqw, 1.3rem);
  line-height: 1;
}

.endgame-stat em {
  color: #007a70;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.endgame-support {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin-top: 0.12rem;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(147, 112, 219, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(120deg, rgba(0, 150, 136, 0.08), rgba(147, 112, 219, 0.08)),
    rgba(255, 255, 255, 0.58);
  text-align: left;
}

.endgame-support-eyebrow {
  margin: 0 0 0.18rem;
  color: #007a70;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.endgame-support p {
  margin: 0;
  color: #514a43;
  font-family: "Merriweather", serif;
  font-size: clamp(0.82rem, 1cqw, 0.94rem);
  font-weight: 700;
  line-height: 1.32;
}

.endgame-donate-link {
  white-space: nowrap;
  text-decoration: none;
}

.endgame-donate-link-disabled {
  cursor: default;
  opacity: 0.72;
  pointer-events: none;
  filter: saturate(0.55);
}

@media (max-width: 700px) {
  .endgame-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
  }

  .endgame-action-column {
    justify-items: stretch;
  }

  .endgame-panel-divider {
    width: 100%;
    min-height: 1px;
    height: 1px;
    background: linear-gradient(
      90deg,
      rgba(0, 150, 136, 0),
      rgba(0, 150, 136, 0.28),
      rgba(147, 112, 219, 0.22),
      rgba(0, 150, 136, 0)
    );
  }

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

  .endgame-support {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
}

#draw-panel .panel-head .soft-btn {
  padding: 0.52rem 0.9rem;
}

.action-center-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.92rem;
  animation: action-controls-enter 280ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.action-center-controls.hidden,
.action-center-controls.guidance-pending {
  display: none;
}

.action-center-controls.guidance-pending {
  pointer-events: none;
}

@keyframes action-controls-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.action-center-controls .soft-btn,
.action-center-controls .text-btn {
  min-height: 2.72rem;
  padding: 0.66rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 119, 111, 0.34);
  font-family: var(--button-font);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  box-shadow: none;
}

.action-center-controls #draw-btn,
.action-center-controls #claim-inline-btn,
.action-center-controls #joker-exchange-inline-btn,
.action-center-controls #dead-pin-inline-btn {
  color: #fffdf8;
  background: var(--sage);
  border-color: rgba(0, 119, 111, 0.34);
  box-shadow: none;
}

.action-center-controls.dead-hand-controls #dead-pin-inline-btn {
  order: 1;
}

.action-center-controls.dead-hand-controls #dead-new-game-inline-btn {
  order: 2;
  min-height: 2.72rem;
  min-width: 8.8rem;
  border-color: rgba(0, 150, 136, 0.28);
  border-radius: 999px;
  color: var(--sage-dark);
  background: var(--tile-cream);
  box-shadow: inset 0 -2px 0 rgba(238, 138, 104, 0.18);
  cursor: pointer;
  opacity: 1;
  filter: none;
}

.action-center-controls.call-recommended #claim-inline-btn {
  order: 1;
  color: #fffdf8;
  background: var(--sage);
  border-color: rgba(0, 119, 111, 0.42);
}

.action-center-controls.call-recommended #draw-btn {
  order: 2;
  color: #64736f;
  background: rgba(222, 229, 226, 0.86);
  border-color: rgba(112, 128, 124, 0.22);
  opacity: 0.82;
  filter: saturate(0.35);
}

.action-center-controls.call-recommended #draw-btn:hover,
.action-center-controls.call-recommended #draw-btn:focus-visible {
  color: #4f5e5a;
  background: rgba(214, 223, 220, 0.94);
  border-color: rgba(112, 128, 124, 0.3);
  opacity: 0.96;
}

.action-center-controls.call-recommended #pass-claim-inline-btn {
  order: 3;
}

.action-center-controls.joker-exchange-choice #pass-claim-inline-btn {
  order: 1;
  color: #64736f;
  background: rgba(222, 229, 226, 0.86);
  border-color: rgba(112, 128, 124, 0.22);
  opacity: 0.94;
  filter: saturate(0.45);
}

.action-center-controls.joker-exchange-choice #joker-exchange-inline-btn {
  order: 2;
}

.action-center-controls.joker-exchange-choice #pass-claim-inline-btn:hover,
.action-center-controls.joker-exchange-choice #pass-claim-inline-btn:focus-visible {
  color: #4f5e5a;
  background: rgba(214, 223, 220, 0.94);
  border-color: rgba(112, 128, 124, 0.3);
  opacity: 0.98;
}

.action-center-controls.draw-recommended-with-claim #draw-btn {
  order: 1;
  color: #fffdf8;
  background: var(--sage);
  border-color: rgba(0, 119, 111, 0.42);
  opacity: 1;
  filter: none;
}

.action-center-controls.draw-recommended-with-claim #claim-inline-btn {
  order: 2;
  color: #64736f;
  background: rgba(222, 229, 226, 0.86);
  border-color: rgba(112, 128, 124, 0.22);
  opacity: 0.82;
  filter: saturate(0.35);
}

.action-center-controls.draw-recommended-with-claim #pass-claim-inline-btn {
  order: 3;
}

.action-center-controls.draw-recommended-with-claim #claim-inline-btn:hover,
.action-center-controls.draw-recommended-with-claim #claim-inline-btn:focus-visible {
  color: #4f5e5a;
  background: rgba(214, 223, 220, 0.94);
  border-color: rgba(112, 128, 124, 0.3);
  opacity: 0.96;
  filter: saturate(0.45);
}

.action-center-controls:not(.call-recommended) #draw-btn:hover,
.action-center-controls:not(.call-recommended) #draw-btn:focus-visible,
.action-center-controls #claim-inline-btn:hover,
.action-center-controls #claim-inline-btn:focus-visible,
.action-center-controls #joker-exchange-inline-btn:hover,
.action-center-controls #joker-exchange-inline-btn:focus-visible,
.action-center-controls #dead-pin-inline-btn:hover,
.action-center-controls #dead-pin-inline-btn:focus-visible,
.discard-tray #confirm-discard-btn:hover,
.discard-tray #confirm-discard-btn:focus-visible {
  color: #fffdf8;
  background: var(--sage-dark);
  border-color: rgba(0, 119, 111, 0.48);
  box-shadow: none;
}

.action-center-controls.dead-hand-controls #dead-new-game-inline-btn:hover,
.action-center-controls.dead-hand-controls #dead-new-game-inline-btn:focus-visible {
  color: var(--tile-red);
  background: #fff3d9;
  border-color: rgba(238, 138, 104, 0.5);
  box-shadow: inset 0 -2px 0 rgba(0, 150, 136, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.action-center-controls #draw-btn:disabled,
.action-center-controls #claim-inline-btn:disabled,
.action-center-controls #joker-exchange-inline-btn:disabled,
.action-center-controls #dead-pin-inline-btn:disabled,
.action-center-controls #dead-new-game-inline-btn:disabled {
  background: rgba(0, 150, 136, 0.34);
  color: rgba(255, 255, 255, 0.78);
}

.action-center-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.64rem;
  align-items: start;
}

@media (min-width: 760px) {
  .action-center-secondary:has(#discard-tray:not(.hidden)):has(#joker-exchange-actions:not(.hidden)) {
    grid-template-columns: minmax(260px, 0.92fr) minmax(280px, 1fr);
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.54fr);
    column-gap: clamp(0.8rem, 1.6vw, 1.15rem);
    align-items: start;
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) > h3,
  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) > .draw-decision-hint,
  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) > .charleston-guidance-banner,
  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) > .draw-result-panel,
  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) > .action-center-controls {
    grid-column: 1;
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) > .action-center-secondary {
    display: contents;
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) #discard-tray,
  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) #open-jokers-panel {
    grid-column: 1;
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) #joker-exchange-actions {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: start;
    width: 100%;
    margin-top: 0;
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) .joker-exchange-row {
    align-content: start;
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) .joker-exchange-card {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    align-items: stretch;
    gap: 0.76rem;
    min-height: 0;
    width: 100%;
    padding: clamp(0.82rem, 1.5vw, 1.08rem);
  }

  .right-strategy-panel:has(#joker-exchange-actions:not(.hidden)) .joker-exchange-card .open-joker-btn {
    width: 100%;
    justify-content: center;
  }
}

.discard-tray {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas:
    "button tile spacer";
  align-items: center;
  justify-content: start;
  gap: 0.5rem 0.76rem;
  margin-top: 0.82rem;
  padding: 0.34rem 0 0.34rem 1rem;
  border: 0;
  border-left: 4px solid var(--sage);
  border-radius: 0;
  background: transparent;
}

.discard-tray.hidden {
  display: none;
}

.discard-tray-copy {
  display: contents;
}

.discard-tray-title {
  margin: 0;
  color: #352f2b;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.1;
}

.discard-tray-tile {
  grid-area: tile;
  width: 42px;
  min-width: 42px;
}

.discard-tray-preview-tile.tile.discard {
  width: 42px;
  height: 55px;
  border-radius: 7px;
  pointer-events: none;
}

.discard-tray #confirm-discard-btn {
  grid-area: button;
  justify-self: start;
  min-height: 2.45rem;
  padding: 0.54rem 0.86rem 0.6rem;
  border: 1px solid rgba(0, 119, 111, 0.34);
  border-radius: 16px;
  color: #fffdf8;
  background: var(--sage);
  font-family: var(--button-font);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: none;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .discard-tray {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "button tile";
  }

  .discard-tray-tile {
    grid-area: tile;
  }

  .discard-tray #confirm-discard-btn {
    grid-area: button;
    width: min(100%, 13.5rem);
  }
}

.draw-result-panel {
  margin-top: 0.82rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid rgba(0, 150, 136, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(0, 150, 136, 0.09), rgba(147, 112, 219, 0.07)),
    rgba(255, 253, 248, 0.72);
}

.draw-result-panel h4 {
  margin: 0.14rem 0 0.14rem;
  color: var(--sage-dark);
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(1.02rem, 1.4vw, 1.22rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.draw-result-panel .inline-help {
  margin: 0;
}

.draw-result-panel.draw-result-celebration {
  position: relative;
  overflow: hidden;
  border-color: rgba(79, 207, 122, 0.55);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.95) 0 0.18rem, transparent 0.2rem),
    radial-gradient(circle at 88% 22%, rgba(217, 180, 110, 0.62) 0 0.16rem, transparent 0.18rem),
    radial-gradient(circle at 72% 78%, rgba(147, 112, 219, 0.38) 0 0.14rem, transparent 0.16rem),
    linear-gradient(90deg, rgba(79, 207, 122, 0.18), rgba(32, 201, 195, 0.14), rgba(147, 112, 219, 0.13)),
    rgba(255, 253, 248, 0.88);
  box-shadow: 0 0 0 2px rgba(79, 207, 122, 0.16), 0 12px 24px rgba(0, 120, 110, 0.12);
  animation: draw-result-pop 720ms ease-out both;
}

.draw-result-panel.draw-result-celebration h4 {
  color: #007a70;
}

.charleston-action-center-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.72rem;
  align-items: start;
  margin-top: 0.25rem;
}

.charleston-action-center-controls .soft-btn {
  min-width: 166px;
  justify-content: center;
  justify-self: start;
  margin-left: 0.72rem;
}

.charleston-action-center-controls .text-btn {
  min-width: 148px;
  justify-self: start;
}

.inline-help {
  font-size: 0.86rem;
  color: var(--ink-mute);
}

.discard-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wall-count {
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: rgba(32, 201, 195, 0.14);
  color: #146f6b;
  font-weight: 700;
  border: 1px solid rgba(32, 201, 195, 0.34);
}

.tile-ledger {
  margin-top: -0.2rem;
  font-size: 0.76rem;
  line-height: 1.28;
  color: #5e6663;
}

.tile-ledger.has-mismatch {
  color: #9c3c62;
  font-weight: 700;
}

.tile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52rem;
  min-height: 52px;
}

.hand-row {
  grid-area: hand;
  position: relative;
  background: transparent;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-end;
  align-self: end;
  min-height: 132px;
  padding: 0.35rem clamp(1rem, 4vw, 4rem) clamp(1.5rem, 3vh, 2.35rem);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: clamp(1rem, 4vw, 4rem);
}

.rack-exposure-shelf {
  grid-area: exposure;
  border-radius: 1.05rem;
  border: 0;
  background: transparent;
  padding: 0.2rem clamp(1rem, 4vw, 4rem) 0.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  align-items: end;
  align-self: end;
  min-height: 0;
  box-shadow: none;
}

.charleston-choice-banner {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 90;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
  width: min(430px, calc(100vw - 2rem));
  padding: 1.3rem;
  border: 1px solid rgba(0, 150, 136, 0.28);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 24px 58px rgba(38, 55, 59, 0.24);
}

.charleston-choice-banner.hidden {
  display: none;
}

.charleston-choice-banner .pre-game-label {
  margin: 0;
}

.charleston-choice-banner h2 {
  margin: 0.12rem 0 0;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.charleston-choice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  gap: 0.5rem;
}

.charleston-choice-btn {
  min-width: 148px;
  flex: 1 1 0;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid rgba(0, 150, 136, 0.34);
  border-radius: 14px;
  padding: 0.72rem 0.9rem;
  color: var(--sage-dark);
  background: var(--tile-cream);
  box-shadow: inset 0 -3px 0 rgba(238, 138, 104, 0.2), 0 10px 22px rgba(38, 30, 22, 0.1);
  cursor: pointer;
  font-family: var(--button-font);
  font-weight: 900;
  text-align: center;
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: 0;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.charleston-choice-skip-btn {
  color: #6b4bb8;
  border-color: rgba(116, 82, 190, 0.3);
  box-shadow: inset 0 -3px 0 rgba(116, 82, 190, 0.18), 0 10px 22px rgba(38, 30, 22, 0.1);
}

.charleston-choice-btn:hover,
.charleston-choice-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.charleston-choice-play-btn:hover,
.charleston-choice-play-btn:focus-visible {
  color: #7b3c2f;
  background: #fff3d9;
  border-color: rgba(238, 138, 104, 0.5);
  box-shadow: inset 0 -3px 0 rgba(182, 99, 77, 0.24), 0 12px 24px rgba(38, 30, 22, 0.12);
}

.charleston-choice-skip-btn:hover,
.charleston-choice-skip-btn:focus-visible {
  color: #5e3fa9;
  background: #f8f2ff;
  border-color: rgba(116, 82, 190, 0.46);
  box-shadow: inset 0 -3px 0 rgba(116, 82, 190, 0.24), 0 12px 24px rgba(38, 30, 22, 0.12);
}

@media (max-width: 620px) {
  .charleston-choice-banner {
    width: min(360px, calc(100vw - 1.4rem));
    padding: 1.05rem;
  }

  .charleston-choice-banner h2 {
    font-size: 1.18rem;
  }

  .charleston-choice-btn {
    flex-basis: 100%;
  }
}

/* Layout source of truth:
   - .board-hand-slot owns the top hand/rack/action area.
   - .board-bottom-left owns the integrated hand card.
   - .board-bottom-right owns draw/discard panels and should stay isolated. */
.hero-hand-panel #next-action-panel {
  display: none !important;
  grid-area: guidance;
  margin-top: 0.1rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 10px 20px rgba(106, 88, 62, 0.08);
  min-width: 0;
}

#next-action-title {
  color: var(--sage-dark);
  font-size: clamp(1.02rem, 1.45vw, 1.28rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

#next-action-detail {
  color: #5f554c;
  font-size: clamp(0.94rem, 1.15vw, 1.04rem);
  font-weight: 650;
  line-height: 1.26;
}

.right-strategy-panel {
  position: relative;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.28rem;
}

.right-strategy-panel.has-table-location-status {
  grid-template-columns: minmax(0, 1fr);
  padding-right: clamp(6.1rem, 19%, 6.9rem);
  align-items: start;
}

.right-strategy-panel.has-table-location-status > h3,
.right-strategy-panel.has-table-location-status > .draw-decision-hint,
.right-strategy-panel.has-table-location-status > .charleston-guidance-banner,
.right-strategy-panel.has-table-location-status > .draw-result-panel,
.right-strategy-panel.has-table-location-status > .action-center-controls,
.right-strategy-panel.has-table-location-status > .action-center-secondary {
  grid-column: 1;
}

.table-location-status {
  position: absolute;
  top: -0.45rem;
  right: 0;
  z-index: 4;
  width: 6.45rem;
  min-width: 6.45rem;
  display: grid;
  gap: 0.24rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.table-location-status.hidden {
  display: none;
}

.table-location-map {
  position: relative;
  width: 6.35rem;
  height: 5.82rem;
  margin: 0 auto;
}

.table-location-seat {
  position: absolute;
  width: 2.08rem;
  height: 2.08rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(91, 81, 66, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.84), rgba(248, 245, 237, 0.94) 68%, rgba(240, 235, 224, 0.98)),
    rgba(255, 253, 248, 0.92);
  color: #3f4c4b;
  font-family: "Merriweather Sans", sans-serif;
  line-height: 1;
  box-shadow: 0 0.28rem 0.7rem rgba(54, 46, 36, 0.13), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.table-location-seat strong {
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
}

.table-location-seat em {
  position: absolute;
  left: 50%;
  bottom: -0.43rem;
  width: 0.94rem;
  height: 0.94rem;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(97, 86, 70, 0.12);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.96), rgba(248, 244, 237, 0.98)),
    rgba(255, 253, 248, 0.98);
  color: #7a7066;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 0.24rem 0.48rem rgba(48, 40, 31, 0.12);
}

.table-location-seat-you {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.table-location-seat-across {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.table-location-seat-right {
  right: 0;
  top: 43%;
  transform: translateY(-50%);
}

.table-location-seat-left {
  left: 0;
  top: 43%;
  transform: translateY(-50%);
}

.table-location-seat.active {
  z-index: 2;
  border-color: rgba(0, 119, 111, 0.3);
  background:
    radial-gradient(circle at 38% 28%, rgba(112, 196, 180, 0.9), rgba(0, 150, 136, 0.92) 66%, rgba(0, 119, 111, 0.96)),
    var(--sage);
  color: #fffdf8;
  box-shadow:
    0 0 0 0.15rem rgba(255, 253, 248, 0.95),
    0 0 0 0.3rem rgba(0, 150, 136, 0.18),
    0 0.38rem 0.9rem rgba(0, 119, 111, 0.2);
}

.table-location-seat.called {
  border-color: rgba(0, 150, 136, 0.3);
}

.table-location-seat.passed {
  opacity: 0.46;
  filter: saturate(0.3);
}

.table-location-seat.active.table-location-seat-you {
  transform: translateX(-50%) scale(1.08);
}

.table-location-seat.active.table-location-seat-across {
  transform: translateX(-50%) scale(1.08);
}

.table-location-seat.active.table-location-seat-right {
  transform: translateY(-50%) scale(1.08);
}

.table-location-seat.active.table-location-seat-left {
  transform: translateY(-50%) scale(1.08);
}

.table-location-copy {
  margin: 0;
  min-height: 1.18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  padding: 0.2rem 0.42rem;
  border: 1px solid rgba(0, 119, 111, 0.18);
  border-radius: 999px;
  background: rgba(248, 253, 250, 0.76);
  color: #3f4c4b;
  font-family: "Merriweather", serif;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: 0 0.18rem 0.55rem rgba(38, 55, 47, 0.06);
}

.table-location-copy::before {
  content: "✦";
  color: #7bc68d;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.68rem;
  line-height: 1;
}

@media (max-width: 760px) {
  .right-strategy-panel.has-table-location-status {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 0;
  }

  .table-location-status {
    position: relative;
    top: auto;
    right: auto;
    justify-self: end;
    width: 6.1rem;
    min-width: 6.1rem;
  }

  .table-location-map {
    width: 6rem;
    height: 5.52rem;
  }

  .table-location-seat {
    width: 1.96rem;
    height: 1.96rem;
  }

  .table-location-seat strong {
    font-size: 0.74rem;
  }
}

.charleston-guidance-banner {
  margin: 0 0 0.22rem;
  padding: 0.48rem 0.62rem;
  border-left: 4px solid var(--sage);
  border-radius: 8px;
  background: rgba(0, 150, 136, 0.09);
  color: #315852;
  font-family: "Merriweather", serif;
  font-size: clamp(0.9rem, 1vw, 0.98rem);
  font-weight: 400;
  line-height: 1.28;
}

.right-strategy-panel h3 {
  margin: 0;
  color: var(--sage-dark);
  font-family: "Merriweather", serif;
  font-size: clamp(1.08rem, 1.5vw, 1.34rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: normal;
}

.right-strategy-panel h3:empty {
  display: none;
}

.right-strategy-panel .draw-decision-hint {
  margin: 0;
  min-width: 0;
  color: #5f554c;
  font-family: "Merriweather", serif;
  font-size: clamp(0.94rem, 1.08vw, 1.02rem);
  font-weight: 400;
  line-height: 1.28;
}

.right-strategy-panel .draw-decision-hint:empty {
  display: none;
}

.table-watch-stack {
  display: grid;
  gap: 0.34rem;
  margin-top: 0.1rem;
}

.table-watch-row {
  display: block;
  min-width: 0;
  padding: 0.08rem 0 0.08rem 0.58rem;
  border-left: 3px solid rgba(0, 150, 136, 0.3);
  color: #4f4640;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.86rem, 0.96vw, 0.94rem);
  font-weight: 800;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.table-watch-row-no-call {
  border-left-color: rgba(113, 104, 97, 0.26);
  color: #716861;
}

.table-watch-row-pass {
  border-left-color: rgba(113, 104, 97, 0.34);
  color: #5f554c;
}

.table-watch-row-priority {
  border-left-color: rgba(205, 158, 77, 0.46);
  color: #76572c;
}

.table-watch-row-callable {
  border-left-color: rgba(0, 150, 136, 0.5);
  color: #00796f;
}

.table-watch-row-useful {
  border-left-color: rgba(88, 147, 124, 0.42);
  color: #466f61;
}

.table-watch-row-hint {
  border-left-color: rgba(0, 150, 136, 0.34);
  color: #006f66;
}

.table-watch-row-call {
  margin-left: clamp(0.72rem, 1.2vw, 1.05rem);
  padding-left: 0.72rem;
  border-left-color: rgba(0, 150, 136, 0.34);
  color: #006f66;
}

.right-strategy-panel .draw-decision-hint:has(.round-result-card) {
  font-family: var(--button-font);
  line-height: 1.1;
}

#draw-panel:has(.round-result-card) {
  overflow: hidden;
}

#draw-panel:has(.round-result-card) > .panel-head {
  display: none;
}

#draw-panel:has(.round-result-card) .right-strategy-panel {
  gap: clamp(0.42rem, 1vw, 0.68rem);
}

#draw-panel:has(.round-result-card) #strategy-title {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.3rem clamp(0.72rem, 1.6vw, 1rem) 0.4rem;
  border-left: 5px solid var(--sage);
  border-radius: 8px;
  color: #006f66;
  background: linear-gradient(90deg, rgba(0, 150, 136, 0.14), rgba(147, 112, 219, 0.08));
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.12rem, 1.72vw, 1.55rem);
  font-weight: 700;
  line-height: 1.08;
  overflow: hidden;
  white-space: nowrap;
}

.round-result-card {
  display: grid;
  gap: 0.48rem;
  min-width: 0;
}

.round-result-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.72rem, 1.4vw, 1rem);
  min-width: 0;
}

.round-result-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.round-result-summary,
.round-result-subline,
.round-result-note {
  margin: 0;
}

.round-result-summary {
  color: #302c28;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.9rem, 1.18vw, 1.05rem);
  font-weight: 900;
  line-height: 1.12;
}

.round-result-subline {
  color: #007a70;
  font-family: "Merriweather", serif;
  font-size: clamp(0.94rem, 1.3vw, 1.12rem);
  font-weight: 800;
  line-height: 1.05;
}

.round-result-note {
  color: #5f554c;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.72rem, 0.9vw, 0.84rem);
  font-weight: 800;
  line-height: 1.2;
}

.round-result-new-game-btn {
  min-height: 2.22rem;
  min-width: 7.9rem;
  border: 1px solid rgba(0, 150, 136, 0.28);
  border-radius: 999px;
  padding: 0.46rem 0.9rem;
  color: var(--sage-dark);
  background: var(--tile-cream);
  box-shadow: inset 0 -2px 0 rgba(238, 138, 104, 0.18);
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.round-result-new-game-btn:hover,
.round-result-new-game-btn:focus-visible {
  color: var(--tile-red);
  background: #fff3d9;
  border-color: rgba(238, 138, 104, 0.5);
  box-shadow: inset 0 -2px 0 rgba(0, 150, 136, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.round-result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.round-result-stat {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  padding: 0.5rem 0.58rem;
  border: 1px solid rgba(0, 150, 136, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.86), rgba(242, 252, 255, 0.72));
}

.round-result-stat span {
  color: #69736c;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.round-result-stat strong {
  overflow: hidden;
  color: #2f2d2a;
  font-family: var(--button-font);
  font-size: clamp(0.96rem, 1.5vw, 1.24rem);
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-result-stat em {
  overflow: hidden;
  color: #007a70;
  font-family: "Merriweather", serif;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .round-result-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .round-result-new-game-btn {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 520px) {
  .round-result-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .round-result-new-game-btn {
    width: 100%;
  }
}

.right-strategy-panel.charleston-coach-panel {
  gap: 0.42rem;
}

#draw-panel.charleston-incoming-panel.charleston-coach-held {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  pointer-events: none;
}

#draw-panel.charleston-incoming-panel.charleston-coach-reveal {
  animation: charleston-coach-reveal 620ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
  transform-origin: 50% 72%;
}

#draw-panel-title.charleston-round-title {
  font-family: "Merriweather Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.charleston-round-typewriter {
  display: inline-block;
  max-width: 100%;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-transform: inherit;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  animation: charleston-round-type 760ms steps(18, end) 80ms both;
}

.right-strategy-panel.charleston-coach-panel.charleston-compact-guidance {
  padding-top: clamp(0.52rem, 1vw, 0.78rem);
}

.right-strategy-panel.charleston-coach-panel h3 {
  color: var(--sage-dark);
  font-family: "Merriweather", serif;
  font-size: clamp(1rem, 1.22vw, 1.16rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.14;
  text-transform: none;
}

.right-strategy-panel.charleston-coach-panel h3.action-typing:empty {
  display: block;
  min-height: 1.14em;
}

.right-strategy-panel.charleston-coach-panel .draw-decision-hint {
  display: block;
  padding: 0.1rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #352f2b;
  font-family: "Merriweather", serif;
  font-size: clamp(0.92rem, 1.03vw, 1rem);
  font-weight: 400;
}

.right-strategy-panel.charleston-coach-panel .draw-decision-hint:empty,
.right-strategy-panel.charleston-coach-panel .draw-decision-hint.hidden {
  display: none;
}

.right-strategy-panel.charleston-coach-panel .draw-decision-hint.has-pass-chips {
  padding-bottom: 0;
}

.coach-pass-advice {
  display: grid;
  gap: 0.48rem;
}

.coach-pass-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin: 0;
}

.coach-pass-advice-enter {
  animation: coach-pass-advice-enter 220ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

.coach-pass-advice-enter .coach-pass-message,
.coach-pass-advice-enter .coach-advice-text {
  animation: coach-pass-message-pop 360ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

.coach-pass-advice-enter .coach-pass-chips {
  animation: coach-pass-chips-pop 380ms cubic-bezier(0.2, 0.86, 0.24, 1) 130ms both;
}

.coach-pass-chip-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.coach-pass-chip-label {
  color: #786c61;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.coach-pass-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.72rem;
  padding: 0.22rem 0.54rem;
  border: 1px solid rgba(0, 120, 109, 0.24);
  border-radius: 8px;
  background: rgba(0, 150, 136, 0.1);
  color: var(--sage-dark);
  font-weight: 900;
  line-height: 1;
}

.coach-pass-chip-tradeoff {
  border-color: rgba(191, 128, 71, 0.34);
  background: rgba(217, 180, 110, 0.18);
  color: #7b4f2e;
}

.coach-pass-why,
.coach-pass-message,
.coach-advice-text {
  display: block;
  color: #625951;
  font-family: "Merriweather", serif;
  font-weight: 400;
  line-height: 1.28;
}

.right-strategy-panel.charleston-coach-panel .charleston-guidance-banner {
  margin: 0;
}

.right-strategy-panel.charleston-coach-panel .charleston-guidance-banner:not(.coach-pass-chip-row) {
  padding: 0;
  border: 0;
  background: transparent;
  color: #6a625a;
  font-family: "Merriweather", serif;
  font-size: clamp(0.82rem, 0.95vw, 0.9rem);
  font-weight: 400;
  line-height: 1.3;
}

.right-strategy-panel.charleston-coach-panel .charleston-guidance-banner.coach-pass-chip-row:not(.hidden) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.right-strategy-panel.charleston-coach-panel .charleston-guidance-banner.coach-pass-chip-row-enter {
  animation: pass-chip-row-enter 360ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

.action-typing::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.9em;
  margin-left: 0.08em;
  border-right: 2px solid currentColor;
  transform: translateY(0.08em);
  animation: action-type-caret 760ms steps(1, end) infinite;
}

.joker-exchange-actions {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
  margin-top: 0.82rem;
  width: 100%;
}

.joker-exchange-row {
  display: grid;
  gap: 0.36rem;
  min-width: 0;
  width: 100%;
}

.joker-exchange-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(149, 192, 203, 0.38);
  border-radius: 12px;
  background: rgba(247, 253, 255, 0.94);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.52rem;
  min-width: 0;
  padding: 0.42rem 0.5rem;
}

.joker-exchange-card.actionable-joker-exchange {
  border-color: rgba(0, 150, 136, 0.42);
  box-shadow: 0 0 0 1px rgba(0, 150, 136, 0.14), 0 10px 24px rgba(0, 119, 111, 0.12);
  animation: joker-card-pulse 2200ms ease-in-out infinite;
}

.joker-exchange-card.actionable-joker-exchange::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.82) 49%, rgba(255, 255, 255, 0) 63%, transparent 100%);
  transform: translateX(-120%);
  animation: joker-card-shimmer 2600ms ease-in-out infinite;
}

.joker-exchange-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.joker-exchange-title {
  color: #385f61;
  font-size: clamp(1rem, 1.18vw, 1.24rem);
  font-weight: 800;
}

.joker-exchange-tiles {
  margin-top: 0.06rem;
}

.joker-exchange-tiles .open-joker-tile {
  width: 30px;
  height: 40px;
}

.joker-exchange-card .open-joker-btn {
  position: relative;
  z-index: 1;
}

.joker-exchange-card.actionable-joker-exchange .open-joker-btn {
  animation: joker-button-glow 1600ms ease-in-out infinite;
}

@keyframes joker-card-shimmer {
  0%, 42% {
    transform: translateX(-120%);
  }
  72%, 100% {
    transform: translateX(120%);
  }
}

@keyframes joker-card-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(0, 150, 136, 0.12), 0 10px 24px rgba(0, 119, 111, 0.1);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.18), 0 12px 28px rgba(0, 119, 111, 0.16);
  }
}

@keyframes joker-button-glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  #draw-panel.charleston-incoming-panel.charleston-coach-reveal,
  .coach-pass-advice-enter,
  .coach-pass-advice-enter .coach-pass-message,
  .coach-pass-advice-enter .coach-advice-text,
  .coach-pass-advice-enter .coach-pass-chips,
  .charleston-round-typewriter,
  .joker-exchange-card.actionable-joker-exchange,
  .joker-exchange-card.actionable-joker-exchange::before,
  .joker-exchange-card.actionable-joker-exchange .open-joker-btn {
    animation: none;
  }

  .charleston-round-typewriter {
    overflow: visible;
    border-right: 0;
    clip-path: none;
    white-space: normal;
  }
}

.right-strategy-panel .open-jokers-panel {
  gap: 0.28rem;
  min-width: 0;
  margin-top: 0.82rem;
  padding: 0.42rem 0 0;
  border: 0;
  border-top: 1px solid rgba(0, 150, 136, 0.18);
  border-radius: 0;
  background: transparent;
}

.right-strategy-panel .open-jokers-panel .panel-head {
  gap: 0.42rem;
}

.right-strategy-panel .open-jokers-panel h3 {
  font-size: 0.82rem;
}

.right-strategy-panel .open-jokers-panel .inline-help {
  font-size: 0.76rem;
}

.right-strategy-panel .open-jokers-row {
  display: flex;
  gap: 0.34rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.right-strategy-panel .open-joker-card {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.34rem;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.3rem 0.38rem;
}

.right-strategy-panel .open-joker-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
}

.right-strategy-panel .open-joker-bot,
.right-strategy-panel .open-joker-need {
  font-size: 0.68rem;
}

.right-strategy-panel .open-joker-tile {
  width: 28px;
  height: 38px;
}

.strategy-reason {
  grid-column: 1 / -1;
  margin: 0;
  border-top: 1px solid rgba(0, 150, 136, 0.14);
  padding-top: 0.34rem;
  color: #5f554c;
  font-family: "Merriweather", serif;
  font-size: clamp(0.84rem, 1vw, 0.94rem);
  font-weight: 400;
  line-height: 1.32;
}

.right-table-preview {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 0.28rem;
}

.tile {
  position: relative;
  width: 72px;
  height: 96px;
  border: none;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  user-select: none;
  padding: 0;
  overflow: visible;
  box-shadow: none;
}

.tile::before {
  display: none;
}

.hero-hand-panel .tile {
  width: 78px;
  height: 106px;
  border-radius: 12px;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(67, 53, 44, 0.16);
}

.tile-corner,
.tile-motif {
  display: none;
}

.tile-art {
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}

.tile-photo-art {
  display: block;
  background-repeat: no-repeat;
  background-color: transparent;
}

.hero-hand-panel .tile .tile-art {
  width: 100%;
  height: 100%;
}

.wall-tile {
  border: 1px dashed rgba(32, 201, 195, 0.62);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8ffff 0%, #e9fefd 100%);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 0.22rem;
}

.wall-tile .tile-corner,
.wall-tile .tile-motif {
  display: block;
}

.wall-tile .tile-corner {
  font-size: 0.7rem;
  font-weight: 700;
  color: #1baea9;
}

.wall-tile .tile-motif {
  font-size: 0.58rem;
  font-weight: 700;
  color: #177f7b;
}

.tile-wall-icon {
  z-index: 1;
  font-size: 2rem;
  color: var(--miami-teal);
  line-height: 1;
}

.tile.selected,
.tile.relevant {
  box-shadow: 0 0 0 2px rgba(217, 180, 110, 0.36), 0 8px 16px rgba(98, 78, 54, 0.14);
}

.tile.drawn {
  box-shadow: 0 0 0 3px rgba(214, 132, 111, 0.3), 0 8px 16px rgba(116, 56, 41, 0.16);
}

.tile.discard {
  width: 52px;
  height: 68px;
  border-radius: 8px;
}

.tile.discard.claim-window-discard-tile {
  cursor: pointer;
}

.tile.discard.legal-call-discard-tile {
  box-shadow: 0 8px 14px rgba(0, 111, 102, 0.12);
}

.tile.discard.claim-window-discard-tile:hover {
  transform: translateY(-2px);
}

.tile.discard .tile-art {
  width: 100%;
  height: 100%;
}

.tile.discard .tile-corner,
.tile.discard .tile-motif {
  display: none;
}

.soft-btn,
.text-btn {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--button-font);
  transition: 140ms ease;
}

.soft-btn {
  background: linear-gradient(180deg, var(--sage) 0%, var(--sage-dark) 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.96rem;
  padding: 0.62rem 0.95rem;
  letter-spacing: -0.01em;
}

.soft-btn:hover {
  background: linear-gradient(180deg, #0aa79a 0%, #00887d 100%);
}

.soft-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.soft-btn.accent {
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-dark) 100%);
}

.text-btn {
  background: transparent;
  color: var(--ink-mute);
  padding: 0.25rem 0.5rem;
  font-weight: 600;
}

.strategic-alert-panel {
  margin-top: 0.72rem;
  padding-top: 0.68rem;
  border-top: 1px solid rgba(149, 192, 203, 0.34);
  display: grid;
  gap: 0.5rem;
}

.strategic-alert-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.strategic-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
}

.strategic-alert-switch-btn {
  max-width: 100%;
  padding: 0.48rem 0.72rem;
  font-size: 0.82rem;
}

.strategic-alert-dismiss-btn {
  color: #47645f;
  font-weight: 800;
}

.card-fit-badge {
  justify-self: end;
  width: max-content;
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  background: rgba(149, 192, 203, 0.28);
  color: #33646c;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card-fit-badge.blocked {
  background: rgba(167, 111, 94, 0.14);
  color: #8d4a3b;
}

.card-fit-badge.dead {
  background: #1f1d1a;
  color: #ffffff;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compact {
  min-height: 44px;
}

.card-list {
  display: grid;
  gap: 0.82rem;
}

.hand-option {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.72rem;
  background: var(--bg-soft);
  display: grid;
  gap: 0.5rem;
}

.hand-option.pinned {
  border-color: rgba(109, 143, 125, 0.68);
  box-shadow: inset 0 0 0 1px rgba(109, 143, 125, 0.4);
}

.hand-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.hand-title-row h3 {
  font-size: 1rem;
}

.hand-meta {
  font-size: 0.78rem;
  color: var(--ink-mute);
}

.pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pattern-pill {
  border-radius: 999px;
  background: #efe9de;
  padding: 0.2rem 0.52rem;
  font-size: 0.72rem;
  border: 1px solid rgba(104, 95, 89, 0.15);
}

.progress-wrap {
  display: grid;
  gap: 0.32rem;
}

.progress-track {
  height: 8px;
  width: 100%;
  background: #e4ddd1;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mustard), var(--terracotta));
}

.hidden {
  display: none;
}

.mobile-only {
  display: none;
}

@media (max-width: 1100px) {
  .mobile-only {
    display: none;
  }
}

@media (max-width: 760px) {
  .top-bar {
    grid-template-columns: 1fr;
    gap: 0.72rem;
    padding: 0.95rem 1rem 1rem;
  }

  .brand-ribbon {
    gap: 0.36rem;
  }

  .status-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .status-pill {
    min-width: 0;
  }

  .status-pill > p:last-child {
    font-size: 1.45rem;
  }

  .top-cta {
    justify-self: stretch;
  }

  .top-actions {
    justify-self: start;
    flex-direction: row;
    align-items: center;
    max-width: 100%;
  }

  .top-actions .soft-btn {
    flex: 1;
  }

  .top-nav {
    width: auto;
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.08rem;
  }

  .top-nav-tab {
    flex: 0 0 auto;
  }

  .rules-header,
  .rules-columns,
  .rules-action-grid {
    grid-template-columns: 1fr;
  }

  .rules-tile-table,
  .rules-state-list {
    grid-template-columns: 1fr;
  }

  .rules-jump-list {
    position: static;
  }

  .hero-hand-panel .tile {
    width: 64px;
    height: 88px;
  }

  .tile {
    width: 62px;
    height: 84px;
  }
}

@media (min-width: 900px) {
  .rules-view {
    height: auto;
    max-height: none;
  }
}

@media (max-width: 899px) {
  .rules-view {
    overflow-y: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }

  .hero-hand-panel .tile {
    width: 66px;
    height: 90px;
  }
}

.main-grid {
  grid-template-columns: 1fr;
}

/* Start hand modal */
.start-modal {
  position: fixed;
  inset: 0;
  background: rgba(32, 26, 20, 0.34);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 1rem;
}

.start-modal-card {
  width: min(760px, 100%);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.start-modal-copy {
  display: grid;
  gap: 0.18rem;
}

.start-modal-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.start-option {
  border: 1px solid rgba(108, 100, 94, 0.24);
  border-radius: 14px;
  background: #fffdf8;
  padding: 0.8rem;
  display: grid;
  gap: 0.45rem;
  text-align: left;
  cursor: pointer;
}

.start-option:hover {
  border-color: rgba(149, 192, 203, 0.72);
  box-shadow: 0 0 0 2px rgba(149, 192, 203, 0.22);
}

.start-option.selected {
  border-color: rgba(149, 192, 203, 0.82);
  box-shadow: 0 0 0 2px rgba(149, 192, 203, 0.22);
}

.start-option .tag-row {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.start-tag {
  border-radius: 999px;
  padding: 0.18rem 0.46rem;
  font-size: 0.68rem;
  border: 1px solid rgba(108, 100, 94, 0.2);
  background: #f5efe5;
  color: #5f5752;
}

.start-tag.reco {
  background: rgba(149, 192, 203, 0.18);
  border-color: rgba(149, 192, 203, 0.62);
  color: #426e79;
}

.start-option h3 {
  font-size: 1rem;
}

.start-option-pattern {
  font-size: 0.98rem;
  line-height: 1.28;
}

.start-option p {
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.start-option-why {
  font-weight: 700;
  color: #425d63;
  line-height: 1.35;
}

.start-option-note {
  font-size: 0.76rem;
  color: #7a716a;
  line-height: 1.3;
}

/* Polished pre-game start view */
.pre-game-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: clamp(0.9rem, 2.5vw, 2rem);
  background:
    linear-gradient(120deg, rgba(252, 248, 239, 0.48), rgba(240, 249, 252, 0.38)),
    rgba(34, 28, 22, 0.22);
  backdrop-filter: blur(10px);
}

.pre-game-modal.hidden {
  display: none !important;
}

.pre-game-card {
  position: relative;
  width: min(860px, 100%);
  padding: clamp(1rem, 2.4vw, 1.55rem);
  display: grid;
  gap: 1rem;
  overflow: hidden;
  font-family: "Merriweather Sans", sans-serif;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(242, 250, 252, 0.92)),
    var(--card);
  border: 1px solid rgba(149, 192, 203, 0.26);
  box-shadow: 0 24px 70px rgba(62, 54, 46, 0.22);
}

.pre-game-card::before {
  content: "";
  position: absolute;
  inset: auto -8% -34% auto;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(149, 192, 203, 0.28), rgba(149, 192, 203, 0));
  pointer-events: none;
}

.pre-game-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.34rem;
}

.pre-game-copy h2 {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.pre-game-subtitle {
  max-width: 720px;
  color: #52615d;
  font-size: clamp(0.95rem, 1.25vw, 1.08rem);
  font-weight: 700;
  line-height: 1.45;
}

.pre-game-value-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.18rem;
}

.pre-game-value-line span {
  border-radius: 999px;
  background: rgba(149, 192, 203, 0.16);
  border: 1px solid rgba(149, 192, 203, 0.24);
  color: #355b60;
  padding: 0.3rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.pre-game-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 0.9rem;
}

.pre-game-panel {
  border: 1px solid rgba(108, 100, 94, 0.16);
  border-radius: 20px;
  background: rgba(255, 251, 246, 0.78);
  padding: 0.78rem;
  display: grid;
  gap: 0.7rem;
}

.pre-game-label {
  color: #385f61;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-panel {
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.88), rgba(242, 250, 252, 0.78)),
    rgba(255, 251, 246, 0.78);
}

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.7rem;
}

.profile-head h3 {
  margin-top: 0.18rem;
  font-size: 1.18rem;
  line-height: 1.05;
}

.profile-summary {
  max-width: 11rem;
  color: #5e6c68;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.28;
  text-align: right;
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 0.52rem;
}

.profile-form label {
  display: grid;
  gap: 0.22rem;
}

.profile-form label:first-child,
.profile-save-btn {
  grid-column: 1 / -1;
}

.profile-form span {
  color: #4d5d59;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-form input,
.profile-form select {
  width: 100%;
  border: 1px solid rgba(108, 100, 94, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: 800 0.88rem "Merriweather Sans", sans-serif;
  padding: 0.62rem 0.68rem;
  outline: none;
}

.profile-form input:focus,
.profile-form select:focus {
  border-color: rgba(149, 192, 203, 0.92);
  box-shadow: 0 0 0 3px rgba(149, 192, 203, 0.18);
}

.profile-save-btn {
  justify-self: start;
  padding: 0.52rem 0.82rem;
  font-size: 0.84rem;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-dark) 100%);
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.profile-stats span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(108, 100, 94, 0.14);
  color: #53635f;
  padding: 0.22rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 850;
}

.profile-stats strong {
  color: #305f67;
}

.start-session-panel {
  align-content: start;
  gap: 0.82rem;
}

.start-session-panel h3 {
  max-width: 18rem;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.mode-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.mode-choice {
  border: 1px solid rgba(108, 100, 94, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 0.76rem;
  display: grid;
  gap: 0.18rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.mode-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(149, 192, 203, 0.7);
}

.mode-choice.selected {
  border-color: rgba(149, 192, 203, 0.9);
  box-shadow: 0 0 0 3px rgba(149, 192, 203, 0.18);
  background: rgba(244, 252, 254, 0.92);
}

.mode-choice span {
  font-family: var(--button-font);
  font-size: 1.05rem;
  font-weight: 900;
}

.mode-choice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.mode-choice-badge {
  border-radius: 999px;
  padding: 0.18rem 0.46rem;
  background: rgba(0, 150, 136, 0.12);
  color: #007a70;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-choice.selected .mode-choice-badge {
  background: #007a70;
  color: #fffdf8;
}

.mode-choice small,
.pre-game-toggle small {
  color: #6e655f;
  font-size: 0.78rem;
  line-height: 1.32;
  font-weight: 700;
}

.pre-game-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.62rem;
  align-items: start;
  border-radius: 18px;
  background: rgba(149, 192, 203, 0.12);
  border: 1px solid rgba(149, 192, 203, 0.28);
  padding: 0.72rem;
  cursor: pointer;
}

.pre-game-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.12rem;
  accent-color: #95C0CB;
}

.pre-game-toggle span {
  display: grid;
  gap: 0.12rem;
}

.pre-game-toggle strong {
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.95rem;
}

.pre-game-practice ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.38rem;
  color: #4f5c58;
  font-weight: 750;
  line-height: 1.35;
}

.pre-game-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.82rem;
  justify-items: stretch;
}

.learn-table-prompt {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 6.2rem;
  border: 1px solid transparent;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.94), rgba(238, 252, 248, 0.9)) padding-box,
    linear-gradient(120deg, #009688, #9370db 52%, #d96f53) border-box;
  padding: 1rem 1rem 1rem 6.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(72, 55, 38, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.learn-table-prompt::before {
  content: none;
}

.learn-table-mini-tiles {
  position: absolute;
  left: 1rem;
  top: 50%;
  width: 4.5rem;
  height: 4.35rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.learn-table-mini-tiles img {
  position: absolute;
  width: 2.7rem;
  height: 3.55rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(77, 57, 36, 0.14));
}

.learn-table-mini-tiles img:nth-child(1) {
  left: 0;
  top: 0.66rem;
  z-index: 1;
  transform: rotate(-12deg);
}

.learn-table-mini-tiles img:nth-child(2) {
  left: 0.9rem;
  top: 0.26rem;
  z-index: 2;
  transform: rotate(3deg);
}

.learn-table-mini-tiles img:nth-child(3) {
  left: 1.78rem;
  top: 0;
  z-index: 3;
  transform: rotate(13deg);
}

.learn-table-prompt::after {
  content: "";
  position: absolute;
  inset: auto -4rem -5rem auto;
  z-index: -2;
  width: 13rem;
  height: 13rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(147, 112, 219, 0.2), transparent 62%),
    radial-gradient(circle at 34% 38%, rgba(0, 150, 136, 0.18), transparent 44%);
}

.learn-table-prompt:has(.learn-table-btn:hover),
.learn-table-prompt:has(.learn-table-btn:focus-visible) {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(72, 55, 38, 0.18);
}

.learn-table-copy {
  display: grid;
  gap: 0;
}

.learn-table-prompt p {
  color: #006f67;
  font-size: 0.92rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.learn-table-copy span {
  color: #6a4a37;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.28;
}

.learn-table-btn {
  position: relative;
  min-width: 13.5rem;
  min-height: 3.35rem;
  padding: 0.86rem 1.2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 950;
  color: #ffffff;
  background: linear-gradient(180deg, #9370db 0%, #7351bd 100%);
  box-shadow: 0 10px 24px rgba(115, 81, 189, 0.22);
}

.learn-table-btn::after {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.58rem;
  border-radius: 999px;
  color: #7351bd;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  line-height: 1;
}

.learn-table-btn:hover {
  background: linear-gradient(180deg, #009688 0%, #007a70 100%);
  box-shadow: 0 12px 26px rgba(0, 122, 112, 0.24);
}

.pre-game-start-btn {
  min-width: 210px;
  padding: 0.78rem 1.25rem;
  font-size: 1.04rem;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(180deg, var(--sage) 0%, var(--sage-dark) 100%);
}

.table-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 142;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.2rem);
  background:
    radial-gradient(circle at 82% 20%, rgba(147, 112, 219, 0.1), transparent 20rem),
    radial-gradient(circle at 18% 84%, rgba(0, 150, 136, 0.1), transparent 20rem),
    linear-gradient(rgba(94, 64, 37, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 64, 37, 0.045) 1px, transparent 1px),
    #fffaf3;
  background-size: auto, auto, 72px 72px, 72px 72px, auto;
  pointer-events: auto;
}

.table-tour-overlay.hidden {
  display: none !important;
}

.table-tour-card {
  position: relative;
  width: min(1180px, 100%);
  max-height: calc(100vh - 2rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(0.7rem, 1.4vw, 1rem);
  padding: clamp(0.9rem, 1.8vw, 1.25rem);
  overflow: auto;
  background:
    radial-gradient(circle at 88% 12%, rgba(147, 112, 219, 0.08), transparent 19rem),
    radial-gradient(circle at 12% 88%, rgba(0, 150, 136, 0.08), transparent 19rem),
    rgba(255, 253, 248, 0.96);
  border-color: rgba(149, 192, 203, 0.4);
}

.table-tour-close {
  position: absolute;
  top: 0.72rem;
  right: 0.72rem;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 2.28rem;
  height: 2.28rem;
  border: 1px solid rgba(70, 62, 54, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  color: #4f4943;
  cursor: pointer;
  font: 900 1.28rem/1 var(--button-font);
}

.table-tour-close:hover,
.table-tour-close:focus-visible {
  color: #fffdf8;
  background: #008f83;
  outline: none;
}

.table-tour-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.8rem, 2vw, 1.4rem);
  padding-right: 2.75rem;
}

.table-tour-copy {
  min-width: 0;
}

.table-tour-copy h2 {
  margin-top: 0.15rem;
  color: #242424;
  font-family: "Merriweather", serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.02;
}

.table-tour-play-now {
  flex: 0 0 auto;
  min-width: clamp(9.5rem, 16vw, 12.5rem);
  min-height: 3.15rem;
  border: 1px solid rgba(116, 82, 190, 0.36);
  border-radius: 999px;
  padding: 0.8rem 1.35rem;
  color: #fffdf8;
  background:
    linear-gradient(180deg, #9b72df 0%, #7d58c7 100%);
  box-shadow:
    0 14px 26px rgba(117, 81, 189, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  cursor: pointer;
  font: 900 1rem/1 var(--button-font);
}

.table-tour-play-now:hover,
.table-tour-play-now:focus-visible {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, #a57de8 0%, #7351bd 100%);
  box-shadow:
    0 18px 30px rgba(117, 81, 189, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  outline: none;
}

.table-tour-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.38fr);
  gap: clamp(0.8rem, 1.5vw, 1.1rem);
  align-items: stretch;
}

.table-tour-demo-board {
  position: relative;
  min-height: clamp(31rem, 58vh, 42rem);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(rgba(94, 64, 37, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 64, 37, 0.045) 1px, transparent 1px),
    #fffaf3;
  background-size: 64px 64px, 64px 64px, auto;
  border: 1px solid rgba(149, 192, 203, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 253, 248, 0.72);
}

.table-tour-demo-table {
  position: absolute;
  inset: clamp(1.05rem, 2.2vw, 1.75rem);
  border: 2px solid rgba(0, 122, 112, 0.64);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 150, 136, 0.07), transparent 16rem),
    rgba(255, 253, 248, 0.32);
}

.table-tour-demo-table::before {
  content: "";
  position: absolute;
  inset: 3.8rem;
  border: 1px solid rgba(0, 122, 112, 0.42);
  border-radius: 16px;
  pointer-events: none;
}

.table-tour-demo-wall {
  position: absolute;
  left: 50%;
  bottom: 17%;
  width: min(72%, 33rem);
  height: 1.25rem;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, #c08b62 0 1.45rem, #a97550 1.45rem 1.7rem);
  box-shadow: 0 12px 22px rgba(64, 45, 31, 0.22);
  transform: translateX(-50%);
}

.table-tour-demo-rack {
  position: absolute;
  left: 50%;
  bottom: 23%;
  display: flex;
  gap: 0.18rem;
  padding: 0.35rem 0.52rem;
  border-radius: 12px;
  background: rgba(91, 58, 36, 0.82);
  box-shadow: 0 12px 20px rgba(64, 45, 31, 0.22);
  transform: translateX(-50%);
}

.table-tour-demo-rack img,
.table-tour-demo-discards img,
.table-tour-demo-exposure img {
  width: clamp(2.05rem, 4.6vw, 3rem);
  border-radius: 6px;
  box-shadow: 0 7px 12px rgba(61, 48, 36, 0.14);
}

.table-tour-demo-exposure {
  position: absolute;
  right: 11%;
  bottom: 36%;
  display: flex;
  gap: 0.12rem;
}

.table-tour-demo-action {
  position: absolute;
  left: 10%;
  top: 14%;
  width: min(15rem, 28%);
  display: grid;
  gap: 0.28rem;
  padding: 0.78rem;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(149, 192, 203, 0.32);
  box-shadow: 0 14px 28px rgba(37, 31, 24, 0.12);
}

.table-tour-demo-action strong {
  color: #242424;
  font: 900 1rem/1.1 var(--button-font);
}

.table-tour-demo-action span,
.table-tour-demo-counts,
.table-tour-demo-compass,
.table-tour-demo-sort,
.table-tour-demo-style {
  color: #006f67;
  font: 900 0.72rem/1.1 var(--button-font);
}

.table-tour-demo-discards {
  position: absolute;
  left: 10%;
  bottom: 10%;
  display: flex;
  gap: 0.18rem;
  padding: 0.42rem;
  border-radius: 13px;
  background: rgba(236, 250, 251, 0.88);
  border: 1px solid rgba(149, 192, 203, 0.42);
}

.table-tour-demo-counts,
.table-tour-demo-compass,
.table-tour-demo-sort,
.table-tour-demo-style {
  position: absolute;
  display: grid;
  place-items: center;
  min-height: 2rem;
  padding: 0.42rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(0, 122, 112, 0.2);
  box-shadow: 0 8px 16px rgba(24, 38, 35, 0.1);
}

.table-tour-demo-counts { right: 11%; top: 11%; }
.table-tour-demo-compass { right: 10%; top: 25%; }
.table-tour-demo-sort { right: 10%; bottom: 11%; }
.table-tour-demo-style { left: 10%; top: 40%; }

.table-tour-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tour-hotspot {
  position: absolute;
  z-index: 4;
  border: 1px solid rgba(67, 92, 88, 0.24);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.97);
  color: #263532;
  padding: 0.56rem 0.78rem;
  font: 900 0.76rem/1 var(--button-font);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 12px 28px rgba(37, 31, 24, 0.16);
  transform: translate(-50%, -50%);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.tour-hotspot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 1px solid rgba(255, 253, 248, 0.72);
  opacity: 0.75;
}

.tour-hotspot:hover,
.tour-hotspot:focus-visible {
  transform: translate(-50%, calc(-50% - 1px));
  border-color: rgba(149, 192, 203, 0.92);
  box-shadow: 0 16px 34px rgba(37, 31, 24, 0.22);
  outline: none;
}

.tour-hotspot.selected {
  color: #fffdf8;
  background: linear-gradient(135deg, #7452be 0%, #8e63d7 52%, #d47b5d 100%);
  border-color: rgba(255, 253, 248, 0.9);
  box-shadow:
    0 0 0 4px rgba(255, 253, 248, 0.88),
    0 0 0 8px rgba(116, 82, 190, 0.28),
    0 16px 34px rgba(82, 54, 151, 0.26);
}

.tour-hotspot.selected::after {
  inset: -9px;
  border: 2px solid rgba(212, 123, 93, 0.7);
  opacity: 1;
}

.tour-hotspot[data-table-tour="card"] { left: 18%; top: 51%; }
.tour-hotspot[data-table-tour="rack"] { left: 50%; top: 70%; }
.tour-hotspot[data-table-tour="action"] { left: 18%; top: 20%; }
.tour-hotspot[data-table-tour="discards"] { left: 20%; top: 88%; }
.tour-hotspot[data-table-tour="wall"] { left: 50%; top: 82%; }
.tour-hotspot[data-table-tour="counters"] { left: 82%; top: 13%; }
.tour-hotspot[data-table-tour="compass"] { left: 84%; top: 29%; }
.tour-hotspot[data-table-tour="sort"] { left: 83%; top: 86%; }
.tour-hotspot[data-table-tour="tile-style"] { left: 18%; top: 41%; }
.tour-hotspot[data-table-tour="exposure"] { left: 79%; top: 47%; }

.table-tour-detail {
  align-self: stretch;
  min-height: 0;
  display: grid;
  align-content: center;
  gap: 0.65rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(242, 250, 252, 0.96)),
    var(--card);
  border: 1px solid rgba(149, 192, 203, 0.32);
  box-shadow: 0 20px 44px rgba(34, 30, 25, 0.14);
}

.table-tour-detail h3 {
  color: #242424;
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.table-tour-detail p:last-of-type {
  color: #52615d;
  font-family: "Merriweather", serif;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 750;
  line-height: 1.48;
}

@media (max-width: 860px) {
  .table-tour-layout {
    grid-template-columns: 1fr;
  }

  .table-tour-demo-board {
    min-height: 34rem;
  }

  .table-tour-detail {
    align-content: start;
  }
}

@media (max-width: 560px) {
  .table-tour-overlay {
    padding: 0.5rem;
  }

  .table-tour-card {
    max-height: calc(100vh - 1rem);
  }

  .table-tour-topline {
    display: grid;
    padding-right: 2.75rem;
  }

  .table-tour-play-now {
    width: min(100%, 14rem);
    justify-self: start;
  }

  .table-tour-demo-board {
    min-height: 31rem;
  }

  .tour-hotspot {
    max-width: 8.4rem;
    padding: 0.5rem 0.62rem;
    font-size: 0.68rem;
    white-space: normal;
    line-height: 1.05;
  }

  .table-tour-demo-rack img,
  .table-tour-demo-discards img,
  .table-tour-demo-exposure img {
    width: 2rem;
  }
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(35, 31, 26, 0.22);
  backdrop-filter: blur(7px);
}

.profile-modal.hidden {
  display: none !important;
}

.profile-modal-card {
  width: min(720px, 100%);
  padding: clamp(1.15rem, 2.2vw, 1.7rem);
  display: grid;
  gap: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(244, 250, 251, 0.95)),
    var(--card);
  border: 1px solid rgba(149, 192, 203, 0.28);
  box-shadow: 0 22px 70px rgba(45, 41, 36, 0.22);
}

.profile-modal-card h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.05em;
}

.support-modal {
  z-index: 134;
}

.support-modal-card {
  position: relative;
  width: min(1080px, 100%);
  padding: 0;
  overflow: hidden;
  border-color: rgba(149, 192, 203, 0.3);
  background:
    radial-gradient(circle at 78% 30%, rgba(147, 112, 219, 0.08), transparent 21rem),
    radial-gradient(circle at 12% 82%, rgba(0, 150, 136, 0.08), transparent 22rem),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(255, 249, 241, 0.96));
  box-shadow:
    0 32px 80px rgba(37, 31, 24, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.support-modal-close {
  position: absolute;
  top: 0.92rem;
  right: 0.92rem;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid rgba(116, 82, 190, 0.18);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  color: #7452be;
  cursor: pointer;
  font: 900 1.28rem/1 Arial, sans-serif;
  box-shadow: 0 8px 18px rgba(37, 31, 24, 0.08);
}

.support-modal-close:hover,
.support-modal-close:focus-visible {
  color: #fffdf8;
  background: #7452be;
  outline: none;
}

.support-modal-support-card {
  min-height: clamp(26rem, 41vw, 34rem);
  grid-template-columns: minmax(18rem, 0.86fr) minmax(20rem, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "copy visual"
    "action visual";
  align-content: center;
  align-items: center;
  column-gap: clamp(1.8rem, 5vw, 5rem);
  row-gap: clamp(1.15rem, 1.7vw, 1.55rem);
  padding: clamp(2.1rem, 4.2vw, 3.6rem);
  border: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 253, 248, 0.9), rgba(255, 253, 248, 0.38)),
    transparent;
  box-shadow: none;
}

.support-modal-support-card .profile-support-copy {
  grid-area: copy;
  align-self: end;
  justify-self: start;
  width: min(100%, 29rem);
  text-align: left;
}

.support-modal-support-card .profile-support-copy span {
  color: #007a70;
  font-size: clamp(0.76rem, 1.05vw, 0.9rem);
  letter-spacing: 0.15em;
}

.support-modal-support-card .profile-support-copy strong {
  max-width: 29rem;
  margin-inline: 0;
  margin-top: clamp(0.52rem, 1vw, 0.72rem);
  color: #2f2d2a;
  font-family: "Fraunces", serif;
  font-size: clamp(2.65rem, 4.6vw, 4.35rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.support-modal-support-card .profile-support-copy strong span {
  display: block;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  white-space: nowrap;
}

.support-modal-support-card .profile-support-copy p {
  width: min(100%, 27.5rem);
  margin-top: clamp(1rem, 1.7vw, 1.35rem);
  margin-inline: 0;
  color: #5f6a65;
  font-family: "Merriweather", serif;
  font-size: clamp(0.98rem, 1.25vw, 1.16rem);
  font-weight: 400;
  line-height: 1.62;
}

.support-modal-support-card .profile-support-visual {
  grid-area: visual;
  align-self: center;
  justify-self: center;
  width: min(100%, 34rem);
  min-height: clamp(21rem, 33vw, 30rem);
  display: grid;
  place-items: center;
  align-content: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.support-modal-support-card .profile-support-logo {
  width: min(100%, 33rem);
  max-height: 29rem;
  object-fit: contain;
  filter:
    drop-shadow(0 20px 26px rgba(0, 88, 84, 0.12))
    drop-shadow(0 10px 18px rgba(116, 82, 190, 0.08));
}

.support-modal-support-card .profile-support-link {
  grid-area: action;
  align-self: start;
  justify-self: start;
  width: fit-content;
  min-height: 3.18rem;
  min-width: 12.8rem;
  border-radius: 999px;
  padding: 0.78rem 1.55rem;
  color: #fffdf8;
  background:
    linear-gradient(135deg, #008f83, #7452be);
  border: 1px solid rgba(255, 253, 248, 0.78);
  box-shadow:
    0 14px 26px rgba(0, 119, 111, 0.17),
    0 8px 18px rgba(116, 82, 190, 0.11);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.support-modal-support-card .profile-support-link:hover,
.support-modal-support-card .profile-support-link:focus-visible {
  background:
    linear-gradient(135deg, #007a70, #6744ad);
  border-color: rgba(255, 253, 248, 0.92);
  box-shadow:
    0 17px 30px rgba(0, 119, 111, 0.2),
    0 10px 20px rgba(116, 82, 190, 0.14);
  transform: translateY(-1px);
}

.support-modal-donate-area {
  grid-area: action;
  align-self: start;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.support-modal-donate-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.donate-amount-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.6rem;
  min-height: 3.18rem;
  border-radius: 999px;
  padding: 0.62rem 1.15rem;
  color: #fffdf8;
  background: linear-gradient(135deg, #008f83, #7452be);
  border: 1px solid rgba(255, 253, 248, 0.78);
  box-shadow:
    0 14px 26px rgba(0, 119, 111, 0.17),
    0 8px 18px rgba(116, 82, 190, 0.11);
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.donate-amount-btn:hover,
.donate-amount-btn:focus-visible {
  background: linear-gradient(135deg, #007a70, #6744ad);
  border-color: rgba(255, 253, 248, 0.92);
  box-shadow:
    0 17px 30px rgba(0, 119, 111, 0.2),
    0 10px 20px rgba(116, 82, 190, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.support-modal-skip-btn {
  border: none;
  background: none;
  padding: 0.2rem 0;
  color: #6b7a76;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .support-modal-card {
    width: min(100%, calc(100vw - 1rem));
  }

  .support-modal-support-card {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-areas:
      "visual"
      "copy"
      "action";
    justify-items: center;
    row-gap: 1rem;
    padding: clamp(1.35rem, 6vw, 2rem);
  }

  .support-modal-support-card .profile-support-copy {
    align-self: center;
    justify-self: center;
    text-align: center;
  }

  .support-modal-support-card .profile-support-copy strong {
    max-width: 22rem;
    font-size: clamp(2.25rem, 11vw, 3.35rem);
  }

  .support-modal-support-card .profile-support-copy p {
    width: min(100%, 21rem);
    font-size: clamp(0.9rem, 4.2vw, 1.02rem);
    line-height: 1.54;
  }

  .support-modal-support-card .profile-support-visual {
    width: min(100%, 23rem);
    min-height: clamp(13.5rem, 58vw, 21rem);
    padding: 0;
  }

  .support-modal-support-card .profile-support-logo {
    width: min(100%, 22rem);
    max-height: 20rem;
  }

  .support-modal-support-card .profile-support-link {
    justify-self: center;
    min-width: min(100%, 13.5rem);
  }

  .support-modal-donate-area {
    justify-self: center;
    align-items: center;
  }

  .support-modal-donate-options {
    justify-content: center;
  }
}

#donation-thanks-modal {
  z-index: 135;
}

.donation-thanks-card {
  position: relative;
  width: min(420px, 100%);
  text-align: center;
  justify-items: center;
}

.donation-thanks-card #donation-thanks-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #007a70;
}

.profile-modal-stats {
  gap: 0.5rem;
}

.profile-modal-stats span {
  padding: 0.5rem 0.68rem;
  font-size: 0.82rem;
}

.account-profile-form {
  display: grid;
  gap: 1rem;
}

.account-profile-top {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.34fr) minmax(0, 1fr);
  gap: clamp(0.95rem, 2vw, 1.35rem);
  align-items: stretch;
  padding: clamp(0.86rem, 1.4vw, 1rem);
  border: 1px solid rgba(147, 112, 219, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 150, 136, 0.14), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(147, 112, 219, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.58);
}

.account-profile-fields {
  display: grid;
  gap: 0.78rem;
  align-content: center;
}

.account-profile-form label {
  display: grid;
  gap: 0.34rem;
  color: #46625e;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-profile-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(0, 150, 136, 0.22);
  border-radius: 12px;
  padding: 0.72rem 0.82rem;
  background: rgba(255, 253, 248, 0.92);
  color: #302b27;
  font-family: "Merriweather", serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.account-profile-form input:focus {
  outline: none;
  border-color: rgba(0, 150, 136, 0.62);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.14);
}

.account-profile-hero {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.7rem;
  min-height: 100%;
  padding: 0.1rem;
}

.account-profile-upload {
  min-height: 2.35rem;
  padding: 0.48rem 0.8rem;
  border: 1px solid rgba(0, 150, 136, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.76);
  color: #006f66;
  cursor: pointer;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.account-profile-avatar-preview {
  width: clamp(7.4rem, 13vw, 9rem);
  height: clamp(7.4rem, 13vw, 9rem);
  border-radius: 24px;
  font-size: clamp(2.35rem, 4vw, 3.25rem);
  box-shadow:
    0 14px 28px rgba(33, 104, 108, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.account-profile-preferences {
  display: grid;
  gap: 0.62rem;
  margin-top: 0.1rem;
  padding: 0.78rem;
  border: 1px solid rgba(0, 150, 136, 0.16);
  border-radius: 14px;
  background: rgba(247, 253, 255, 0.58);
}

.account-profile-pref-head {
  display: grid;
  gap: 0.16rem;
}

.account-profile-pref-head span,
.account-profile-pref-row > span {
  color: #46625e;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-profile-pref-head p {
  margin: 0;
  color: #6a625c;
  font-family: "Merriweather", serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.account-profile-pref-row {
  display: grid;
  grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
  align-items: center;
  gap: 0.62rem;
}

.account-profile-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.28rem;
  padding: 0.24rem;
  border: 1px solid rgba(0, 150, 136, 0.16);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
}

.account-profile-segmented button {
  min-width: 0;
  border: 0;
  border-radius: 9px;
  padding: 0.52rem 0.62rem;
  background: transparent;
  color: #315f59;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.account-profile-segmented button.active {
  background: rgba(0, 150, 136, 0.14);
  color: #006f66;
  box-shadow: inset 0 0 0 1px rgba(0, 150, 136, 0.2);
}

.account-profile-segmented button:not(.active):hover,
.account-profile-segmented button:not(.active):focus-visible {
  background: rgba(147, 112, 219, 0.1);
  color: #5a3faf;
}

.account-profile-actions {
  display: flex;
  justify-content: flex-end;
}

.account-profile-actions .soft-btn {
  min-width: 7.5rem;
  justify-content: center;
}

@media (max-width: 520px) {
  .account-profile-top,
  .account-profile-pref-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-profile-hero {
    justify-items: start;
  }
}

body.help-less .discard-coach-panel {
  display: none !important;
}

@media (max-width: 760px) {
  .start-modal-options {
    grid-template-columns: 1fr;
  }

  .pre-game-layout,
  .mode-choice-grid {
    grid-template-columns: 1fr;
  }

  .profile-summary {
    text-align: left;
  }

  .pre-game-actions {
    justify-items: stretch;
  }

  .pre-game-start-btn,
  .learn-table-btn,
  .learn-table-prompt {
    width: 100%;
  }

  .learn-table-prompt {
    grid-template-columns: 1fr;
    padding: 4.6rem 0.9rem 0.9rem;
    text-align: left;
  }

  .learn-table-prompt::before {
    content: none;
  }

  .learn-table-mini-tiles {
    left: 1rem;
    top: 0.82rem;
    transform: none;
  }

  .learn-table-btn {
    min-width: 0;
    justify-content: center;
  }

  .tour-hotspot {
    max-width: 38vw;
    white-space: normal;
    line-height: 1.1;
  }

  .table-tour-detail {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    top: auto;
    width: auto;
  }

}

/* 2025-inspired card view */
.year-card {
  display: grid;
  gap: 0.7rem;
}

.year-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px dashed rgba(98, 90, 84, 0.25);
  padding-bottom: 0.4rem;
}

.year-card-title {
  font-family: "Merriweather Sans", sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.year-card-sub {
  font-size: 0.74rem;
  color: var(--ink-mute);
}

.year-card-section {
  display: grid;
  gap: 0.4rem;
  border: 1px solid rgba(108, 100, 94, 0.22);
  border-radius: 12px;
  background: #fffdf8;
  padding: 0.55rem;
}

.year-card-section h3 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.year-card-line {
  display: grid;
  gap: 0.15rem;
  border-radius: 10px;
  background: #f8f2e7;
  padding: 0.4rem 0.5rem;
}

.year-card-line strong {
  font-size: 0.77rem;
}

.year-card-line span {
  font-size: 0.72rem;
  color: #675e58;
}

/* Render the inspired hand card as one visual image */
.year-card-image-wrap {
  border: 1px solid rgba(108, 100, 94, 0.24);
  border-radius: 12px;
  overflow: hidden;
  background: #fffdf9;
}

.year-card-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Draw-to-hand + Charleston drag UX */
.charleston-grid {
  display: grid;
  gap: 0.72rem;
}

.charleston-lane {
  border: 1px solid rgba(108, 100, 94, 0.24);
  border-radius: 12px;
  padding: 0.58rem;
  background: rgba(255, 252, 246, 0.82);
  display: grid;
  gap: 0.45rem;
}

.incoming-lane {
  background: linear-gradient(180deg, rgba(240, 251, 250, 0.96), rgba(252, 255, 253, 0.9));
  border-color: rgba(32, 201, 195, 0.32);
}

.outgoing-lane {
  background: linear-gradient(180deg, rgba(255, 244, 250, 0.96), rgba(255, 252, 247, 0.9));
  border-color: rgba(239, 92, 178, 0.32);
}

.lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}

.lane-count {
  font-weight: 700;
  color: #5b5652;
}

.lane-row {
  min-height: 96px;
}

.drop-zone {
  min-height: 96px;
  border: 1px dashed rgba(108, 100, 94, 0.36);
  border-radius: 10px;
  padding: 0.45rem;
  background: rgba(255, 253, 247, 0.76);
}

.drop-zone:empty::before {
  content: "Drag tiles here to swap";
  font-size: 0.8rem;
  color: #8a7f76;
  align-self: center;
}

.tile.tile-hit {
  animation: tile-hit 620ms cubic-bezier(0.2, 0.82, 0.25, 1) both;
  transform-origin: 50% 88%;
  will-change: transform, filter;
}

.tile.tile-hit.deal-tile-entry {
  animation: deal-tile-enter 430ms cubic-bezier(0.2, 0.76, 0.24, 1.02) both;
  transform-origin: 50% 92%;
  will-change: transform, opacity, filter;
}

.tile.incoming-pop {
  animation: incoming-pop 470ms cubic-bezier(0.2, 0.9, 0.24, 1.08) both;
  transform-origin: 50% 90%;
  will-change: transform, filter;
}

.tile.charleston-fly-tile {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.tile.charleston-transfer-target {
  opacity: 0 !important;
}

@keyframes tile-hit {
  0% {
    opacity: 0;
    transform: translateY(-24px) scale(0.95) rotateX(24deg);
    filter: saturate(0.82) drop-shadow(0 18px 12px rgba(36, 30, 24, 0.03));
  }

  68% {
    opacity: 1;
    transform: translateY(4px) scale(1.01) rotateX(0deg);
    filter: saturate(1.04) drop-shadow(0 6px 8px rgba(36, 30, 24, 0.12));
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
    filter: saturate(1) drop-shadow(0 3px 6px rgba(36, 30, 24, 0.09));
  }
}

@keyframes deal-tile-enter {
  0% {
    opacity: 0;
    transform: translateY(-38px) scale(0.97) rotate(-0.75deg);
    filter: saturate(0.88) drop-shadow(0 18px 13px rgba(36, 30, 24, 0.04));
  }

  80% {
    opacity: 1;
    transform: translateY(3px) scale(1.006) rotate(0deg);
    filter: saturate(1.03) drop-shadow(0 7px 8px rgba(36, 30, 24, 0.13));
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
    filter: saturate(1) drop-shadow(0 3px 6px rgba(36, 30, 24, 0.09));
  }
}

@keyframes incoming-pop {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.93) rotateX(22deg);
    filter: saturate(0.8);
  }

  72% {
    opacity: 1;
    transform: translateY(3px) scale(1.02) rotateX(0deg);
    filter: saturate(1.05);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
    filter: saturate(1);
  }
}

@keyframes charleston-panel-enter {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pass-chip-row-enter {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes coach-pass-advice-enter {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes charleston-round-type {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes coach-pass-message-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.992);
  }

  72% {
    opacity: 1;
    transform: translateY(-1px) scale(1.004);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes coach-pass-chips-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  68% {
    opacity: 1;
    transform: translateY(-1px) scale(1.018);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes charleston-coach-reveal {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    box-shadow: 0 8px 20px rgba(106, 88, 62, 0.04);
  }

  62% {
    opacity: 1;
    transform: translateY(-2px) scale(1.006);
    box-shadow: 0 18px 36px rgba(234, 154, 132, 0.18);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.claim-panel {
  border: 1px solid rgba(149, 192, 203, 0.48);
  border-radius: 16px;
  padding: 0.6rem;
  background: rgba(246, 253, 255, 0.94);
  display: grid;
  gap: 0.45rem;
}

.claim-reason,
.discard-coach-text {
  margin: 0;
  color: #3f5f5d;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.28;
}

.discard-coach-panel {
  border-radius: 16px;
  border: 1px solid rgba(149, 192, 203, 0.34);
  background: rgba(255, 251, 246, 0.9);
  padding: 0.54rem 0.62rem;
  display: grid;
  gap: 0.22rem;
}

.discard-coach-panel.callable {
  background: rgba(242, 252, 255, 0.94);
  border-color: rgba(149, 192, 203, 0.52);
}

.discard-coach-panel.not-callable {
  background: rgba(255, 249, 240, 0.94);
  border-color: rgba(217, 180, 110, 0.42);
}

.discard-coach-title {
  margin: 0;
  color: #385f61;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.open-jokers-panel {
  border: 1px solid rgba(149, 192, 203, 0.34);
  border-radius: 14px;
  padding: 0.55rem 0.6rem;
  background: rgba(247, 253, 255, 0.92);
  display: grid;
  gap: 0.45rem;
}

.open-jokers-panel .panel-head {
  margin-bottom: 0;
}

.open-jokers-panel h3 {
  font-size: 1rem;
}

.open-jokers-row {
  display: grid;
  gap: 0.45rem;
}

.open-joker-card {
  border: 1px solid rgba(149, 192, 203, 0.28);
  border-radius: 12px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  gap: 0.36rem;
}

.open-joker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.open-joker-bot,
.open-joker-need {
  font-size: 0.82rem;
  font-weight: 700;
  color: #3d575d;
}

.open-joker-tiles {
  display: flex;
  gap: 0.28rem;
  align-items: center;
}

.open-joker-tile {
  width: 42px;
  height: 56px;
  flex: 0 0 auto;
}

.open-joker-btn {
  min-width: 138px;
  padding: 0.42rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffffff;
}

.discard-latest-wrap {
  border: 1px solid rgba(108, 100, 94, 0.22);
  border-radius: 12px;
  padding: 0.52rem;
  background: rgba(255, 251, 245, 0.88);
  display: grid;
  gap: 0.38rem;
}

.discard-pool {
  position: relative;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0 0.55rem 0.55rem;
  scroll-padding-inline: 0.55rem;
}

.discard-pool::-webkit-scrollbar {
  height: 9px;
}

.discard-pool::-webkit-scrollbar-thumb {
  background: rgba(140, 127, 116, 0.45);
  border-radius: 999px;
}

.discard-item {
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  flex: 0 0 auto;
  min-width: 52px;
  transition: opacity 180ms ease, filter 180ms ease, transform 300ms ease;
}

.claimable-discard-item {
  color: #006f66;
}

.live-discard-item {
  position: relative;
  padding-bottom: 0.32rem;
}

.live-discard-slider {
  position: absolute;
  left: 0;
  bottom: 0.16rem;
  z-index: 3;
  display: block;
  width: var(--live-discard-width, 52px);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #009688, #7d6ad8);
  box-shadow: 0 4px 10px rgba(0, 111, 102, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--live-discard-left, 0px));
  transition:
    transform 320ms ease,
    width 320ms ease,
    opacity 140ms ease;
}

.live-discard-slider.visible {
  opacity: 1;
}

.called-discard-item {
  color: #766f68;
}

.called-discard-item .discard-by {
  color: #8a837c;
}

.tile.discard.called-discard-tile {
  opacity: 0.46;
  filter: grayscale(0.86) saturate(0.52);
  box-shadow: none;
}

.called-discard-banner {
  min-width: 52px;
  border-radius: 999px;
  padding: 0.09rem 0.34rem 0.11rem;
  background: rgba(116, 110, 104, 0.16);
  color: #625c56;
  font-size: 0.56rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
}

.claimable-discard-item .discard-by {
  color: #006f66;
  font-weight: 900;
}

.latest-discard-item {
  position: relative;
}

.latest-discard-item .discard-by {
  color: #00796f;
}

.discard-call-open {
  border-radius: 999px;
  padding: 0.08rem 0.34rem;
  background: rgba(0, 150, 136, 0.14);
  color: #006f66;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.discard-call-event {
  background: rgba(147, 112, 219, 0.15);
  color: #6744ad;
}

.discard-by {
  width: 52px;
  max-width: 52px;
  overflow: hidden;
  color: #716861;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.exposure-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-height: 48px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
}

.exposure-set {
  border: 1px solid rgba(149, 192, 203, 0.44);
  border-radius: 0.88rem;
  background: rgba(255, 251, 246, 0.94);
  padding: 0.24rem 0.3rem;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.34rem;
  align-items: center;
  flex: 0 0 auto;
}

.exposure-tiles {
  display: flex;
  gap: 0.18rem;
}

.exposure-tile {
  width: 34px;
  height: 46px;
  border-radius: 8px;
  padding: 0;
}

.exposure-label {
  max-width: 9.5rem;
  font-size: 0.58rem;
  color: #47645f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
  font-weight: 800;
}

.charleston-intro-modal {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(29, 22, 18, 0.36);
}

.charleston-intro-modal.hidden {
  display: none;
}

.charleston-intro-card {
  width: min(520px, calc(100vw - 2rem));
  display: grid;
  justify-items: center;
  gap: clamp(0.72rem, 1.35vw, 0.95rem);
  padding: clamp(1.35rem, 3vw, 1.9rem) clamp(1.1rem, 3vw, 1.75rem) clamp(1.3rem, 2.8vw, 1.7rem);
  border: 1px solid rgba(255, 253, 248, 0.82);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 8%, rgba(0, 150, 136, 0.08), transparent 12rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 249, 241, 0.96));
  box-shadow: 0 20px 46px rgba(42, 32, 27, 0.2);
}

.charleston-intro-card h2 {
  width: 100%;
  max-width: 100%;
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.9rem, 4.2vw, 2.45rem);
  color: #17675f;
  letter-spacing: 0;
  line-height: 1.02;
  overflow: visible;
  white-space: normal;
  text-align: center;
  text-wrap: balance;
}

.charleston-intro-card p {
  margin: 0;
  color: #46413d;
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.38;
  text-align: center;
}

.charleston-intro-divider,
.charleston-seat-note,
.charleston-intro-instructions,
.charleston-intro-actions {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: charleston-intro-pop 360ms cubic-bezier(0.18, 0.9, 0.28, 1.08) both;
}

.charleston-intro-divider {
  width: min(9rem, 48%);
  height: 0.18rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 150, 136, 0), rgba(0, 150, 136, 0.76), rgba(147, 112, 219, 0.74), rgba(147, 112, 219, 0));
  animation-delay: 140ms;
}

.charleston-seat-note {
  display: grid;
  gap: 0.52rem;
  width: min(100%, 26.5rem);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  animation-delay: 300ms;
}

.charleston-seat-kicker {
  justify-self: start;
  color: #2f5d56;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.72rem, 1.45vw, 0.82rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
}

.charleston-seat-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}

.charleston-seat-fact {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.48rem 0.56rem;
  border: 1px solid rgba(83, 137, 130, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.58);
  color: #3f3a35;
  font-size: clamp(0.86rem, 1.45vw, 0.95rem);
  line-height: 1.15;
}

.charleston-seat-fact-wide {
  grid-column: 1 / -1;
}

.charleston-seat-fact strong {
  color: #2f5d56;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.62rem, 1.2vw, 0.72rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.charleston-seat-fact em {
  font-style: normal;
}

.charleston-seat-fact-wide em {
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
}

.charleston-intro-instructions {
  display: grid;
  width: min(100%, 24rem);
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation-delay: 460ms;
}

.charleston-intro-instructions p {
  font-weight: 500;
}

.charleston-intro-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.36rem;
  padding-top: 0;
  color: #5c534b;
}

.charleston-intro-note span {
  color: var(--sage-dark);
  font-weight: 900;
  line-height: 1.45;
}

.charleston-highlighter {
  display: inline;
  padding: 0.02em 0.18em 0.08em;
  border-radius: 0.18em 0.38em 0.16em 0.34em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 12%, rgba(255, 222, 128, 0.78) 12%, rgba(255, 222, 128, 0.78) 88%, rgba(255, 255, 255, 0) 88%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: #2f2a23;
  font-weight: 900;
}

.charleston-intro-card strong {
  color: #2d5f58;
  font-weight: 900;
}

.charleston-intro-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-top: clamp(0.25rem, 1vw, 0.62rem);
  animation-delay: 620ms;
}

.charleston-intro-actions .soft-btn {
  min-width: min(100%, 13.8rem);
  min-height: 3rem;
  justify-content: center;
  border-radius: 999px;
  font-size: clamp(0.95rem, 1.55vw, 1.05rem);
}

@keyframes charleston-intro-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .charleston-intro-card h2 {
    overflow: visible;
    border-right: 0;
    clip-path: none;
    white-space: normal;
  }

  .charleston-intro-divider,
  .charleston-seat-note,
  .charleston-intro-instructions,
  .charleston-intro-actions {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.rule-popup {
  position: fixed;
  inset: 0;
  background: rgba(29, 22, 18, 0.38);
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 1rem;
}

.rule-popup-card {
  width: min(620px, 100%);
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
  justify-items: start;
}

.rule-popup-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.62rem;
}

.rule-popup-choice-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.72rem;
}

.rule-popup-choice-actions.hidden {
  display: none;
}

.rule-popup-choice-btn {
  min-height: 5.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0, 137, 123, 0.34);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(237, 249, 246, 0.96), rgba(255, 255, 255, 0.98));
  color: #2f2a27;
  display: grid;
  gap: 0.42rem;
  align-content: center;
  justify-items: center;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(36, 83, 76, 0.08);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.rule-popup-choice-btn:hover,
.rule-popup-choice-btn:focus-visible {
  border-color: #008f83;
  box-shadow: 0 10px 22px rgba(0, 137, 123, 0.16);
  transform: translateY(-1px);
  outline: none;
}

.rule-popup-choice-btn.is-selected {
  border-color: #008f83;
  background: linear-gradient(145deg, rgba(220, 245, 239, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow:
    0 0 0 3px rgba(0, 143, 131, 0.13),
    0 10px 22px rgba(0, 137, 123, 0.14);
}

.rule-popup-choice-btn:active {
  transform: translateY(1px) scale(0.99);
}

.rule-popup-choice-btn strong {
  color: #006f66;
  font-family: var(--button-font);
  font-size: 1rem;
  font-weight: 900;
}

.rule-popup-choice-btn span {
  color: #665d57;
  font-family: var(--body-font);
  font-size: 0.84rem;
  line-height: 1.35;
}

.rule-popup-choice-btn .rule-popup-choice-notation {
  color: #433d38;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.055em;
}

.rule-popup.exposure-choice-popup .rule-popup-card {
  width: min(680px, 100%);
  padding: 1.2rem;
  gap: 0.9rem;
}

.rule-popup.exposure-choice-popup #rule-popup-text {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 750;
}

.rule-popup.exposure-choice-popup .rule-popup-actions {
  justify-content: space-between;
}

.rule-popup.exposure-choice-popup #rule-popup-close {
  order: -1;
  min-width: 4.6rem;
  min-height: 2.1rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(167, 61, 58, 0.28);
  border-radius: 999px;
  color: var(--tile-red);
  background: transparent;
  box-shadow: none;
  font-size: 0.78rem;
  justify-content: center;
}

.rule-popup.exposure-choice-popup #rule-popup-close:hover,
.rule-popup.exposure-choice-popup #rule-popup-close:focus-visible {
  color: var(--tile-red);
  background: rgba(167, 61, 58, 0.08);
  border-color: rgba(167, 61, 58, 0.42);
  box-shadow: none;
  outline: none;
}

.rule-popup.exposure-choice-popup #rule-popup-confirm {
  min-width: 9.5rem;
  min-height: 2.8rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid rgba(0, 119, 111, 0.38);
  border-radius: 999px;
  color: #fffdf8;
  background: var(--sage);
  box-shadow: 0 8px 18px rgba(0, 119, 111, 0.16);
}

.rule-popup.exposure-choice-popup #rule-popup-confirm:hover,
.rule-popup.exposure-choice-popup #rule-popup-confirm:focus-visible {
  color: #fffdf8;
  background: var(--sage-dark);
  border-color: rgba(0, 119, 111, 0.5);
  outline: none;
}

.rule-popup.exposure-choice-popup #rule-popup-confirm:disabled {
  color: rgba(255, 253, 248, 0.84);
  background: #85aaa5;
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
}

.rule-popup-confirm {
  min-height: 2.45rem;
  padding: 0.56rem 0.88rem;
  border-radius: 10px;
  color: #8f3f8f;
  font-family: var(--button-font);
  font-weight: 900;
}

.rule-popup.discard-warning-popup #rule-popup-close {
  min-width: 6.6rem;
  justify-content: center;
}

#rule-popup-text {
  font-size: 0.95rem;
  color: #433d38;
  line-height: 1.4;
}

.rule-popup.hidden {
  display: none;
}

.play-transition {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  background: rgba(29, 22, 18, 0.16);
  animation: play-transition-backdrop 3000ms ease both;
  isolation: isolate;
}

.play-transition.hidden {
  display: none;
}

.play-transition-mahjong,
.play-transition-wall {
  animation-duration: 3800ms;
}

.play-transition-bot {
  animation-duration: 5000ms;
}

.play-transition-exposure {
  animation-duration: 2200ms;
}

.play-transition-card {
  position: relative;
  z-index: 2;
  overflow: visible;
  width: min(420px, calc(100% - 2rem));
  padding: 0.85rem 1.2rem 1.05rem;
  text-align: center;
  border: 1px solid rgba(0, 150, 136, 0.24);
  box-shadow: 0 24px 54px rgba(34, 28, 24, 0.18);
  animation: play-transition-card 3000ms ease both;
}

.play-transition-mahjong .play-transition-card,
.play-transition-wall .play-transition-card {
  width: min(480px, calc(100% - 2rem));
  padding: 1.25rem 1.35rem 1.35rem;
  animation-duration: 3800ms;
}

.play-transition-bot .play-transition-card {
  width: min(480px, calc(100% - 2rem));
  padding: 1.25rem 1.35rem 1.35rem;
  animation-duration: 5000ms;
}

.play-transition-mahjong .play-transition-card {
  border-color: rgba(147, 112, 219, 0.34);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 205, 101, 0.28), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(0, 150, 136, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 251, 246, 0.98), rgba(247, 252, 251, 0.98));
  box-shadow:
    0 30px 68px rgba(54, 38, 99, 0.22),
    0 0 0 6px rgba(255, 255, 255, 0.34);
}

.play-transition-mahjong .play-transition-card::before,
.play-transition-mahjong .play-transition-card::after {
  content: "";
  position: absolute;
  inset: -0.72rem;
  z-index: -1;
  border-radius: inherit;
  border: 2px solid rgba(0, 150, 136, 0.2);
  animation: mahjong-card-spark-ring 3800ms ease both;
}

.play-transition-mahjong .play-transition-card::after {
  inset: -1.15rem;
  border-color: rgba(147, 112, 219, 0.18);
  animation-delay: 160ms;
}

.play-transition-wall .play-transition-card {
  border-color: rgba(92, 126, 140, 0.28);
  box-shadow: 0 28px 64px rgba(46, 62, 70, 0.18);
}

.play-transition-bot .play-transition-card {
  border-color: rgba(216, 126, 100, 0.28);
  box-shadow: 0 28px 64px rgba(90, 52, 39, 0.16);
}

.play-transition-exposure .play-transition-card {
  border-color: rgba(0, 150, 136, 0.32);
  box-shadow: 0 24px 54px rgba(0, 150, 136, 0.16);
  animation-duration: 2200ms;
}

.play-transition-burst {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.play-transition-burst span {
  position: absolute;
  left: var(--x-start);
  top: -10vh;
  width: var(--size);
  height: calc(var(--size) * 1.9);
  border-radius: 0.12rem;
  background: hsl(var(--hue), 76%, 58%);
  opacity: 0;
  transform: translate3d(0, 0, 0) rotate(0deg);
  animation: result-confetti 2900ms cubic-bezier(0.18, 0.78, 0.28, 1) var(--delay) both;
}

.play-transition-mahjong .play-transition-burst span {
  top: var(--y-start);
  height: calc(var(--size) * 1.65);
  border-radius: 0.08rem 0.18rem 0.08rem 0.18rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36);
  animation-name: mahjong-card-confetti;
  animation-duration: 3400ms;
  animation-timing-function: cubic-bezier(0.16, 0.86, 0.2, 1);
}

.play-transition-wall .play-transition-burst span {
  height: var(--size);
  border-radius: 999px;
  background: rgba(0, 150, 136, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
  animation-name: result-wall-float;
}

.play-transition-bot .play-transition-burst span {
  background: hsl(14deg, 62%, 60%);
  animation-name: result-table-pop;
}

.play-transition-exposure .play-transition-burst span {
  background: hsl(var(--hue), 56%, 62%);
  animation-duration: 1800ms;
}

.play-transition:not(.play-transition-play) .play-transition-tiles {
  display: none;
}

.play-transition-tiles {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.42rem;
  height: 3.15rem;
  width: min(13rem, 100%);
  margin: 0 auto 0.2rem;
}

.play-transition-tile {
  position: relative;
  flex: 0 0 auto;
  height: 3.05rem;
  width: auto;
  display: block;
  filter: drop-shadow(0 0.42rem 0.45rem rgba(69, 55, 39, 0.18));
  animation: play-tile-drop 3000ms cubic-bezier(0.18, 0.85, 0.18, 1) both;
}

.transition-tile-joker {
  --tile-rotate-start: -14deg;
  --tile-rotate-end: -5deg;
  animation-delay: 80ms;
}

.transition-tile-dot {
  --tile-rotate-start: 10deg;
  --tile-rotate-end: 4deg;
  animation-delay: 190ms;
}

.transition-tile-flower {
  --tile-rotate-start: 16deg;
  --tile-rotate-end: 6deg;
  animation-delay: 300ms;
}

.play-transition-card p {
  margin: 0;
  color: var(--sage-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-transition-card h2 {
  margin: 0.18rem 0 0;
  color: var(--ink);
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.play-transition-mahjong .play-transition-card h2,
.play-transition-wall .play-transition-card h2,
.play-transition-bot .play-transition-card h2 {
  font-size: clamp(2.15rem, 5vw, 3.25rem);
}

.play-transition-detail {
  display: block;
  margin-top: 0.58rem;
  color: #5f554c;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.25;
}

.play-transition-detail.hidden {
  display: none;
}

@keyframes play-transition-backdrop {
  0%,
  100% {
    opacity: 0;
  }

  14%,
  86% {
    opacity: 1;
  }
}

@keyframes play-transition-card {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  14%,
  86% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
}

@keyframes result-confetti {
  0% {
    opacity: 0;
    transform: translate3d(0, -8vh, 0) rotate(0deg);
  }

  12% {
    opacity: 1;
  }

  82% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(var(--x-end) - var(--x-start)), 112vh, 0) rotate(var(--spin));
  }
}

@keyframes mahjong-card-confetti {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.35);
  }

  9% {
    opacity: 1;
  }

  30% {
    opacity: 1;
    transform: translate3d(var(--burst-x), var(--burst-y), 0) rotate(calc(var(--spin) * 0.36)) scale(1);
  }

  82% {
    opacity: 0.92;
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(var(--burst-x) + var(--fall-x)), calc(var(--burst-y) + var(--fall-y)), 0) rotate(var(--spin)) scale(0.82);
  }
}

@keyframes mahjong-card-spark-ring {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  14%,
  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes result-wall-float {
  0% {
    opacity: 0;
    transform: translate3d(0, 102vh, 0) scale(0.4);
  }

  18%,
  76% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    transform: translate3d(calc((var(--x-end) - var(--x-start)) * 0.25), 18vh, 0) scale(1.35);
  }
}

@keyframes result-table-pop {
  0% {
    opacity: 0;
    transform: translate3d(0, 56vh, 0) rotate(-20deg) scale(0.7);
  }

  18% {
    opacity: 0.9;
    transform: translate3d(calc((var(--x-end) - var(--x-start)) * 0.12), 36vh, 0) rotate(12deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate3d(calc((var(--x-end) - var(--x-start)) * 0.32), 18vh, 0) rotate(var(--spin)) scale(0.8);
  }
}

@keyframes play-tile-drop {
  0% {
    opacity: 0;
    transform: translateY(-6.5rem) rotate(var(--tile-rotate-start)) scale(0.95);
  }

  22% {
    opacity: 1;
    transform: translateY(0.16rem) rotate(var(--tile-rotate-end)) scale(1);
  }

  29% {
    opacity: 1;
    transform: translateY(-0.22rem) rotate(var(--tile-rotate-end)) scale(1);
  }

  38%,
  86% {
    opacity: 1;
    transform: translateY(0) rotate(var(--tile-rotate-end)) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-0.2rem) rotate(var(--tile-rotate-end)) scale(0.98);
  }
}

/* Image-first tile overrides */
.tile:not(.wall-tile) {
  padding: 0 !important;
  overflow: hidden !important;
  border: 2px solid #e6d9c3;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(92, 81, 67, 0.12);
}

.tile:not(.wall-tile) .tile-art {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center;
  image-rendering: auto;
}

.tile.suit-wind:not(.wall-tile),
.tile.suit-flower:not(.wall-tile),
.tile.suit-bam:not(.wall-tile),
.tile.suit-dot:not(.wall-tile),
.tile.suit-dragon:not(.wall-tile),
.tile.suit-crak:not(.wall-tile),
.tile.suit-joker:not(.wall-tile) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.tile.suit-wind:not(.wall-tile) .tile-art,
.tile.suit-flower:not(.wall-tile) .tile-art,
.tile.suit-bam:not(.wall-tile) .tile-art,
.tile.suit-dot:not(.wall-tile) .tile-art,
.tile.suit-dragon:not(.wall-tile) .tile-art,
.tile.suit-crak:not(.wall-tile) .tile-art,
.tile.suit-joker:not(.wall-tile) .tile-art {
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 0 !important;
  transform: none !important;
}

.tile.suit-wind.selected,
.tile.suit-wind.relevant,
.tile.suit-wind.drawn,
.tile.suit-flower.selected,
.tile.suit-flower.relevant,
.tile.suit-flower.drawn,
.tile.suit-bam.selected,
.tile.suit-bam.relevant,
.tile.suit-bam.drawn,
.tile.suit-dot.selected,
.tile.suit-dot.relevant,
.tile.suit-dot.drawn,
.tile.suit-dragon.selected,
.tile.suit-dragon.relevant,
.tile.suit-dragon.drawn,
.tile.suit-crak.selected,
.tile.suit-crak.relevant,
.tile.suit-crak.drawn,
.tile.suit-joker.selected,
.tile.suit-joker.relevant,
.tile.suit-joker.drawn {
  box-shadow: none !important;
}

.hand-row .tile.drawn-rack-tile {
  margin-left: 0.9rem;
  transform: translateY(-8px);
  box-shadow: 0 0 0 3px rgba(10, 167, 154, 0.48), 0 14px 26px rgba(0, 116, 107, 0.22) !important;
  filter: saturate(1.08);
}

.hand-row .tile.drawn-rack-tile.tile-hit {
  animation: drawn-rack-land 1040ms cubic-bezier(0.2, 0.78, 0.22, 1.04) both;
}

@keyframes drawn-rack-land {
  0% {
    opacity: 0;
    transform: translateY(-58px) translateX(18px) scale(0.86) rotate(6deg);
    filter: saturate(1.32) brightness(1.3) drop-shadow(0 22px 20px rgba(0, 116, 107, 0.08));
  }

  48% {
    opacity: 1;
    transform: translateY(7px) translateX(0) scale(1.09) rotate(-2.4deg);
    filter: saturate(1.24) brightness(1.18) drop-shadow(0 16px 18px rgba(0, 116, 107, 0.2));
  }

  70% {
    transform: translateY(-12px) scale(1.04) rotate(1.1deg);
    filter: saturate(1.18) brightness(1.12) drop-shadow(0 12px 14px rgba(0, 116, 107, 0.2));
  }

  86% {
    transform: translateY(-5px) scale(1.015) rotate(-0.4deg);
  }

  100% {
    opacity: 1;
    transform: translateY(-8px) scale(1) rotate(0deg);
    filter: saturate(1.08);
  }
}

.hero-hand-panel .tile:not(.wall-tile) {
  box-shadow: none !important;
  border-color: transparent !important;
}

.hero-hand-panel .tile:not(.wall-tile) .tile-art {
  width: 100% !important;
  height: 100% !important;
}

.tile:not(.wall-tile) .tile-corner {
  display: none !important;
}

.tile:not(.wall-tile) .tile-motif {
  display: none !important;
}

.tile.discard:not(.wall-tile) .tile-motif {
  display: none !important;
}

.tile.discard.tile-photo-source .tile-art {
  object-fit: cover !important;
  object-position: center center;
}

/* Current interaction utilities kept from the cleanup pass */
.tile.dragging {
  opacity: 0.74;
  transform: scale(0.98);
}

.hand-insert-caret {
  position: absolute;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(32, 201, 195, 0.95), rgba(79, 207, 122, 0.95));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75), 0 0 0 4px rgba(32, 201, 195, 0.18);
  pointer-events: none;
  z-index: 20;
}

.claim-panel.hidden {
  display: none !important;
}

.discard-coach-panel.hidden {
  display: none !important;
}

/* Digitized hand card */
.digitized-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(250, 252, 251, 0.94)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(101, 126, 153, 0.24);
  border-radius: 16px;
  padding: 0.72rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.pinned-hand-callout {
  display: grid;
  gap: 0.48rem;
  margin-bottom: 0.66rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(0, 150, 136, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(0, 150, 136, 0.18), rgba(147, 112, 219, 0.08) 44%, rgba(255, 255, 255, 0.78)),
    rgba(250, 255, 253, 0.82);
  box-shadow: inset 4px 0 0 var(--sage), 0 14px 28px rgba(34, 63, 61, 0.06);
}

.pinned-hand-callout.is-empty {
  border-color: rgba(149, 192, 203, 0.22);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 4px 0 0 rgba(149, 192, 203, 0.65);
}

.pinned-empty-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.pinned-hand-callout p.pinned-empty-line {
  color: var(--sage-dark);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pinned-empty-line strong {
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.pinned-empty-line.pinned-charleston-guidance {
  align-items: center;
  letter-spacing: 0.04em;
}

.pinned-empty-line.pinned-charleston-guidance strong {
  color: #315852;
  font-size: clamp(0.86rem, 1.2vw, 0.98rem);
  font-weight: 850;
}

.pinned-hand-copy {
  display: grid;
  gap: 0.52rem;
}

.pinned-hand-header {
  display: block;
}

.pinned-hand-status-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.36rem;
  min-width: max-content;
}

.pinned-hand-name-pill {
  appearance: none;
  border: 1px solid rgba(35, 70, 111, 0.28);
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  background: rgba(255, 255, 255, 0.78);
  color: #23466f;
  cursor: pointer;
  font-family: var(--button-font);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    inset 0 -1px 0 rgba(0, 150, 136, 0.14),
    0 3px 10px rgba(35, 70, 111, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.pinned-hand-name-pill:hover,
.pinned-hand-name-pill:focus-visible {
  color: #007a70;
  background: #fffdf8;
  border-color: rgba(0, 150, 136, 0.42);
  box-shadow:
    inset 0 -2px 0 rgba(238, 138, 104, 0.18),
    0 5px 14px rgba(0, 119, 111, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.pinned-hand-meta-block {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
  width: 100%;
}

.pinned-hand-meta-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.72rem;
  row-gap: 0.28rem;
  min-width: 0;
  color: #5f6d68;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.22;
  letter-spacing: 0;
}

.pinned-hand-meta-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
}

.pinned-hand-meta-line .pre-game-label {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: 0;
}

.pinned-hand-meta-line .pinned-official-pattern {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: 0;
}

.pinned-official-pattern .card-token {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.pinned-official-or {
  color: #6f746f;
}

.pinned-official-note-line {
  margin: 0;
  color: #65746f;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
}

.pinned-status-pill {
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  background: rgba(255, 255, 255, 0.68);
  color: #006f66;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 150, 136, 0.16);
}

.pinned-hand-title-line {
  display: flex;
  align-items: baseline;
  gap: 0.52rem;
  flex-wrap: wrap;
  font-size: 1.38rem;
  font-weight: 900;
  line-height: 1.12;
}

.pinned-hand-callout h3 {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: -0.02em;
  margin: 0;
}

.pinned-hand-callout p:not(.pre-game-label) {
  color: #5f554c;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}

.pinned-hand-callout .pinned-hand-pattern {
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  margin-top: 0;
}

.pinned-hand-callout .pinned-hand-pattern .card-token {
  font-size: inherit;
  line-height: inherit;
}

.pinned-primary-pattern-line {
  display: grid;
  gap: 0.18rem;
}

.pinned-tracking-label {
  color: #61706a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.pinned-hand-callout p.pinned-primary-pattern {
  color: var(--ink);
  font-size: 1.48rem;
  font-weight: 900;
  line-height: 1.08;
  margin: 0;
}

.pinned-hand-callout p.pinned-primary-pattern .card-token {
  font-size: inherit;
  line-height: inherit;
}

.pinned-variation-annotation {
  display: inline-block;
  margin-left: 0.18rem;
  color: #61706a;
  font-family: var(--button-font);
  font-size: 0.52em;
  font-weight: 900;
  line-height: 1;
  vertical-align: 0.08em;
  white-space: nowrap;
}

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

.pinned-info-row {
  display: grid;
  gap: 0.18rem;
  align-content: start;
}

.pinned-info-row-wide {
  grid-column: 1 / -1;
}

.pinned-info-label {
  color: #61706a;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.pinned-info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}

.pinned-info-chip {
  border: 1px solid rgba(0, 150, 136, 0.24);
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
  background: rgba(255, 255, 255, 0.74);
  color: #27332f;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.05;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.pinned-info-chip.muted {
  color: #68736e;
  background: rgba(255, 255, 255, 0.44);
}

.pinned-info-chip-meta {
  border-radius: 999px;
  padding: 0.08rem 0.28rem;
  background: rgba(0, 150, 136, 0.12);
  color: #006f66;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pinned-hand-callout .pinned-info-note {
  margin: 0;
  max-width: 36rem;
  padding-left: 0.62rem;
  border-left: 0.18rem solid rgba(0, 150, 136, 0.34);
  color: #4f625b;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.24;
}

.card-token-owned {
  text-decoration-line: underline;
  text-decoration-color: #009688;
  text-decoration-thickness: 0.14em;
  text-underline-offset: 0.12em;
}

.pinned-hand-progress {
  width: 100%;
  height: 0.46rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 150, 136, 0.14);
}

.pinned-hand-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--purple));
}

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

.hand-compass-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.52rem;
  align-items: start;
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.78rem;
  border: 1px solid rgba(35, 70, 111, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(35, 70, 111, 0.1), rgba(255, 255, 255, 0.76)),
    rgba(246, 251, 252, 0.84);
}

.hand-compass-summary h3 {
  font-size: 0.92rem;
  line-height: 1.05;
  margin-top: 0.12rem;
}

.hand-compass-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.hand-card-panel .panel-head {
  align-items: center;
}

.hand-card-panel .panel-head h2 {
  min-width: max-content;
}

.hand-compass-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

.hand-compass-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.08rem 0.32rem;
  align-items: center;
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(0, 150, 136, 0.26);
  border-radius: 10px;
  padding: 0.42rem 0.54rem;
  background: rgba(255, 255, 255, 0.82);
  color: #25322f;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(35, 57, 54, 0.06);
}

.hand-compass-chip:hover,
.hand-compass-chip:focus-visible {
  transform: translateY(-1px);
  outline: none;
  border-color: #95c0cb;
  box-shadow: 0 10px 22px rgba(44, 93, 102, 0.16);
}

.hand-compass-rank-badge {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--sage);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.78rem;
}

.hand-compass-chip-title {
  grid-column: 2;
  font-size: 0.7rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.hand-compass-chip-meta {
  grid-column: 2;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2rem;
  font-style: normal;
  font-size: 0.64rem;
  color: #65716d;
  font-weight: 800;
  line-height: 1;
}

.hand-compass-pinned-label {
  color: var(--sage);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.hand-compass-meta-dot {
  color: #8a938f;
  font-weight: 900;
}

.hand-compass-chip.rank-2 .hand-compass-rank-badge {
  background: var(--purple);
}

.hand-compass-chip.rank-3 .hand-compass-rank-badge {
  background: var(--terracotta);
}

.hand-compass-chip.rank-2 .hand-compass-pinned-label {
  color: var(--purple);
}

.hand-compass-chip.rank-3 .hand-compass-pinned-label {
  color: var(--terracotta);
}

.hand-compass-chip.selected {
  background: rgba(0, 150, 136, 0.12);
  border-color: rgba(0, 150, 136, 0.72);
}

.hand-compass-chip.pivot-recommended {
  border-color: rgba(0, 150, 136, 0.82);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.16), 0 12px 24px rgba(44, 93, 102, 0.18);
  animation: hand-compass-pivot-flash 1.35s ease-in-out 0s 3;
}

@keyframes hand-compass-pivot-flash {
  0%, 100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-2px);
    background: rgba(232, 247, 244, 0.96);
  }
}

.hand-compass-chip.rank-2 {
  border-color: rgba(147, 112, 219, 0.46);
}

.hand-compass-chip.rank-2.selected {
  background: rgba(147, 112, 219, 0.13);
  border-color: rgba(147, 112, 219, 0.76);
}

.hand-compass-chip.rank-3 {
  border-color: rgba(214, 132, 111, 0.48);
}

.hand-compass-chip.rank-3.selected {
  background: rgba(214, 132, 111, 0.14);
  border-color: rgba(214, 132, 111, 0.78);
}

.digitized-card-note {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #8a4d5c;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.digitized-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.64rem;
}

.card-cheats {
  margin-top: 0.72rem;
  border: 1px solid rgba(35, 70, 111, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 0.52rem 0.58rem 0.54rem;
}

.card-cheats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.32rem;
}

.card-cheats h3 {
  color: var(--card-meta-blue);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
}

.card-cheats ol {
  display: grid;
  gap: 0.22rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--card-meta-blue);
  font-size: 0.73rem;
  font-weight: 750;
  line-height: 1.24;
}

.card-cheats li::marker {
  color: var(--sage);
  font-weight: 900;
}

.digitized-section {
  border: 1px solid rgba(35, 70, 111, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.54rem 0.58rem 0.38rem;
  display: grid;
  gap: 0.22rem;
  box-shadow: 0 10px 24px rgba(40, 54, 72, 0.04);
}

.digitized-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 0;
  padding-bottom: 0.34rem;
  margin-bottom: 0.04rem;
  position: relative;
}

.digitized-section-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--card-meta-blue), rgba(0, 150, 136, 0.55), rgba(147, 112, 219, 0.28));
}

.digitized-section-head h3 {
  font-family: "Merriweather Sans", sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0;
  color: var(--card-meta-blue);
}

.digitized-section-head p {
  font-size: 0.68rem;
  color: var(--card-meta-blue);
  letter-spacing: 0.08em;
  font-weight: 800;
}

.digitized-section-note {
  color: var(--card-meta-blue);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.digitized-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.22rem;
  align-items: start;
  border-bottom: 1px solid rgba(35, 70, 111, 0.12);
  padding: 0.42rem 5rem 0.48rem 0.62rem;
  margin-bottom: 0;
  border-radius: 8px;
  overflow: hidden;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.digitized-line::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.digitized-line:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.digitized-line-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem 0.42rem;
  align-items: center;
  min-width: 0;
}

.card-hand-number {
  width: max-content;
  padding: 0;
  background: transparent;
  color: var(--sage-dark);
  box-shadow: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.selectable-card-line {
  padding-right: 5rem;
}

.selectable-card-line:hover,
.selectable-card-line:focus-visible {
  outline: none;
  background: rgba(149, 192, 203, 0.09);
}

.hand-line-pin-btn {
  position: absolute;
  top: 0.32rem;
  right: 0.32rem;
  border: none;
  border-radius: 999px;
  padding: 0.22rem 0.52rem;
  background: linear-gradient(180deg, var(--sage) 0%, var(--sage-dark) 100%);
  color: #ffffff;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.selectable-card-line:hover .hand-line-pin-btn,
.selectable-card-line:focus-within .hand-line-pin-btn,
.hand-line-pin-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.help-solo .selectable-card-line .hand-line-pin-btn,
.free-play-unpin-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.free-play-unpin-btn {
  position: static;
  flex: 0 0 auto;
}

.compass-rank-1 {
  background: transparent;
}

.compass-rank-1::before {
  background: transparent;
}

.compass-rank-2 {
  background: transparent;
}

.compass-rank-2::before {
  background: transparent;
}

.compass-rank-3 {
  background: transparent;
}

.compass-rank-3::before {
  background: transparent;
}

.hand-compass-option:hover,
.hand-compass-option:focus-visible {
  background: rgba(149, 192, 203, 0.09);
}

.pinned-card-line {
  outline: none;
  background: linear-gradient(90deg, rgba(0, 150, 136, 0.15), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 0 0 1px rgba(0, 150, 136, 0.3);
}

.pinned-card-line::before {
  background: var(--sage);
}

.pinned-card-line .hand-line-pin-btn {
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-dark) 100%);
}

.hand-line-jump {
  animation: hand-line-jump 900ms ease-out both;
}

@keyframes hand-line-jump {
  0% {
    box-shadow: inset 0 0 0 999px rgba(0, 150, 136, 0.16);
  }

  100% {
    box-shadow: inset 0 0 0 999px rgba(0, 150, 136, 0);
  }
}

.digitized-pattern {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.22;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.digitized-or {
  color: #5a6781;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.digitized-leader {
  display: none;
}

.digitized-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem 0.42rem;
  align-items: center;
  white-space: normal;
}

.compass-badge {
  width: max-content;
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  background: var(--sage);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.compass-badge-2 {
  background: var(--purple);
}

.compass-badge-3 {
  background: var(--terracotta);
}

.digitized-note {
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--card-meta-blue);
  font-weight: 650;
  white-space: normal;
}

.digitized-value {
  position: absolute;
  right: 0.48rem;
  bottom: 0.42rem;
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  background: rgba(35, 70, 111, 0.1);
  box-shadow: inset 0 0 0 1px rgba(35, 70, 111, 0.1);
  font-size: 0.78rem;
  color: var(--card-meta-blue);
  font-weight: 900;
  align-self: center;
  line-height: 1.15;
}

.card-token {
  display: inline-block;
  margin-right: 0.1rem;
}

.tone-g { color: #159f67; }
.tone-r { color: #bb466b; }
.tone-b { color: #2e5fa4; }
.tone-o { color: #b68a18; }
.tone-k { color: #1f2532; }
.tone-v { color: #4c4f9f; }
.tone-m { color: #666f7f; }

/* Current action and Charleston utilities */
.hero-hand-panel #next-action-panel.next-action-highlighted {
  border-color: rgba(79, 207, 122, 0.72);
  box-shadow: 0 0 0 2px rgba(79, 207, 122, 0.18), 0 10px 22px rgba(57, 120, 76, 0.15);
}

.hero-hand-panel #next-action-panel.action-guidance-flash {
  animation: action-guidance-flash 860ms ease-out both;
}

.hero-hand-panel #next-action-panel.call-opportunity-celebration {
  border-color: rgba(147, 112, 219, 0.52);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(120deg, rgba(229, 250, 246, 0.96), rgba(244, 237, 255, 0.94));
  box-shadow:
    0 0 0 3px rgba(147, 112, 219, 0.1),
    0 14px 28px rgba(65, 126, 115, 0.15);
  animation: call-opportunity-pop 720ms cubic-bezier(0.2, 0.88, 0.28, 1) both;
}

.hero-hand-panel #next-action-panel.call-opportunity-celebration #next-action-title {
  color: #006f66;
  background: linear-gradient(90deg, rgba(0, 150, 136, 0.14), rgba(147, 112, 219, 0.15));
}

.hero-hand-panel #next-action-panel.mahjong-call-celebration #next-action-title,
.right-strategy-panel.mahjong-call-celebration #strategy-title {
  color: #006f66;
}

.mahjong-call-letter {
  display: inline-block;
  transform-origin: 50% 80%;
  animation:
    mahjong-call-letter-dance 1.85s ease-in-out infinite,
    mahjong-call-letter-color 5.6s ease-in-out infinite;
  animation-delay:
    calc(var(--letter-index, 0) * 62ms),
    calc(var(--letter-index, 0) * 96ms);
  will-change: color, transform;
}

.hero-hand-panel #next-action-panel.draw-pickup-celebration {
  border-color: rgba(0, 150, 136, 0.54);
  background:
    linear-gradient(120deg, rgba(242, 252, 248, 0.98), rgba(255, 248, 235, 0.94));
  box-shadow:
    0 0 0 3px rgba(0, 150, 136, 0.1),
    0 14px 26px rgba(80, 119, 91, 0.14);
  animation: draw-pickup-pop 760ms cubic-bezier(0.2, 0.88, 0.28, 1) both;
}

.hero-hand-panel #next-action-panel.draw-pickup-celebration #next-action-title {
  color: #006f66;
  background: linear-gradient(90deg, rgba(0, 150, 136, 0.16), rgba(218, 165, 32, 0.15));
}

#next-action-detail.action-guidance-flash {
  animation: action-detail-flash 860ms ease-out both;
}

#next-action-title.action-title-highlight {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(79, 207, 122, 0.2), rgba(32, 201, 195, 0.16));
  color: #1f4f36;
}

@keyframes action-guidance-flash {
  0% {
    border-color: rgba(0, 150, 136, 0.72);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.18), 0 12px 24px rgba(0, 120, 110, 0.18);
  }

  100% {
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(106, 88, 62, 0.08);
  }
}

@keyframes call-opportunity-pop {
  0% {
    transform: translateY(5px) scale(0.985);
    filter: saturate(0.9);
  }

  55% {
    transform: translateY(-2px) scale(1.012);
    filter: saturate(1.14);
  }

  100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes draw-pickup-pop {
  0% {
    transform: translateY(4px) scale(0.986);
    filter: saturate(0.95);
  }

  50% {
    transform: translateY(-2px) scale(1.01);
    filter: saturate(1.16);
  }

  100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes mahjong-call-letter-dance {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-0.08em) rotate(-1.2deg);
  }

  50% {
    transform: translateY(0.03em) rotate(0.8deg);
  }

  75% {
    transform: translateY(-0.05em) rotate(1.1deg);
  }
}

@keyframes mahjong-call-letter-color {
  0%,
  100% {
    color: #00766c;
  }

  35% {
    color: #7b61cf;
  }

  70% {
    color: #b34f72;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-hand-panel #next-action-panel.call-opportunity-celebration,
  .hero-hand-panel #next-action-panel.draw-pickup-celebration,
  .action-center-controls,
  .mahjong-call-letter {
    animation: none;
  }
}

@keyframes action-type-caret {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

@keyframes draw-result-pop {
  0% {
    transform: translateY(2px) scale(0.985);
    filter: saturate(0.9);
  }

  52% {
    transform: translateY(-1px) scale(1.012);
    filter: saturate(1.18);
  }

  100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes action-detail-flash {
  0% {
    color: #006f66;
    background: rgba(0, 150, 136, 0.1);
    border-radius: 0.42rem;
  }

  100% {
    color: #5f554c;
    background: transparent;
  }
}

.charleston-simple-split {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.72rem;
  align-items: stretch;
}

.charleston-simple-split.charleston-simple-enter {
  animation: charleston-panel-enter 520ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

.charleston-simple-col {
  min-width: 0;
  display: grid;
  gap: 0.32rem;
  align-content: start;
}

.charleston-simple-col-discard {
  border-left: 1px solid rgba(157, 174, 170, 0.52);
  padding-left: 0.72rem;
}

.charleston-simple-label {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #4b4640;
}

.charleston-simple-row {
  min-height: 98px;
  align-items: center;
  justify-content: flex-start;
  gap: 0.36rem;
}

body.charleston-active #draw-panel.charleston-incoming-panel {
  min-height: clamp(250px, 34vh, 340px);
  align-content: stretch;
  grid-template-rows: auto auto auto auto;
}

body.charleston-active #draw-panel.charleston-incoming-panel .right-strategy-panel.charleston-coach-panel {
  align-self: start;
  min-height: min-content;
  height: auto;
  overflow: visible;
}

body.charleston-active #draw-panel.charleston-incoming-panel #draw-slot {
  min-height: clamp(104px, 14vh, 150px);
  align-self: start;
}

#hand-card-panel .hand-card-scroll,
#discard-history-row.discard-pool {
  scrollbar-width: thin;
  scrollbar-color: rgba(72, 126, 121, 0.75) rgba(203, 221, 219, 0.52);
}

#hand-card-panel .hand-card-scroll::-webkit-scrollbar {
  width: 10px;
}

#hand-card-panel .hand-card-scroll::-webkit-scrollbar-track,
#discard-history-row.discard-pool::-webkit-scrollbar-track {
  background: rgba(203, 221, 219, 0.56);
  border-radius: 999px;
}

#hand-card-panel .hand-card-scroll::-webkit-scrollbar-thumb,
#discard-history-row.discard-pool::-webkit-scrollbar-thumb {
  background: rgba(72, 126, 121, 0.78);
  border-radius: 999px;
}

#discard-history-row.discard-pool::-webkit-scrollbar {
  height: 10px;
}

/* Canonical board layout. This file intentionally owns layout; styles.css owns visual styling. */

.hidden,
.board-hidden-panels {
  display: none !important;
}

@media (min-width: 900px) {
  html,
  body {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    width: calc(100vw - 1rem);
    max-width: 1600px;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 auto;
    padding: 0.35rem 0.45rem 0.55rem;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.82rem;
    overflow: hidden;
  }

  .main-grid.board-layout {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(290px, 36vh, 368px) minmax(0, 1fr);
    gap: 0.92rem;
    overflow: hidden;
  }

  .board-hand-slot {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .board-hand-slot .hero-hand-panel {
    margin: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    transform: none;
    backdrop-filter: none;
    padding: 0.85rem 0.95rem;
    grid-template-columns: minmax(260px, 1fr) auto;
    grid-template-areas:
      "exposure exposure"
      "hand hand"
      "actions actions";
    grid-template-rows: minmax(0, auto) minmax(0, auto) auto;
    gap: 0.46rem;
  }

  .board-hand-slot .hero-hand-panel .panel-head {
    min-height: 0;
  }

  .board-hand-slot .hero-hand-panel .rack-exposure-shelf {
    min-height: 56px;
    max-height: none;
    overflow: auto;
  }

  .board-hand-slot .hero-hand-panel .hand-row {
    background: transparent;
    min-height: 104px;
    max-height: none;
    padding-top: 6px;
    padding-bottom: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-end;
  }

  .board-hand-slot .hero-hand-panel .hand-row .tile {
    width: 68px;
    height: 92px;
  }

  .board-bottom-grid {
    --board-gap: 0.72rem;
    width: 100%;
    max-width: none;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--board-gap);
    overflow: visible;
  }

  .board-bottom-left,
  .board-bottom-right {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--board-gap);
    overflow: hidden;
  }

  .board-bottom-left {
    grid-template-rows: minmax(0, 1fr);
  }

  .board-bottom-right {
    grid-template-rows: minmax(210px, 1.08fr) minmax(166px, 0.92fr);
    position: relative;
    overflow: visible;
  }

  .board-bottom-right:has(> #draw-panel.hidden),
  .board-bottom-right:has(> #turn-lane-panel.hidden):has(> #draw-panel:not(.hidden)) {
    grid-template-rows: minmax(0, 1fr);
  }

  body.charleston-active .board-bottom-right {
    grid-template-rows: minmax(0, 1fr);
  }

  .right-declare-slot {
    position: absolute;
    top: calc(-3.1rem - var(--board-gap));
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: min(24rem, 48%);
    min-height: 3.1rem;
    pointer-events: none;
  }

  .right-declare-slot #declare-btn {
    pointer-events: auto;
  }

  .right-declare-slot.hidden {
    display: none !important;
  }

  .board-bottom-left > #hand-card-panel,
  .board-bottom-right > #draw-panel,
  .board-bottom-right > #turn-lane-panel {
    margin: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    position: static;
    transform: none;
    align-self: stretch;
    justify-self: stretch;
    backdrop-filter: none;
  }

  .board-bottom-left > #hand-card-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    grid-row: 1 / -1;
  }

  body.charleston-active .board-bottom-left > #hand-card-panel {
    box-shadow: none;
  }

  .board-bottom-left > #hand-card-panel .hand-card-scroll {
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .board-bottom-right > #draw-panel,
  .board-bottom-right > #draw-panel.charleston-incoming-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: start;
    gap: 0.48rem;
    overflow: hidden;
    padding: 0.62rem 0.74rem;
    border-width: 1px;
    border-color: rgba(122, 196, 170, 0.28);
    background: rgba(255, 251, 246, 0.94);
    box-shadow: none;
  }

  .board-bottom-right > #draw-panel.charleston-incoming-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: start;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  body.charleston-active .board-bottom-right > #draw-panel.charleston-incoming-panel {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    grid-template-rows: auto auto auto auto;
  }

  body.charleston-active .board-bottom-right > #draw-panel.charleston-incoming-panel .right-strategy-panel.charleston-coach-panel {
    align-self: start;
    min-height: min-content;
    height: auto;
    overflow: visible;
  }

  .board-bottom-right > #draw-panel #draw-slot {
    min-width: 0;
    min-height: 0;
    max-height: 128px;
    overflow: hidden;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    justify-content: flex-start;
    align-items: center;
  }

  .board-bottom-right > #draw-panel.charleston-incoming-panel #draw-slot {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin-top: 0.16rem;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  body.charleston-active .board-bottom-right > #draw-panel.charleston-incoming-panel #draw-slot {
    min-height: 0;
    height: auto;
    max-height: 100%;
    align-self: start;
  }

  .board-bottom-right > #draw-panel.charleston-incoming-panel .charleston-simple-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 0;
    height: auto;
    max-height: 100%;
    gap: 0.72rem;
    align-items: start;
    overflow: hidden;
  }

  .board-bottom-right > #draw-panel.charleston-incoming-panel .charleston-simple-col {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 0.52rem;
    overflow: visible;
  }

  .board-bottom-right > #draw-panel.charleston-incoming-panel .charleston-simple-row {
    min-height: clamp(86px, 10vh, 112px);
    height: auto;
    max-height: 100%;
    overflow: hidden;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.42rem;
    padding-top: 0.22rem;
  }

  .board-bottom-right > #draw-panel.charleston-incoming-panel .charleston-simple-row .tile {
    flex: 0 0 auto;
    width: clamp(52px, 4.4vw, 66px);
    height: clamp(70px, 5.9vw, 88px);
  }

  .board-bottom-right > #turn-lane-panel {
    display: block;
    overflow: hidden;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .board-bottom-right > #turn-lane-panel.hidden {
    display: none !important;
  }

  .board-bottom-right > #turn-lane-panel > #discard-history-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 0.36rem;
    margin: 0;
    min-width: 0;
    min-height: 236px;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0.62rem 0.74rem;
    background: rgba(242, 252, 255, 0.92);
    border: 1px solid rgba(122, 220, 229, 0.26);
    border-radius: 1.85rem;
    box-shadow: none;
    backdrop-filter: none;
    position: static;
    transform: none;
  }

  .board-bottom-right > #turn-lane-panel > #discard-history-panel .panel-head {
    margin-bottom: 0;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel > #discard-history-panel #discard-history-row.discard-pool {
    min-height: 178px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0 0.55rem 0.55rem;
    scroll-padding-inline: 0.55rem;
  }
}

@media (max-width: 899px) {
  html,
  body {
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    width: calc(100vw - 0.7rem);
    min-height: 100dvh;
    height: auto;
    margin: 0.2rem auto 0;
    padding: 0.2rem;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.56rem;
    overflow: visible;
  }

  .main-grid.board-layout {
    width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.56rem;
    overflow: visible;
  }

  .board-bottom-grid,
  .board-bottom-left,
  .board-bottom-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.56rem;
    min-height: 0;
    overflow: visible;
  }

  .board-bottom-left > #hand-card-panel {
    max-height: none;
    height: auto;
    overflow: visible;
  }

  .board-bottom-left > #hand-card-panel .hand-card-scroll {
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (min-width: 900px) and (max-height: 760px) {
  body:not(.charleston-active):not(.table-tour-active) .app-shell:has(> #game-view.board-layout:not(.hidden) #turn-lane-panel:not(.hidden)) {
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
    padding-bottom: clamp(1.25rem, 3vh, 2rem);
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-hand-slot,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-hand-slot .hero-hand-panel,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-grid,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left > #hand-card-panel,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #draw-panel,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-hand-slot .hero-hand-panel {
    min-height: clamp(250px, 54vh, 330px);
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-grid {
    align-items: start;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left {
    grid-template-rows: auto;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right {
    grid-template-rows: auto auto;
    max-height: none;
    overflow: visible;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left > #hand-card-panel .hand-card-scroll {
    height: auto;
    max-height: clamp(340px, 76vh, 560px);
    overflow-y: auto;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel > #discard-history-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel > #discard-history-panel #discard-history-row.discard-pool {
    min-height: 178px;
    max-height: none;
    padding-bottom: 0.78rem;
  }
}

@keyframes discard-history-pop-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 900px) {
  .board-bottom-right > #turn-lane-panel:not(.hidden) > #discard-history-panel {
    animation: discard-history-pop-in 220ms ease-out both;
  }
}

/* Tighten photo tile crop in the Incoming Draw / swap panel only */
.board-bottom-right > #draw-panel .tile.tile-photo-source .tile-art {
  object-fit: cover !important;
  object-position: center center !important;
  transform: scale(1.06);
}

/* Header modernized: simpler masthead, no ribbon chips */
.top-bar .brand-lockup {
  gap: 0;
}

.top-bar .eyebrow,
.top-bar .brand-tagline,
.top-bar .top-cta,
.top-bar .brand-lockup h1 {
  font-family: "Merriweather Sans", sans-serif;
}

.top-bar .brand-lockup h1 {
  font-size: clamp(2.25rem, 3.4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.top-bar .brand-tagline {
  margin-top: 0.12rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #3f6f66;
}

.top-bar .eyebrow {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.top-bar .top-cta {
  font-family: var(--button-font);
  font-weight: 700;
}

.brand-ribbon {
  display: none !important;
}

/* Charleston action buttons: compact buttons with stronger labels */
#charleston-inline-actions {
  flex-wrap: wrap;
  gap: 0.62rem;
  align-items: center;
}

#charleston-inline-actions .soft-btn {
  width: auto;
  min-width: 166px;
  justify-content: center;
  text-align: center;
  padding: 0.58rem 1rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

#charleston-inline-actions .text-btn {
  min-width: 148px;
  border: 1px solid rgba(0, 119, 111, 0.24);
  border-radius: 999px;
  padding: 0.58rem 1rem;
  background: rgba(255, 253, 248, 0.74);
  color: var(--sage-dark);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

#charleston-inline-actions.charleston-action-center-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.72rem;
  align-items: start;
  margin-top: -0.38rem;
}

#charleston-inline-actions.charleston-action-center-controls #confirm-charleston-btn {
  grid-column: 1;
  justify-self: stretch;
  width: 100%;
  margin-left: 0;
}

#charleston-inline-actions.charleston-action-center-controls.charleston-choice-controls {
  margin-top: 0.65rem;
  align-items: center;
}

#charleston-inline-actions.charleston-action-center-controls.charleston-choice-controls #confirm-charleston-btn {
  justify-self: stretch;
  width: 100%;
  margin-left: 0;
}

@media (max-width: 899px) {
  #charleston-inline-actions.charleston-action-center-controls {
    margin-top: -2.05rem;
    align-items: start;
  }

  #charleston-inline-actions.charleston-action-center-controls.charleston-choice-controls {
    margin-top: 0.65rem;
  }
}

@media (max-width: 700px) {
  .hero-hand-panel,
  .board-hand-slot .hero-hand-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "exposure"
      "hand"
      "actions";
  }

  .hand-sort-utility {
    top: 0.48rem;
    right: 0.58rem;
  }

  .hand-sort-utility {
    gap: 0.28rem;
    padding: 0.18rem 0.26rem;
  }

  .sort-utility-label {
    font-size: 0.5rem;
  }

  .sort-utility-btn {
    padding: 0.2rem 0.16rem 0.32rem;
    font-size: 0.66rem;
  }

}

/* Global neutral tile-table background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  background-image:
    linear-gradient(rgba(0, 150, 136, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 150, 136, 0.035) 1px, transparent 1px),
    repeating-linear-gradient(135deg, transparent 0 34px, rgba(147, 112, 219, 0.018) 34px 35px, transparent 35px 70px);
  background-repeat: repeat;
  background-size: 96px 96px, 96px 96px, 140px 140px;
  background-position: top left;
}

/* Global text modernization */
.section-heading,
.panel-title,
#hand-panel h2,
#next-action-panel h2,
#draw-panel h2,
#turn-lane-panel h2,
#discard-history-panel h2,
#hand-card-panel h2,
.hand-card-title,
.turn-lane-title {
  font-family: "Merriweather Sans", sans-serif;
}

#charleston-inline-actions button,
button,
.action-button {
  font-family: var(--button-font);
}

/* Physical rack stage */
.hero-hand-panel,
.board-hand-slot .hero-hand-panel,
.hero-hand-panel.charleston-actions-first {
  grid-template-areas:
    "rack rack"
    "actions actions";
  grid-template-rows: minmax(190px, 1fr) auto;
  align-items: stretch;
  row-gap: clamp(0.9rem, 2.4cqw, 1.85rem);
}

.rack-stage {
  grid-area: rack;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  --rack-gutter: clamp(0.7rem, 3cqw, 3.2rem);
  --rack-hand-gap: clamp(0.12rem, 0.48cqw, 0.42rem);
  --rack-stage-overhang: clamp(0.25rem, 0.7cqw, 0.65rem);
  --rack-art-inset: calc(var(--rack-gutter) - var(--rack-stage-overhang));
  --rack-art-width: min(calc(100cqw - var(--rack-art-inset) - var(--rack-art-inset)), 84rem);
  /* The SVG top lip runs from x=96 to x=1584 inside its 1680px viewBox. */
  --rack-seat-width: calc(var(--rack-art-width) * 0.8857142857);
  --rack-tile-scale: 1.15;
  --rack-slot-width: clamp(39px, calc((var(--rack-seat-width) - (17 * var(--rack-hand-gap))) / 18), 78px);
  --rack-tile-width: calc(var(--rack-slot-width) * var(--rack-tile-scale));
  --rack-tile-height: calc(var(--rack-tile-width) * 1.36);
  --rack-exposure-width: calc(var(--rack-tile-width) * 0.62);
  --rack-exposure-height: calc(var(--rack-exposure-width) * 1.36);
  --rack-hand-track-width: calc((18 * var(--rack-slot-width)) + (17 * var(--rack-hand-gap)));
  --rack-exposure-gap: clamp(0.08rem, 0.28cqw, 0.18rem);
  --rack-art-bottom: clamp(0.22rem, 0.9cqw, 0.7rem);
  --rack-art-height: clamp(90px, 17.25cqw, 173px);
  /* Concealed tiles sit behind the SVG front base, which starts at y=166 / 220. */
  --rack-front-shelf-rise: clamp(22px, 4.25cqw, 43px);
  --rack-front-shelf-seat: clamp(5px, 0.72cqw, 8px);
  --rack-front-shelf-bottom: calc(var(--rack-art-bottom) + var(--rack-front-shelf-rise) - var(--rack-front-shelf-seat));
  --rack-back-shelf-seat: clamp(10px, 1.8cqw, 20px);
  --rack-back-shelf-bottom: calc(var(--rack-art-bottom) + (var(--rack-art-height) * 0.68) - var(--rack-back-shelf-seat));
  min-height: max(190px, calc(var(--rack-tile-height) + var(--rack-exposure-height) + 53px));
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-items: end;
  padding: 0 var(--rack-gutter);
  overflow: hidden;
}

.rack-stage::before {
  content: none;
}

.rack-art {
  position: absolute;
  left: 50%;
  bottom: var(--rack-art-bottom);
  width: var(--rack-art-width);
  height: var(--rack-art-height);
  z-index: 0;
  pointer-events: none;
  object-fit: fill;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 20px rgba(38, 28, 20, 0.2));
}

.rack-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: var(--rack-art-bottom);
  width: var(--rack-art-width);
  height: var(--rack-art-height);
  z-index: 4;
  pointer-events: none;
  background: url("assets/mahjong-rack-dark-oak-visible-grain.svg") center / 100% 100% no-repeat;
  clip-path: inset(75% 0 10%);
  transform: translateX(-50%);
}

.rack-stage .rack-exposure-shelf {
  grid-area: auto;
  grid-row: 1;
  position: absolute;
  left: 50%;
  bottom: var(--rack-back-shelf-bottom);
  width: min(100%, var(--rack-hand-track-width));
  z-index: 1;
  min-height: calc(var(--rack-exposure-height) + 10px);
  padding: 0;
  align-self: auto;
  overflow: visible;
  transform: translateX(-50%);
  pointer-events: none;
}

.rack-stage .rack-exposure-shelf.has-exposures::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 2;
  height: clamp(7px, 1.05cqw, 12px);
  pointer-events: none;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(204, 142, 82, 0.56), rgba(98, 51, 23, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 167, 0.22),
    0 2px 3px rgba(44, 24, 12, 0.18);
}

.rack-stage .rack-exposure-shelf.table-tour-demo-exposure {
  bottom: calc(var(--rack-back-shelf-bottom) + clamp(0.18rem, 0.7cqw, 0.45rem));
}

.rack-stage .exposure-row {
  position: relative;
  z-index: 1;
  min-height: calc(var(--rack-exposure-height) + 10px);
  align-items: flex-end;
  justify-content: flex-start;
  gap: clamp(0.22rem, 0.78cqw, 0.56rem);
  overflow-x: hidden;
  overflow-y: visible;
  padding: 0;
}

.rack-stage .table-tour-demo-exposure .exposure-row {
  justify-content: flex-start;
  padding-left: clamp(5rem, 10cqw, 11rem);
}

.rack-stage .exposure-set {
  display: flex;
  align-items: end;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.rack-stage .exposure-tiles {
  align-items: flex-end;
  gap: var(--rack-exposure-gap);
}

.rack-stage .exposure-tile {
  width: var(--rack-exposure-width);
  height: var(--rack-exposure-height);
  z-index: 1;
}

.rack-stage .rack-exposure-shelf.mahjong-win-shelf {
  bottom: calc(var(--rack-back-shelf-bottom) + clamp(0.1rem, 0.32cqw, 0.24rem));
  z-index: 5;
}

.rack-stage .exposure-row.mahjong-winning-layout {
  justify-content: center;
  gap: clamp(0.34rem, 0.95cqw, 0.7rem);
  overflow: visible;
}

.rack-stage .mahjong-winning-group {
  filter: drop-shadow(0 16px 14px rgba(35, 24, 16, 0.16));
}

.rack-stage .mahjong-winning-group .exposure-tiles {
  gap: clamp(0.04rem, 0.16cqw, 0.12rem);
}

.rack-stage .mahjong-winning-tile {
  transform-origin: 50% 100%;
}

.rack-stage .mahjong-winning-animate .mahjong-winning-tile {
  animation: mahjong-winning-tile-rise 1180ms cubic-bezier(0.16, 0.9, 0.2, 1.06) both;
  animation-delay: calc(80ms + (var(--win-tile-index) * 54ms));
}

.rack-stage .hand-row.mahjong-hand-cleared {
  pointer-events: none;
  overflow: visible;
}

.rack-stage .hand-row.mahjong-winning-hand-layout {
  pointer-events: none;
  overflow: visible;
  align-items: flex-end;
}

.rack-stage .mahjong-winning-hand-tile {
  transform-origin: 50% 100%;
  z-index: 4;
  filter: drop-shadow(0 14px 12px rgba(36, 20, 10, 0.2));
  animation: mahjong-winning-hand-wave 1800ms ease-in-out infinite;
  animation-delay: calc(var(--win-tile-index) * 78ms);
}

.rack-stage .mahjong-winning-animate .mahjong-winning-hand-tile {
  animation-name: mahjong-winning-hand-arrive, mahjong-winning-hand-wave;
  animation-duration: 720ms, 1800ms;
  animation-timing-function: cubic-bezier(0.16, 0.9, 0.2, 1.06), ease-in-out;
  animation-delay: calc(var(--win-tile-index) * 42ms), calc(720ms + (var(--win-tile-index) * 78ms));
  animation-fill-mode: both, none;
  animation-iteration-count: 1, infinite;
}

@keyframes mahjong-winning-tile-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, calc(var(--rack-tile-height) * 0.62), 0) scale(1.18) rotate(-2.5deg);
    filter: saturate(1.18) brightness(1.12) drop-shadow(0 18px 16px rgba(0, 116, 107, 0.18));
  }

  58% {
    opacity: 1;
    transform: translate3d(0, -0.34rem, 0) scale(1.02) rotate(1deg);
  }

  76% {
    transform: translate3d(0, 0.16rem, 0) scale(1) rotate(-0.4deg);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    filter: saturate(1) brightness(1) drop-shadow(0 8px 7px rgba(36, 20, 10, 0.22));
  }
}

@keyframes mahjong-winning-hand-arrive {
  0% {
    opacity: 0;
    transform: translate3d(0, calc(var(--rack-tile-height) * 0.34), 0) scale(0.96);
  }

  68% {
    opacity: 1;
    transform: translate3d(0, -0.42rem, 0) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes mahjong-winning-hand-wave {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  35% {
    transform: translate3d(0, -0.55rem, 0) rotate(-0.7deg);
  }

  70% {
    transform: translate3d(0, 0.1rem, 0) rotate(0.35deg);
  }
}

.rack-stage .table-tour-demo-exposure .exposure-tile {
  width: clamp(38px, 4.9cqw, 64px);
  height: calc(clamp(38px, 4.9cqw, 64px) * 1.36);
}

.rack-stage .hand-row {
  display: grid;
  grid-template-columns: repeat(18, var(--rack-slot-width));
  grid-auto-flow: column;
  grid-area: auto;
  grid-row: 1;
  position: relative;
  z-index: 2;
  justify-self: center;
  width: min(100%, var(--rack-hand-track-width));
  min-height: calc(var(--rack-tile-height) + 34px);
  padding: 0 0 var(--rack-front-shelf-bottom);
  gap: var(--rack-hand-gap);
  column-gap: var(--rack-hand-gap);
  align-items: flex-end;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: hidden;
  scroll-padding-inline: 0;
}

.board-hand-slot .hero-hand-panel .rack-stage .hand-row {
  padding-bottom: var(--rack-front-shelf-bottom);
  overflow-x: hidden;
  overflow-y: hidden;
}

.rack-stage .hand-row .tile,
.board-hand-slot .hero-hand-panel .rack-stage .hand-row .tile,
.hero-hand-panel .rack-stage .tile:not(.exposure-tile) {
  width: var(--rack-tile-width);
  height: var(--rack-tile-height);
  justify-self: center;
  align-self: end;
}

.rack-stage .hand-row .tile:not(.wall-tile) .tile-art,
.rack-stage .exposure-tile:not(.wall-tile) .tile-art {
  filter: drop-shadow(0 8px 7px rgba(36, 20, 10, 0.22));
}

.rack-stage .hand-row .tile:hover {
  transform: translateY(clamp(-6px, -0.65cqw, -3px));
}

.rack-stage .hand-row .tile.drawn-rack-tile {
  margin-left: 0;
  transform: translateY(clamp(-8px, -0.9cqw, -4px));
}

.rack-stage .hand-row .tile.drawn-rack-tile:hover {
  transform: translateY(clamp(-12px, -1.25cqw, -6px));
}

.rack-stage .hand-insert-caret {
  z-index: 5;
}

body.endgame-mode .hero-hand-panel,
body.endgame-mode .board-hand-slot .hero-hand-panel,
body.endgame-mode .hero-hand-panel.charleston-actions-first {
  grid-template-areas:
    "endgame"
    "rack";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(230px, 1fr);
  align-content: start;
  justify-items: center;
  gap: clamp(0.9rem, 2.2cqw, 1.75rem);
  padding-top: clamp(1rem, 2.6vh, 1.65rem);
}

body.endgame-mode .main-grid.board-layout {
  grid-template-rows: minmax(0, 1fr) 0;
}

body.endgame-mode .hand-sort-utility,
body.endgame-mode #next-action-panel,
body.endgame-mode #charleston-choice-banner {
  display: none;
}

body.endgame-mode .rack-stage {
  width: 100%;
  min-height: max(230px, calc(var(--rack-tile-height) + var(--rack-exposure-height) + 78px));
  align-self: end;
  overflow: visible;
}

body.endgame-player .hero-hand-panel,
body.endgame-player .board-hand-slot .hero-hand-panel,
body.endgame-player .hero-hand-panel.charleston-actions-first {
  grid-template-areas:
    "rack"
    "endgame";
  grid-template-rows: minmax(210px, 42vh) auto;
  gap: clamp(0.45rem, 1.2cqw, 0.85rem);
  padding-top: clamp(0.45rem, 1.4vh, 0.9rem);
}

body.endgame-wall .hero-hand-panel,
body.endgame-wall .board-hand-slot .hero-hand-panel,
body.endgame-wall .hero-hand-panel.charleston-actions-first {
  grid-template-areas:
    "rack"
    "endgame";
  grid-template-rows: minmax(220px, 43vh) auto;
  gap: clamp(0.55rem, 1.3cqw, 0.95rem);
  padding-top: clamp(0.45rem, 1.5vh, 0.95rem);
}

body.endgame-player .rack-stage {
  --rack-exposure-gap: clamp(0.1rem, 0.32cqw, 0.26rem);
  --rack-exposure-width: clamp(32px, calc((var(--rack-seat-width) - (13 * var(--rack-exposure-gap))) / 14), 72px);
  --rack-exposure-height: calc(var(--rack-exposure-width) * 1.36);
  align-self: start;
  min-height: max(220px, calc(var(--rack-tile-height) + var(--rack-exposure-height) + 58px));
}

body.endgame-player .rack-stage .hand-row {
  display: none;
}

body.endgame-player .rack-stage .rack-exposure-shelf.final-mahjong-exposures {
  bottom: var(--rack-back-shelf-bottom);
  width: min(100%, var(--rack-hand-track-width));
}

body.endgame-player .rack-stage .final-mahjong-exposures .exposure-row {
  justify-content: center;
  overflow: visible;
}

body.endgame-player .rack-stage .final-mahjong-set,
body.endgame-player .rack-stage .final-mahjong-tiles {
  min-width: 0;
}

body.endgame-player .rack-stage .final-mahjong-tiles {
  justify-content: center;
  gap: var(--rack-exposure-gap);
}

body.endgame-player .rack-stage .final-mahjong-tile {
  width: var(--rack-exposure-width);
  height: var(--rack-exposure-height);
}

body.endgame-mode .endgame-panel {
  width: min(760px, calc(100% - 2rem));
  gap: clamp(0.85rem, 2.2cqw, 1.35rem);
  margin: 0 auto;
  padding: clamp(1rem, 2.2cqw, 1.45rem) clamp(1.2rem, 3.5cqw, 2.5rem);
  overflow: hidden;
  border: 1px solid rgba(0, 150, 136, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 150, 136, 0.12), transparent 34%),
    radial-gradient(circle at 88% 100%, rgba(147, 112, 219, 0.12), transparent 36%),
    rgba(255, 253, 248, 0.94);
  box-shadow:
    0 18px 45px rgba(61, 48, 36, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

body.endgame-player .endgame-panel {
  width: min(860px, calc(100% - 2rem));
  gap: clamp(0.72rem, 1.8cqw, 1.08rem);
  margin-top: -0.35rem;
  padding: clamp(0.78rem, 1.35cqw, 1rem) clamp(1rem, 2.3cqw, 1.55rem);
  border-radius: 18px;
}

body.endgame-wall .endgame-panel {
  width: min(900px, calc(100% - 2rem));
  grid-template-columns: minmax(0, 1fr) auto minmax(170px, auto);
  gap: clamp(0.72rem, 1.8cqw, 1.15rem);
  margin-top: -0.25rem;
  padding: clamp(0.82rem, 1.45cqw, 1.12rem) clamp(1rem, 2.4cqw, 1.65rem);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(245, 253, 251, 0.9) 48%, rgba(248, 244, 255, 0.82)),
    rgba(255, 253, 248, 0.94);
}

body.endgame-mode .endgame-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #009688 0 50%, #9370db 50% 100%);
}

body.endgame-mode .endgame-panel .pre-game-label {
  margin: 0;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(0, 150, 136, 0.2);
  border-radius: 999px;
  color: #007a70;
  background: rgba(0, 150, 136, 0.08);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.endgame-mode .endgame-panel h2 {
  max-width: 18ch;
  color: #2f2d2a;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 4.2cqw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

body.endgame-player .endgame-panel h2 {
  max-width: none;
  font-size: clamp(1.45rem, 2.45cqw, 2.35rem);
}

body.endgame-wall .endgame-panel h2 {
  max-width: none;
  font-size: clamp(1.5rem, 2.5cqw, 2.4rem);
}

body.endgame-mode .endgame-panel .inline-help {
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  color: #665b53;
  background: rgba(147, 112, 219, 0.08);
  font-family: "Merriweather", serif;
  font-size: clamp(0.82rem, 1.1cqw, 0.98rem);
  font-weight: 700;
}

body.endgame-player .endgame-panel .inline-help {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #4f4842;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.9rem, 1.15cqw, 1.05rem);
  font-weight: 850;
}

body.endgame-wall .endgame-panel .inline-help {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #4f4842;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.88rem, 1.08cqw, 1.02rem);
  font-weight: 800;
}

body.endgame-player .endgame-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  margin-top: 0.12rem;
}

body.endgame-wall .endgame-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.34rem;
  margin-top: 0.12rem;
}

body.endgame-player .endgame-stat {
  padding: 0.46rem 0.5rem;
  border-radius: 8px;
}

body.endgame-wall .endgame-stat {
  padding: 0.46rem 0.54rem;
  border-color: rgba(0, 150, 136, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

body.endgame-wall .endgame-stat strong {
  font-size: clamp(0.98rem, 1.45cqw, 1.18rem);
}

body.endgame-player .endgame-support {
  gap: 0.68rem;
  margin-top: 0.06rem;
  padding: 0.66rem 0.78rem;
  border-radius: 10px;
}

body.endgame-mode #endgame-new-game-btn.diamond-gradient-btn {
  --diamond-min-width: 178px;
  --diamond-min-height: 2.85rem;
  --diamond-padding: 0.64rem 1.25rem;
  margin-top: 0;
  border-radius: 16px;
}

body.endgame-player #endgame-new-game-btn.diamond-gradient-btn {
  --diamond-min-height: 2.45rem;
  --diamond-padding: 0.48rem 1rem;
}

body.endgame-wall #endgame-new-game-btn.diamond-gradient-btn {
  --diamond-min-height: 2.5rem;
  --diamond-padding: 0.5rem 1.05rem;
}

body.endgame-wall .endgame-panel .pre-game-label {
  color: #007a70;
  border-color: rgba(0, 150, 136, 0.22);
  background: rgba(0, 150, 136, 0.09);
}

body.endgame-mode .board-bottom-grid {
  opacity: 0;
  transform: translateY(42px);
  pointer-events: none;
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  transition: opacity 360ms ease, transform 420ms ease, max-height 420ms ease;
}

body.endgame-mode .rack-stage .hand-row .tile,
body.endgame-mode .rack-stage .exposure-tile {
  animation: endgame-tile-dance 1350ms ease-in-out infinite;
  animation-delay: calc((var(--dance-index, 0)) * 70ms);
  transform-origin: 50% 92%;
}

body.endgame-bot .rack-stage .hand-row .tile,
body.endgame-bot .rack-stage .exposure-tile,
body.endgame-wall .rack-stage .hand-row .tile,
body.endgame-wall .rack-stage .exposure-tile {
  animation-name: endgame-tile-gentle-dance;
  animation-duration: 1700ms;
}

body.endgame-mode .rack-stage .hand-row .tile:nth-child(1),
body.endgame-mode .rack-stage .exposure-tile:nth-child(1) { --dance-index: 0; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(2),
body.endgame-mode .rack-stage .exposure-tile:nth-child(2) { --dance-index: 1; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(3),
body.endgame-mode .rack-stage .exposure-tile:nth-child(3) { --dance-index: 2; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(4),
body.endgame-mode .rack-stage .exposure-tile:nth-child(4) { --dance-index: 3; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(5),
body.endgame-mode .rack-stage .exposure-tile:nth-child(5) { --dance-index: 4; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(6),
body.endgame-mode .rack-stage .exposure-tile:nth-child(6) { --dance-index: 5; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(7) { --dance-index: 6; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(8) { --dance-index: 7; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(9) { --dance-index: 8; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(10) { --dance-index: 9; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(11) { --dance-index: 10; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(12) { --dance-index: 11; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(13) { --dance-index: 12; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(14) { --dance-index: 13; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(15) { --dance-index: 14; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(16) { --dance-index: 15; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(17) { --dance-index: 16; }
body.endgame-mode .rack-stage .hand-row .tile:nth-child(18) { --dance-index: 17; }

@keyframes endgame-message-rise {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes endgame-tile-dance {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  35% {
    transform: translateY(-12px) rotate(-1.5deg);
  }

  68% {
    transform: translateY(-3px) rotate(1deg);
  }
}

@keyframes endgame-tile-gentle-dance {
  0%,
  100% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(-7px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.endgame-mode .rack-stage .hand-row .tile,
  body.endgame-mode .rack-stage .exposure-tile,
  .endgame-panel {
    animation: none;
  }
}

@media (max-height: 650px) and (min-width: 900px) {
  body.endgame-mode .hero-hand-panel,
  body.endgame-mode .board-hand-slot .hero-hand-panel,
  body.endgame-mode .hero-hand-panel.charleston-actions-first {
    grid-template-rows: auto minmax(205px, 1fr);
    gap: 0.65rem;
    padding-top: 0.55rem;
  }

  body.endgame-mode .endgame-panel {
    gap: 0.42rem;
    width: min(760px, calc(100% - 2rem));
    padding: 0.78rem 1.5rem 0.85rem;
    border-radius: 20px;
  }

  body.endgame-mode .endgame-panel h2 {
    font-size: clamp(1.75rem, 3.5cqw, 2.75rem);
  }

  body.endgame-mode .endgame-panel .pre-game-label {
    padding: 0.22rem 0.58rem;
    font-size: 0.64rem;
  }

  body.endgame-mode .endgame-panel .inline-help {
    padding-block: 0.32rem;
  }

  body.endgame-mode #endgame-new-game-btn.diamond-gradient-btn {
    --diamond-min-height: 2.5rem;
    --diamond-padding: 0.52rem 1.05rem;
  }

  body.endgame-mode .rack-stage {
    min-height: max(205px, calc(var(--rack-tile-height) + var(--rack-exposure-height) + 62px));
  }

  body.endgame-player .hero-hand-panel,
  body.endgame-player .board-hand-slot .hero-hand-panel,
  body.endgame-player .hero-hand-panel.charleston-actions-first,
  body.endgame-wall .hero-hand-panel,
  body.endgame-wall .board-hand-slot .hero-hand-panel,
  body.endgame-wall .hero-hand-panel.charleston-actions-first {
    grid-template-areas:
      "rack"
      "endgame";
    grid-template-rows: minmax(198px, 40vh) auto;
    gap: 0.45rem;
    padding-top: 0.35rem;
  }

  body.endgame-player .endgame-panel {
    width: min(820px, calc(100% - 2rem));
    margin-top: -0.35rem;
    padding: 0.62rem 1.1rem 0.72rem;
    border-radius: 16px;
  }

  body.endgame-wall .endgame-panel {
    width: min(840px, calc(100% - 2rem));
    margin-top: -0.25rem;
    padding: 0.64rem 1.1rem 0.74rem;
    border-radius: 16px;
  }

  body.endgame-player .endgame-panel h2 {
    font-size: clamp(1.35rem, 2.6cqw, 2rem);
  }

  body.endgame-player .endgame-stats,
  body.endgame-wall .endgame-stats {
    gap: 0.28rem;
  }

  body.endgame-player .endgame-stat,
  body.endgame-wall .endgame-stat {
    padding: 0.38rem 0.44rem;
  }

  body.endgame-player .endgame-support {
    padding: 0.46rem 0.58rem;
  }

  body.endgame-player #endgame-new-game-btn.diamond-gradient-btn,
  body.endgame-wall #endgame-new-game-btn.diamond-gradient-btn {
    --diamond-min-height: 2.35rem;
    --diamond-padding: 0.44rem 0.92rem;
  }
}

@media (max-width: 700px) {
  body.endgame-mode .hero-hand-panel,
  body.endgame-mode .board-hand-slot .hero-hand-panel,
  body.endgame-mode .hero-hand-panel.charleston-actions-first {
    grid-template-areas:
      "endgame"
      "rack";
    grid-template-rows: auto minmax(190px, 1fr);
  }

  body.endgame-wall .hero-hand-panel,
  body.endgame-wall .board-hand-slot .hero-hand-panel,
  body.endgame-wall .hero-hand-panel.charleston-actions-first {
    grid-template-areas:
      "rack"
      "endgame";
    grid-template-rows: minmax(190px, 1fr) auto;
  }

  body.endgame-mode .endgame-panel {
    width: calc(100% - 0.5rem);
    padding-inline: 1rem;
    border-radius: 20px;
  }
}

body.charleston-active .hero-hand-panel.charleston-actions-first {
  grid-template-areas: "rack rack";
  grid-template-rows: minmax(190px, 1fr);
  row-gap: 0;
}

@media (max-width: 700px) {
  .hero-hand-panel,
  .board-hand-slot .hero-hand-panel,
  .hero-hand-panel.charleston-actions-first {
    grid-template-areas:
      "rack"
      "actions";
  }

  body.charleston-active .hero-hand-panel.charleston-actions-first {
    grid-template-areas: "rack";
  }

  .rack-stage {
    --rack-gutter: clamp(0.35rem, 2cqw, 0.8rem);
    --rack-tile-scale: 1.08;
    --rack-slot-width: clamp(25px, calc((var(--rack-seat-width) - (17 * var(--rack-hand-gap))) / 18), 62px);
    min-height: max(175px, calc(var(--rack-tile-height) + 90px));
  }

  .rack-stage .hand-row {
    justify-content: flex-start;
  }
}

/* Reversible rack experiment: remove `rack-unframed` from <body> to restore the framed rack panel. */
body.rack-unframed .hero-hand-panel,
body.rack-unframed .board-hand-slot .hero-hand-panel,
body.rack-unframed .hero-hand-panel.charleston-actions-first {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
  padding-inline: clamp(0.3rem, 1.1vw, 0.8rem);
}

body.rack-unframed .main-grid.board-layout,
body.rack-unframed .board-hand-slot {
  overflow: visible;
}

body.rack-unframed .rack-stage {
  overflow: visible;
}

body.rack-unframed .rack-art {
  filter:
    drop-shadow(0 18px 20px rgba(38, 28, 20, 0.24))
    drop-shadow(0 0 28px rgba(225, 243, 248, 0.72));
}

body.rack-unframed .hand-sort-utility {
  top: 0.18rem;
  right: 0.5rem;
  min-height: 2.55rem;
  gap: 0.18rem;
  padding: 0.28rem 0.34rem 0.28rem 0.62rem;
  border: 1px solid rgba(0, 150, 136, 0.16);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 8px 18px rgba(33, 104, 108, 0.08);
}

body.rack-unframed .hand-sort-utility .sort-utility-label {
  padding: 0 0.34rem 0 0;
  color: #586c66;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

body.rack-unframed .hand-sort-utility .sort-utility-btn {
  min-height: 1.95rem;
  padding: 0.42rem 0.72rem;
  border-radius: 10px;
  font-size: 0.82rem;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

body.rack-unframed .hand-sort-utility .sort-utility-btn.active {
  color: #004f49;
  background: rgba(0, 150, 136, 0.13);
  box-shadow: inset 0 -2px 0 rgba(109, 95, 209, 0.34);
}

body.rack-unframed .hand-sort-utility .sort-utility-btn.active::after {
  content: none;
}

body.rack-unframed .hand-sort-utility .sort-utility-btn:not(:disabled):hover,
body.rack-unframed .hand-sort-utility .sort-utility-btn:not(:disabled):focus-visible {
  color: #5137a4;
  background: rgba(147, 112, 219, 0.14);
  outline: none;
  transform: translateY(-1px);
}

body.rack-unframed .hand-sort-utility .sort-utility-btn:disabled {
  color: #82958f;
  opacity: 0.58;
}

.tile-style-utility {
  position: absolute;
  top: 0.25rem;
  left: 0.5rem;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 0.34rem;
  padding: 0.22rem 0.34rem;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.48);
  box-shadow: none;
}

#game-view:not(.hidden) .tile-style-utility {
  display: inline-flex;
}

.tile-style-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 1.8rem;
  padding: 0.18rem 0.24rem 0.34rem 0.24rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2f6963;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease, opacity 140ms ease;
}

.tile-style-chip .tile-style-swatch {
  width: 1.24rem;
  border-radius: 5px;
}

.tile-style-chip.active,
.tile-style-chip[aria-pressed="true"] {
  color: #004f49;
  background: transparent;
}

.tile-style-chip.active::after,
.tile-style-chip[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: calc(0.24rem + 1.24rem + 0.32rem);
  right: 0.2rem;
  bottom: 0.08rem;
  height: 0.17rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #009688, #6d5fd1);
}

.tile-style-chip:hover,
.tile-style-chip:focus-visible {
  color: #5a3faf;
  background: transparent;
}

@media (max-width: 700px) {
  body.rack-unframed .hand-sort-utility {
    top: 0.2rem;
    right: 0.35rem;
    min-height: 2.2rem;
    padding: 0.22rem 0.25rem 0.22rem 0.48rem;
  }

  body.rack-unframed .hand-sort-utility .sort-utility-label {
    padding-right: 0.22rem;
    font-size: 0.56rem;
  }

  body.rack-unframed .hand-sort-utility .sort-utility-btn {
    min-height: 1.7rem;
    padding: 0.34rem 0.5rem;
    font-size: 0.72rem;
  }
}

@media (min-width: 901px) and (min-height: 680px) {
  body.rack-unframed .main-grid.board-layout {
    grid-template-rows: clamp(264px, 32vh, 336px) minmax(0, 1fr);
  }
}

#hand-panel h2,
#next-action-panel h2,
#draw-panel h2,
#turn-lane-panel h2,
#discard-history-panel h2,
#hand-card-panel h2,
.hand-card-title,
.turn-lane-title {
  font-weight: 700;
  letter-spacing: -0.03em;
}

#draw-btn {
  font-family: var(--button-font);
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Minimal start screen: tile-inspired palette, fewer decisions */
.pre-game-modal {
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 150, 136, 0.16), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(165, 42, 42, 0.12), transparent 30%),
    radial-gradient(circle at 75% 86%, rgba(218, 165, 32, 0.14), transparent 32%),
    rgba(34, 28, 22, 0.2);
}

.pre-game-card {
  width: min(620px, 100%);
  gap: 1.05rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  font-family: "Merriweather Sans", sans-serif;
  background:
    linear-gradient(145deg, rgba(255, 248, 231, 0.98), rgba(255, 252, 244, 0.95)),
    #fff8e7;
  border: 1px solid rgba(210, 180, 140, 0.62);
  box-shadow: 0 28px 80px rgba(61, 46, 36, 0.28);
}

.pre-game-card::before {
  inset: -3rem -3rem auto auto;
  width: 12rem;
  height: 12rem;
  background:
    radial-gradient(circle at 44% 42%, rgba(0, 150, 136, 0.22), transparent 34%),
    radial-gradient(circle at 62% 62%, rgba(147, 112, 219, 0.2), transparent 36%);
}

.pre-game-card::after {
  content: "";
  position: absolute;
  left: clamp(1.2rem, 3vw, 2rem);
  right: clamp(1.2rem, 3vw, 2rem);
  top: 0;
  height: 6px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #009688 0%, #009688 50%, #9370DB 50%, #9370DB 100%);
}

.pre-game-copy {
  gap: 0.42rem;
}

.pre-game-copy h2 {
  max-width: none;
  font-size: 3.6rem;
  line-height: 0.96;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.pre-game-subtitle {
  max-width: 460px;
  color: #5f554c;
  font-size: clamp(1rem, 1.45vw, 1.14rem);
  font-weight: 800;
}

.pre-game-value-line,
.start-session-panel,
.pre-game-toggle,
.mode-choice-grid {
  display: none !important;
}

.assist-mode-panel {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.72rem;
}

.assist-mode-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pre-game-layout {
  grid-template-columns: 1fr;
  gap: 0;
}

.pre-game-panel {
  border-color: rgba(210, 180, 140, 0.48);
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.84), rgba(255, 248, 231, 0.72)),
    rgba(255, 248, 231, 0.82);
  border-radius: 22px;
  padding: clamp(0.9rem, 2vw, 1.1rem);
}

.profile-head {
  display: block;
}

.profile-head h3 {
  font-family: "Merriweather", serif;
  font-size: 1.16rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}

.profile-summary,
.profile-stats,
.profile-save-btn {
  display: none !important;
}

.profile-form {
  grid-template-columns: 1fr;
  gap: 0.58rem;
}

.profile-form label:first-child {
  grid-column: auto;
}

.profile-form input {
  min-height: 3.15rem;
  border-color: rgba(210, 180, 140, 0.58);
  background: rgba(255, 255, 255, 0.82);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.profile-form input:focus {
  border-color: rgba(0, 150, 136, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.14);
}

.pre-game-actions {
  justify-content: stretch;
  gap: 0.62rem;
}

.pre-game-start-btn {
  width: 100%;
  min-width: 0;
  padding: 0.86rem 1.25rem;
  font-size: 1.22rem;
  color: #fffdf8;
  background: linear-gradient(180deg, #009688 0%, #007f74 100%);
  box-shadow: 0 10px 22px rgba(0, 127, 116, 0.22);
}

.pre-game-or-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.78rem;
  color: #7a7068;
  font-family: "Merriweather", serif;
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.pre-game-or-divider::before,
.pre-game-or-divider::after {
  content: "";
  height: 1px;
  background: rgba(0, 150, 136, 0.16);
}

.pre-game-start-btn:hover {
  background: linear-gradient(180deg, #08a596 0%, #00887c 100%);
}

/* Tile-palette start screen refinement */
.pre-game-card {
  background:
    linear-gradient(145deg, rgba(255, 248, 231, 0.98), rgba(252, 242, 221, 0.96)),
    #fff8e7;
  border-color: rgba(210, 180, 140, 0.78);
  color: #2b2a28;
}

.pre-game-card::before {
  background:
    radial-gradient(circle at 38% 38%, rgba(0, 150, 136, 0.16), transparent 36%),
    radial-gradient(circle at 68% 60%, rgba(147, 112, 219, 0.14), transparent 38%),
    radial-gradient(circle at 52% 72%, rgba(147, 112, 219, 0.1), transparent 38%);
}

.pre-game-card::after {
  background: linear-gradient(90deg, #009688 0%, #009688 50%, #9370DB 50%, #9370DB 100%);
}

.pre-game-card .eyebrow,
.pre-game-label {
  color: #006f67;
}

.pre-game-copy h2,
.profile-head h3 {
  color: #2b2a28;
}

.pre-game-subtitle {
  color: #6a4a37;
}

.pre-game-panel {
  border-color: rgba(210, 180, 140, 0.74);
  background: rgba(255, 248, 231, 0.7);
}

.profile-panel {
  border-color: transparent;
  background: transparent;
  padding: 0;
}

.profile-form span {
  color: #006f67;
}

.profile-form input {
  border-color: rgba(210, 180, 140, 0.86);
  background: rgba(255, 253, 247, 0.9);
  color: #2b2a28;
}

.profile-form input:focus {
  border-color: rgba(0, 150, 136, 0.8);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.16);
}

.pre-game-start-btn {
  background: linear-gradient(180deg, #009688 0%, #007a70 100%);
}

.pre-game-start-btn:hover {
  background: linear-gradient(180deg, #08a596 0%, #00877b 100%);
}

.mode-choice {
  position: relative;
  overflow: hidden;
  padding-right: 4.65rem;
}

.mode-choice.selected,
.mode-choice.active {
  border-color: rgba(0, 150, 136, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 248, 231, 0.98), rgba(231, 250, 246, 0.9)),
    #fff8e7;
  box-shadow:
    inset 0 0 0 2px rgba(0, 150, 136, 0.2),
    0 12px 26px rgba(0, 111, 102, 0.13);
  transform: translateY(-1px);
}

.mode-choice[aria-pressed="true"]::after {
  content: none;
}

.mode-choice-icon {
  position: absolute;
  right: 0.78rem;
  top: 0.62rem;
  width: 2.75rem;
  height: 2.75rem;
  opacity: 0.34;
  pointer-events: none;
}

.mode-choice.active .mode-choice-icon,
.mode-choice.selected .mode-choice-icon {
  opacity: 0.72;
}

.mode-choice-icon-solo::before {
  left: 50%;
  top: 14%;
  right: auto;
  width: clamp(0.88rem, 1.4vw, 1.08rem);
  height: clamp(0.88rem, 1.4vw, 1.08rem);
  transform: translateX(-50%);
}

.mode-choice-icon-solo::after {
  left: 50%;
  top: 48%;
  right: auto;
  width: clamp(2rem, 3.3vw, 2.55rem);
  height: clamp(1.15rem, 2vw, 1.46rem);
  border-width: clamp(0.18rem, 0.32vw, 0.24rem);
  border-bottom-width: clamp(0.23rem, 0.4vw, 0.3rem);
  transform: translateX(-50%);
}

.mode-choice-icon::before,
.mode-choice-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.mode-choice-icon-teacher::before {
  inset: 0.12rem;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23009688' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='32' cy='32' r='25' stroke-width='3.5'/%3E%3Ccircle cx='32' cy='32' r='19' stroke-width='2' opacity='.7'/%3E%3Cpath d='M32 10v5M32 49v5M10 32h5M49 32h5' stroke-width='3'/%3E%3Cpath d='m39.5 24.5-4.1 10.9-10.9 4.1 4.1-10.9z' fill='%23009688' fill-opacity='.16' stroke-width='3.5'/%3E%3Cpath d='m39.5 24.5-10.9 4.1 6.8 6.8z' fill='%23009688' stroke='none'/%3E%3Ccircle cx='32' cy='32' r='2.7' fill='%23009688' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
}

.mode-choice-icon-teacher::after {
  content: none;
}

.mode-choice-icon-solo::before {
  right: 0.88rem;
  top: 0.28rem;
  width: 0.86rem;
  height: 0.86rem;
  border-radius: 999px;
  background: var(--sage);
}

.mode-choice-icon-solo::after {
  right: 0.42rem;
  top: 1.32rem;
  width: 1.78rem;
  height: 1.18rem;
  border-radius: 1rem 1rem 0.36rem 0.36rem;
  border: 0.2rem solid var(--sage);
  border-bottom-width: 0.28rem;
}

.learn-table-prompt {
  min-height: 7.6rem;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.44fr);
  padding: 1.15rem 1.25rem 1.15rem 7.45rem;
  border-radius: 22px;
}

.learn-table-mini-tiles {
  left: 1.2rem;
  width: 5.35rem;
  height: 5rem;
}

.learn-table-mini-tiles img {
  width: 3.1rem;
  height: 4.05rem;
}

.learn-table-mini-tiles img:nth-child(2) {
  left: 1.02rem;
}

.learn-table-mini-tiles img:nth-child(3) {
  left: 2.05rem;
}

.learn-table-prompt p {
  font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.learn-table-btn {
  width: 100%;
  min-height: 3.65rem;
  min-width: 0;
}

/* Landing + email flow */
.landing-screen,
.email-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(0.7rem, 2vw, 1.6rem);
  background: #fbf7ef;
}

.email-gate-modal {
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 150, 136, 0.07), transparent 28rem),
    radial-gradient(circle at 84% 78%, rgba(147, 112, 219, 0.07), transparent 25rem),
    #fbf7ef;
}

.email-gate-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 64, 37, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 64, 37, 0.045) 1px, transparent 1px);
  background-repeat: repeat;
  background-size: clamp(66px, 7vw, 112px) clamp(66px, 7vw, 112px);
  background-position: top left;
}

.landing-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.72), transparent 26rem),
    radial-gradient(circle at 78% 38%, rgba(255, 255, 255, 0.8), transparent 30rem),
    radial-gradient(circle at 18% 80%, rgba(0, 150, 136, 0.08), transparent 22rem),
    radial-gradient(circle at 86% 82%, rgba(147, 112, 219, 0.08), transparent 23rem),
    #fffaf3;
}

.landing-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 64, 37, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 64, 37, 0.045) 1px, transparent 1px);
  background-repeat: repeat;
  background-size: clamp(66px, 7vw, 112px) clamp(66px, 7vw, 112px);
  background-position: top left;
}

.landing-screen::after {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(255, 253, 248, 0.04) 0 42%, rgba(255, 250, 243, 0.36) 78%),
    linear-gradient(90deg, rgba(255, 250, 243, 0.58), rgba(255, 250, 243, 0) 11% 89%, rgba(255, 250, 243, 0.58));
}

.landing-screen.hidden,
.email-gate-modal.hidden {
  display: none !important;
}

body.landing-active,
body.email-gate-active {
  overflow: hidden;
}

.landing-legal-links {
  position: absolute;
  bottom: clamp(0.6rem, 2vh, 1.2rem);
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  font-size: 0.85rem;
}

.landing-legal-links a {
  color: #4f6b68;
  text-decoration: none;
}

.landing-legal-links a:hover,
.landing-legal-links a:focus-visible {
  text-decoration: underline;
}

.landing-rack-wrap {
  position: relative;
  z-index: 1;
  width: min(1720px, 100%);
  min-height: min(820px, calc(100vh - clamp(1.4rem, 4vw, 3.2rem)));
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  isolation: isolate;
}

.landing-hero-grid {
  position: relative;
  z-index: 2;
  width: min(1320px, calc(100vw - clamp(2rem, 7vw, 8rem)));
  display: grid;
  grid-template-columns: minmax(330px, 0.98fr) minmax(390px, 0.92fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4.5rem);
}

.landing-home-content {
  position: relative;
  z-index: 3;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(0.85rem, 1.7vw, 1.35rem);
  padding-block: clamp(1rem, 4vw, 2.6rem);
  text-align: center;
  transform: translateY(clamp(-2.1rem, -2.3vw, -1rem));
}

.landing-logo-stack {
  display: grid;
  justify-items: center;
  gap: clamp(0.42rem, 0.9vw, 0.72rem);
}

.mahj-logo {
  display: block;
  width: clamp(310px, 31vw, 640px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 12px 14px rgba(0, 88, 84, 0.12));
}

.mahj-logo-raster {
  width: clamp(340px, 36vw, 590px);
  border-radius: 18px;
  object-fit: contain;
  filter: drop-shadow(0 15px 20px rgba(0, 88, 84, 0.1));
}

.landing-logo-raster .mahj-logo-svg,
.landing-logo-raster .landing-title-divider,
.landing-logo-raster .landing-statement {
  display: none;
}

.landing-logo-svg .mahj-logo-raster {
  display: none;
}

.landing-title-divider {
  width: min(250px, 45vw);
  height: auto;
  margin-top: -0.44rem;
  margin-bottom: -0.2rem;
  overflow: visible;
}

.landing-title-divider path {
  fill: none;
  stroke: rgba(147, 112, 219, 0.48);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landing-title-divider circle {
  fill: #9370DB;
  filter: drop-shadow(0 1px 2px rgba(147, 112, 219, 0.2));
}

.landing-statement {
  position: relative;
  z-index: 3;
  width: min(760px, 100%);
  color: #0d7277;
  font-family: "Merriweather", serif;
  font-size: clamp(1.25rem, 2.05vw, 2.05rem);
  font-weight: 700;
  line-height: 1.18;
  text-align: center;
  text-shadow: 0 2px 0 rgba(255, 253, 248, 0.86);
}

.landing-statement::before {
  content: none;
}

.landing-play-row {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 560px);
  margin-top: 0.15rem;
}

.game-menu-footer {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.52rem 0.74rem;
  padding: 0.18rem 0.8rem 0;
  color: rgba(79, 87, 83, 0.78);
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.74rem, 1.15vw, 0.88rem);
  font-weight: 900;
  letter-spacing: 0.01em;
}

.game-menu-footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.58rem;
}

.game-menu-footer a,
.game-menu-footer button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 140ms ease, transform 140ms ease;
}

.game-menu-footer a:hover,
.game-menu-footer a:focus-visible,
.game-menu-footer button:hover,
.game-menu-footer button:focus-visible {
  color: #006f67;
  outline: none;
  transform: translateY(-1px);
}

.game-menu-footer p {
  margin: 0;
}

.game-menu-footer-dot {
  color: rgba(116, 82, 190, 0.5);
}

.game-menu-social-link {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(149, 192, 203, 0.28),
    0 10px 22px rgba(37, 31, 24, 0.08);
}

.game-menu-social-link svg {
  width: 1.24rem;
  height: 1.24rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legal-page-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 18%, rgba(0, 150, 136, 0.08), transparent 28rem),
    radial-gradient(circle at 86% 14%, rgba(147, 112, 219, 0.08), transparent 26rem),
    #fbf7ef;
}

.legal-page-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 64, 37, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 64, 37, 0.045) 1px, transparent 1px);
  background-repeat: repeat;
  background-size: clamp(66px, 7vw, 112px) clamp(66px, 7vw, 112px);
}

.legal-page-shell {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.1rem, 3vw, 2rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.8rem;
  color: #007a70;
  font: 900 0.86rem var(--button-font);
  text-decoration: none;
}

.legal-back-link::before {
  content: "←";
  margin-right: 0.38rem;
  font-size: 1rem;
  line-height: 1;
}

.legal-back-link:hover,
.legal-back-link:focus-visible {
  color: #00645e;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.legal-page-card {
  padding: clamp(1.25rem, 4vw, 2.65rem);
  border: 1px solid rgba(109, 91, 68, 0.16);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow:
    0 28px 65px rgba(61, 48, 36, 0.14),
    0 7px 18px rgba(61, 48, 36, 0.07);
}

.legal-page-card h1 {
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(1.72rem, 4vw, 2.55rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
}

.legal-effective-date {
  margin: 0.65rem 0 1.5rem;
  color: #007a70;
  font-family: var(--button-font);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.legal-page-card h2 {
  margin-top: 1.5rem;
  color: #007a70;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.22rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

.legal-page-card p {
  margin-top: 0.72rem;
  color: #3d3833;
  font-size: clamp(0.92rem, 1.6vw, 1rem);
  line-height: 1.72;
}

.legal-page-card strong {
  color: #2f2d2a;
  font-weight: 700;
}

.game-view-only-banner {
  position: fixed;
  top: 5.6rem;
  left: 50%;
  z-index: 210;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(0, 150, 136, 0.28);
  border-radius: 16px;
  background: #fbf7ef;
  box-shadow: 0 8px 22px rgba(37, 31, 24, 0.1);
}

.game-view-only-banner.hidden {
  display: none;
}

@media (max-width: 899px) {
  /* The nav wraps under the logo here; keep the banner off it. */
  .game-view-only-banner {
    top: auto;
    bottom: 16px;
  }
}

.game-view-only-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  color: #385f61;
}

.game-view-only-copy strong {
  color: #2f2d2a;
  font-weight: 800;
}

body.game-view-only #game-view {
  filter: saturate(0.8);
  opacity: 0.88;
}

/* Prompts that ask for a move make no sense on a game that can't be played. */
body.game-view-only #opening-deal-modal,
body.game-view-only #hand-picker-modal,
body.game-view-only #charleston-intro-modal,
body.game-view-only #rule-popup {
  display: none;
}

.profile-avatar {
  overflow: hidden;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.account-profile-upload:disabled,
.account-profile-remove-photo:disabled {
  cursor: progress;
  opacity: 0.6;
}

.account-profile-remove-photo {
  border: 0;
  background: transparent;
  color: #586560;
  font-family: var(--button-font);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.account-profile-remove-photo.hidden {
  display: none;
}

.account-profile-photo-status {
  margin: 0;
  min-height: 1.1em;
  color: #586560;
  font-size: 0.78rem;
  text-align: center;
}

.account-profile-field-note {
  color: #586560;
  font-size: 0.74rem;
}

.account-profile-fields input[readonly] {
  background: rgba(88, 101, 96, 0.06);
  color: #586560;
}

.account-profile-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(108, 88, 61, 0.14);
}

.account-profile-danger p {
  margin: 0;
  color: #586560;
  font-size: 0.86rem;
}

.account-profile-delete-btn {
  border: 1px solid rgba(178, 58, 58, 0.45);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  background: transparent;
  color: #a33434;
  font-family: var(--button-font);
  font-weight: 900;
  cursor: pointer;
}

.account-profile-delete-btn:hover,
.account-profile-delete-btn:focus-visible {
  background: rgba(178, 58, 58, 0.08);
}

/* Opens on top of Edit Profile, which uses the same modal layer. */
.delete-account-modal {
  z-index: 125;
}

.delete-account-error {
  margin: 0;
  color: #a33434;
  font-weight: 700;
}

.delete-account-error:empty {
  display: none;
}

.leave-game-card {
  max-width: 460px;
  text-align: center;
}

.leave-game-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

/* My Table scrolls; rows keep their natural height so match history adds
   to the page instead of squeezing the dashboard above it. */
.profile-view {
  grid-auto-rows: max-content;
}

.match-history {
  box-sizing: border-box;
  width: min(100%, 1440px);
  display: grid;
  gap: 0.7rem;
  padding: clamp(1rem, 1.45vw, 1.35rem);
  border: 1px solid rgba(108, 88, 61, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 10%, rgba(147, 112, 219, 0.08), transparent 18rem),
    rgba(255, 253, 248, 0.86);
}

.match-history-status {
  margin: 0;
  color: #586560;
}

.match-history-status:empty {
  display: none;
}

.match-history-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.match-history-row {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid rgba(108, 88, 61, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.match-history-badge {
  justify-self: start;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-family: var(--button-font);
  font-size: 0.74rem;
  font-weight: 900;
  color: #586560;
  background: rgba(88, 101, 96, 0.1);
}

.match-history-win .match-history-badge {
  color: #ffffff;
  background: linear-gradient(180deg, var(--sage) 0%, var(--sage-dark) 100%);
}

.match-history-live .match-history-badge {
  color: var(--sage-dark);
  background: rgba(0, 150, 136, 0.14);
}

.match-history-loss .match-history-badge {
  color: #6b4fa3;
  background: rgba(147, 112, 219, 0.14);
}

.match-history-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.match-history-copy strong {
  overflow: hidden;
  color: #2f2d2a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-history-copy span {
  color: #586560;
  font-size: 0.86rem;
}

.match-history-link {
  font-family: var(--button-font);
  font-weight: 900;
  color: var(--sage-dark);
  text-decoration: none;
  white-space: nowrap;
}

.match-history-link:hover,
.match-history-link:focus-visible {
  text-decoration: underline;
}

.match-history-more {
  justify-self: center;
}

.match-history-more.hidden {
  display: none;
}

@media (max-width: 560px) {
  .match-history-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .match-history-badge {
    grid-column: 1 / -1;
  }
}

.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: clamp(0.7rem, 2vw, 1.35rem);
  background: rgba(47, 45, 42, 0.24);
  backdrop-filter: blur(3px);
}

.page-overlay.hidden {
  display: none;
}

.page-overlay-panel {
  width: min(940px, 100%);
  height: min(92vh, 960px);
  border-radius: 24px;
  overflow: hidden;
  background: #fbf7ef;
  box-shadow:
    0 28px 65px rgba(37, 31, 24, 0.25),
    0 7px 18px rgba(37, 31, 24, 0.16);
}

.page-overlay-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fbf7ef;
}

.page-overlay.support-page-overlay .page-overlay-panel,
.page-overlay.support-page-overlay .page-overlay-frame {
  background: transparent;
}

.page-overlay.support-page-overlay .page-overlay-panel {
  box-shadow: none;
}

body.page-overlay-open {
  overflow: hidden;
}

.landing-feature-panel {
  position: relative;
  z-index: 3;
  width: min(610px, 100%);
  justify-self: center;
  display: grid;
  gap: clamp(0.85rem, 1.45vw, 1.08rem);
  padding: clamp(0.55rem, 1vw, 0.8rem);
  isolation: isolate;
}

.landing-feature-panel::before,
.landing-feature-panel::after {
  content: none;
}

.landing-feature-heading {
  display: block;
  color: #0d7277;
  text-align: center;
}

.landing-feature-heading h2 {
  color: inherit;
  font-family: var(--button-font);
  font-size: clamp(0.9rem, 1.28vw, 1.28rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1.25;
  text-transform: uppercase;
}

.landing-feature-card {
  position: relative;
  display: grid;
  grid-template-columns: clamp(6.3rem, 8.6vw, 8.2rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 1.55vw, 1.45rem);
  min-height: clamp(7.2rem, 8.9vw, 8.6rem);
  padding: clamp(0.82rem, 1.15vw, 1rem) clamp(1.1rem, 1.7vw, 1.5rem);
  border: 1px solid rgba(92, 69, 48, 0.08);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow:
    0.9rem 0.68rem 0 rgba(147, 112, 219, 0.12),
    1.35rem 1rem 1.55rem rgba(147, 112, 219, 0.08),
    0 22px 34px rgba(66, 50, 34, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.landing-feature-card:nth-of-type(1) {
  transform: translateX(-0.35rem) rotate(-0.25deg);
}

.landing-feature-card:nth-of-type(2) {
  transform: translateX(-0.22rem) rotate(0.2deg);
}

.landing-feature-card:nth-of-type(3) {
  transform: translateX(-0.1rem) rotate(-0.12deg);
}

.landing-feature-art {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(5.5rem, 7.4vw, 6.9rem);
  aspect-ratio: 1;
  border-radius: 999px;
  justify-self: center;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.75), transparent 28%),
    rgba(0, 150, 136, 0.12);
}

.landing-feature-daily {
  isolation: isolate;
  color: #c86443;
}

.landing-feature-daily::before,
.landing-feature-daily::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 19%;
  aspect-ratio: 1;
  background: #ee8a68;
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  filter: drop-shadow(0 2px 0 rgba(255, 248, 231, 0.85));
}

.landing-feature-daily::before {
  left: 7%;
  top: 22%;
}

.landing-feature-daily::after {
  right: 5%;
  bottom: 18%;
}

.landing-daily-tile {
  position: relative;
  z-index: 2;
  width: 47%;
  aspect-ratio: 0.76;
  display: grid;
  place-items: center;
  border: 2px solid #0d7277;
  border-radius: 10px;
  background: #fff8e7;
  box-shadow:
    6px 7px 0 rgba(147, 112, 219, 0.5),
    0 10px 14px rgba(71, 55, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: rotate(5deg);
}

.landing-daily-sun {
  width: 70%;
  height: auto;
  transform: rotate(-5deg);
}

.landing-feature-copy {
  display: grid;
  gap: 0.52rem;
  min-width: 0;
}

.landing-feature-copy h3 {
  color: #0c6970;
  font-family: "Merriweather", serif;
  font-size: clamp(1.22rem, 1.62vw, 1.72rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.landing-feature-copy p {
  color: #117d86;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.92rem, 1.12vw, 1.12rem);
  font-weight: 700;
  line-height: 1.24;
}

.mini-rack {
  position: relative;
  width: 82%;
  height: 66%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5%;
  padding: 0 7% 10%;
  transform: translateY(-6%);
}

.mini-rack::before,
.mini-rack::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  border-radius: 6px;
  background: linear-gradient(180deg, #10ada4 0%, #00877f 58%, #006d68 100%);
  box-shadow:
    0 5px 8px rgba(0, 99, 93, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.mini-rack::before {
  z-index: 0;
  bottom: 18%;
  height: 38%;
  border-radius: 8px 8px 4px 4px;
}

.mini-rack::after {
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 9%;
  height: 14%;
  border-radius: 999px;
  background: linear-gradient(180deg, #08a199 0%, #00726d 100%);
  box-shadow:
    0 6px 7px rgba(0, 93, 88, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mini-rack img {
  position: relative;
  z-index: 2;
  width: 22.5%;
  height: auto;
  margin-bottom: -1%;
  filter: drop-shadow(0 4px 4px rgba(58, 43, 30, 0.16));
}

.mini-rack .mini-rack-flower {
  position: absolute;
  z-index: 4;
  right: 3%;
  bottom: 10%;
  width: 25.5%;
  transform: rotate(-2deg);
}

.landing-feature-compass svg {
  width: 86%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 11px 12px rgba(93, 68, 44, 0.16));
}

.compass-shadow {
  fill: rgba(45, 42, 38, 0.1);
}

.compass-outer-rim {
  fill: #fff8e7;
  stroke: rgba(147, 112, 219, 0.72);
  stroke-width: 3;
}

.compass-inner-rim {
  fill: rgba(147, 112, 219, 0.16);
  stroke: rgba(255, 248, 231, 0.86);
  stroke-width: 2.5;
}

.compass-face {
  fill: #009688;
  stroke: rgba(0, 122, 112, 0.72);
  stroke-width: 1.5;
}

.compass-cardinal-lines,
.compass-tick-lines {
  fill: none;
  stroke: rgba(255, 248, 231, 0.76);
  stroke-linecap: round;
}

.compass-cardinal-lines {
  stroke-width: 3;
}

.compass-tick-lines {
  stroke-width: 1.7;
}

.compass-cardinal {
  fill: #fff8e7;
  font-family: var(--button-font);
  font-size: 10px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(0, 122, 112, 0.32);
  stroke-width: 1.5px;
}

.compass-needle {
  stroke: rgba(90, 58, 35, 0.28);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.compass-red {
  fill: #ee8a68;
}

.compass-cream {
  fill: #fff8e7;
}

.compass-teal {
  fill: #007a70;
}

.compass-gold {
  fill: #9370DB;
}

.compass-pin {
  fill: #9370DB;
  stroke: #fff8e7;
  stroke-width: 2;
}

.landing-feature-tile img {
  width: 48%;
  height: auto;
  transform: rotate(-8deg);
  filter: drop-shadow(0 10px 10px rgba(58, 43, 30, 0.18));
}

.landing-spark {
  position: absolute;
  right: 24%;
  top: 26%;
  width: clamp(1rem, 1.7vw, 1.55rem);
  aspect-ratio: 1;
  background: #e6b23d;
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  filter: drop-shadow(0 2px 0 #fff8e7) drop-shadow(0 5px 6px rgba(115, 82, 36, 0.18));
}

.landing-play-btn {
  position: relative;
  z-index: 3;
  margin-top: 0;
  min-width: min(100%, 400px);
  min-height: clamp(3.65rem, 5.2vw, 4.85rem);
  padding: 0.82rem clamp(2rem, 4vw, 3.7rem);
  border-radius: 22px;
  color: #fffdf8;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 248, 231, 0.36), transparent 24%),
    linear-gradient(135deg, #008f8d 0%, #009688 38%, #7494d4 68%, #9171d7 100%);
  box-shadow:
    0 18px 30px rgba(0, 122, 112, 0.22),
    0 10px 20px rgba(143, 120, 216, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.17);
  font-family: var(--button-font);
  font-size: clamp(1.65rem, 2.45vw, 2.35rem);
  font-weight: 900;
  letter-spacing: 0;
}

.landing-play-btn:hover,
.landing-play-btn:focus-visible {
  transform: translateY(-2px);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 248, 231, 0.42), transparent 25%),
    linear-gradient(135deg, #aa9be2 0%, #65b3b2 30%, #1ba99c 55%, #00877b 100%);
  box-shadow:
    0 20px 34px rgba(0, 122, 112, 0.3),
    0 9px 20px rgba(143, 120, 216, 0.2);
}

.email-gate-card {
  position: relative;
  isolation: isolate;
  z-index: 1;
  width: min(560px, calc(100vw - 2rem));
  min-height: min(535px, calc(100vh - 2rem));
  padding: clamp(1.55rem, 3vw, 2.35rem);
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  gap: 0;
  overflow: visible;
  background: #fffdf8;
  border: 1px solid rgba(109, 91, 68, 0.16);
  border-radius: 24px;
  box-shadow:
    0 28px 65px rgba(61, 48, 36, 0.14),
    0 7px 18px rgba(61, 48, 36, 0.07);
}

.email-gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #009688 0 58%, #9370db 58% 100%);
}

.email-gate-tiles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.email-gate-tile {
  position: absolute;
  width: clamp(52px, 7vw, 74px);
  height: auto;
  filter: drop-shadow(0 18px 22px rgba(61, 48, 36, 0.14));
}

.email-gate-tile-left {
  left: -52px;
  bottom: 10px;
  transform: rotate(-8deg);
}

.email-gate-tile-right {
  right: -50px;
  top: 22px;
  transform: rotate(8deg);
}

.email-gate-form-panel {
  min-width: 0;
  width: min(100%, 100%);
  min-height: auto;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: clamp(1rem, 2vw, 1.35rem);
  padding: 0;
  background: transparent;
}

.email-gate-copy {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding-bottom: 0.2rem;
  text-align: center;
}

.email-gate-copy p {
  color: #56504b;
  font: 700 1rem "Merriweather", serif;
  line-height: 1.5;
}

.email-gate-copy p:empty {
  display: none;
}

.email-gate-logo {
  display: block;
  width: clamp(230px, 54vw, 320px);
  height: auto;
  object-fit: contain;
}

.email-auth-signup .email-gate-copy {
  gap: calc(0.65rem + clamp(0.4rem, 1vw, 0.45rem));
}

.email-auth-signup .email-gate-logo {
  position: relative;
  top: clamp(-10px, -1.1vw, -8px);
}

.email-gate-copy h2 {
  font-family: "Merriweather", serif;
  font-size: clamp(1.92rem, 4.65vw, 2.78rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
  color: #2f2d2a;
}

.google-auth-btn-slot {
  width: 100%;
  max-width: 420px;
  min-height: 3.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.google-auth-btn {
  width: 100%;
  min-height: 3.15rem;
  border: 1px solid rgba(109, 91, 68, 0.3);
  border-radius: 16px;
  background: #fffdf8;
  color: #3c3530;
  font-family: var(--button-font);
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.google-auth-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.google-auth-btn-slot.is-locked .google-auth-btn {
  pointer-events: none;
}

.email-auth-placeholder {
  width: min(100%, 420px);
  margin: 0 auto;
  display: grid;
  gap: 0.72rem;
}

.email-auth-placeholder.hidden {
  display: none;
}

.email-auth-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.72rem;
  color: #746a62;
  font: 700 0.82rem/1.2 "Merriweather", serif;
  text-align: center;
}

.email-auth-divider::before,
.email-auth-divider::after {
  content: "";
  height: 1px;
  background: rgba(109, 91, 68, 0.22);
}

.email-auth-fields {
  display: grid;
  gap: 0.62rem;
}

.email-auth-field {
  display: block;
}

.email-auth-field.hidden {
  display: none;
}

.email-auth-field input {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid rgba(70, 62, 54, 0.2);
  border-radius: 16px;
  padding: 0.78rem 0.95rem;
  color: #4e4945;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 2px rgba(61, 48, 36, 0.035);
  font: 700 0.92rem/1.2 "Merriweather", serif;
}

.email-auth-field input::placeholder {
  color: rgba(80, 73, 68, 0.38);
  font-weight: 400;
  opacity: 1;
}

.email-auth-field input:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.email-auth-field input:disabled::placeholder {
  color: rgba(80, 73, 68, 0.38);
  -webkit-text-fill-color: rgba(80, 73, 68, 0.38);
}

.email-auth-action {
  width: 100%;
  min-height: 3.15rem;
  border: 0;
  border-radius: 16px;
  color: #fffdf8;
  background: linear-gradient(90deg, #009688, #9370db);
  box-shadow: 0 10px 20px rgba(0, 122, 112, 0.12);
  font-family: var(--button-font);
  font-size: 0.98rem;
  font-weight: 900;
}

.email-auth-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.email-auth-forgot {
  justify-self: center;
  border: 0;
  padding: 0;
  color: #007a70;
  background: transparent;
  font-family: var(--button-font);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.email-auth-forgot:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.email-auth-forgot.hidden {
  display: none;
}

.email-verify-panel {
  width: min(100%, 420px);
  margin: 0 auto;
  display: grid;
  gap: 0.72rem;
  text-align: center;
}

.email-verify-panel.hidden {
  display: none;
}

.email-verify-copy {
  color: #3c3530;
  font: 400 0.9rem/1.45 "Merriweather", serif;
}

.google-auth-btn-slot.is-locked {
  cursor: not-allowed;
  opacity: 0.5;
}

.google-auth-btn-slot.is-locked iframe {
  pointer-events: none;
}

/* Consent prompt shown after sign-in (no Google button there). */
.consent-continue-btn {
  justify-self: center;
  width: min(100%, 420px);
  min-height: 3rem;
  border-radius: 999px;
}

.email-consent-panel {
  display: grid;
  gap: 0.48rem;
  padding: 0.08rem 0 0 1.4rem;
}

.email-consent-panel.hidden {
  display: none;
}

.email-consent-option {
  display: grid;
  grid-template-columns: 1.08rem minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  color: #5f5751;
  font: 700 0.78rem/1.4 "Merriweather", serif;
}

.email-consent-option input {
  appearance: none;
  width: 1.08rem;
  height: 1.08rem;
  margin: 0.06rem 0 0;
  border: 1.5px solid rgba(0, 122, 112, 0.46);
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #fff;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.email-consent-option input::after {
  content: "";
  width: 0.34rem;
  height: 0.58rem;
  border: solid #fffdf8;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: translateY(-1px) rotate(45deg);
}

.email-consent-option input:checked {
  border-color: #00877b;
  background: #009688;
}

.email-consent-option input:checked::after {
  opacity: 1;
}

.email-consent-option input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.16);
}

.email-consent-option input[aria-invalid="true"] {
  border-color: #a73d3a;
  box-shadow: 0 0 0 3px rgba(167, 61, 58, 0.12);
}

.email-consent-option a {
  color: #007a70;
  font-family: var(--button-font);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.email-consent-option a:hover,
.email-consent-option a:focus-visible {
  color: #00645e;
}

.email-consent-option-optional {
  color: #6d655f;
}

.email-consent-error {
  min-height: 0;
  color: #8f2f2c;
  font: 800 0.76rem/1.35 "Merriweather Sans", sans-serif;
}

.email-consent-error:empty {
  display: none;
}

.profile-form input::placeholder {
  color: rgba(47, 45, 42, 0.42);
  font-weight: 700;
}

.learn-table-prompt::before,
.learn-table-prompt::after {
  content: none;
}

.email-google-step-mark {
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(70, 62, 54, 0.12),
    0 10px 22px rgba(61, 48, 36, 0.08);
}

.email-google-step-mark .google-mark {
  width: 1.75rem;
  height: 1.75rem;
}

.email-gate-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.65rem;
  color: #746a62;
  font-family: "Merriweather", serif;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.3;
}

.email-gate-switch button {
  border: 0;
  padding: 0;
  color: #007a70;
  background: transparent;
  font-family: var(--button-font);
  font-size: inherit;
  font-weight: 900;
  cursor: pointer;
}

.email-auth-signup .email-gate-switch button {
  color: #007a70;
}

.email-gate-switch button:hover,
.email-gate-switch button:focus-visible {
  color: #00645e;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.email-auth-signup .email-gate-switch button:hover,
.email-auth-signup .email-gate-switch button:focus-visible {
  color: #00645e;
}

.pre-game-card {
  background-color: #f7f3ea;
  background-image:
    linear-gradient(145deg, rgba(255, 253, 248, 0.82), rgba(247, 243, 234, 0.72)),
    linear-gradient(rgba(0, 150, 136, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 150, 136, 0.035) 1px, transparent 1px),
    repeating-linear-gradient(135deg, transparent 0 34px, rgba(147, 112, 219, 0.018) 34px 35px, transparent 35px 70px);
  background-repeat: no-repeat, repeat, repeat, repeat;
  background-size: 100% 100%, 96px 96px, 96px 96px, 140px 140px;
  background-position: top left;
}

@media (max-width: 620px) {
  .email-gate-card {
    width: min(460px, calc(100vw - 1rem));
    border-radius: 20px;
    padding: 2rem 1.3rem 1.75rem;
  }

  .email-gate-form-panel {
    width: 100%;
  }

  .email-gate-tile {
    display: none;
  }
}

@media (max-height: 650px) {
  .email-gate-modal {
    place-items: start center;
  }
}

.diamond-gradient-btn {
  --diamond-min-width: 170px;
  --diamond-min-height: 3.05rem;
  --diamond-padding: 0.78rem 1.45rem;
  --diamond-font-size: 1rem;
}

:is(
  #landing-play-btn,
  #new-game-btn,
  #endgame-new-game-btn,
  #declare-inline-btn,
  #declare-btn,
  #pass-claim-inline-btn,
  #confirm-charleston-btn,
  #start-practice-btn
).diamond-gradient-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--diamond-min-width);
  min-height: var(--diamond-min-height);
  padding: var(--diamond-padding);
  border: 0;
  border-radius: 16px;
  color: #fffdf8;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 248, 231, 0.36), transparent 24%),
    linear-gradient(135deg, #8f78d8 0%, #0aa797 44%, #007a70 100%);
  box-shadow:
    0 18px 34px rgba(0, 122, 112, 0.25),
    0 7px 18px rgba(143, 120, 216, 0.18);
  font-family: var(--button-font);
  font-size: var(--diamond-font-size);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 140ms ease, filter 140ms ease;
}

:is(
  #landing-play-btn,
  #new-game-btn,
  #endgame-new-game-btn,
  #declare-inline-btn,
  #declare-btn,
  #pass-claim-inline-btn,
  #confirm-charleston-btn,
  #start-practice-btn
).diamond-gradient-btn:hover,
:is(
  #landing-play-btn,
  #new-game-btn,
  #endgame-new-game-btn,
  #declare-inline-btn,
  #declare-btn,
  #pass-claim-inline-btn,
  #confirm-charleston-btn,
  #start-practice-btn
).diamond-gradient-btn:focus-visible {
  color: #fffdf8;
  transform: translateY(-2px);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 248, 231, 0.42), transparent 25%),
    linear-gradient(135deg, #9a82e6 0%, #08b2a2 45%, #00877b 100%);
  box-shadow:
    0 20px 34px rgba(0, 122, 112, 0.3),
    0 9px 20px rgba(143, 120, 216, 0.2);
}

:is(
  #landing-play-btn,
  #new-game-btn,
  #endgame-new-game-btn,
  #declare-inline-btn,
  #declare-btn,
  #pass-claim-inline-btn,
  #confirm-charleston-btn,
  #start-practice-btn
).diamond-gradient-btn:disabled,
#confirm-charleston-btn.diamond-gradient-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
  filter: saturate(0.78);
  transform: none;
}

#landing-play-btn.diamond-gradient-btn {
  --diamond-min-width: min(100%, 400px);
  --diamond-min-height: clamp(3.65rem, 5.2vw, 4.85rem);
  --diamond-padding: 0.82rem clamp(2rem, 4vw, 3.7rem);
  --diamond-font-size: clamp(1.65rem, 2.45vw, 2.35rem);
  font-family: var(--button-font);
  font-weight: 900;
  letter-spacing: 0;
  border: 1px solid rgba(255, 253, 248, 0.42);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 248, 231, 0.36), transparent 24%),
    linear-gradient(135deg, #008f8d 0%, #009688 38%, #7494d4 68%, #9171d7 100%);
  box-shadow:
    4px 5px 0 rgba(87, 70, 143, 0.24),
    10px 18px 30px rgba(0, 122, 112, 0.24),
    14px 14px 24px rgba(143, 120, 216, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(72, 53, 129, 0.18);
}

#landing-play-btn.diamond-gradient-btn:hover,
#landing-play-btn.diamond-gradient-btn:focus-visible {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 248, 231, 0.42), transparent 25%),
    linear-gradient(135deg, #00877e 0%, #0aa797 38%, #7a95db 68%, #9a82e6 100%);
  box-shadow:
    4px 5px 0 rgba(87, 70, 143, 0.22),
    11px 20px 34px rgba(0, 122, 112, 0.3),
    15px 15px 26px rgba(143, 120, 216, 0.23),
    inset 0 2px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(72, 53, 129, 0.16);
}

#start-practice-btn.diamond-gradient-btn {
  --diamond-min-width: 100%;
  --diamond-min-height: 3.5rem;
  --diamond-padding: 0.9rem 1.45rem;
  --diamond-font-size: 1.08rem;
  width: 100%;
}

#start-practice-btn.diamond-gradient-btn {
  --diamond-font-size: 1.28rem;
}

#new-game-btn.diamond-gradient-btn {
  --diamond-min-width: 108px;
  --diamond-min-height: 2.24rem;
  --diamond-padding: 0.44rem 0.9rem;
  --diamond-font-size: 0.88rem;
  border-radius: 14px;
  margin-left: 0.28rem;
}

#endgame-new-game-btn.diamond-gradient-btn {
  --diamond-min-width: 190px;
  --diamond-min-height: 3.2rem;
}

#declare-inline-btn.diamond-gradient-btn,
#declare-btn.diamond-gradient-btn {
  --diamond-min-width: 188px;
  --diamond-min-height: 3rem;
  --diamond-padding: 0.72rem 1.35rem;
  --diamond-font-size: 0.96rem;
}

#confirm-charleston-btn.diamond-gradient-btn {
  --diamond-min-width: 178px;
  --diamond-min-height: 3.1rem;
  --diamond-padding: 0.78rem 1.3rem;
  --diamond-font-size: 1rem;
}

#pass-claim-inline-btn.diamond-gradient-btn {
  --diamond-min-width: 122px;
  --diamond-min-height: 2.72rem;
  --diamond-padding: 0.66rem 1rem;
  --diamond-font-size: 0.94rem;
}

#new-game-btn.diamond-gradient-btn,
#confirm-charleston-btn.diamond-gradient-btn,
#declare-inline-btn.diamond-gradient-btn,
#declare-btn.diamond-gradient-btn,
#endgame-new-game-btn.diamond-gradient-btn {
  color: #fffdf8;
  background: var(--tile-coral);
  border: 1px solid rgba(167, 61, 58, 0.22);
  box-shadow: none;
}

#new-game-btn.diamond-gradient-btn {
  color: var(--sage-dark);
  background: var(--tile-cream);
  border-color: rgba(0, 150, 136, 0.34);
  box-shadow: inset 0 -3px 0 rgba(238, 138, 104, 0.28);
}

#new-game-btn.diamond-gradient-btn:hover,
#new-game-btn.diamond-gradient-btn:focus-visible,
#confirm-charleston-btn.diamond-gradient-btn:hover,
#confirm-charleston-btn.diamond-gradient-btn:focus-visible,
#declare-inline-btn.diamond-gradient-btn:hover,
#declare-inline-btn.diamond-gradient-btn:focus-visible,
#declare-btn.diamond-gradient-btn:hover,
#declare-btn.diamond-gradient-btn:focus-visible,
#endgame-new-game-btn.diamond-gradient-btn:hover,
#endgame-new-game-btn.diamond-gradient-btn:focus-visible {
  color: #fffdf8;
  background: var(--tile-coral-dark);
  box-shadow: none;
}

#new-game-btn.diamond-gradient-btn:hover,
#new-game-btn.diamond-gradient-btn:focus-visible {
  color: var(--tile-red);
  background: #fff3d9;
  border-color: rgba(238, 138, 104, 0.5);
  box-shadow: inset 0 -3px 0 rgba(0, 150, 136, 0.22);
}

#declare-inline-btn.diamond-gradient-btn,
#declare-btn.diamond-gradient-btn {
  color: #fffdf8;
  background: var(--sage);
  border-color: rgba(0, 119, 111, 0.34);
  box-shadow: none;
}

#declare-inline-btn.diamond-gradient-btn:hover,
#declare-inline-btn.diamond-gradient-btn:focus-visible,
#declare-btn.diamond-gradient-btn:hover,
#declare-btn.diamond-gradient-btn:focus-visible {
  color: #fffdf8;
  background: var(--sage-dark);
  border-color: rgba(0, 119, 111, 0.48);
  box-shadow: none;
}

#pass-claim-inline-btn.diamond-gradient-btn {
  color: var(--tile-red);
  background: var(--tile-cream);
  border: 1px solid rgba(167, 61, 58, 0.24);
  box-shadow: none;
}

#pass-claim-inline-btn.diamond-gradient-btn:hover,
#pass-claim-inline-btn.diamond-gradient-btn:focus-visible {
  color: var(--tile-red);
  background: #fff3d9;
  border-color: rgba(167, 61, 58, 0.34);
  box-shadow: none;
}

.action-center-controls.joker-exchange-choice #pass-claim-inline-btn.diamond-gradient-btn {
  order: 1;
  color: #64736f;
  background: rgba(222, 229, 226, 0.9);
  border-color: rgba(112, 128, 124, 0.24);
  opacity: 0.94;
  filter: saturate(0.42);
  box-shadow: none;
}

.action-center-controls.joker-exchange-choice #joker-exchange-inline-btn {
  order: 2;
}

.action-center-controls.joker-exchange-choice #pass-claim-inline-btn.diamond-gradient-btn:hover,
.action-center-controls.joker-exchange-choice #pass-claim-inline-btn.diamond-gradient-btn:focus-visible {
  color: #59625f;
  background: rgba(218, 224, 221, 0.96);
  border-color: rgba(112, 128, 124, 0.34);
  opacity: 0.98;
  filter: saturate(0.5);
  box-shadow: none;
}

.action-center-controls.draw-recommended-with-claim #pass-claim-inline-btn.diamond-gradient-btn {
  color: #6f7774;
  background: rgba(226, 230, 228, 0.9);
  border-color: rgba(112, 128, 124, 0.24);
  opacity: 0.78;
  filter: saturate(0.25);
  box-shadow: none;
}

.action-center-controls.draw-recommended-with-claim #pass-claim-inline-btn.diamond-gradient-btn:hover,
.action-center-controls.draw-recommended-with-claim #pass-claim-inline-btn.diamond-gradient-btn:focus-visible {
  color: #59625f;
  background: rgba(218, 224, 221, 0.96);
  border-color: rgba(112, 128, 124, 0.34);
  opacity: 0.9;
  filter: saturate(0.35);
  box-shadow: none;
}

.action-center-controls.pivot-call-choice #claim-inline-btn,
.action-center-controls.pivot-call-choice #pass-claim-inline-btn.diamond-gradient-btn {
  color: #fffdf8;
  background: var(--sage);
  border-color: rgba(0, 119, 111, 0.42);
  opacity: 1;
  filter: none;
  box-shadow: none;
}

.action-center-controls.pivot-call-choice #claim-inline-btn {
  order: 1;
}

.action-center-controls.pivot-call-choice #pass-claim-inline-btn.diamond-gradient-btn {
  order: 2;
}

.action-center-controls.pivot-call-choice #claim-inline-btn:hover,
.action-center-controls.pivot-call-choice #claim-inline-btn:focus-visible,
.action-center-controls.pivot-call-choice #pass-claim-inline-btn.diamond-gradient-btn:hover,
.action-center-controls.pivot-call-choice #pass-claim-inline-btn.diamond-gradient-btn:focus-visible {
  color: #fffdf8;
  background: var(--sage-dark);
  border-color: rgba(0, 119, 111, 0.48);
  box-shadow: none;
}

.action-center-controls.call-not-recommended #pass-claim-inline-btn.diamond-gradient-btn {
  order: 1;
  color: #fffdf8;
  background: var(--sage);
  border-color: rgba(0, 119, 111, 0.42);
  opacity: 1;
  filter: none;
}

.action-center-controls.call-not-recommended #claim-inline-btn {
  order: 2;
  color: #64736f;
  background: rgba(222, 229, 226, 0.86);
  border-color: rgba(112, 128, 124, 0.22);
  opacity: 0.82;
  filter: saturate(0.35);
}

.action-center-controls.call-not-recommended #claim-inline-btn:hover,
.action-center-controls.call-not-recommended #claim-inline-btn:focus-visible {
  color: #4f5e5a;
  background: rgba(214, 223, 220, 0.94);
  border-color: rgba(112, 128, 124, 0.3);
  opacity: 0.96;
}

/* Inline Compass decisions read left-to-right as the safe exit, then action. */
.action-center-controls.call-or-pass-only #pass-claim-inline-btn {
  order: 1;
}

.action-center-controls.call-or-pass-only #claim-inline-btn {
  order: 2;
}

@media (max-width: 1180px) {
  .landing-screen {
    overflow-y: auto;
  }

  .landing-rack-wrap {
    min-height: auto;
    padding-block: clamp(1.2rem, 4vw, 2.4rem);
  }

  .landing-hero-grid {
    width: min(860px, calc(100vw - 2rem));
    grid-template-columns: 1fr;
    gap: clamp(1.4rem, 3vw, 2.25rem);
  }

  .landing-home-content {
    gap: 0.8rem;
    padding-block: 0;
    transform: none;
  }

  .mahj-logo {
    width: clamp(300px, 56vw, 560px);
  }

  .mahj-logo-raster {
    width: clamp(300px, 62vw, 500px);
  }

  .landing-feature-panel {
    width: min(760px, 100%);
    justify-self: center;
  }

  .landing-legal-links {
    position: static;
    padding-block: 0.4rem 0.8rem;
  }
}

@media (max-width: 720px) {
  .pre-game-copy h2 {
    font-size: 2.15rem;
  }

  .profile-head h3 {
    font-size: 1.05rem;
  }

  .landing-screen {
    padding: 0.75rem;
  }

  .landing-hero-grid {
    width: min(460px, 100%);
    gap: 1.15rem;
  }

  .landing-statement {
    width: min(350px, 100%);
    font-size: clamp(1rem, 5vw, 1.32rem);
  }

  .mahj-logo-raster {
    width: min(350px, 92vw);
  }

  .landing-play-row {
    width: min(330px, 100%);
  }

  .landing-feature-heading h2 {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
  }

  .landing-feature-panel {
    padding: 0;
  }

  .game-menu-footer {
    width: min(350px, 100%);
    gap: 0.42rem 0.58rem;
    padding-top: 0.2rem;
    font-size: 0.74rem;
  }

  .game-menu-footer-dot {
    display: none;
  }

  .landing-feature-panel::after {
    display: none;
  }

  .landing-feature-card {
    grid-template-columns: clamp(4.9rem, 22vw, 6rem) minmax(0, 1fr);
    gap: 0.85rem;
    min-height: 6.8rem;
    padding: 0.78rem 0.9rem;
    border-radius: 18px;
    transform: none !important;
  }

  .landing-feature-art {
    width: clamp(4.6rem, 20vw, 5.6rem);
  }

  .landing-feature-copy {
    gap: 0.28rem;
  }

  .landing-feature-copy h3 {
    font-size: clamp(1rem, 5vw, 1.32rem);
  }

  .landing-feature-copy p {
    font-size: clamp(0.78rem, 3.6vw, 0.95rem);
  }

  #landing-play-btn.diamond-gradient-btn {
    --diamond-min-width: min(100%, 320px);
    --diamond-min-height: 3.8rem;
    --diamond-padding: 0.72rem 1.8rem;
    --diamond-font-size: clamp(1.5rem, 8vw, 2.15rem);
    border-radius: 20px;
  }
}

@media (max-width: 430px) {
  .pre-game-copy h2 {
    font-size: 1.72rem;
  }
}

@media (max-width: 360px) {
  .pre-game-copy h2 {
    font-size: 1.48rem;
  }
}

@media (max-width: 700px) {
  .hand-compass-summary {
    grid-template-columns: 1fr;
  }

  .hand-compass-chips {
    grid-template-columns: 1fr;
  }

  .hand-compass-chip {
    min-width: 0;
  }
}

/* Canonical pre-game setup card */
.pre-game-modal {
  padding: clamp(0.8rem, 2.5vw, 1.8rem);
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 150, 136, 0.08), transparent 28rem),
    radial-gradient(circle at 84% 78%, rgba(147, 112, 219, 0.08), transparent 25rem),
    rgba(44, 37, 31, 0.24);
  backdrop-filter: blur(9px);
}

.pre-game-card {
  width: min(570px, 100%);
  gap: 0.95rem;
  padding: clamp(1.45rem, 3.5vw, 2rem);
  overflow: visible;
  font-family: "Merriweather", serif;
  color: #2f2d2a;
  background: rgba(255, 253, 248, 0.985);
  background-image: none;
  border: 1px solid rgba(109, 91, 68, 0.16);
  border-radius: 24px;
  box-shadow:
    0 28px 65px rgba(42, 34, 28, 0.22),
    0 7px 18px rgba(42, 34, 28, 0.1);
}

.pre-game-card::before {
  content: none;
}

.pre-game-card::after {
  left: 1.25rem;
  right: 1.25rem;
  height: 4px;
  background: linear-gradient(90deg, #009688 0 58%, #9370db 58% 100%);
}

.pre-game-copy {
  justify-items: center;
  text-align: center;
}

.pre-game-copy h2 {
  max-width: none;
  font-family: "Merriweather", serif;
  font-size: clamp(1.9rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  white-space: normal;
  color: #2f2d2a;
}

.pre-game-panel,
.profile-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.profile-form input {
  min-height: 3.25rem;
  border: 1px solid rgba(70, 62, 54, 0.2);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: 400 0.98rem "Merriweather", serif;
  padding: 0.76rem 0.9rem;
  box-shadow: inset 0 1px 2px rgba(61, 48, 36, 0.035);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.profile-form input::placeholder {
  color: rgba(47, 45, 42, 0.42);
  font-weight: 400;
}

.profile-form input:focus {
  border-color: rgba(0, 150, 136, 0.74);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.13);
}

.assist-mode-panel {
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.pre-game-label {
  color: #5f554c;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.assist-mode-grid {
  gap: 0.65rem;
}

.mode-choice {
  min-height: 6.1rem;
  padding: 0.9rem 4.35rem 0.9rem 0.9rem;
  border: 1px solid rgba(70, 62, 54, 0.16);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(61, 48, 36, 0.045);
}

.mode-choice:hover {
  border-color: rgba(0, 150, 136, 0.42);
  box-shadow: 0 8px 18px rgba(61, 48, 36, 0.08);
}

.mode-choice.selected,
.mode-choice.active {
  border-color: rgba(0, 150, 136, 0.74);
  background: #f7fcfa;
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.1),
    0 7px 18px rgba(0, 122, 112, 0.08);
  transform: none;
}

.mode-choice[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: auto;
  bottom: 0.62rem;
  right: 0.62rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  color: #fff;
  background: #009688;
  font: 800 0.72rem/1 "Merriweather Sans", sans-serif;
}

.mode-choice span {
  font-size: 1rem;
  font-weight: 800;
}

.mode-choice small {
  color: #746a62;
  font-family: "Merriweather", serif;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.38;
}

.tile-style-panel {
  display: grid;
  gap: 0.48rem;
}

.tile-style-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.58rem;
}

.tile-style-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.16rem 0.56rem;
  min-height: 4.1rem;
  padding: 0.64rem 0.72rem;
  border: 1px solid rgba(0, 150, 136, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  color: #2f2d2a;
  cursor: pointer;
  font-family: "Merriweather Sans", sans-serif;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.tile-style-choice:hover {
  border-color: rgba(0, 150, 136, 0.42);
  box-shadow: 0 8px 18px rgba(61, 48, 36, 0.08);
}

.tile-style-choice.active {
  border-color: rgba(0, 150, 136, 0.74);
  background: #f7fcfa;
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.1),
    0 7px 18px rgba(0, 122, 112, 0.08);
}

.tile-style-choice[aria-pressed="true"] {
  transform: none;
}

.tile-style-choice span:not(.tile-style-swatch) {
  color: #2f2d2a;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.tile-style-choice small {
  grid-column: 2;
  color: #746a62;
  font-family: "Merriweather", serif;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.26;
}

.tile-style-swatch {
  grid-row: 1 / span 2;
  width: 2.35rem;
  aspect-ratio: 1 / 1.28;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 6px 14px rgba(61, 48, 36, 0.12);
}

.tile-style-swatch-sunrise {
  border: 1px solid rgba(210, 180, 140, 0.82);
  background:
    radial-gradient(circle at 50% 42%, #009688 0 11%, #9370db 12% 22%, #ffa07a 23% 34%, transparent 35%),
    #fff8e7;
}

.tile-style-swatch-midnight {
  border: 1px solid rgba(185, 143, 79, 0.82);
  background:
    radial-gradient(circle at 50% 42%, #2fb7a6 0 11%, #8a73c9 12% 22%, #d9b66f 23% 34%, transparent 35%),
    #1f2b33;
}

.mode-choice-icon {
  right: 0.72rem;
  top: 1.55rem;
  width: 2.55rem;
  height: 2.55rem;
  opacity: 0.24;
}

.mode-choice.active .mode-choice-icon,
.mode-choice.selected .mode-choice-icon {
  opacity: 0.55;
}

.pre-game-actions {
  gap: 0.7rem;
}

.pre-game-start-btn {
  width: 100%;
  min-width: 0;
  min-height: 3.35rem;
  padding: 0.86rem 1.25rem;
  border: 0;
  border-radius: 16px;
  color: #fffdf8;
  background: #008f83;
  box-shadow: 0 10px 20px rgba(0, 122, 112, 0.18);
  font-family: var(--button-font);
  font-size: 1.04rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.pre-game-start-btn:hover,
.pre-game-start-btn:focus-visible {
  transform: translateY(-1px);
  background: #007d73;
  box-shadow: 0 13px 24px rgba(0, 122, 112, 0.23);
}

.pre-game-or-divider {
  display: block;
  color: #8a8077;
  font-size: 0.78rem;
}

.pre-game-or-divider::before,
.pre-game-or-divider::after {
  content: none;
}

.learn-table-prompt {
  min-height: 5.5rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  padding: 0.78rem 0.85rem 0.78rem 5.7rem;
  overflow: visible;
  border: 1px solid rgba(70, 62, 54, 0.14);
  border-radius: 16px;
  background: #fffaf0;
  box-shadow: none;
}

.learn-table-prompt::after {
  content: none;
}

.learn-table-prompt:has(.learn-table-btn:hover),
.learn-table-prompt:has(.learn-table-btn:focus-visible) {
  transform: none;
  border-color: rgba(147, 112, 219, 0.36);
  box-shadow: 0 7px 18px rgba(61, 48, 36, 0.07);
}

.learn-table-mini-tiles {
  left: 0.65rem;
  width: 4.4rem;
  height: 4.15rem;
}

.learn-table-mini-tiles img {
  width: 2.55rem;
  height: 3.35rem;
}

.learn-table-mini-tiles img:nth-child(2) {
  left: 0.82rem;
}

.learn-table-mini-tiles img:nth-child(3) {
  left: 1.62rem;
}

.learn-table-prompt p {
  color: #006f67;
  font-family: "Merriweather", serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.learn-table-btn {
  width: auto;
  min-width: 9.8rem;
  min-height: 2.85rem;
  padding: 0.66rem 0.92rem;
  border: 1px solid rgba(147, 112, 219, 0.58);
  border-radius: 14px;
  color: #7351bd;
  background: transparent;
  box-shadow: none;
  font-size: 0.88rem;
  font-weight: 800;
}

.learn-table-btn::after {
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.4rem;
  color: #fff;
  background: #9370db;
  font-size: 0.66rem;
}

.learn-table-btn:hover,
.learn-table-btn:focus-visible {
  color: #fff;
  border-color: #7e5fc2;
  background: #7e5fc2;
  box-shadow: none;
}

.learn-table-btn:hover::after,
.learn-table-btn:focus-visible::after {
  color: #7351bd;
  background: #fff;
}

/* Learning-first pre-game menu */
.pre-game-card {
  width: min(940px, calc(100vw - 2.4rem));
  max-height: calc(100dvh - clamp(1.6rem, 5vw, 3.6rem));
  gap: clamp(0.92rem, 1.7vw, 1.35rem);
  padding: clamp(1.55rem, 3vw, 2.35rem) clamp(1.45rem, 3.8vw, 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background:
    radial-gradient(circle at 13% 8%, rgba(32, 201, 195, 0.12), transparent 12rem),
    radial-gradient(circle at 95% 98%, rgba(185, 107, 228, 0.1), transparent 13rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(255, 249, 238, 0.98)),
    #fffdf8;
}

.pre-game-copy {
  gap: 0.38rem;
  align-items: start;
  justify-items: start;
  text-align: left;
}

.pre-game-copy h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
}

.pre-game-subtitle {
  color: #655b53;
  font-family: "Merriweather", serif;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  font-weight: 700;
}

.pre-game-layout {
  display: block;
}

.profile-panel {
  display: grid;
  gap: 0.82rem;
}

.profile-form input {
  width: 100%;
  min-height: 3.42rem;
  border-radius: 14px;
  font-size: 1.02rem;
  padding-left: 1.1rem;
}

.pre-game-section-divider {
  display: block;
  margin: 0.02rem 0 0.62rem;
  color: #5f554c;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.78rem, 1.1vw, 0.92rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.pre-game-section-divider::before,
.pre-game-section-divider::after {
  content: none;
}

.assist-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.82rem, 1.8vw, 1.3rem);
}

.mode-choice {
  display: grid;
  grid-template-columns: clamp(3.35rem, 5.2vw, 4.25rem) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  column-gap: clamp(0.78rem, 1.6vw, 1.22rem);
  min-height: clamp(6.75rem, 11vw, 8.4rem);
  padding: clamp(1.05rem, 2vw, 1.45rem) clamp(1rem, 2vw, 1.45rem);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 242, 0.82)),
    #fffdf8;
  box-shadow: 0 9px 21px rgba(61, 48, 36, 0.06);
  text-align: left;
}

.mode-choice.selected,
.mode-choice.active {
  border-color: rgba(0, 150, 136, 0.58);
  background:
    radial-gradient(circle at 18% 48%, rgba(32, 201, 195, 0.11), transparent 8rem),
    linear-gradient(135deg, rgba(0, 150, 136, 0.08), rgba(255, 253, 248, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.08),
    0 9px 22px rgba(0, 122, 112, 0.08);
}

.mode-choice[aria-pressed="false"] {
  border-color: rgba(70, 62, 54, 0.13);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(61, 48, 36, 0.04);
  transform: none;
}

.mode-choice[aria-pressed="false"]:hover,
.mode-choice[aria-pressed="false"]:focus-visible {
  border-color: rgba(0, 150, 136, 0.32);
  background: rgba(255, 255, 255, 0.92);
}

.assist-mode-grid .mode-choice[aria-pressed="false"] {
  border-color: rgba(70, 62, 54, 0.13);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(61, 48, 36, 0.04);
}

.assist-mode-grid .mode-choice[aria-pressed="true"] {
  border-color: rgba(0, 150, 136, 0.58);
  background:
    radial-gradient(circle at 18% 48%, rgba(32, 201, 195, 0.11), transparent 8rem),
    linear-gradient(135deg, rgba(0, 150, 136, 0.08), rgba(255, 253, 248, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.08),
    0 9px 22px rgba(0, 122, 112, 0.08);
}

.hand-card-choice-divider {
  margin-top: clamp(1rem, 2vw, 1.45rem);
}

.hand-card-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.72rem, 1.5vw, 1rem);
}

.hand-card-choice {
  position: relative;
  display: grid;
  gap: 0.32rem;
  min-height: 5.35rem;
  padding: 0.92rem 3.3rem 0.92rem 1rem;
  border: 1px solid rgba(70, 62, 54, 0.13);
  border-radius: 14px;
  color: #2f2d2a;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(61, 48, 36, 0.04);
  cursor: pointer;
  text-align: left;
}

.hand-card-choice:hover,
.hand-card-choice:focus-visible {
  border-color: rgba(0, 150, 136, 0.32);
  background: rgba(255, 255, 255, 0.92);
}

.hand-card-choice.selected {
  border-color: rgba(0, 150, 136, 0.58);
  background:
    radial-gradient(circle at 18% 48%, rgba(32, 201, 195, 0.11), transparent 8rem),
    linear-gradient(135deg, rgba(0, 150, 136, 0.08), rgba(255, 253, 248, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.08),
    0 9px 22px rgba(0, 122, 112, 0.08);
}

.hand-card-choice.selected::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  color: #fffdf8;
  background: #009688;
  box-shadow: 0 8px 18px rgba(0, 122, 112, 0.18);
  font: 900 1rem/1 "Merriweather Sans", sans-serif;
  transform: translateY(-50%);
}

.hand-card-choice-heading {
  font-family: "Merriweather", serif;
  font-size: clamp(1.02rem, 1.55vw, 1.24rem);
  font-weight: 700;
  line-height: 1.1;
}

.hand-card-choice small {
  color: #5f554c;
  font-family: "Merriweather", serif;
  font-size: clamp(0.76rem, 1vw, 0.88rem);
  font-weight: 700;
  line-height: 1.35;
}

.mode-choice-badge {
  position: absolute;
  top: clamp(0.68rem, 1.1vw, 0.82rem);
  left: clamp(0.72rem, 1.25vw, 0.95rem);
  width: max-content;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  color: #fff;
  background: linear-gradient(90deg, #008f83, #20c9c3);
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.62rem, 0.82vw, 0.72rem) !important;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  box-shadow: 0 8px 15px rgba(0, 122, 112, 0.18);
}

.mode-choice-badge::before {
  content: "★";
  margin-right: 0.28rem;
}

.mode-choice-icon {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 1 / span 2;
  justify-self: center;
  width: clamp(2.9rem, 4.6vw, 3.7rem);
  height: clamp(2.9rem, 4.6vw, 3.7rem);
  opacity: 0.3;
}

.mode-choice.active .mode-choice-icon,
.mode-choice.selected .mode-choice-icon {
  opacity: 0.72;
}

.mode-choice[aria-pressed="true"]::after {
  content: "\2713";
  position: absolute;
  right: clamp(0.82rem, 1.55vw, 1.05rem);
  bottom: clamp(0.82rem, 1.55vw, 1.05rem);
  display: grid;
  place-items: center;
  width: clamp(1.55rem, 2.55vw, 2.05rem);
  height: clamp(1.55rem, 2.55vw, 2.05rem);
  border-radius: 999px;
  color: #fffdf8;
  background: #009688;
  box-shadow: 0 8px 18px rgba(0, 122, 112, 0.18);
  font: 900 clamp(0.92rem, 1.45vw, 1.18rem)/1 "Merriweather Sans", sans-serif;
}

.mode-choice .mode-choice-heading {
  grid-column: 2;
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem) !important;
  font-weight: 700 !important;
  line-height: 1.02;
}

.mode-choice small {
  grid-column: 2;
  max-width: 18rem;
  color: #5f554c;
  font-family: "Merriweather", serif;
  font-size: clamp(0.78rem, 1.05vw, 0.92rem);
  font-weight: 700;
  line-height: 1.35;
}

.pre-game-actions {
  display: grid;
  gap: clamp(0.74rem, 1.45vw, 1rem);
  justify-items: stretch;
}

.learn-table-prompt {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  gap: clamp(0.74rem, 1.7vw, 1.24rem);
  padding: clamp(0.64rem, 1.15vw, 0.86rem) 0 0;
  border: 0;
  border-top: 1px solid rgba(70, 62, 54, 0.13);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.learn-table-copy {
  border-right: 1px solid rgba(70, 62, 54, 0.13);
  padding-right: clamp(0.72rem, 1.4vw, 1rem);
}

.learn-table-prompt p {
  color: #5f554c;
  font-family: "Merriweather", serif;
  font-size: clamp(0.9rem, 1.45vw, 1.12rem);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.learn-table-prompt p span {
  display: block;
}

.learn-table-prompt p span:last-child {
  margin-top: 0;
  color: inherit;
}

.learn-table-btn {
  display: inline-grid;
  grid-template-columns: auto max-content auto;
  align-items: center;
  width: auto;
  min-width: 0;
  min-height: 2.25rem;
  gap: 0.48rem;
  padding: 0.18rem 0.28rem;
  border: 0;
  border-radius: 8px;
  color: #7351bd;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.learn-table-btn::after {
  content: "\2192";
  display: inline;
  width: auto;
  height: auto;
  margin-left: 0;
  border-radius: 0;
  color: #7351bd;
  background: transparent;
  font-size: clamp(0.94rem, 1.25vw, 1.12rem);
  line-height: 1;
}

.learn-table-prompt:has(.learn-table-btn:hover),
.learn-table-prompt:has(.learn-table-btn:focus-visible) {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.learn-table-btn:hover,
.learn-table-btn:focus-visible {
  color: #5f3fb0;
  border-color: transparent;
  background: rgba(147, 112, 219, 0.08);
  box-shadow: none;
}

.learn-table-btn:hover::after,
.learn-table-btn:focus-visible::after {
  color: #5f3fb0;
  background: transparent;
}

.learn-table-btn small {
  display: none;
}

.learn-table-btn strong {
  font-family: "Merriweather", serif;
  font-size: clamp(1.03rem, 1.75vw, 1.32rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.learn-table-btn img {
  width: clamp(1.16rem, 1.7vw, 1.36rem);
  height: clamp(1.52rem, 2.15vw, 1.78rem);
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(61, 48, 36, 0.11));
}

.learn-table-btn span {
  display: grid;
  gap: 0.12rem;
}

.learn-table-btn strong {
  color: inherit;
  font-family: "Merriweather", serif;
  font-size: clamp(0.9rem, 1.35vw, 1.05rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.learn-table-btn small {
  color: #746a62;
  font-family: "Merriweather", serif;
  font-size: 0.72rem;
  font-weight: 400;
}

.learn-table-btn:hover small,
.learn-table-btn:focus-visible small {
  color: #6e655f;
}

.learn-table-btn small {
  display: none;
}

.learn-table-btn strong {
  font-family: "Merriweather", serif;
  font-size: clamp(0.9rem, 1.35vw, 1.05rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.game-menu-footer {
  border-top: 1px solid rgba(70, 62, 54, 0.12);
  margin-top: 0.1rem;
  padding-top: clamp(0.74rem, 1.4vw, 1rem);
}

.regular-game-footer {
  width: min(760px, calc(100vw - 2rem));
  margin: 0.85rem auto 1.45rem;
  padding-bottom: 0.2rem;
}

.pre-game-start-btn {
  width: min(100%, 34rem);
  justify-self: center;
  min-height: clamp(2.72rem, 3.7vw, 3.18rem);
  padding: 0.54rem 1rem;
  border-radius: 14px;
  font-family: var(--button-font);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
}

.pre-game-start-btn::after {
  content: none;
}

.opening-choice-panel {
  display: grid;
  gap: 0.62rem;
}

.opening-choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 0.72rem;
}

.opening-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.72rem;
  min-height: 5.2rem;
  padding: 0.74rem 0.82rem;
  border: 1px solid rgba(70, 62, 54, 0.15);
  border-radius: 14px;
  color: #2f2d2a;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 249, 238, 0.78)),
    #fffdf8;
  box-shadow: 0 7px 18px rgba(61, 48, 36, 0.06);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.opening-choice:hover,
.opening-choice:focus-visible {
  border-color: rgba(0, 150, 136, 0.42);
  box-shadow: 0 10px 22px rgba(61, 48, 36, 0.1);
}

.opening-choice.active,
.opening-choice.selected {
  border-color: rgba(0, 150, 136, 0.74);
  background:
    linear-gradient(135deg, rgba(0, 150, 136, 0.1), rgba(255, 253, 248, 0.96)),
    #fffdf8;
}

.opening-choice[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  right: 0.62rem;
  bottom: 0.62rem;
  display: grid;
  place-items: center;
  width: 1.22rem;
  height: 1.22rem;
  border-radius: 999px;
  color: #fff;
  background: #008f83;
  font: 800 0.72rem/1 "Merriweather Sans", sans-serif;
}

.opening-choice-stack {
  position: relative;
  width: 2.55rem;
  height: 2.05rem;
  transform: rotate(-8deg);
}

.opening-choice-stack::before,
.opening-choice-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(145deg, #e9fbff, #bddbe7);
  border: 1px solid rgba(67, 118, 138, 0.28);
  box-shadow: 0 7px 12px rgba(61, 48, 36, 0.14);
}

.opening-choice-stack::before {
  transform: translate(0.18rem, 0.28rem);
  background: linear-gradient(145deg, #cde7ef, #93bdcc);
}

.opening-choice-stack-quick {
  transform: rotate(9deg);
  opacity: 0.8;
}

.opening-choice strong {
  display: block;
  margin-bottom: 0.16rem;
  font-family: "Merriweather", serif;
  font-size: 1rem;
  line-height: 1;
}

.opening-choice small {
  display: block;
  max-width: 15rem;
  color: #655b53;
  font-family: "Merriweather", serif;
  font-size: 0.74rem;
  line-height: 1.28;
}

.opening-deal-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: clamp(0.7rem, 2vw, 1.5rem);
  background:
    radial-gradient(circle at 20% 18%, rgba(0, 150, 136, 0.16), transparent 22rem),
    radial-gradient(circle at 82% 84%, rgba(147, 112, 219, 0.14), transparent 24rem),
    rgba(41, 35, 30, 0.44);
  backdrop-filter: blur(10px);
}

.opening-deal-overlay.hidden {
  display: none;
}

.opening-deal-card {
  display: grid;
  grid-template-rows: auto;
  gap: 0;
  width: min(1120px, calc(100vw - 1.6rem));
  max-height: min(780px, calc(100vh - 1.4rem));
  padding: clamp(0.78rem, 1.35vw, 1rem);
  border: 1px solid rgba(70, 62, 54, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(255, 248, 236, 0.98)),
    #fffdf8;
  box-shadow:
    0 30px 70px rgba(36, 29, 24, 0.28),
    0 10px 22px rgba(36, 29, 24, 0.14);
  overflow: auto;
}

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

.opening-deal-copy h2 {
  margin: 0;
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(1.85rem, 3.4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.opening-deal-copy .inline-help {
  max-width: 46rem;
  margin: 0;
  color: #635a51;
}

.opening-deal-stage {
  min-height: 0;
  overflow: visible;
}

.opening-deal-overlay.opening-setup-choice-mode {
  background: rgba(41, 35, 30, 0.12);
  backdrop-filter: none;
}

.opening-deal-overlay.opening-setup-choice-mode .opening-deal-card {
  width: min(700px, calc(100vw - 1.6rem));
  max-height: none;
  padding: 0;
  overflow: visible;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.99), rgba(255, 247, 230, 0.98)),
    #fffaf0;
  box-shadow:
    0 22px 44px rgba(36, 29, 24, 0.2),
    0 6px 16px rgba(36, 29, 24, 0.12);
}

.opening-setup-choice-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "art"
    "copy"
    "actions";
  align-items: center;
  justify-items: center;
  gap: 0.5rem;
  padding: clamp(1.05rem, 2.25vw, 1.45rem) clamp(1rem, 2.7vw, 1.7rem) clamp(1rem, 2.15vw, 1.32rem);
  text-align: center;
}

.opening-setup-choice-copy {
  grid-area: copy;
  display: grid;
  gap: 0.32rem;
}

.opening-setup-choice-copy h2 {
  margin: 0;
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(2rem, 4vw, 2.55rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.opening-setup-choice-art {
  grid-area: art;
  position: relative;
  width: clamp(7.6rem, 21vw, 9.1rem);
  height: clamp(4.3rem, 11vw, 5.2rem);
  margin-bottom: -0.18rem;
  isolation: isolate;
}

.opening-setup-choice-art img {
  position: absolute;
  bottom: 0.15rem;
  left: 50%;
  width: clamp(2.35rem, 6.4vw, 2.95rem);
  height: auto;
  filter: drop-shadow(0 8px 10px rgba(61, 48, 36, 0.16));
}

.opening-setup-choice-art img:nth-child(1) {
  transform: translateX(-115%) translateY(0.2rem) rotate(-8deg);
}

.opening-setup-choice-art img:nth-child(2) {
  bottom: 0.48rem;
  z-index: 2;
  transform: translateX(-50%) rotate(1deg);
}

.opening-setup-choice-art img:nth-child(3) {
  transform: translateX(15%) translateY(0.2rem) rotate(8deg);
}

.opening-setup-choice-actions {
  grid-area: actions;
  width: 100%;
  align-self: end;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 12.4rem));
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.48rem;
}

.opening-setup-choice-btn {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid rgba(0, 150, 136, 0.34);
  border-radius: 14px;
  padding: 0.72rem 1.2rem;
  color: var(--sage-dark);
  background: var(--tile-cream);
  box-shadow: inset 0 -3px 0 rgba(238, 138, 104, 0.2), 0 10px 22px rgba(38, 30, 22, 0.1);
  font-family: var(--button-font);
  font-weight: 900;
  font-size: clamp(0.88rem, 1.6vw, 1rem);
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.opening-setup-choice-play {
  color: #6b4bb8;
  border-color: rgba(116, 82, 190, 0.3);
  box-shadow: inset 0 -3px 0 rgba(116, 82, 190, 0.18), 0 10px 22px rgba(38, 30, 22, 0.1);
}

.opening-setup-choice-btn:hover,
.opening-setup-choice-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.opening-setup-choice-learn:hover,
.opening-setup-choice-learn:focus-visible {
  color: #006f67;
  background: #effbf8;
  border-color: rgba(0, 150, 136, 0.48);
  box-shadow: inset 0 -3px 0 rgba(0, 150, 136, 0.22), 0 12px 24px rgba(38, 30, 22, 0.12);
}

.opening-setup-choice-play:hover,
.opening-setup-choice-play:focus-visible {
  color: #5e3fa9;
  background: #f8f2ff;
  border-color: rgba(116, 82, 190, 0.46);
  box-shadow: inset 0 -3px 0 rgba(116, 82, 190, 0.24), 0 12px 24px rgba(38, 30, 22, 0.12);
}

@media (max-width: 620px) {
  .opening-setup-choice-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "art"
      "copy"
      "actions";
    justify-items: center;
    text-align: center;
  }

  .opening-setup-choice-actions {
    grid-template-columns: 1fr;
    width: min(100%, 18rem);
  }
}

.opening-deal-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(250px, 330px);
  align-items: start;
  justify-content: center;
  gap: clamp(0.78rem, 1.45vw, 1.05rem);
  height: auto;
  min-height: 0;
}

.opening-table-panel {
  position: relative;
  display: grid;
  align-self: start;
  min-height: 0;
  isolation: isolate;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(0, 150, 136, 0.055), transparent 46%),
    radial-gradient(circle at 16% 14%, rgba(0, 150, 136, 0.065), transparent 18rem),
    radial-gradient(circle at 88% 80%, rgba(147, 112, 219, 0.07), transparent 20rem),
    linear-gradient(rgba(94, 64, 37, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 64, 37, 0.038) 1px, transparent 1px),
    #fffaf3;
  background-size: auto, auto, auto, 72px 72px, 72px 72px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 248, 0.72),
    inset 0 -18px 36px rgba(66, 50, 34, 0.04),
    inset 0 22px 44px rgba(255, 253, 248, 0.34);
  overflow: hidden;
}

.opening-table-panel::before,
.opening-table-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.opening-table-panel::before {
  background:
    linear-gradient(90deg, rgba(0, 150, 136, 0.2), rgba(147, 112, 219, 0.12)) left 1.25rem top 1.25rem / 5.6rem 2px no-repeat,
    linear-gradient(180deg, rgba(0, 150, 136, 0.2), rgba(147, 112, 219, 0.12)) left 1.25rem top 1.25rem / 2px 5.6rem no-repeat,
    linear-gradient(270deg, rgba(0, 150, 136, 0.2), rgba(147, 112, 219, 0.12)) right 1.25rem bottom 1.25rem / 5.6rem 2px no-repeat,
    linear-gradient(0deg, rgba(0, 150, 136, 0.2), rgba(147, 112, 219, 0.12)) right 1.25rem bottom 1.25rem / 2px 5.6rem no-repeat;
  opacity: 0.72;
}

.opening-table-panel::after {
  inset: 1rem;
  border-radius: 14px;
  background:
    repeating-linear-gradient(135deg, rgba(0, 150, 136, 0.026) 0 1px, transparent 1px 1.35rem),
    repeating-linear-gradient(45deg, rgba(147, 112, 219, 0.02) 0 1px, transparent 1px 1.55rem);
  opacity: 0.72;
}

.opening-table-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1 / 0.82;
  padding: clamp(2.45rem, 4vw, 3.6rem);
  isolation: isolate;
}

.opening-table-wrap::before,
.opening-table-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 14px;
}

.opening-table-wrap::before {
  inset: clamp(0.9rem, 1.8vw, 1.45rem);
  z-index: 1;
  border: 2px solid rgba(0, 122, 112, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 248, 0.72),
    inset 0 0 0 0.58rem rgba(255, 253, 248, 0.16),
    0 10px 22px rgba(0, 122, 112, 0.08);
}

.opening-table-wrap::after {
  inset: clamp(1.65rem, 3vw, 2.45rem);
  z-index: 1;
  border: 1px solid rgba(0, 122, 112, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 248, 0.42),
    0 0 0 0.42rem rgba(255, 253, 248, 0.08);
}

.opening-table-center {
  position: absolute;
  inset: 22%;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: transparent;
  border: 0;
}

.opening-table-center::before {
  content: "";
  position: absolute;
  inset: 2%;
  z-index: 0;
  border-radius: 26px;
  background: transparent;
  opacity: 0;
  filter: none;
}

.opening-table-felt {
  display: none;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid rgba(0, 122, 112, 0.12);
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(0, 122, 112, 0.08) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(0, 122, 112, 0.08) 50%, transparent calc(50% + 0.5px)),
    rgba(255, 253, 248, 0.18);
  box-shadow:
    inset 0 0 0 0.42rem rgba(255, 253, 248, 0.08),
    0 8px 18px rgba(0, 122, 112, 0.035);
}

.opening-center-pile {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(76%, 31rem);
  min-height: min(54%, 22rem);
  transform: translate(-50%, -50%);
}

.opening-center-pile-stacks {
  position: relative;
  width: 100%;
  height: min(54vw, 22rem);
  max-height: 22rem;
  min-height: 18rem;
}

.opening-loose-tile {
  position: absolute;
  display: block;
  width: 1.46rem;
  height: 2.02rem;
  padding: 0;
  border: 1px solid rgba(78, 123, 139, 0.32);
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(252, 255, 255, 0.95), rgba(209, 236, 244, 0.88)),
    #e6f7fb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.54),
    0 6px 10px rgba(22, 41, 38, 0.2);
  transform: translate(-50%, -50%) rotate(var(--loose-rotate, 0deg));
  cursor: default;
}

.opening-loose-tile.available {
  z-index: 12;
  cursor: grab;
  border-color: rgba(78, 123, 139, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.54),
    0 6px 10px rgba(22, 41, 38, 0.2);
}

.opening-loose-tile.available:hover,
.opening-loose-tile.available:focus-visible {
  border-color: rgba(78, 123, 139, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 8px 14px rgba(22, 41, 38, 0.22);
}

.opening-pile-loose {
  left: var(--loose-x, 50%);
  top: var(--loose-y, 50%);
  transform: translate(-50%, -50%) rotate(var(--loose-rotate, 0deg)) scale(var(--loose-scale, 1));
}

.opening-pile-loose.used {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--loose-rotate, 0deg)) scale(0.42);
  transition: opacity 260ms ease, transform 260ms ease;
}

.opening-pile-loose.being-used {
  opacity: 0.28;
  filter: saturate(0.82);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--loose-rotate, 0deg)) scale(0.72);
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
}

.opening-center-count {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  z-index: 20;
  display: grid;
  place-items: center;
  min-width: 8.6rem;
  min-height: 1.75rem;
  padding: 0 0.72rem;
  border-radius: 999px;
  color: #006f67;
  background: rgba(255, 253, 248, 0.93);
  box-shadow: 0 8px 16px rgba(20, 35, 32, 0.16);
  transform: translateX(-50%);
  font: 900 0.72rem/1 "Merriweather Sans", sans-serif;
}

.opening-mat-action {
  position: absolute;
  z-index: 35;
  display: grid;
  justify-items: center;
  gap: 0.46rem;
  color: #2f2d2a;
  text-align: center;
}

.opening-mat-roll-action {
  left: 50%;
  top: 50%;
  width: min(17.8rem, 42%);
  min-width: 14.8rem;
  padding: 0.98rem 0.95rem;
  border: 1px solid rgba(255, 253, 248, 0.72);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 253, 248, 0.98), rgba(255, 253, 248, 0.88)),
    rgba(255, 253, 248, 0.9);
  box-shadow: 0 18px 34px rgba(48, 82, 75, 0.18);
  transform: translate(-50%, -50%);
  backdrop-filter: none;
}

.opening-mat-roll-action h3 {
  margin: 0;
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(1.18rem, 1.9vw, 1.48rem);
  line-height: 1;
}

.opening-table-intro-card {
  gap: 0.62rem;
  padding-block: 1.28rem;
  animation: opening-table-intro-card 2200ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

.opening-table-intro-card h3 {
  font-size: clamp(1.36rem, 2.25vw, 1.78rem);
}

.opening-table-intro-line {
  width: min(9.6rem, 72%);
  height: 0.22rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), rgba(147, 112, 219, 0.9));
  box-shadow: 0 0.24rem 0.58rem rgba(0, 150, 136, 0.18);
  transform-origin: center;
  animation: opening-table-intro-line 820ms 120ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

@keyframes opening-table-intro-card {
  0% {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.985);
  }

  18%,
  76% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -53%) scale(0.992);
  }
}

@keyframes opening-table-intro-line {
  from {
    opacity: 0;
    transform: scaleX(0.45);
  }

  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.opening-mat-roll-action.opening-rack-ready-card {
  top: 50%;
  width: min(18.5rem, 44%);
  padding: 1.02rem 1rem;
}

.opening-mat-roll-action.opening-roll-tie-card {
  top: 50%;
  width: min(16.5rem, 44%);
  padding: 0.9rem 1rem;
}

.opening-mat-roll-action .opening-action-row {
  width: 100%;
}

.opening-turn-card {
  width: min(18.6rem, 44%);
}

.opening-turn-card h3 {
  color: #2f2d2a;
}

.opening-turn-card-ready {
  border-color: rgba(0, 150, 136, 0.34);
  box-shadow:
    0 0 0 4px rgba(0, 150, 136, 0.12),
    0 18px 34px rgba(48, 82, 75, 0.18);
}

.opening-turn-btn {
  width: min(100%, 12.6rem);
  min-height: 2.65rem;
  margin-top: 0.12rem;
  border-radius: 999px;
  font-size: 0.92rem;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.opening-turn-btn-waiting,
.opening-turn-btn-waiting:disabled {
  color: rgba(95, 85, 76, 0.68) !important;
  background:
    linear-gradient(180deg, rgba(245, 242, 235, 0.94), rgba(232, 227, 217, 0.9)) !important;
  border-color: rgba(122, 111, 105, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
  cursor: default;
  opacity: 1;
  transform: none;
}

.opening-turn-btn-ready {
  color: #fffdf8 !important;
  background:
    linear-gradient(135deg, #009688, #007a70) !important;
  border-color: rgba(0, 111, 103, 0.34) !important;
  box-shadow:
    0 0 0 4px rgba(0, 150, 136, 0.13),
    0 12px 22px rgba(0, 111, 103, 0.2) !important;
}

.opening-turn-btn-ready:hover,
.opening-turn-btn-ready:focus-visible {
  background:
    linear-gradient(135deg, #008f83, #006f67) !important;
  box-shadow:
    0 0 0 4px rgba(0, 150, 136, 0.18),
    0 16px 26px rgba(0, 111, 103, 0.24) !important;
}

.opening-turn-btn[aria-disabled="true"] {
  pointer-events: none;
}

.opening-mat-action-copy {
  margin: 0;
  color: #5f554c;
  font: 700 0.76rem/1.25 "Merriweather", serif;
}

.opening-mat-action-subcopy {
  margin-top: -0.28rem;
  color: #746a62;
  font-size: 0.72rem;
  font-weight: 400;
}

.opening-break-card {
  width: min(20rem, 54%);
  gap: 0.58rem;
  padding: 0.9rem 1.1rem;
}

.opening-break-card h3 {
  font-size: clamp(1.14rem, 1.7vw, 1.34rem);
  line-height: 1.08;
}

.opening-break-card .opening-mat-action-copy {
  max-width: 17rem;
}

.opening-break-result {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: 18rem;
  padding: 0.1rem 0 0;
  color: #5f554c;
  background: transparent;
  box-shadow: none;
}

.opening-break-result strong {
  color: #2f2d2a;
  font: 900 1.55rem/1 "Merriweather Sans", sans-serif;
}

.opening-break-result span {
  max-width: 16.5rem;
  font: 700 0.68rem/1.22 "Merriweather", serif;
}

.opening-mat-guide {
  width: min(17.8rem, 42%);
}

.opening-mat-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.34rem;
  width: 100%;
}

.opening-mat-steps span {
  display: grid;
  min-height: 2.1rem;
  place-items: center;
  padding: 0.28rem 0.34rem;
  border: 1px solid rgba(0, 111, 103, 0.14);
  border-radius: 10px;
  color: rgba(47, 45, 42, 0.54);
  background: rgba(255, 253, 248, 0.52);
  font: 900 0.62rem/1.1 "Merriweather Sans", sans-serif;
}

.opening-mat-steps span.current {
  color: #fffdf8;
  background: linear-gradient(135deg, #008f86, #006f67);
  border-color: rgba(0, 111, 103, 0.42);
  box-shadow: 0 8px 18px rgba(0, 111, 103, 0.18);
}

.opening-mat-steps span.complete {
  color: #006f67;
  background: rgba(225, 241, 234, 0.84);
}

.opening-mat-dice-board {
  inset: 7%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: 20px;
  background: transparent;
  backdrop-filter: none;
}

.opening-roll-tie-note {
  grid-column: 1 / -1;
  justify-self: center;
  min-height: 2rem;
  padding: 0.42rem 0.82rem;
  border-radius: 999px;
  color: #006f67;
  background: rgba(232, 249, 245, 0.94);
  box-shadow: 0 10px 18px rgba(0, 150, 136, 0.16);
  font: 900 0.72rem/1 "Merriweather Sans", sans-serif;
}

.opening-seat-roll {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.42rem;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 10px 18px rgba(48, 82, 75, 0.12);
  opacity: 0.68;
}

.opening-seat-roll-you {
  grid-column: 1;
  grid-row: 2;
}

.opening-seat-roll-right {
  grid-column: 2;
  grid-row: 2;
}

.opening-seat-roll-across {
  grid-column: 2;
  grid-row: 1;
}

.opening-seat-roll-left {
  grid-column: 1;
  grid-row: 1;
}

.opening-seat-roll-name {
  color: #006f67;
  font: 900 0.68rem/1 "Merriweather Sans", sans-serif;
}

.opening-seat-roll-dice {
  display: flex;
  gap: 0.28rem;
}

.opening-seat-roll.active {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 150, 136, 0.16), transparent 4.8rem),
    linear-gradient(180deg, rgba(226, 252, 246, 0.98), rgba(255, 253, 248, 0.92));
  box-shadow:
    0 0 0 3px rgba(0, 150, 136, 0.42),
    0 0 0 8px rgba(147, 112, 219, 0.13),
    0 14px 26px rgba(0, 111, 103, 0.22);
}

.opening-seat-roll.complete {
  opacity: 0.92;
}

.opening-seat-roll.inactive {
  opacity: 0.36;
}

.opening-seat-roll.tie {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 0%, rgba(147, 112, 219, 0.16), transparent 4.4rem),
    rgba(255, 253, 248, 0.82);
  box-shadow:
    0 0 0 2px rgba(147, 112, 219, 0.2),
    0 12px 22px rgba(48, 38, 80, 0.12);
}

.opening-seat-roll.winner {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 150, 136, 0.34), transparent 4.8rem),
    linear-gradient(180deg, rgba(226, 252, 246, 0.98), rgba(255, 253, 248, 0.92));
  box-shadow:
    0 0 0 3px rgba(0, 150, 136, 0.46),
    0 0 0 8px rgba(147, 112, 219, 0.15),
    0 16px 30px rgba(0, 111, 103, 0.24);
  animation: opening-east-winner-pop 920ms cubic-bezier(0.17, 0.9, 0.22, 1.18) both;
}

.opening-seat-roll.winner .opening-seat-roll-name,
.opening-seat-roll.winner .opening-roll-total {
  color: #005f58;
}

.opening-roll-total {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  color: #5f554c;
  background: transparent;
  box-shadow: none;
  font: 900 1rem/1 "Merriweather Sans", sans-serif;
}

.opening-roll-east-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.34rem;
  padding: 0.1rem 0.62rem;
  border-radius: 999px;
  color: #fffdf8;
  background: #9370db;
  box-shadow: 0 8px 18px rgba(48, 38, 80, 0.18);
  font: 900 0.62rem/1 "Merriweather Sans", sans-serif;
  font-style: normal;
  text-transform: uppercase;
  animation: opening-east-tag-bounce 1300ms 180ms cubic-bezier(0.16, 0.9, 0.24, 1.18) both;
}

@keyframes opening-east-winner-pop {
  0% { transform: translateY(0) scale(0.96); filter: saturate(0.8); }
  52% { transform: translateY(-0.32rem) scale(1.05); filter: saturate(1.15); }
  100% { transform: translateY(0) scale(1); filter: saturate(1); }
}

@keyframes opening-east-tag-bounce {
  0% { transform: translateY(0.38rem) scale(0.74); opacity: 0; }
  45% { transform: translateY(-0.18rem) scale(1.08); opacity: 1; }
  68% { transform: translateY(0.08rem) scale(0.98); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.opening-wall-count {
  display: grid;
  place-items: center;
  min-width: 5.2rem;
  min-height: 2.15rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  color: #006f67;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 112, 0.14);
  font: 900 0.78rem/1 "Merriweather Sans", sans-serif;
}

.opening-build-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.62rem;
  width: 100%;
  margin-top: 0.1rem;
}

.opening-build-controls .opening-wall-count {
  justify-self: start;
}

.opening-build-controls .opening-autofill-btn {
  justify-self: end;
  min-height: 2.25rem;
  padding: 0.36rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  box-shadow: 0 8px 16px rgba(0, 122, 112, 0.14);
}

.opening-build-choice-controls {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.opening-build-choice-controls .opening-autofill-btn {
  justify-self: center;
  min-width: min(100%, 12rem);
}

.opening-build-choice-controls .opening-autofill-btn:disabled,
.opening-build-choice-controls .opening-autofill-btn[aria-disabled="true"] {
  color: rgba(95, 85, 76, 0.62);
  background:
    linear-gradient(180deg, rgba(245, 242, 235, 0.92), rgba(226, 221, 212, 0.86));
  border-color: rgba(122, 111, 105, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  cursor: default;
  opacity: 1;
}

.opening-count-break-controls {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.opening-count-break-controls .opening-wall-count {
  justify-self: center;
}

.opening-roll-waiting {
  display: grid;
  place-items: center;
  min-width: 4.3rem;
  min-height: 2.2rem;
  color: #746a62;
  font: 800 0.68rem/1 "Merriweather Sans", sans-serif;
}

.opening-wind-assignment-card {
  left: 50%;
  top: 50%;
  width: min(18rem, 86%);
  padding: 1rem;
  border: 1px solid rgba(255, 253, 248, 0.76);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 253, 248, 0.94), rgba(255, 253, 248, 0.7)),
    rgba(255, 253, 248, 0.74);
  box-shadow: 0 18px 34px rgba(48, 82, 75, 0.18);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(3px);
}

.opening-wind-assignment-card h3 {
  margin: 0;
  color: #006f67;
  font-family: "Merriweather", serif;
  font-size: clamp(1.14rem, 2.3vw, 1.52rem);
  line-height: 1.08;
}

.opening-wind-assignment-card p:not(.pre-game-label) {
  margin: 0;
  color: #5f554c;
  font: 700 0.78rem/1.3 "Merriweather", serif;
}

.opening-seat-roll .opening-die {
  width: 2.2rem;
  padding: 0.32rem;
  border-radius: 8px;
}

.opening-wall {
  --opening-wall-track-length: clamp(16.4rem, 45vw, 21.4rem);
  --opening-wall-horizontal-track-length: clamp(17.8rem, 48vw, 23.6rem);
  position: absolute;
  z-index: 3;
  display: grid;
  gap: clamp(0.08rem, 0.28vw, 0.18rem);
  padding: 0.22rem;
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.12);
}

.opening-wall-you,
.opening-wall-across {
  grid-template-columns: repeat(19, minmax(0, 1fr));
  left: 50%;
  width: var(--opening-wall-horizontal-track-length);
  transform: translateX(-50%);
}

.opening-wall-you {
  bottom: clamp(5.8rem, 7.6vw, 6.65rem);
}

.opening-wall-across {
  top: clamp(5.8rem, 7.6vw, 6.65rem);
}

.opening-wall-left,
.opening-wall-right {
  grid-template-rows: repeat(19, minmax(0, 1fr));
  top: 50%;
  height: var(--opening-wall-track-length);
  transform: translateY(-50%);
}

.opening-wall-left {
  left: clamp(5.8rem, 7.6vw, 6.65rem);
}

.opening-wall-right {
  right: clamp(5.8rem, 7.6vw, 6.65rem);
}

.opening-wall-you.east-pushed {
  bottom: clamp(6.55rem, 8.5vw, 7.45rem);
}

.opening-wall-across.east-pushed {
  top: clamp(6.55rem, 8.5vw, 7.45rem);
}

.opening-wall-left.east-pushed {
  left: clamp(6.55rem, 8.5vw, 7.45rem);
}

.opening-wall-right.east-pushed {
  right: clamp(6.55rem, 8.5vw, 7.45rem);
}

.opening-rack-line {
  --opening-rack-track-length: clamp(13.6rem, 37vw, 17.4rem);
  --opening-rack-cross-size: 2.12rem;
  --opening-rack-gap: clamp(0.11rem, 0.24vw, 0.16rem);
  --opening-rack-tile-short: clamp(0.62rem, 1.08vw, 0.78rem);
  --opening-rack-tile-long: clamp(0.9rem, 1.5vw, 1.08rem);
  --opening-rack-ledger-depth: 0.42rem;
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.opening-rack-track {
  position: absolute;
  display: block;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(0, 122, 112, 0), rgba(0, 122, 112, 0.48), rgba(0, 122, 112, 0));
  box-shadow: 0 1px 0 rgba(255, 253, 248, 0.8);
}

.opening-rack-line-you,
.opening-rack-line-across {
  left: 50%;
  width: var(--opening-rack-track-length);
  min-height: 2rem;
  transform: translateX(-50%);
}

.opening-rack-line-you {
  bottom: clamp(3.65rem, 5.2vw, 4.35rem);
}

.opening-rack-line-across {
  top: clamp(3.65rem, 5.2vw, 4.35rem);
}

.opening-rack-line-left,
.opening-rack-line-right {
  top: 50%;
  width: var(--opening-rack-cross-size);
  height: var(--opening-rack-track-length);
  transform: translateY(-50%);
}

.opening-rack-line-left {
  left: clamp(3.65rem, 5.2vw, 4.35rem);
}

.opening-rack-line-right {
  right: clamp(3.65rem, 5.2vw, 4.35rem);
}

.opening-rack-line-you .opening-rack-track,
.opening-rack-line-across .opening-rack-track {
  left: 0;
  right: 0;
  height: 2px;
}

.opening-rack-line-you .opening-rack-track {
  bottom: var(--opening-rack-ledger-depth);
}

.opening-rack-line-across .opening-rack-track {
  top: var(--opening-rack-ledger-depth);
}

.opening-rack-line-left .opening-rack-track,
.opening-rack-line-right .opening-rack-track {
  top: 0;
  bottom: 0;
  width: 2px;
  background:
    linear-gradient(180deg, rgba(0, 122, 112, 0), rgba(0, 122, 112, 0.48), rgba(0, 122, 112, 0));
}

.opening-rack-line-left .opening-rack-track {
  left: var(--opening-rack-ledger-depth);
}

.opening-rack-line-right .opening-rack-track {
  right: var(--opening-rack-ledger-depth);
}

.opening-rack-tiles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--opening-rack-gap);
  min-width: 1rem;
  min-height: 1rem;
}

.opening-rack-line-you .opening-rack-tiles {
  transform: translateY(0.08rem);
}

.opening-rack-line-across .opening-rack-tiles {
  transform: translateY(-0.08rem);
}

.opening-rack-line-left .opening-rack-tiles,
.opening-rack-line-right .opening-rack-tiles {
  flex-direction: column;
  gap: var(--opening-rack-gap);
}

.opening-rack-line-left .opening-rack-tiles {
  transform: translateX(-0.14rem);
}

.opening-rack-line-right .opening-rack-tiles {
  transform: translateX(0.14rem);
}

.opening-rack-tile {
  flex: 0 0 auto;
  display: block;
  width: var(--opening-rack-tile-short);
  height: var(--opening-rack-tile-long);
  border: 1px solid rgba(78, 123, 139, 0.28);
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(252, 255, 255, 0.96), rgba(207, 232, 240, 0.9)),
    #e9f8fb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0.2rem 0.42rem rgba(22, 41, 38, 0.16);
}

.opening-rack-line-left .opening-rack-tile,
.opening-rack-line-right .opening-rack-tile {
  width: var(--opening-rack-tile-long);
  height: var(--opening-rack-tile-short);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0.2rem 0.42rem rgba(22, 41, 38, 0.16);
}

.opening-rack-count {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 2.35rem;
  min-height: 1.18rem;
  padding: 0 0.36rem;
  border-radius: 999px;
  color: #006f67;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 5px 12px rgba(24, 38, 35, 0.12);
  font: 900 0.58rem/1 "Merriweather Sans", sans-serif;
}

.opening-rack-line-you .opening-rack-count {
  top: -1.1rem;
}

.opening-rack-line-across .opening-rack-count {
  bottom: -1.1rem;
}

.opening-rack-line-left .opening-rack-count {
  right: -0.92rem;
  top: 50%;
  transform: translate(100%, -50%) rotate(-90deg);
}

.opening-rack-line-right .opening-rack-count {
  left: -0.92rem;
  top: 50%;
  transform: translate(-100%, -50%) rotate(90deg);
}

.opening-rack-line.active .opening-rack-track {
  background: #20c9c3;
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.18), 0 5px 14px rgba(0, 150, 136, 0.22);
  animation: opening-active-rack-pulse 1180ms ease-in-out infinite;
}

.opening-deal-flight {
  position: absolute;
  z-index: 34;
  left: var(--flight-from-x, 50%);
  top: var(--flight-from-y, 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
  filter: drop-shadow(0 12px 14px rgba(25, 34, 31, 0.22));
  animation: opening-deal-packet-flight 1000ms cubic-bezier(0.18, 0.78, 0.22, 1) forwards;
}

.opening-deal-flight-to-left,
.opening-deal-flight-to-right {
  flex-direction: column;
}

.opening-deal-flight-tile {
  display: block;
  width: clamp(0.82rem, 1.55vw, 1.08rem);
  height: clamp(1.12rem, 2.05vw, 1.48rem);
  border: 1px solid rgba(78, 123, 139, 0.32);
  border-radius: 5px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(218, 241, 247, 0.96)),
    #e9f8fb;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 5px 9px rgba(22, 41, 38, 0.16);
  transform: translate(var(--flight-tile-offset, 0), var(--flight-tile-lift, 0)) rotate(var(--flight-tile-tilt, 0deg));
  animation: opening-deal-flight-tile-pop 1000ms cubic-bezier(0.18, 0.78, 0.22, 1) forwards;
  animation-delay: calc(var(--flight-tile-index, 0) * 34ms);
}

.opening-deal-flight-to-left .opening-deal-flight-tile,
.opening-deal-flight-to-right .opening-deal-flight-tile {
  width: clamp(1.12rem, 2.05vw, 1.48rem);
  height: clamp(0.82rem, 1.55vw, 1.08rem);
}

@keyframes opening-deal-packet-flight {
  0% {
    left: var(--flight-from-x, 50%);
    top: var(--flight-from-y, 50%);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
  }
  14% {
    opacity: 1;
  }
  78% {
    opacity: 1;
  }
  100% {
    left: var(--flight-to-x, 50%);
    top: var(--flight-to-y, 50%);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
  }
}

@keyframes opening-deal-flight-tile-pop {
  0% {
    transform: translate(var(--flight-tile-offset, 0), calc(var(--flight-tile-lift, 0) + 0.16rem)) rotate(var(--flight-tile-tilt, 0deg)) scale(0.9);
  }
  45% {
    transform: translate(var(--flight-tile-offset, 0), calc(var(--flight-tile-lift, 0) - 0.2rem)) rotate(var(--flight-tile-tilt, 0deg)) scale(1.03);
  }
  100% {
    transform: translate(var(--flight-tile-offset, 0), var(--flight-tile-lift, 0)) rotate(var(--flight-tile-tilt, 0deg)) scale(0.94);
  }
}

@media (prefers-reduced-motion: reduce) {
  .opening-deal-flight,
  .opening-deal-flight-tile,
  .opening-rack-line.active .opening-rack-track,
  .opening-seat.active {
    animation: none !important;
  }

  .opening-deal-flight {
    left: var(--flight-to-x, 50%);
    top: var(--flight-to-y, 50%);
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.98);
  }

}

.opening-tile-stack {
  position: relative;
  display: block;
  width: clamp(1.12rem, 2.1vw, 1.58rem);
  height: clamp(1.58rem, 3.1vw, 2.22rem);
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: default;
  transform: rotate(var(--stack-tilt, -1deg));
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.opening-wall-left .opening-tile-stack,
.opening-wall-right .opening-tile-stack {
  transform: rotate(90deg) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-you .opening-tile-stack,
.opening-wall-across .opening-tile-stack {
  width: clamp(1.18rem, 2.18vw, 1.66rem);
  height: clamp(1.64rem, 3.18vw, 2.3rem);
}

.opening-wall-you .opening-tile-stack.pushed-section {
  transform: translateY(-0.6rem) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-across .opening-tile-stack.pushed-section {
  transform: translateY(0.6rem) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-left .opening-tile-stack.pushed-section {
  transform: translateX(0.6rem) rotate(90deg) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-right .opening-tile-stack.pushed-section {
  transform: translateX(-0.6rem) rotate(90deg) rotate(var(--stack-tilt, -1deg));
}

.opening-tile-stack:nth-child(3n) { --stack-tilt: 1.2deg; }
.opening-tile-stack:nth-child(4n) { --stack-tilt: -1.8deg; }
.opening-tile-stack:nth-child(5n) { --stack-tilt: 0.6deg; }

.opening-tile-stack span {
  z-index: 1;
  position: absolute;
  inset: 0;
  border-radius: 4px;
  border: 1px solid rgba(78, 123, 139, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(207, 232, 240, 0.78)),
    #d9eef5;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 6px 10px rgba(22, 41, 38, 0.22);
}

.opening-tile-stack span:first-child {
  transform: translate(0.16rem, 0.25rem);
  background:
    linear-gradient(135deg, rgba(231, 249, 255, 0.9), rgba(157, 194, 207, 0.88)),
    #aacfdc;
}

.opening-tile-stack.empty span {
  opacity: 0.16;
  background: rgba(255, 253, 248, 0.38);
  border-style: dashed;
  box-shadow: none;
}

.opening-tile-stack.half span:first-child {
  opacity: 0;
  box-shadow: none;
}

.opening-tile-stack.reserve {
  opacity: 0.66;
  filter: saturate(0.72);
}

.opening-tile-stack.current-source:not(.empty) {
  z-index: 4;
  filter:
    drop-shadow(0 0 10px rgba(0, 150, 136, 0.36))
    drop-shadow(0 0 3px rgba(147, 112, 219, 0.18));
}

.opening-tile-stack.active-source:not(.empty) {
  z-index: 6;
  filter:
    drop-shadow(0 0 16px rgba(125, 76, 219, 0.72))
    drop-shadow(0 0 5px rgba(83, 45, 168, 0.48));
}

.opening-tile-stack.active-source:not(.empty)::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -0.32rem;
  right: -0.32rem;
  top: -0.26rem;
  bottom: -0.34rem;
  border: 2px solid rgba(139, 92, 246, 0.9);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.2);
  box-shadow:
    0 0 0 0.18rem rgba(139, 92, 246, 0.18),
    0 0 1.15rem rgba(139, 92, 246, 0.62),
    0 0.45rem 1rem rgba(83, 45, 168, 0.34);
}

.opening-tile-stack.active-source:not(.empty) span {
  border-color: rgba(139, 92, 246, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 5px 10px rgba(83, 45, 168, 0.28);
}

.opening-tile-stack.active,
.opening-tile-stack.next {
  cursor: pointer;
  filter:
    drop-shadow(0 0 20px rgba(0, 150, 136, 0.78))
    drop-shadow(0 0 5px rgba(147, 112, 219, 0.22));
  transform: translateY(-0.12rem) rotate(var(--stack-tilt, -1deg));
}

.opening-tile-stack.next span,
.opening-tile-stack.active span {
  border-color: rgba(0, 150, 136, 0.9);
  background:
    linear-gradient(135deg, rgba(226, 252, 246, 0.98), rgba(161, 226, 221, 0.9)),
    #dffbf4;
  box-shadow:
    0 0 0 2px rgba(0, 150, 136, 0.2),
    0 7px 12px rgba(0, 111, 103, 0.16);
}

.opening-wall-left .opening-tile-stack.active,
.opening-wall-right .opening-tile-stack.active,
.opening-wall-left .opening-tile-stack.next,
.opening-wall-right .opening-tile-stack.next {
  transform: rotate(90deg) translateY(-0.12rem) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-you .opening-tile-stack.next {
  transform: translateY(-0.72rem) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-across .opening-tile-stack.next {
  transform: translateY(0.72rem) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-left .opening-tile-stack.next {
  transform: translateX(0.72rem) rotate(90deg) rotate(var(--stack-tilt, -1deg));
}

.opening-wall-right .opening-tile-stack.next {
  transform: translateX(-0.72rem) rotate(90deg) rotate(var(--stack-tilt, -1deg));
}

.opening-break-start-hint {
  position: absolute;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.6rem;
  min-height: 1.58rem;
  padding: 0.2rem 0.56rem;
  border: 1px solid rgba(0, 150, 136, 0.34);
  border-radius: 999px;
  color: #006f67;
  background: rgba(255, 253, 248, 0.96);
  box-shadow:
    0 0 0 3px rgba(0, 150, 136, 0.1),
    0 0.45rem 1.15rem rgba(0, 111, 103, 0.18);
  font-family: var(--button-font);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.opening-break-start-hint::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
}

.opening-wall-you .opening-break-start-hint,
.opening-wall-across .opening-break-start-hint {
  right: -1rem;
}

.opening-wall-you .opening-break-start-hint {
  bottom: calc(100% + 0.84rem);
}

.opening-wall-you .opening-break-start-hint::before {
  left: 50%;
  top: 100%;
  border-left: 0.36rem solid transparent;
  border-right: 0.36rem solid transparent;
  border-top: 0.52rem solid #006f67;
  transform: translateX(-50%);
}

.opening-wall-across .opening-break-start-hint {
  top: calc(100% + 0.84rem);
}

.opening-wall-across .opening-break-start-hint::before {
  left: 50%;
  bottom: 100%;
  border-left: 0.36rem solid transparent;
  border-right: 0.36rem solid transparent;
  border-bottom: 0.52rem solid #006f67;
  transform: translateX(-50%);
}

.opening-wall-left .opening-break-start-hint,
.opening-wall-right .opening-break-start-hint {
  bottom: -0.22rem;
}

.opening-wall-left .opening-break-start-hint {
  left: calc(100% + 0.92rem);
}

.opening-wall-left .opening-break-start-hint::before {
  right: 100%;
  top: 50%;
  border-top: 0.36rem solid transparent;
  border-bottom: 0.36rem solid transparent;
  border-right: 0.52rem solid #006f67;
  transform: translateY(-50%);
}

.opening-wall-right .opening-break-start-hint {
  right: calc(100% + 0.92rem);
}

.opening-wall-right .opening-break-start-hint::before {
  left: 100%;
  top: 50%;
  border-top: 0.36rem solid transparent;
  border-bottom: 0.36rem solid transparent;
  border-left: 0.52rem solid #006f67;
  transform: translateY(-50%);
}

.opening-tile-stack.counted {
  opacity: 0.62;
}

.opening-tile-stack.dragging {
  opacity: 0.55;
}

.opening-source-stack {
  width: 3.2rem;
  height: 4.35rem;
  margin: 0.35rem auto;
  cursor: grab;
}

.opening-source-stack:active {
  cursor: grabbing;
}

.single-packet-tile {
  width: 2rem;
  height: 2.72rem;
}

.opening-seat {
  position: absolute;
  z-index: 5;
  display: grid;
  justify-items: center;
  box-sizing: border-box;
  gap: 0.06rem;
  min-width: 5.9rem;
  padding: 0.34rem 0.55rem;
  border-radius: 999px;
  color: #2f2d2a;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(70, 62, 54, 0.1);
  box-shadow: 0 7px 14px rgba(24, 38, 35, 0.16);
  font: 900 0.78rem/1 "Merriweather Sans", sans-serif;
  text-align: center;
}

.opening-seat span {
  display: inline-block;
  color: #008f83;
  font-size: 0.68rem;
}

.opening-seat.wind-revealing {
  border-color: rgba(0, 150, 136, 0.52);
  background:
    radial-gradient(circle at 50% 8%, rgba(0, 150, 136, 0.18), transparent 4.8rem),
    linear-gradient(135deg, #dffbf4, #fffdf8);
  box-shadow:
    0 0 0 4px rgba(0, 150, 136, 0.42),
    0 0 0 10px rgba(147, 112, 219, 0.13),
    0 16px 30px rgba(0, 111, 103, 0.24);
  animation: opening-wind-seat-pop 1080ms cubic-bezier(0.16, 0.9, 0.22, 1.18) both;
}

.opening-seat.wind-revealing span {
  color: #006f67;
  animation: opening-wind-name-pop 1080ms cubic-bezier(0.16, 0.9, 0.22, 1.18) both;
}

@keyframes opening-wind-seat-pop {
  0% {
    transform: var(--seat-transform, none) scale(0.92);
  }
  42% {
    transform: var(--seat-transform, none) scale(1.18);
  }
  68% {
    transform: var(--seat-transform, none) scale(1.05);
  }
  100% {
    transform: var(--seat-transform, none) scale(1);
  }
}

@keyframes opening-wind-name-pop {
  0% {
    opacity: 0;
    transform: translateY(0.42rem) scale(0.58);
    filter: blur(2px);
  }
  48% {
    opacity: 1;
    transform: translateY(-0.22rem) scale(1.48);
    filter: blur(0);
  }
  72% {
    opacity: 1;
    transform: translateY(0.06rem) scale(1.14);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.opening-seat.active {
  border-color: rgba(0, 150, 136, 0.52);
  background:
    radial-gradient(circle at 50% 8%, rgba(0, 150, 136, 0.16), transparent 4.8rem),
    linear-gradient(135deg, #dffbf4, #fffdf8);
  box-shadow:
    0 0 0 3px rgba(0, 150, 136, 0.4),
    0 0 0 7px rgba(147, 112, 219, 0.1),
    0 12px 22px rgba(0, 111, 103, 0.22);
  animation: opening-active-seat-pulse 1180ms ease-in-out infinite;
}

.opening-seat.east-seat {
  color: #fffdf8;
  border-color: rgba(147, 112, 219, 0.34);
  background: #9370db;
  box-shadow: 0 7px 14px rgba(48, 38, 80, 0.18);
  text-shadow: none;
}

.opening-seat.east-seat span {
  color: #fffdf8;
}

.opening-seat-you { --seat-transform: translateX(-50%); left: 50%; bottom: 0.72rem; transform: var(--seat-transform); }
.opening-seat-across { --seat-transform: translateX(-50%); left: 50%; top: 0.72rem; transform: var(--seat-transform); }
.opening-seat-left,
.opening-seat-right {
  padding: 0.22rem 0.48rem;
  gap: 0.02rem;
}

.opening-seat-left { --seat-transform: translateY(-50%) rotate(-90deg); left: -0.42rem; top: 50%; transform: var(--seat-transform); }
.opening-seat-right { --seat-transform: translateY(-50%) rotate(90deg); right: -0.42rem; top: 50%; transform: var(--seat-transform); }

@keyframes opening-active-rack-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(0, 150, 136, 0.18),
      0 5px 14px rgba(0, 150, 136, 0.22);
    opacity: 0.86;
  }

  50% {
    box-shadow:
      0 0 0 6px rgba(0, 150, 136, 0.25),
      0 0 0 14px rgba(147, 112, 219, 0.13),
      0 8px 22px rgba(0, 150, 136, 0.32);
    opacity: 1;
  }
}

@keyframes opening-active-seat-pulse {
  0%,
  100% {
    transform: var(--seat-transform, none) scale(1);
    box-shadow:
      0 0 0 3px rgba(0, 150, 136, 0.4),
      0 0 0 7px rgba(147, 112, 219, 0.1),
      0 12px 22px rgba(0, 111, 103, 0.22);
  }

  50% {
    transform: var(--seat-transform, none) scale(1.025);
    box-shadow:
      0 0 0 4px rgba(0, 150, 136, 0.45),
      0 0 0 10px rgba(147, 112, 219, 0.14),
      0 16px 30px rgba(0, 111, 103, 0.27);
  }
}

.opening-history-controls {
  position: absolute;
  left: clamp(1.2rem, 2.4vw, 1.85rem);
  right: clamp(1.2rem, 2.4vw, 1.85rem);
  bottom: clamp(1.05rem, 1.9vw, 1.55rem);
  z-index: 42;
  display: block;
  min-height: 2.4rem;
  pointer-events: none;
}

.opening-history-btn {
  position: absolute;
  bottom: 0;
  display: grid;
  place-items: center;
  width: clamp(2rem, 3.4vw, 2.46rem);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(0, 122, 112, 0.24);
  border-radius: 999px;
  color: #006f67;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 253, 248, 0.98), rgba(238, 249, 245, 0.92)),
    #fffdf8;
  box-shadow:
    0 9px 18px rgba(24, 38, 35, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  cursor: pointer;
  pointer-events: auto;
  font: 900 clamp(1.02rem, 1.8vw, 1.32rem)/1 "Merriweather Sans", sans-serif;
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.opening-history-back-btn {
  left: 0;
  grid-template-columns: auto auto;
  gap: 0.34rem;
  width: auto;
  min-width: clamp(4.9rem, 8vw, 5.8rem);
  aspect-ratio: auto;
  min-height: clamp(2rem, 3.4vw, 2.46rem);
  padding: 0 0.72rem 0 0.62rem;
  border-radius: 999px;
  font-size: clamp(0.66rem, 1.05vw, 0.78rem);
}

.opening-history-back-btn span:first-child {
  font-size: clamp(1.02rem, 1.8vw, 1.32rem);
  line-height: 1;
}

.opening-history-btn:hover,
.opening-history-btn:focus-visible {
  transform: translateY(-0.08rem);
  box-shadow:
    0 0 0 3px rgba(0, 150, 136, 0.16),
    0 12px 22px rgba(0, 122, 112, 0.18);
}

.opening-history-btn:disabled {
  opacity: 0.24;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.opening-side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  align-content: stretch;
  align-self: stretch;
  gap: clamp(0.58rem, 1vw, 0.78rem);
  min-height: 0;
  overflow: hidden;
  padding: clamp(1.05rem, 1.8vw, 1.35rem) clamp(0.9rem, 1.6vw, 1.15rem);
  border: 1px solid rgba(70, 62, 54, 0.14);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 248, 231, 0.74), transparent 11rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 243, 0.95)),
    #fffdf8;
  box-shadow:
    0 18px 34px rgba(61, 48, 36, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.opening-side-title {
  margin: 0;
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(1.46rem, 2.25vw, 1.9rem);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.opening-side-title::after {
  content: "";
  display: block;
  width: min(7.2rem, 62%);
  height: 2px;
  margin: 0.42rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 150, 136, 0), #009688, #9370db, rgba(147, 112, 219, 0));
}

.opening-step-count {
  justify-self: center;
  margin: 0;
  padding: 0.34rem 0.82rem;
  border-radius: 999px;
  color: #007a70;
  background: rgba(243, 238, 228, 0.8);
  font: 900 0.82rem/1 "Merriweather Sans", sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.opening-step-rail {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.42rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.28rem 0;
  box-shadow: none;
}

.opening-step-rail::before {
  content: "";
  position: absolute;
  left: 1.22rem;
  top: 1.7rem;
  bottom: 1.7rem;
  width: 2px;
  border-radius: 999px;
  background: rgba(70, 62, 54, 0.12);
}

.opening-step-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.52rem;
  min-height: clamp(2.55rem, 4.2vw, 3.35rem);
  padding: 0.42rem 0.7rem 0.42rem 0;
  border-radius: 12px;
  color: rgba(47, 45, 42, 0.5);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 253, 248, 0.46));
  opacity: 0.72;
  width: 100%;
  appearance: none;
  border: 0;
  font: inherit;
  text-align: left;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.opening-step-item.clickable {
  cursor: pointer;
}

.opening-step-item.clickable:hover,
.opening-step-item.clickable:focus-visible {
  opacity: 1;
  outline: none;
  color: #006f67;
  background: rgba(247, 253, 251, 0.92);
  box-shadow:
    0 0 0 2px rgba(0, 150, 136, 0.12),
    0 10px 18px rgba(0, 122, 112, 0.08);
}

.opening-step-item.current {
  color: #007a70;
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(232, 249, 245, 0.96), rgba(255, 253, 248, 0.92));
  box-shadow:
    0 9px 18px rgba(0, 122, 112, 0.08),
    inset 0 0 0 1px rgba(0, 150, 136, 0.06);
}

.opening-step-item.complete {
  color: #006f67;
  opacity: 0.9;
  background:
    linear-gradient(90deg, rgba(236, 251, 247, 0.72), rgba(255, 253, 248, 0.42));
}

.opening-step-number {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 1.55rem;
  aspect-ratio: 1;
  border-radius: 999px;
  color: #7e7871;
  background: #ece9e3;
  box-shadow: 0 0 0 0.22rem rgba(255, 253, 248, 0.92);
  font: 900 0.78rem/1 "Merriweather Sans", sans-serif;
}

.opening-step-item.current .opening-step-number {
  color: #fffdf8;
  background: #009688;
  box-shadow:
    0 8px 14px rgba(0, 122, 112, 0.22),
    0 0 0 0.22rem rgba(255, 253, 248, 0.94);
}

.opening-step-item.complete .opening-step-number {
  color: #fffdf8;
  background: rgba(0, 150, 136, 0.78);
}

.opening-step-label {
  font: 900 clamp(0.78rem, 1.1vw, 0.92rem)/1.08 "Merriweather", serif;
}

.opening-side-logo {
  display: grid;
  align-self: end;
  justify-items: center;
  width: 100%;
  opacity: 0.92;
  padding-top: 0.1rem;
}

.opening-side-logo img {
  display: block;
  width: min(86%, 14.8rem);
  height: auto;
  filter: drop-shadow(0 8px 10px rgba(0, 88, 84, 0.08));
}

.opening-side-footer {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  min-height: 2.25rem;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(70, 62, 54, 0.1);
}

.opening-skip-setup-btn {
  min-height: 2rem;
  padding: 0.3rem 0;
  border: 0;
  border-radius: 0;
  color: #006f67;
  background: transparent;
  box-shadow: none;
  font: 900 0.88rem/1 "Merriweather Sans", sans-serif;
}

.opening-skip-setup-btn span {
  display: inline-block;
  margin-left: 0.42rem;
  font-size: 1.18em;
  line-height: 0;
  transform: translateY(0.04rem);
}

.opening-skip-setup-btn:hover,
.opening-skip-setup-btn:focus-visible {
  color: #005f58;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.opening-step-direction {
  margin: 0.16rem 0 0;
  color: #746a62;
  font: 700 0.72rem/1.25 "Merriweather", serif;
  text-align: center;
  opacity: 0.72;
}

.opening-step-direction.active {
  color: #006f67;
  opacity: 1;
}

.opening-current-card {
  display: grid;
  justify-items: center;
  gap: 0.58rem;
  border: 1px solid rgba(70, 62, 54, 0.12);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 150, 136, 0.1), transparent 8rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 241, 0.82)),
    #fffdf8;
  padding: 0.78rem;
  text-align: center;
  box-shadow: 0 8px 18px rgba(61, 48, 36, 0.06);
}

.opening-current-count {
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1;
}

.opening-current-card .opening-rolling-dice,
.opening-current-card .opening-dice-grid,
.opening-current-card .opening-break-card {
  width: 100%;
  box-shadow: none;
}

.opening-current-card .opening-bot-build-list.compact {
  margin-top: 0.1rem;
}

.opening-stack-supply,
.opening-break-card,
.opening-interaction-panel,
.opening-dice-grid {
  border: 1px solid rgba(70, 62, 54, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 249, 238, 0.82)),
    #fffdf8;
  padding: 0.82rem;
  box-shadow: 0 8px 18px rgba(61, 48, 36, 0.07);
}

.opening-stack-supply {
  display: grid;
  justify-items: center;
  gap: 0.32rem;
  text-align: center;
}

.opening-stack-supply strong,
.opening-break-card strong {
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: 1.25rem;
}

.opening-bot-build-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.38rem;
  width: 100%;
}

.opening-bot-build-list span {
  display: grid;
  place-items: center;
  min-height: 2rem;
  border-radius: 999px;
  color: #006f67;
  background: rgba(0, 150, 136, 0.08);
  font: 800 0.68rem/1 "Merriweather Sans", sans-serif;
}

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

.opening-east-assignment {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.22rem;
  padding: 0.72rem 0.78rem;
  border-radius: 12px;
  color: #2f2d2a;
  background:
    linear-gradient(135deg, rgba(0, 150, 136, 0.1), rgba(147, 112, 219, 0.12)),
    #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(0, 150, 136, 0.14);
}

.opening-east-assignment strong {
  color: #006f67;
  font-family: "Merriweather", serif;
  font-size: 1rem;
  line-height: 1.08;
}

.opening-east-assignment span {
  color: #5f554c;
  font: 700 0.76rem/1.28 "Merriweather", serif;
}

.opening-rolling-dice,
.opening-break-card {
  display: grid;
  justify-items: center;
  gap: 0.62rem;
}

.opening-rolling-dice {
  border: 1px solid rgba(70, 62, 54, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 15%, rgba(0, 150, 136, 0.12), transparent 7rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 238, 0.84));
  padding: 0.9rem;
  box-shadow: 0 8px 18px rgba(61, 48, 36, 0.07);
}

.opening-rolling-dice-row,
.opening-break-dice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.56rem;
}

.opening-break-dice-pending {
  min-height: 3.1rem;
}

.opening-break-dice:not(.opening-break-dice-pending) .opening-die.rolling {
  animation-duration: 1120ms;
}

.opening-break-dice:not(.opening-break-dice-pending) .opening-die.rolling:nth-child(2) {
  animation-delay: 140ms;
}

.opening-die {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0.16rem;
  width: 3.1rem;
  aspect-ratio: 1;
  padding: 0.42rem;
  border-radius: 11px;
  border: 1px solid rgba(70, 62, 54, 0.2);
  background:
    linear-gradient(145deg, #fffdf8, #f0dfc2);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 8px 16px rgba(61, 48, 36, 0.16);
}

.opening-die i {
  display: block;
  border-radius: 50%;
}

.opening-die i.filled {
  background: #2f2d2a;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.24);
}

.opening-die.unrevealed i {
  background: rgba(47, 45, 42, 0.18);
}

.opening-die.rolling {
  animation: opening-die-roll 900ms cubic-bezier(0.22, 0.86, 0.28, 1) both;
}

.opening-die.rolling.delay {
  animation-delay: 80ms;
}

@keyframes opening-die-roll {
  0% { transform: translateY(-0.65rem) rotate(-18deg) scale(0.92); }
  30% { transform: translateY(0.25rem) rotate(21deg) scale(1.06); }
  62% { transform: translateY(-0.18rem) rotate(-9deg) scale(0.98); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

.opening-dice-result {
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  min-height: 4.4rem;
  padding: 0.6rem;
  border-radius: 12px;
  background: rgba(70, 62, 54, 0.06);
}

.opening-dice-result.winner {
  background: linear-gradient(135deg, rgba(0, 150, 136, 0.13), rgba(147, 112, 219, 0.16));
  box-shadow: inset 0 0 0 1px rgba(0, 150, 136, 0.18);
}

.opening-dice-result span {
  color: #5f554c;
  font: 800 0.72rem/1 "Merriweather Sans", sans-serif;
}

.opening-dice-result strong {
  display: grid;
  place-items: center;
  width: 2.25rem;
  aspect-ratio: 1;
  border-radius: 9px;
  color: #2f2d2a;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(70, 62, 54, 0.16), 0 5px 10px rgba(61, 48, 36, 0.1);
  font: 900 1.1rem/1 "Merriweather Sans", sans-serif;
}

.opening-interaction-panel {
  display: grid;
  gap: 0.68rem;
}

.opening-interaction-panel h3 {
  margin: 0.1rem 0 0;
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: clamp(1.18rem, 2.1vw, 1.55rem);
  line-height: 1.08;
}

.opening-packet-row,
.opening-final-row,
.opening-ready-rack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 4.2rem;
  padding: 0.56rem;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(0, 150, 136, 0.08), rgba(147, 112, 219, 0.08)),
    rgba(255, 253, 248, 0.72);
}

.draggable-packet {
  cursor: grab;
}

.opening-rack-target {
  display: grid;
  place-items: center;
  min-height: 3.05rem;
  border: 1px dashed rgba(0, 150, 136, 0.42);
  border-radius: 13px;
  color: #006f67;
  background: rgba(0, 150, 136, 0.07);
  font: 900 0.86rem/1 "Merriweather Sans", sans-serif;
}

.opening-rack-target.final-count {
  color: #7351bd;
  border-color: rgba(147, 112, 219, 0.42);
  background: rgba(147, 112, 219, 0.08);
}

.opening-final-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 3rem;
  border: 1px solid rgba(78, 123, 139, 0.28);
  border-radius: 9px;
  color: #5f554c;
  background: linear-gradient(145deg, #e9fbff, #bddbe7);
  box-shadow: 0 7px 12px rgba(61, 48, 36, 0.14);
  cursor: default;
}

.opening-final-tile.east-final:not(.taken) {
  cursor: pointer;
  color: #2f2d2a;
  background: linear-gradient(145deg, #e8f8f5, #dceef2);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.2), 0 8px 14px rgba(61, 48, 36, 0.16);
}

.opening-final-tile.taken {
  opacity: 0.28;
  transform: translateY(-0.4rem);
}

.opening-final-tile span {
  font: 900 0.78rem/1 "Merriweather Sans", sans-serif;
}

.opening-action-row {
  display: grid;
  gap: 0.48rem;
}

.opening-primary-btn,
.opening-secondary-btn {
  width: 100%;
  min-height: 3rem;
}

.opening-auto-note {
  margin: 0;
  color: #746a62;
  font: 700 0.78rem/1.35 "Merriweather", serif;
  text-align: center;
}

@media (max-width: 860px) {
  .opening-choice-grid {
    grid-template-columns: 1fr;
  }

  .opening-deal-card {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    overflow: auto;
  }

  .opening-deal-grid {
    grid-template-columns: 1fr;
  }

  .opening-table-wrap {
    aspect-ratio: 1 / 0.92;
    min-height: 365px;
    padding: 2.7rem;
  }

  .opening-center-pile {
    width: min(78%, 22rem);
    top: 50%;
  }

  .opening-mat-roll-action {
    top: 50%;
    width: min(17.8rem, 62%);
    min-width: min(16rem, 82%);
  }

  .opening-side-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    overflow: visible;
  }

  .opening-side-footer {
    justify-content: flex-end;
    min-height: auto;
  }

  .opening-step-rail {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.28rem 0;
  }

  .opening-step-item {
    min-height: 2.55rem;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.38rem 0.62rem 0.38rem 0;
  }

  .opening-step-number {
    width: 1.5rem;
    font-size: 0.72rem;
  }

  .opening-step-label {
    font-size: 0.78rem;
  }

  .opening-step-direction {
    grid-column: 1 / -1;
    margin-top: 0.08rem;
  }

  .opening-current-card {
    padding: 0.62rem;
  }
}

@media (max-width: 560px) {
  .opening-table-wrap {
    min-height: 340px;
    padding: 2.35rem;
  }

  .opening-center-pile {
    width: 82%;
    top: 50%;
  }

  .opening-center-pile-stacks {
    min-height: 15rem;
  }

  .opening-mat-roll-action {
    width: 76%;
    min-width: 0;
  }

  .opening-wall {
    --opening-wall-track-length: clamp(14rem, 64vw, 17rem);
    --opening-wall-horizontal-track-length: clamp(15rem, 68vw, 18.1rem);
  }

  .opening-rack-line {
    --opening-rack-track-length: clamp(11.8rem, 57vw, 15.2rem);
  }

  .opening-rack-count {
    min-width: 2.08rem;
    padding: 0 0.28rem;
    font-size: 0.52rem;
  }

  .opening-history-controls {
    left: 0.72rem;
    right: 0.72rem;
    bottom: 0.72rem;
  }

  .opening-history-back-btn {
    min-width: 6.7rem;
    padding-inline: 0.52rem 0.6rem;
    font-size: 0.58rem;
  }

  .opening-tile-stack {
    width: 0.78rem;
    height: 1.14rem;
    border-radius: 6px;
  }

  .opening-break-start-hint {
    min-width: 4.05rem;
    min-height: 1.38rem;
    padding-inline: 0.42rem;
    font-size: 0.62rem;
  }

  .opening-seat {
    min-width: 4.8rem;
    padding: 0.28rem 0.42rem;
    font-size: 0.64rem;
  }

}

@media (max-width: 560px) {
  .pre-game-card {
    width: min(100%, calc(100vw - 1rem));
  }

  .assist-mode-grid {
    grid-template-columns: 1fr;
  }

  .hand-card-choice-grid {
    grid-template-columns: 1fr;
  }

  .learn-table-prompt {
    grid-template-columns: auto auto auto;
    justify-content: center;
    padding: 0.52rem 0 0;
  }

  .mode-choice {
    min-height: 7.8rem;
  }

  .learn-table-prompt {
    padding: 0.78rem;
  }

  .learn-table-copy {
    border-right: 1px solid rgba(70, 62, 54, 0.13);
    border-bottom: 0;
    padding: 0 0.72rem 0 0;
  }
}

.mahjong-101-overlay {
  position: fixed;
  inset: 0;
  z-index: 132;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 14% 18%, rgba(0, 150, 136, 0.2), transparent 24rem),
    radial-gradient(circle at 86% 18%, rgba(147, 112, 219, 0.18), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(218, 165, 32, 0.16), transparent 24rem),
    rgba(45, 38, 31, 0.28);
  backdrop-filter: blur(10px);
}

.mahjong-101-overlay.hidden {
  display: none !important;
}

body.mahjong-101-active .top-bar {
  z-index: 140;
}

body.mahjong-101-active .app-shell {
  z-index: auto;
}

body.mahjong-101-active .mahjong-101-overlay {
  padding-top: clamp(5rem, 10vh, 6.5rem);
}

body.mahjong-101-active .mahjong-101-card {
  min-height: min(680px, calc(100vh - 6.5rem));
}

.mahjong-101-card {
  position: relative;
  width: min(980px, 100%);
  min-height: min(680px, calc(100vh - 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1rem;
  padding: clamp(1.1rem, 3vw, 2rem);
  overflow: hidden;
  border: 1px solid rgba(109, 91, 68, 0.17);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.99), rgba(245, 252, 250, 0.97)),
    #fffdf8;
  box-shadow:
    0 34px 80px rgba(42, 34, 28, 0.26),
    0 8px 22px rgba(42, 34, 28, 0.12);
}

.mahjong-101-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 150, 136, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 112, 219, 0.032) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(130deg, rgba(0, 0, 0, 0.44), transparent 58%);
}

.mahjong-101-card::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #009688 0 50%, #9370db 50% 78%, #daa520 78% 100%);
}

.mahjong-101-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(70, 62, 54, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  color: #4f4943;
  cursor: pointer;
  font: 900 1.25rem/1 var(--button-font);
}

.mahjong-101-close:hover,
.mahjong-101-close:focus-visible {
  color: #fff;
  background: #008f83;
  outline: none;
}

.mahjong-101-progress {
  position: relative;
  z-index: 2;
  width: min(290px, calc(100% - 3rem));
  display: grid;
  gap: 0.38rem;
  color: #006f67;
  font: 900 0.78rem var(--button-font);
}

.mahjong-101-progress-track {
  width: 100%;
  height: 0.42rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 150, 136, 0.13);
}

.mahjong-101-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #009688, #9370db);
  transition: width 240ms ease;
}

.mahjong-101-slide {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.2rem, 4vw, 3rem);
  min-height: 0;
  animation: mahjong-101-slide-in 360ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

.mahjong-101-visual {
  min-width: 0;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.mahjong-101-copy {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.mahjong-101-kicker {
  color: #008f83;
  font: 900 0.84rem var(--button-font);
}

.mahjong-101-copy h2 {
  max-width: 11ch;
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: 2.65rem;
  font-weight: 700;
  line-height: 1.02;
}

.mahjong-101-body-copy {
  max-width: 44rem;
  color: #5d554e;
  font-family: "Merriweather", serif;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.58;
}

.mahjong-101-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.mahjong-101-actions.back-hidden {
  justify-content: flex-end;
}

.mahjong-101-back,
.mahjong-101-next {
  min-width: 8.8rem;
  min-height: 2.9rem;
  border-radius: 14px;
  font-family: var(--button-font);
  font-weight: 900;
}

.mahjong-101-back:disabled {
  opacity: 0.36;
  cursor: default;
}

.mahjong-101-next {
  border: 0;
  color: #fffdf8;
  background: #008f83;
  box-shadow: 0 10px 20px rgba(0, 122, 112, 0.18);
}

.mahjong-101-next:hover,
.mahjong-101-next:focus-visible {
  background: #007d73;
  transform: translateY(-1px);
}

.mahjong-101-table-scene,
.mahjong-101-seat-map {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1;
  border-radius: 36%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 253, 248, 0.94) 0 32%, rgba(0, 150, 136, 0.16) 33% 55%, transparent 56%),
    linear-gradient(145deg, rgba(147, 112, 219, 0.13), rgba(218, 165, 32, 0.14));
  box-shadow: inset 0 0 0 1px rgba(0, 150, 136, 0.12), 0 26px 48px rgba(61, 48, 36, 0.12);
}

.mahjong-101-center-tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.4rem;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 14px 12px rgba(61, 48, 36, 0.16));
  animation: mahjong-101-tile-float 2400ms ease-in-out infinite;
}

.mahjong-101-center-tile.tile-one {
  transform: translate(-95%, -50%) rotate(-12deg);
}

.mahjong-101-center-tile.tile-two {
  transform: translate(-50%, -62%) rotate(3deg);
  animation-delay: 160ms;
}

.mahjong-101-center-tile.tile-three {
  transform: translate(-8%, -48%) rotate(12deg);
  animation-delay: 320ms;
}

.mahjong-101-tile-family-board {
  width: min(360px, 100%);
  display: grid;
  gap: 0.78rem;
}

.mahjong-101-tile-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
  width: 100%;
}

.mahjong-101-tile-gallery figure {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.44rem;
  min-height: 7.4rem;
  padding: 0.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-tile-gallery figure:nth-child(2) { animation-delay: 45ms; }
.mahjong-101-tile-gallery figure:nth-child(3) { animation-delay: 90ms; }
.mahjong-101-tile-gallery figure:nth-child(4) { animation-delay: 135ms; }
.mahjong-101-tile-gallery figure:nth-child(5) { animation-delay: 180ms; }
.mahjong-101-tile-gallery figure:nth-child(6) { animation-delay: 225ms; }

.mahjong-101-tile-gallery img {
  width: 4rem;
  filter: drop-shadow(0 12px 10px rgba(61, 48, 36, 0.12));
}

.mahjong-101-tile-gallery figcaption {
  color: #006f67;
  font: 900 0.92rem var(--button-font);
  line-height: 1;
}

.mahjong-101-joker-callout {
  justify-self: center;
  width: min(250px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid rgba(147, 112, 219, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 14px 28px rgba(61, 48, 36, 0.08);
  animation: mahjong-101-pop 420ms 280ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-joker-callout img {
  width: 2.8rem;
  filter: drop-shadow(0 10px 8px rgba(61, 48, 36, 0.11));
}

.mahjong-101-joker-callout strong {
  display: block;
  color: #7351bd;
  font: 900 0.88rem var(--button-font);
  line-height: 1.1;
}

.mahjong-101-joker-callout span {
  display: block;
  margin-top: 0.12rem;
  color: #796f65;
  font: 700 0.7rem "Merriweather", serif;
  line-height: 1.2;
}

.mahjong-101-suit-counts,
.mahjong-101-honor-board,
.mahjong-101-special-tiles,
.mahjong-101-group-board,
.mahjong-101-pattern-board {
  width: min(400px, 100%);
}

.mahjong-101-suit-counts {
  display: grid;
  gap: 0.72rem;
}

.mahjong-101-special-tiles article {
  display: grid;
  justify-items: center;
  gap: 0.42rem;
  padding: 0.82rem 0.5rem;
  border: 1px solid rgba(70, 62, 54, 0.11);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.66);
  box-shadow: 0 14px 28px rgba(61, 48, 36, 0.08);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-special-tiles article:nth-child(2) {
  animation-delay: 90ms;
}

.mahjong-101-special-tiles strong,
.mahjong-101-group-board strong,
.mahjong-101-pattern-board strong {
  color: #006f67;
  font: 900 0.9rem var(--button-font);
  line-height: 1;
}

.mahjong-101-special-tiles p {
  color: #796f65;
  font: 700 0.72rem "Merriweather", serif;
  line-height: 1.1;
}

.mahjong-101-suit-counts section {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  border: 1px solid rgba(70, 62, 54, 0.11);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.82), rgba(247, 252, 250, 0.78)),
    #fffdf8;
  box-shadow: 0 14px 28px rgba(61, 48, 36, 0.08);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-suit-counts section:nth-child(2) {
  animation-delay: 90ms;
}

.mahjong-101-suit-counts section:nth-child(3) {
  animation-delay: 180ms;
}

.mahjong-101-suit-counts p {
  color: #006f67;
  font: 900 0.84rem var(--button-font);
}

.suit-tile-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  align-items: end;
  justify-items: center;
  gap: 0.16rem;
}

.suit-tile-row img {
  width: 100%;
  max-width: 1.58rem;
  filter: drop-shadow(0 10px 8px rgba(61, 48, 36, 0.1));
}

.mahjong-101-suit-counts span {
  justify-self: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  color: #7351bd;
  background: rgba(147, 112, 219, 0.1);
  font: 900 0.72rem var(--button-font);
}

.mahjong-101-honor-board {
  display: grid;
  gap: 0.72rem;
}

.mahjong-101-honor-board section {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  border: 1px solid rgba(70, 62, 54, 0.11);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.82), rgba(247, 252, 250, 0.78)),
    #fffdf8;
  box-shadow: 0 14px 28px rgba(61, 48, 36, 0.08);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-honor-board section:nth-child(2) {
  animation-delay: 100ms;
}

.mahjong-101-honor-board p {
  color: #006f67;
  font: 900 0.84rem var(--button-font);
}

.honor-tile-row {
  display: flex;
  justify-content: center;
  gap: 0.28rem;
}

.honor-tile-row img {
  width: 3rem;
  filter: drop-shadow(0 10px 8px rgba(61, 48, 36, 0.1));
}

.mahjong-101-honor-board span {
  justify-self: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  color: #7351bd;
  background: rgba(147, 112, 219, 0.1);
  font: 900 0.72rem var(--button-font);
}

.mahjong-101-special-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.special-tile-fan {
  position: relative;
  width: 8.4rem;
  min-height: 6.4rem;
}

.special-tile-fan img {
  position: absolute;
  left: 50%;
  bottom: 0.2rem;
  width: 3.8rem;
  transform-origin: 50% 92%;
  filter: drop-shadow(0 12px 10px rgba(61, 48, 36, 0.12));
}

.special-tile-fan img:nth-child(1) {
  transform: translateX(-92%) rotate(-13deg);
}

.special-tile-fan img:nth-child(2) {
  transform: translateX(-50%) translateY(-0.38rem) rotate(0deg);
}

.special-tile-fan img:nth-child(3) {
  transform: translateX(-8%) rotate(13deg);
}

.joker-fan img:nth-child(1) {
  transform: translateX(-92%) rotate(-10deg);
}

.joker-fan img:nth-child(3) {
  transform: translateX(-8%) rotate(10deg);
}

.mahjong-101-group-board {
  display: grid;
  gap: 0.44rem;
}

.mahjong-101-pattern-board {
  display: grid;
  gap: 0.58rem;
}

.mahjong-101-group-board article,
.mahjong-101-pattern-board article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.58rem;
  min-height: 3.48rem;
  padding: 0.45rem 0.66rem;
  border: 1px solid rgba(70, 62, 54, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 12px 24px rgba(61, 48, 36, 0.07);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-group-board article:nth-child(2) { animation-delay: 55ms; }
.mahjong-101-group-board article:nth-child(3) { animation-delay: 110ms; }
.mahjong-101-group-board article:nth-child(4) { animation-delay: 165ms; }
.mahjong-101-group-board article:nth-child(5) { animation-delay: 220ms; }
.mahjong-101-pattern-board article:nth-child(2) { animation-delay: 55ms; }
.mahjong-101-pattern-board article:nth-child(3) { animation-delay: 110ms; }
.mahjong-101-pattern-board article:nth-child(4) { animation-delay: 165ms; }

.group-tile-row,
.pattern-tile-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7.55rem;
  min-width: 0;
}

.group-tile-row img,
.pattern-tile-row img {
  width: 2.16rem;
  margin-right: -0.82rem;
  filter: drop-shadow(0 8px 7px rgba(61, 48, 36, 0.1));
}

.group-tile-row img:last-child,
.pattern-tile-row img:last-child {
  margin-right: 0;
}

.mahjong-101-group-board span {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  color: #fff;
  background: #9370db;
  font: 900 0.74rem var(--button-font);
}

.mahjong-101-seat-map .seat {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 4.4rem;
  min-height: 2.3rem;
  border-radius: 999px;
  color: #fff;
  background: #008f83;
  font: 900 0.82rem var(--button-font);
  box-shadow: 0 12px 24px rgba(0, 122, 112, 0.18);
  opacity: 0;
  transform: translate(var(--seat-x), var(--seat-y)) scale(1);
  scale: 1;
  animation:
    mahjong-101-seat-pop 520ms cubic-bezier(0.18, 0.9, 0.22, 1.22) both,
    mahjong-101-seat-turn 5600ms ease-in-out infinite;
  animation-delay: var(--seat-enter-delay), var(--seat-turn-delay);
  transform-origin: center;
}

.mahjong-101-seat-map .seat-top {
  left: 50%;
  top: 0.6rem;
  --seat-x: -50%;
  --seat-y: 0;
  --seat-enter-delay: 170ms;
  --seat-turn-delay: 2800ms;
}

.mahjong-101-seat-map .seat-left {
  left: 0.5rem;
  top: 50%;
  --seat-x: 0;
  --seat-y: -50%;
  --seat-enter-delay: 260ms;
  --seat-turn-delay: 4200ms;
}

.mahjong-101-seat-map .seat-right {
  right: 0.5rem;
  top: 50%;
  --seat-x: 0;
  --seat-y: -50%;
  --seat-enter-delay: 350ms;
  --seat-turn-delay: 1400ms;
}

.mahjong-101-seat-map .seat-bottom {
  left: 50%;
  bottom: 0.6rem;
  --seat-x: -50%;
  --seat-y: 0;
  --seat-enter-delay: 70ms;
  --seat-turn-delay: 0ms;
  background: #9370db;
}

.seat-center {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  gap: 0.35rem;
  transform: translate(-50%, -50%);
}

.seat-center img {
  width: 3.6rem;
  filter: drop-shadow(0 10px 10px rgba(61, 48, 36, 0.12));
}

.mahjong-101-east-board {
  width: min(390px, 100%);
  display: grid;
  gap: 0.9rem;
  justify-items: center;
}

.east-seat-ring {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 253, 248, 0.98) 0 27%, rgba(0, 150, 136, 0.1) 28% 55%, rgba(147, 112, 219, 0.12) 56% 100%);
  box-shadow: inset 0 0 0 1px rgba(70, 62, 54, 0.1), 0 22px 44px rgba(61, 48, 36, 0.12);
}

.east-seat-ring img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.2rem;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 12px 10px rgba(61, 48, 36, 0.13));
  animation: mahjong-101-pop 520ms 180ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-east-board .east-seat {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 4.65rem;
  min-height: 2.25rem;
  border-radius: 999px;
  color: #fff;
  background: #008f83;
  font: 900 0.74rem var(--button-font);
  box-shadow: 0 12px 24px rgba(61, 48, 36, 0.14);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-east-board .east-seat-top { left: 50%; top: 0.25rem; transform: translateX(-50%); animation-delay: 90ms; }
.mahjong-101-east-board .east-seat-left { left: -0.15rem; top: 50%; transform: translateY(-50%); animation-delay: 170ms; }
.mahjong-101-east-board .east-seat-right {
  right: -0.15rem;
  top: 50%;
  background: #9370db;
  transform: translateY(-50%);
  animation-delay: 250ms;
}
.mahjong-101-east-board .east-seat-bottom { left: 50%; bottom: 0.25rem; transform: translateX(-50%); animation-delay: 330ms; }

.east-tile-counts {
  width: min(330px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.east-tile-counts article {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.75rem;
  border: 1px solid rgba(0, 150, 136, 0.14);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.82);
  text-align: center;
  box-shadow: 0 12px 24px rgba(61, 48, 36, 0.08);
}

.east-tile-counts strong {
  color: #2f2d2a;
  font: 900 0.96rem var(--button-font);
}

.east-tile-counts span {
  color: #796f65;
  font: 700 0.72rem "Merriweather", serif;
}

.mahjong-101-turn-path {
  width: min(390px, 100%);
  display: grid;
  gap: 0.62rem;
}

.mahjong-101-turn-path article {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.1rem 0.65rem;
  align-items: center;
  padding: 0.78rem 0.86rem;
  border: 1px solid rgba(70, 62, 54, 0.1);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 14px 26px rgba(61, 48, 36, 0.08);
  animation: mahjong-101-path-step 4200ms ease-in-out infinite;
}

.mahjong-101-turn-path article:nth-child(2) { animation-delay: 1050ms; }
.mahjong-101-turn-path article:nth-child(3) { animation-delay: 2100ms; }
.mahjong-101-turn-path article:nth-child(4) { animation-delay: 3150ms; }

.mahjong-101-turn-path article span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: #009688;
  font: 900 0.78rem var(--button-font);
}

.mahjong-101-turn-path article:nth-child(2) span { background: #9370db; }
.mahjong-101-turn-path article:nth-child(3) span { background: #c97948; }
.mahjong-101-turn-path article:nth-child(4) span { background: #23466f; }

.mahjong-101-turn-path strong {
  color: #2f2d2a;
  font: 900 0.82rem var(--button-font);
}

.mahjong-101-turn-path p {
  color: #665d55;
  font: 400 0.74rem "Merriweather", serif;
  line-height: 1.25;
}

.mahjong-101-rack-demo {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.15%;
  width: min(410px, 100%);
  min-height: 206px;
  padding: 1.75rem 1.3rem 1.58rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mahjong-101-rack-demo::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 1.55rem;
  right: 1.55rem;
  bottom: 1.55rem;
  height: 2.45rem;
  border-radius: 15px 15px 8px 8px;
  background: linear-gradient(180deg, #10ada4 0%, #00877f 58%, #006d68 100%);
  box-shadow:
    0 16px 28px rgba(0, 99, 93, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.mahjong-101-rack-demo::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 1rem;
  right: 1rem;
  bottom: 1.14rem;
  height: 0.78rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #08a199 0%, #00726d 100%);
  box-shadow:
    0 10px 14px rgba(0, 93, 88, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mahjong-101-rack-demo img {
  position: relative;
  z-index: 2;
  width: min(13.4%, 3.95rem);
  margin-bottom: 0.04rem;
  filter: drop-shadow(0 7px 6px rgba(61, 48, 36, 0.14));
  animation: mahjong-101-rack-drop 920ms cubic-bezier(0.17, 0.88, 0.28, 1.12) both;
}

.mahjong-101-rack-demo img:nth-child(2) { animation-delay: 70ms; }
.mahjong-101-rack-demo img:nth-child(3) { animation-delay: 140ms; }
.mahjong-101-rack-demo img:nth-child(4) { animation-delay: 210ms; }
.mahjong-101-rack-demo img:nth-child(5) { animation-delay: 280ms; }
.mahjong-101-rack-demo img:nth-child(6) { animation-delay: 350ms; }
.mahjong-101-rack-demo img:nth-child(7) { animation-delay: 420ms; }

.mahjong-101-card-preview {
  width: min(370px, 100%);
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid rgba(0, 150, 136, 0.2);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 22px 44px rgba(61, 48, 36, 0.13);
}

.mini-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #006f67;
  font: 900 0.86rem var(--button-font);
}

.mini-card-head strong {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  color: #fff;
  background: #9370db;
}

.mini-card-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.mini-token {
  padding: 0.38rem 0.46rem;
  border-radius: 8px;
  background: #fff8e7;
  font: 900 1.08rem var(--button-font);
  box-shadow: inset 0 0 0 1px rgba(70, 62, 54, 0.1);
}

.token-teal { color: #009688; }
.token-blue { color: #2e5fa4; }
.token-green { color: #159f67; }
.token-purple { color: #9370db; }
.token-gold { color: #a77510; }
.token-flower { color: #c05d42; }
.token-black { color: #1f2532; }

.mahjong-101-card-preview p {
  color: #5d554e;
  font: 400 0.92rem "Merriweather", serif;
}

.mahjong-101-app-card-snapshot {
  width: min(410px, 100%);
  max-height: 430px;
  display: grid;
  gap: 0.62rem;
  padding: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(0, 150, 136, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 252, 250, 0.96)),
    #fffdf8;
  box-shadow: 0 22px 44px rgba(61, 48, 36, 0.12);
}

.mini-app-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.42rem;
  border-bottom: 1px solid rgba(35, 70, 111, 0.18);
}

.mini-app-panel-head h3 {
  color: #2f2d2a;
  font-family: "Merriweather", serif;
  font-size: 1rem;
  line-height: 1;
}

.mini-pinned-strip {
  display: grid;
  gap: 0.25rem;
  padding: 0.62rem 0.72rem;
  border-left: 4px solid #009688;
  border-radius: 12px;
  background: rgba(0, 150, 136, 0.08);
}

.mini-pinned-strip span {
  color: #006f67;
  font: 900 0.68rem var(--button-font);
}

.mini-pinned-strip strong {
  color: #33413e;
  font: 700 0.78rem "Merriweather", serif;
  line-height: 1.28;
}

.mini-compass-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mini-compass-strip span {
  display: inline-grid;
  place-items: center;
  min-height: 1.55rem;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  color: #fff;
  background: #009688;
  font: 900 0.66rem var(--button-font);
}

.mini-compass-strip span:nth-child(2) {
  background: #9370db;
}

.mini-compass-strip span:nth-child(3) {
  background: #c97948;
}

.mini-card-sections {
  display: grid;
  gap: 0.52rem;
}

.mini-card-sections article {
  display: grid;
  gap: 0.36rem;
  padding: 0.58rem 0.66rem;
  border: 1px solid rgba(35, 70, 111, 0.12);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.78);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mini-card-sections article:nth-child(2) {
  animation-delay: 80ms;
}

.mini-card-sections article:nth-child(3) {
  animation-delay: 160ms;
}

.mini-card-sections article div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--card-meta-blue);
}

.mini-card-sections strong {
  font: 900 0.78rem var(--button-font);
}

.mini-card-sections em {
  font: 800 0.64rem var(--button-font);
  font-style: normal;
  opacity: 0.72;
}

.mini-card-sections p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}

.mini-card-sections .mini-real-card-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.42rem;
}

.mini-card-sections .mini-real-card-line .mini-token {
  font-size: 0.78rem;
  line-height: 1.1;
}

.mini-real-card-line b {
  display: grid;
  place-items: center;
  min-width: 2.7rem;
  height: 1.7rem;
  border-radius: 999px;
  color: #fff;
  background: var(--card-meta-blue);
  font: 900 0.62rem var(--button-font);
  white-space: nowrap;
}

.mini-card-sections small {
  color: var(--card-meta-blue);
  font: 700 0.66rem "Merriweather", serif;
  line-height: 1.25;
}

.mahjong-101-card-reader {
  width: min(410px, 100%);
  display: grid;
  gap: 0.8rem;
}

.mahjong-101-card-reader-diagram {
  position: relative;
  width: min(620px, 100%);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  align-items: end;
  gap: 0.45rem 0.8rem;
}

.reader-line-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem;
  border: 1px solid rgba(35, 70, 111, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(247, 252, 250, 0.9)),
    #fffdf8;
  box-shadow: 0 18px 34px rgba(61, 48, 36, 0.1);
}

.reader-real-hand-card {
  gap: 0.62rem;
}

.reader-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  color: var(--card-meta-blue);
  font-family: var(--button-font);
}

.reader-section-row span {
  font-weight: 900;
}

.reader-section-row em {
  margin-right: auto;
  color: #6b7481;
  font: 900 0.66rem/1 var(--button-font);
  font-style: normal;
  white-space: nowrap;
}

.reader-section-row strong {
  display: grid;
  place-items: center;
  min-width: 3.1rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: #23466f;
  font-size: 0.76rem;
}

.reader-pattern-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.reader-real-hand-card .reader-pattern-row {
  gap: 0.28rem;
}

.reader-real-hand-card .mini-token {
  font-size: 0.98rem;
  line-height: 1.05;
}

.reader-line-card p {
  color: var(--card-meta-blue);
  font: 700 0.78rem "Merriweather", serif;
  line-height: 1.35;
}

.reader-diagram-hand {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 1rem;
  min-height: 13.2rem;
  padding: 1.32rem 1.55rem;
  border-radius: 24px;
  box-shadow: 0 20px 38px rgba(61, 48, 36, 0.1);
}

.reader-diagram-hand .reader-section-row {
  align-items: center;
}

.reader-diagram-hand .reader-section-row span {
  color: var(--card-meta-blue);
  font: 900 2.85rem/0.95 "Merriweather", serif;
}

.reader-diagram-hand .reader-section-row strong {
  min-width: 4.7rem;
  height: 2.55rem;
  font-size: 1.16rem;
  box-shadow: 0 10px 18px rgba(35, 70, 111, 0.18);
}

.reader-diagram-hand .reader-pattern-row {
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.36rem;
}

.reader-diagram-hand .mini-token {
  min-width: 3.55rem;
  padding: 0.48rem 0.56rem;
  text-align: center;
  font-size: 1.38rem;
  border-radius: 10px;
}

.reader-diagram-hand p {
  justify-self: center;
  transform: translateX(-1.7rem);
  font-size: 1.06rem;
  line-height: 1.2;
}

.reader-callout {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 0.16rem;
  width: 100%;
  color: var(--card-meta-blue);
  font-family: "Merriweather", serif;
  line-height: 1.18;
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.reader-callout strong {
  color: var(--card-meta-blue);
  font-size: 1.08rem;
  line-height: 1.05;
}

.reader-callout span {
  color: #3c4747;
  font-size: 0.84rem;
  line-height: 1.2;
}

.reader-callout-section {
  grid-column: 1 / span 2;
  grid-row: 1;
  justify-self: start;
  padding: 0 0 2.05rem 1.9rem;
}

.reader-callout-points {
  grid-column: 5 / span 2;
  grid-row: 1;
  justify-self: end;
  padding: 0 1.3rem 2.05rem 0;
}

.reader-callout-special {
  grid-column: 1 / span 2;
  grid-row: 3;
  justify-self: start;
  top: -3rem;
  padding: 1.25rem 0 0 1.9rem;
  animation-delay: 80ms;
}

.reader-callout-variation {
  grid-column: 3 / span 2;
  grid-row: 3;
  justify-self: center;
  padding-top: 2.15rem;
  animation-delay: 140ms;
}

.reader-callout-colors {
  grid-column: 5 / span 2;
  grid-row: 3;
  justify-self: end;
  padding: 2.15rem 0 0 0.2rem;
  animation-delay: 200ms;
}

.reader-guide,
.reader-color-guide {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  color: #159f67;
}

.reader-guide {
  width: 1.15rem;
  overflow: visible;
  transform: translateX(-50%);
}

.reader-guide path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-arrow-green,
.reader-color-guide {
  color: #159f67;
}

.reader-arrow-blue {
  color: #2e5fa4;
}

.reader-arrow-orange {
  color: #c97948;
}

.reader-guide-section {
  left: 12.6%;
  top: 19.6%;
  height: 10.8%;
}

.reader-guide-section path,
.reader-guide-points path {
  stroke-width: 4.9;
}

.reader-guide-points {
  left: 78.9%;
  top: 19.6%;
  height: 9.8%;
}

.reader-guide-special {
  left: 3.2%;
  top: 48.6%;
  width: 18.8%;
  height: 26.8%;
  transform: none;
}

.reader-guide-variation {
  left: 50.7%;
  top: 64.8%;
  width: 1.45rem;
  height: 13.2%;
}

.reader-guide-variation path {
  stroke-width: 4.9;
}

.reader-color-guide {
  left: 56.6%;
  top: 46.8%;
  width: 25.4%;
  height: 30.8%;
  overflow: visible;
}

.reader-color-guide path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-color-guide marker path {
  stroke: #159f67;
  stroke-width: 1.6;
}

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

.reader-steps article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.12rem 0.58rem;
  align-items: start;
  padding: 0.68rem 0.72rem;
  border: 1px solid rgba(0, 150, 136, 0.12);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 10px 20px rgba(61, 48, 36, 0.07);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.reader-steps article:nth-child(2) { animation-delay: 70ms; }
.reader-steps article:nth-child(3) { animation-delay: 140ms; }
.reader-steps article:nth-child(4) { animation-delay: 210ms; }

.reader-steps article span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  color: #fff;
  background: #009688;
  font: 900 0.78rem var(--button-font);
  box-shadow: 0 8px 16px rgba(0, 122, 112, 0.18);
}

.reader-steps article:nth-child(2) span {
  background: #9370db;
}

.reader-steps article:nth-child(3) span {
  background: #c97948;
}

.reader-steps article:nth-child(4) span {
  background: #23466f;
}

.reader-steps strong {
  color: #2f2d2a;
  font: 900 0.75rem var(--button-font);
  line-height: 1.15;
}

.reader-steps p {
  color: #665d55;
  font: 400 0.72rem "Merriweather", serif;
  line-height: 1.28;
}

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

.reader-legend article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.12rem 0.42rem;
  align-items: start;
  padding: 0.58rem;
  border: 1px solid rgba(70, 62, 54, 0.1);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
  animation: mahjong-101-pop 420ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.reader-legend article:nth-child(2) { animation-delay: 50ms; }
.reader-legend article:nth-child(3) { animation-delay: 100ms; }
.reader-legend article:nth-child(4) { animation-delay: 150ms; }

.legend-dot {
  grid-row: 1 / span 2;
  width: 0.76rem;
  height: 0.76rem;
  margin-top: 0.12rem;
  border-radius: 999px;
}

.legend-teal { background: #009688; }
.legend-blue { background: #2e5fa4; }
.legend-purple { background: #9370db; }
.legend-gold { background: #daa520; }
.legend-coral { background: #c97948; }
.legend-black { background: #1f2532; }

.reader-legend strong {
  color: #2f2d2a;
  font: 900 0.72rem var(--button-font);
  line-height: 1.12;
}

.reader-legend p {
  grid-column: 2;
  color: #796f65;
  font: 400 0.7rem "Merriweather", serif;
  line-height: 1.25;
}

.mahjong-101-choice-wheel {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffdf8 0 28%, rgba(0, 150, 136, 0.12) 29% 52%, rgba(147, 112, 219, 0.13) 53% 100%);
  box-shadow: inset 0 0 0 1px rgba(70, 62, 54, 0.1), 0 22px 44px rgba(61, 48, 36, 0.12);
}

.mahjong-101-choice-wheel span {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 5rem;
  min-height: 2.35rem;
  border-radius: 999px;
  color: #fff;
  background: #008f83;
  font: 900 0.8rem var(--button-font);
  box-shadow: 0 12px 24px rgba(61, 48, 36, 0.14);
  animation: mahjong-101-choice-pulse 7000ms ease-in-out infinite;
}

.mahjong-101-choice-wheel span:nth-child(1) { left: 50%; top: 0.2rem; transform: translateX(-50%); }
.mahjong-101-choice-wheel span:nth-child(2) { right: -0.2rem; top: 30%; background: #9370db; animation-delay: 1400ms; }
.mahjong-101-choice-wheel span:nth-child(3) { right: 1.4rem; bottom: 1.6rem; background: #c97948; animation-delay: 2800ms; }
.mahjong-101-choice-wheel span:nth-child(4) { left: 1.4rem; bottom: 1.6rem; background: #7494d4; animation-delay: 4200ms; }
.mahjong-101-choice-wheel span:nth-child(5) { left: -0.2rem; top: 30%; background: #006f67; animation-delay: 5600ms; }

.mahjong-101-compass-card {
  width: min(390px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.05rem;
  border: 1px solid rgba(0, 150, 136, 0.18);
  border-radius: 18px;
  background: rgba(247, 252, 250, 0.92);
  box-shadow: 0 22px 44px rgba(61, 48, 36, 0.12);
}

.mahjong-101-compass-card img {
  width: 4.7rem;
  filter: drop-shadow(0 12px 10px rgba(61, 48, 36, 0.12));
}

.mahjong-101-compass-card span {
  display: block;
  color: #008f83;
  font: 900 0.84rem var(--button-font);
}

.mahjong-101-compass-card strong {
  display: block;
  margin-top: 0.28rem;
  color: #2f2d2a;
  font: 700 1.08rem "Merriweather", serif;
  line-height: 1.28;
}

.mahjong-101-finale-card {
  width: min(440px, 100%);
  display: grid;
  justify-items: center;
  padding: 0;
}

.mahjong-101-finale-logo {
  width: min(390px, 100%);
  height: auto;
  filter: drop-shadow(0 20px 28px rgba(61, 48, 36, 0.11));
  animation: mahjong-101-pop 520ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-slide[data-slide="13"] {
  grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.08fr);
}

.mahjong-101-finale-tiles {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.36rem;
}

.mahjong-101-finale-tiles img {
  width: 3.25rem;
  filter: drop-shadow(0 9px 8px rgba(61, 48, 36, 0.12));
  animation: mahjong-101-pop 520ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

.mahjong-101-finale-tiles img:nth-child(2) { animation-delay: 70ms; }
.mahjong-101-finale-tiles img:nth-child(3) { animation-delay: 140ms; }

.mahjong-101-finale-note {
  width: 100%;
  display: grid;
  gap: 0.3rem;
  padding: 0.86rem;
  border-radius: 14px;
  background: rgba(0, 150, 136, 0.08);
  text-align: center;
}

.mahjong-101-finale-note span {
  color: #008f83;
  font: 900 0.78rem var(--button-font);
}

.mahjong-101-finale-note strong {
  color: #2f2d2a;
  font: 700 1rem "Merriweather", serif;
  line-height: 1.28;
}

.mahjong-101-slide[data-slide="13"] .mahjong-101-copy {
  gap: 0.62rem;
}

.mahjong-101-slide[data-slide="13"] .mahjong-101-copy h2 {
  max-width: min(100%, 19ch);
  overflow: visible;
  font-size: clamp(2rem, 3vw, 2.32rem);
}

.mahjong-101-finale-title {
  max-width: 18ch;
}

.mahjong-101-title-word {
  display: inline-block;
  white-space: nowrap;
}

.mahjong-101-title-letter {
  display: inline-block;
  opacity: 0;
  animation: mahjong-101-title-type 1ms step-end forwards;
  animation-delay: calc(var(--letter-index) * 34ms);
}

.mahjong-101-finale-title.title-complete .mahjong-101-title-letter {
  opacity: 1;
}

.mahjong-101-slide[data-slide="13"] .mahjong-101-body-copy {
  font-size: 1rem;
  line-height: 1.48;
}

.mahjong-101-finale-actions {
  display: grid;
  gap: 0.82rem;
  width: min(100%, 25rem);
  margin-top: clamp(1.25rem, 2.8vw, 2.1rem);
  padding: 0.1rem 0 0;
}

.mahjong-101-finale-next {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  margin: 0;
  color: #463f36;
  font: 700 0.98rem/1.2 "Merriweather", serif;
}

.mahjong-101-finale-next span {
  flex: 0 0 auto;
  color: #008f83;
  font: 900 0.72rem/1 var(--button-font);
  text-transform: uppercase;
  letter-spacing: 0;
}

.mahjong-101-finale-play-row {
  display: grid;
}

.mahjong-101-finale-or {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.68rem;
  padding: 0.12rem 0;
  color: #7b7067;
  font: 900 0.7rem/1 var(--button-font);
  letter-spacing: 0;
  text-transform: uppercase;
}

.mahjong-101-finale-or::before,
.mahjong-101-finale-or::after {
  content: "";
  height: 1px;
  background: rgba(0, 122, 112, 0.18);
}

.mahjong-101-finale-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.45rem;
  padding: 0.9rem 1.1rem;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font: 900 0.9rem/1 var(--button-font);
  text-align: center;
  box-shadow:
    0 10px 18px rgba(24, 38, 35, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.36);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.mahjong-101-finale-btn:hover,
.mahjong-101-finale-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 14px 22px rgba(24, 38, 35, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.mahjong-101-finale-btn-learn {
  color: #fffdf8;
  background: #009688;
}

.mahjong-101-finale-btn-play {
  color: #fffdf8;
  background: #9370DB;
}

@keyframes mahjong-101-slide-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes mahjong-101-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mahjong-101-title-type {
  to {
    opacity: 1;
  }
}

@keyframes mahjong-101-rack-drop {
  0% {
    opacity: 0;
    transform: translateY(-4.2rem) scale(0.92) rotate(-2deg);
  }
  58% {
    opacity: 1;
    transform: translateY(0.42rem) scale(1.02) rotate(1deg);
  }
  76% {
    transform: translateY(-0.18rem) scale(0.99) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes mahjong-101-tile-float {
  0%, 100% {
    margin-top: 0;
  }
  50% {
    margin-top: -0.5rem;
  }
}

@keyframes mahjong-101-seat-pop {
  from {
    opacity: 0;
    transform: translate(var(--seat-x), var(--seat-y)) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translate(var(--seat-x), var(--seat-y)) scale(1);
  }
}

@keyframes mahjong-101-choice-pulse {
  0%, 18%, 100% {
    scale: 1;
    box-shadow: 0 12px 24px rgba(61, 48, 36, 0.14);
  }
  6%, 12% {
    scale: 1.16;
    box-shadow:
      0 0 0 0.42rem rgba(0, 150, 136, 0.12),
      0 17px 30px rgba(61, 48, 36, 0.2);
  }
}

@keyframes mahjong-101-path-step {
  0%, 22%, 100% {
    scale: 1;
    box-shadow: 0 14px 26px rgba(61, 48, 36, 0.08);
  }
  7%, 14% {
    scale: 1.045;
    box-shadow:
      0 0 0 0.35rem rgba(0, 150, 136, 0.1),
      0 18px 32px rgba(61, 48, 36, 0.13);
  }
}

@keyframes mahjong-101-seat-turn {
  0%, 21%, 100% {
    scale: 1;
    box-shadow: 0 12px 24px rgba(0, 122, 112, 0.18);
  }
  6%, 15% {
    scale: 1.18;
    box-shadow:
      0 0 0 0.42rem rgba(0, 150, 136, 0.14),
      0 17px 30px rgba(0, 122, 112, 0.24);
  }
}

@media (max-width: 620px) {
  .assist-mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-choice {
    min-height: 5.4rem;
  }

  .tile-style-choice-grid {
    grid-template-columns: 1fr;
  }

  .learn-table-prompt {
    grid-template-columns: auto auto auto;
    justify-content: center;
    padding: 0.52rem 0 0;
  }

  .learn-table-mini-tiles {
    display: none;
  }

  .learn-table-btn {
    width: auto;
  }

  .mahjong-101-card {
    min-height: calc(100vh - 1.5rem);
  }

  .mahjong-101-slide {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 0.9rem;
  }

  .mahjong-101-visual {
    min-height: 230px;
  }

  .mahjong-101-copy h2 {
    max-width: none;
    font-size: 1.82rem;
  }

  .mahjong-101-body-copy {
    font-size: 0.98rem;
  }

  .mahjong-101-tile-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mahjong-101-special-tiles {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .east-seat-ring {
    width: min(250px, 100%);
  }

  .mahjong-101-east-board .east-seat {
    min-width: 4.1rem;
    min-height: 2.05rem;
    font-size: 0.68rem;
  }

  .mahjong-101-suit-counts section,
  .mahjong-101-special-tiles article,
  .mahjong-101-honor-board section,
  .mahjong-101-group-board article,
  .mahjong-101-pattern-board article,
  .east-tile-counts article,
  .mahjong-101-turn-path article {
    padding: 0.62rem;
  }

  .mahjong-101-tile-gallery img {
    width: 2.55rem;
  }

  .mahjong-101-rack-demo img {
    width: clamp(2.35rem, 11vw, 3rem);
  }

  .special-tile-fan img {
    width: 3.1rem;
  }

  .honor-tile-row img {
    width: 2.45rem;
  }

  .suit-tile-row img {
    width: 100%;
    max-width: 1.28rem;
  }

  .special-tile-fan {
    min-height: 5.2rem;
  }

  .group-tile-row img {
    width: 2rem;
    margin-right: -0.78rem;
  }

  .reader-legend {
    grid-template-columns: 1fr;
  }

  .mahjong-101-card-reader-diagram {
    width: min(390px, 100%);
    gap: 0.28rem 0.35rem;
  }

  .reader-diagram-hand {
    min-height: 9.4rem;
    gap: 0.5rem;
    padding: 0.72rem 0.78rem;
    border-radius: 18px;
  }

  .reader-diagram-hand .reader-section-row span {
    font-size: 1.78rem;
  }

  .reader-diagram-hand .reader-section-row strong {
    min-width: 3.3rem;
    height: 1.95rem;
    font-size: 0.78rem;
  }

  .reader-diagram-hand .reader-pattern-row {
    gap: 0.26rem;
  }

  .reader-diagram-hand .mini-token {
    min-width: 2.62rem;
    padding: 0.38rem 0.42rem;
    font-size: 1.02rem;
  }

  .reader-diagram-hand p {
    transform: translateX(-0.75rem);
    font-size: 0.72rem;
  }

  .reader-callout strong {
    font-size: 0.72rem;
  }

  .reader-callout span {
    font-size: 0.6rem;
  }

  .reader-callout-section {
    padding: 0 0 1.15rem 0.2rem;
  }

  .reader-callout-points {
    padding: 0 0.15rem 1.15rem 0;
  }

  .reader-callout-variation,
  .reader-callout-colors {
    padding-top: 1.2rem;
  }

  .reader-callout-special {
    top: -2.15rem;
    padding-top: 0.76rem;
  }

  .reader-guide-section {
    left: 11.8%;
    top: 20.2%;
    height: 10.1%;
  }

  .reader-guide-points {
    left: 80.2%;
    top: 20.2%;
    height: 9.2%;
  }

  .reader-guide-section path,
  .reader-guide-points path {
    stroke-width: 5;
  }

  .reader-guide-special {
    left: 3.4%;
    top: 49%;
    width: 18.4%;
    height: 25.4%;
  }

  .reader-guide path {
    stroke-width: 3.9;
  }

  .reader-guide-variation {
    left: 50.5%;
    top: 64.8%;
    width: 1.2rem;
    height: 11.2%;
  }

  .reader-guide-variation path {
    stroke-width: 5;
  }

  .reader-color-guide {
    left: 56.8%;
    top: 47.8%;
    width: 25.2%;
    height: 28.6%;
  }

  .reader-color-guide path {
    stroke-width: 2.6;
  }

  .reader-color-guide marker path {
    stroke-width: 1.8;
  }

  .reader-steps {
    grid-template-columns: 1fr;
  }

  .mahjong-101-app-card-snapshot {
    max-height: 340px;
  }

  .mahjong-101-actions {
    align-items: stretch;
  }

  .mahjong-101-finale-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  /* The finale has a more specific desktop column rule than the shared
     slide layout. Collapse it explicitly, then scale its artwork and copy
     against both viewport dimensions so the complete slide fits on phones. */
  .mahjong-101-slide[data-slide="13"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: clamp(0.45rem, 1.4vh, 0.75rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-visual {
    min-height: 0;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-finale-logo {
    width: clamp(6.5rem, 34vw, 10rem);
    max-height: clamp(6.5rem, 22vh, 10rem);
    object-fit: contain;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-copy {
    justify-items: center;
    gap: clamp(0.35rem, 1vh, 0.58rem);
    width: 100%;
    text-align: center;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-copy h2 {
    max-width: 20ch;
    font-size: clamp(1.45rem, 7vw, 1.75rem);
    line-height: 1.05;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-body-copy {
    font-size: clamp(0.86rem, 3.8vw, 0.96rem);
    line-height: 1.35;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-finale-actions {
    gap: 0.5rem;
    width: min(100%, 20rem);
    margin-top: 0.2rem;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-finale-next {
    justify-content: center;
    font-size: 0.86rem;
  }

  .mahjong-101-slide[data-slide="13"] .mahjong-101-finale-btn {
    min-height: 2.9rem;
    padding: 0.72rem 0.9rem;
  }

  .mahjong-101-back,
  .mahjong-101-next {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 430px) {
  .learn-table-prompt {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.42rem;
  }

  .learn-table-copy {
    border-right: 0;
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mahjong-101-slide,
  .mahjong-101-center-tile,
  .mahjong-101-tile-gallery figure,
  .mahjong-101-joker-callout,
  .mahjong-101-suit-counts section,
  .mahjong-101-honor-board section,
  .mahjong-101-special-tiles article,
  .mahjong-101-group-board article,
  .mahjong-101-pattern-board article,
  .mini-card-sections article,
  .reader-callout,
  .reader-steps article,
  .reader-legend article,
  .mahjong-101-seat-map .seat,
  .mahjong-101-east-board .east-seat,
  .east-seat-ring img,
  .mahjong-101-turn-path article,
  .mahjong-101-rack-demo img,
  .mahjong-101-choice-wheel span,
  .mahjong-101-finale-logo,
  .mahjong-101-finale-tiles img,
  .mahjong-101-title-letter {
    animation: none !important;
  }

  .mahjong-101-title-letter {
    opacity: 1 !important;
  }

  .mahjong-101-seat-map .seat {
    opacity: 1;
    transform: translate(var(--seat-x), var(--seat-y)) scale(1);
    scale: 1;
  }
}

/* Keep staged-discard actions contained without resizing the Compass Coach row. */
@media (min-width: 900px) {
  .board-bottom-right > #draw-panel:has(#discard-tray:not(.hidden)),
  .board-bottom-right > #draw-panel:has(#joker-exchange-actions:not(.hidden)) {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .board-bottom-right > #draw-panel:has(#discard-tray:not(.hidden)) .right-strategy-panel {
    gap: 0.2rem;
  }

  .board-bottom-right > #draw-panel:has(#discard-tray:not(.hidden)) .discard-tray {
    margin-top: 0.28rem;
    padding: 0.34rem 0 0.34rem 1rem;
  }
}

#discard-tray,
#joker-exchange-actions {
  scroll-margin-block: 0.75rem;
}

/* Regular play keeps the fixed board panels; short windows scroll the page instead of shrinking/clipping them. */
@media (min-width: 900px) {
  body:not(.charleston-active):not(.table-tour-active) .app-shell:has(> #game-view.board-layout:not(.hidden) #turn-lane-panel:not(.hidden)) {
    --regular-game-min-height: 760px;
    height: max(100dvh, var(--regular-game-min-height));
    min-height: var(--regular-game-min-height);
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding-bottom: 0.55rem;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: clamp(290px, 36vh, 368px) minmax(0, 1fr);
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-hand-slot,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-hand-slot .hero-hand-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-grid {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: visible;
    align-items: stretch;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    align-items: stretch;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right {
    grid-template-rows: minmax(166px, 1fr) minmax(158px, 0.92fr);
    align-content: stretch;
    gap: var(--board-gap);
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left {
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left > #hand-card-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    box-shadow: none;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left > #hand-card-panel .hand-card-scroll {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #draw-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel > #discard-history-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel > #discard-history-panel #discard-history-row.discard-pool {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0.56rem;
    padding-bottom: 0.54rem;
  }

  body:not(.charleston-active):not(.table-tour-active) #regular-game-footer:not(.hidden) {
    position: relative;
    z-index: 1;
    margin-top: clamp(1.2rem, 2.8vh, 2rem);
  }
}

@media (min-width: 900px) and (max-height: 760px) {
  body:not(.charleston-active):not(.table-tour-active) .app-shell:has(> #game-view.board-layout:not(.hidden) #turn-lane-panel:not(.hidden)) {
    height: max(100dvh, var(--regular-game-min-height, 760px));
    min-height: var(--regular-game-min-height, 760px);
    max-height: none;
    overflow: hidden;
    padding-bottom: 0.55rem;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: clamp(264px, 32vh, 336px) minmax(0, 1fr);
    overflow: hidden;
  }
}

@media (max-width: 899px) {
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-grid,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left,
  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right {
    align-items: start;
    overflow: visible;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left > #hand-card-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: clamp(22rem, 58dvh, 34rem);
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-left > #hand-card-panel .hand-card-scroll {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right {
    grid-template-rows: auto auto;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #draw-panel:not(.hidden) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    height: clamp(16rem, 42dvh, 24rem);
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #draw-panel:has(.round-result-card):not(.hidden) {
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    scrollbar-gutter: auto;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel:not(.hidden) {
    height: clamp(13rem, 30dvh, 16rem);
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel > #discard-history-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  body:not(.charleston-active):not(.table-tour-active) #game-view.board-layout:has(#turn-lane-panel:not(.hidden)) .board-bottom-right > #turn-lane-panel > #discard-history-panel #discard-history-row.discard-pool {
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    padding-bottom: 0.54rem;
  }
}

/* Live Charleston uses the same bounded-panel model without affecting the Learn the Table tour. */
@media (min-width: 900px) {
  body.charleston-active:not(.table-tour-active) .app-shell:has(> #game-view.board-layout:not(.hidden) #draw-panel.charleston-incoming-panel:not(.hidden)) {
    --charleston-game-min-height: 760px;
    height: max(100dvh, var(--charleston-game-min-height));
    min-height: var(--charleston-game-min-height);
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding-bottom: 0.55rem;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: clamp(264px, 32vh, 336px) minmax(0, 1fr);
    overflow: hidden;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-hand-slot,
  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-hand-slot .hero-hand-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-grid {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    overflow: visible;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-left,
  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-right {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    align-items: stretch;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-left {
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-right {
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-left > #hand-card-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-left > #hand-card-panel .hand-card-scroll {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-right > #draw-panel.charleston-incoming-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: clip;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
}

@media (max-width: 899px) {
  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-grid,
  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-left,
  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-right {
    align-items: start;
    overflow: visible;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-left > #hand-card-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: clamp(22rem, 58dvh, 34rem);
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-left > #hand-card-panel .hand-card-scroll {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }

  body.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-right > #draw-panel.charleston-incoming-panel:not(.hidden) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: clamp(18rem, 48dvh, 28rem);
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
}

/* Free Play Charleston keeps the pass/incoming tiles anchored in the middle of the panel. */
body.help-solo.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-right > #draw-panel.charleston-incoming-panel {
  grid-template-rows: auto minmax(0, max-content) minmax(clamp(9rem, 18vh, 12rem), 1fr) auto;
}

body.help-solo.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .right-table-preview {
  display: grid;
  align-self: stretch;
  align-content: center;
  min-height: clamp(9rem, 18vh, 12rem);
  height: 100%;
}

body.help-solo.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel #draw-slot {
  display: grid;
  align-self: center;
  align-items: center;
  justify-content: stretch;
  min-height: clamp(8rem, 16vh, 10.75rem);
  height: 100%;
  margin-top: 0;
}

body.help-solo.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .charleston-simple-split {
  align-self: center;
  align-items: center;
  min-height: clamp(7.25rem, 14vh, 9.5rem);
  height: auto;
}

body.help-solo.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .charleston-simple-col {
  grid-template-rows: auto clamp(5.5rem, 10vh, 7rem);
  align-content: center;
  align-items: stretch;
}

body.help-solo.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .charleston-simple-row {
  align-items: center;
  min-height: clamp(5.5rem, 10vh, 7rem);
  padding-top: 0;
}

body.help-solo.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .swap-empty-hint {
  display: flex;
  align-items: center;
  min-height: clamp(5.5rem, 10vh, 7rem);
  margin: 0;
}

/* Compass Mode Charleston reserves coach space so changing advice does not nudge the tile rows. */
body.help-teacher.charleston-active:not(.table-tour-active) #game-view.board-layout:has(#draw-panel.charleston-incoming-panel:not(.hidden)) .board-bottom-right > #draw-panel.charleston-incoming-panel {
  grid-template-rows: auto clamp(7.5rem, 14vh, 10rem) minmax(clamp(9rem, 18vh, 12rem), 1fr) auto;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .right-strategy-panel.charleston-coach-panel {
  align-self: stretch;
  align-content: start;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .right-strategy-panel.charleston-coach-panel .draw-decision-hint {
  min-height: 3.2rem;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .right-table-preview {
  display: grid;
  align-self: stretch;
  align-content: center;
  min-height: clamp(9rem, 18vh, 12rem);
  height: 100%;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel #draw-slot {
  display: grid;
  align-self: center;
  align-items: center;
  justify-content: stretch;
  min-height: clamp(8rem, 16vh, 10.75rem);
  height: 100%;
  margin-top: 0;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .charleston-simple-split {
  align-self: center;
  align-items: center;
  min-height: clamp(7.25rem, 14vh, 9.5rem);
  height: auto;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .charleston-simple-col {
  grid-template-rows: auto clamp(5.5rem, 10vh, 7rem);
  align-content: center;
  align-items: stretch;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .charleston-simple-row {
  align-items: center;
  min-height: clamp(5.5rem, 10vh, 7rem);
  padding-top: 0;
}

body.help-teacher.charleston-active:not(.table-tour-active) #draw-panel.charleston-incoming-panel .swap-empty-hint {
  display: flex;
  align-items: center;
  min-height: clamp(5.5rem, 10vh, 7rem);
  margin: 0;
}

/* Canonical My Table dashboard */
.profile-view {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: clamp(0.85rem, 1.45vw, 1.2rem);
}

.profile-dashboard {
  width: min(100%, 1440px);
  min-height: 0;
  padding-bottom: clamp(0.8rem, 1.6vw, 1.4rem);
}

.profile-table-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(clamp(18rem, 28vw, 330px), 0.72fr);
  gap: clamp(0.78rem, 1.05vw, 1rem);
  align-items: stretch;
  min-height: 0;
}

.profile-progress-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(0.72rem, 1vw, 0.95rem);
  padding: clamp(0.95rem, 1.35vw, 1.2rem);
  border-radius: 16px;
}

.profile-progress-panel-head {
  grid-template-columns: minmax(9rem, 0.55fr) minmax(0, 1fr);
  gap: 0.68rem 0.9rem;
  padding-bottom: 0.76rem;
}

.profile-total-points strong {
  font-size: clamp(3rem, 4.2vw, 4.6rem);
}

.profile-points-split {
  gap: 0.5rem;
}

.profile-points-split p {
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(0, 150, 136, 0.12);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
}

.profile-stat-tile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: clamp(0.55rem, 0.8vw, 0.72rem);
}

.profile-stat-summary-bar {
  min-height: 0;
}

.profile-stat-summary-item {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-height: 3.65rem;
  padding: 0.68rem 0.78rem;
  gap: 0.5rem;
}

.profile-stat-summary-item strong {
  flex: 0 0 auto;
  font-size: clamp(1.75rem, 2.35vw, 2.55rem);
}

.profile-stat-summary-item span {
  color: #504a45;
  font-size: clamp(0.74rem, 0.86vw, 0.86rem);
  line-height: 1.1;
}

.profile-stat-tile {
  min-height: 6.8rem;
  padding: 0.72rem 0.78rem;
  align-items: center;
}

.profile-stat-icon {
  width: clamp(2.7rem, 3.2vw, 3.4rem);
  border-radius: 14px;
}

.profile-stat-tile strong {
  font-size: clamp(1.55rem, 2.1vw, 2.35rem);
}

.profile-stat-tile p,
.profile-detail-card p {
  font-size: clamp(0.78rem, 0.9vw, 0.9rem);
}

.profile-stat-tile-mastery {
  min-height: 5.9rem;
}

.profile-activity-card {
  grid-column: 1 / -1;
  min-height: 6.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.76rem 0.84rem;
}

.profile-activity-card .profile-recent-list {
  margin-top: 0.48rem;
  max-height: clamp(3.1rem, 9dvh, 5.2rem);
  gap: 0.28rem;
}

.profile-activity-card .profile-recent-list li {
  align-items: baseline;
  font-size: 0.82rem;
}

.profile-activity-tiles img {
  width: clamp(2.25rem, 3vw, 3rem);
}

.profile-side-stack {
  min-height: 0;
  grid-template-rows: minmax(0, 0.72fr) minmax(0, 1fr);
}

.profile-side-stack .profile-next-step-card,
.profile-side-stack .profile-support-card {
  border-radius: 16px;
}

.profile-side-stack .profile-next-step-card {
  min-height: 0;
  align-content: center;
}

.profile-side-stack .profile-snapshot-card {
  grid-template-columns: clamp(5rem, 6.8vw, 6.4rem) minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "avatar copy"
    "avatar action";
  align-items: center;
  column-gap: clamp(0.92rem, 1.6vw, 1.28rem);
  row-gap: 0.7rem;
  padding: clamp(1rem, 1.65vw, 1.45rem);
}

.profile-side-stack .profile-snapshot-avatar {
  grid-area: avatar;
  align-self: center;
  width: clamp(5rem, 6.8vw, 6.4rem);
  border-radius: 18px;
  font-size: clamp(1.95rem, 2.7vw, 2.75rem);
}

.profile-side-stack .profile-snapshot-copy {
  grid-area: copy;
  max-width: none;
}

.profile-side-stack .profile-snapshot-list {
  grid-template-columns: 1fr;
  gap: 0.3rem;
}

.profile-side-stack .profile-snapshot-list p {
  grid-template-columns: minmax(5.7rem, 0.4fr) minmax(0, 1fr);
  padding: 0.16rem 0;
}

.profile-side-stack .profile-snapshot-list span {
  font-size: 0.62rem;
}

.profile-side-stack .profile-snapshot-list strong {
  font-size: clamp(0.74rem, 0.84vw, 0.88rem);
}

.profile-side-stack .profile-next-step-copy strong {
  font-size: clamp(1.55rem, 2.1vw, 2.15rem);
}

.profile-side-stack .profile-next-step-copy .profile-snapshot-list strong {
  font-size: clamp(0.76rem, 0.85vw, 0.88rem);
}

.profile-side-stack .profile-snapshot-card .profile-action-btn {
  grid-area: action;
  justify-self: start;
}

.profile-side-stack .profile-next-step-copy p,
.profile-side-stack .profile-support-copy p {
  font-size: clamp(0.8rem, 0.92vw, 0.94rem);
}

.profile-side-stack .profile-support-card {
  min-height: 0;
  min-width: 0;
  grid-template-columns: minmax(0, 0.9fr) minmax(9.5rem, 0.86fr);
  column-gap: clamp(1rem, 2.35vw, 2rem);
  padding: clamp(1rem, 1.65vw, 1.45rem);
}

.profile-side-stack .profile-support-copy strong {
  font-size: clamp(1.42rem, 1.9vw, 1.95rem);
}

.profile-side-stack .profile-support-visual {
  width: min(100%, 18.2rem);
  justify-self: center;
}

.profile-side-stack .profile-support-logo {
  width: min(100%, 18rem);
  max-height: 18rem;
}

.profile-side-stack .profile-support-link {
  width: min(100%, clamp(11rem, 18vw, 18.2rem));
  min-width: 0;
  min-height: 3.7rem;
  border-radius: 999px;
  padding: 0.82rem 1.65rem;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 150, 136, 0.98), rgba(116, 88, 199, 0.98));
  border: 1px solid rgba(255, 253, 248, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.46),
    0 14px 26px rgba(0, 119, 111, 0.18),
    0 16px 28px rgba(116, 88, 199, 0.15);
  font-size: clamp(0.95rem, 1.08vw, 1.08rem);
  letter-spacing: 0;
}

@media (max-width: 1320px) and (min-width: 1181px) {
  .profile-table-dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.6fr);
  }

  .profile-progress-panel-head {
    grid-template-columns: minmax(7.5rem, 0.42fr) minmax(0, 1fr);
  }

  .profile-side-stack .profile-snapshot-card {
    grid-template-columns: clamp(4.4rem, 5.2vw, 5.3rem) minmax(0, 1fr);
    column-gap: clamp(0.68rem, 1.05vw, 0.9rem);
  }

  .profile-side-stack .profile-snapshot-avatar {
    width: clamp(4.4rem, 5.2vw, 5.3rem);
    font-size: clamp(1.55rem, 2.15vw, 2.2rem);
  }

  .profile-side-stack .profile-support-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "visual"
      "copy"
      "action";
    justify-items: start;
  }

  .profile-side-stack .profile-support-visual,
  .profile-side-stack .profile-support-logo {
    width: min(100%, 10.5rem);
    max-height: 10.5rem;
  }

  .profile-side-stack .profile-support-link {
    min-width: 0;
  }
}

.profile-side-stack .profile-support-link:not([aria-disabled="true"]):hover,
.profile-side-stack .profile-support-link:not([aria-disabled="true"]):focus-visible {
  background:
    linear-gradient(135deg, rgba(0, 137, 124, 1), rgba(105, 78, 190, 1));
  border-color: rgba(255, 253, 248, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.54),
    0 16px 30px rgba(0, 119, 111, 0.22),
    0 18px 32px rgba(116, 88, 199, 0.19);
  transform: translateY(-1px);
}

@media (max-height: 820px) and (min-width: 761px) {
  .profile-view {
    padding: clamp(0.55rem, 1.05vw, 0.85rem);
  }

  .profile-dashboard,
  .profile-table-dashboard,
  .profile-progress-panel,
  .profile-stat-tile-grid,
  .profile-side-stack {
    gap: clamp(0.44rem, 0.75vw, 0.62rem);
  }

  .profile-dashboard {
    padding-bottom: clamp(0.45rem, 0.9vw, 0.75rem);
  }

  .profile-progress-panel {
    padding: clamp(0.62rem, 1vw, 0.86rem);
  }

  .profile-progress-panel-head {
    gap: 0.42rem 0.62rem;
    padding-bottom: clamp(0.46rem, 0.75vw, 0.62rem);
  }

  .profile-total-points strong {
    font-size: clamp(2.35rem, 3.5vw, 3.55rem);
  }

  .profile-total-points span,
  .profile-points-split span,
  .profile-stat-summary-item span,
  .profile-metric-label {
    font-size: clamp(0.64rem, 0.72vw, 0.78rem);
  }

  .profile-points-split {
    gap: 0.42rem;
  }

  .profile-points-split p {
    padding: 0.36rem 0.5rem;
  }

  .profile-points-split strong {
    font-size: clamp(1.35rem, 2vw, 2.05rem);
  }

  .profile-stat-summary-item {
    min-height: clamp(3rem, 7.4dvh, 4.5rem);
    padding: clamp(0.42rem, 0.75vw, 0.62rem);
  }

  .profile-stat-summary-item strong {
    font-size: clamp(1.5rem, 2.35vw, 2.35rem);
  }

  .profile-stat-tile {
    min-height: clamp(4.15rem, 10.2dvh, 5.55rem);
    padding: clamp(0.46rem, 0.75vw, 0.62rem);
  }

  .profile-stat-icon {
    width: clamp(2.25rem, 2.8vw, 2.85rem);
    border-radius: 12px;
  }

  .profile-stat-tile strong {
    font-size: clamp(1.35rem, 2vw, 2rem);
  }

  .profile-stat-tile p,
  .profile-detail-card p {
    font-size: clamp(0.7rem, 0.78vw, 0.82rem);
  }

  .profile-stat-tile-mastery {
    min-height: clamp(4rem, 8.6dvh, 5rem);
  }

  .profile-activity-card {
    min-height: clamp(5rem, 15dvh, 6.5rem);
    padding: clamp(0.5rem, 0.8vw, 0.68rem);
    gap: 0.5rem;
  }

  .profile-activity-card .profile-recent-list {
    margin-top: 0.28rem;
    max-height: clamp(2.7rem, 8.4dvh, 4.6rem);
    gap: 0.16rem;
  }

  .profile-activity-card .profile-recent-list li {
    font-size: clamp(0.72rem, 0.78vw, 0.82rem);
    line-height: 1.08;
  }

  .profile-activity-card .profile-recent-list li strong {
    font-size: clamp(0.78rem, 0.84vw, 0.9rem);
    line-height: 1.08;
  }

  .profile-activity-tiles img {
    width: clamp(1.95rem, 2.55vw, 2.55rem);
  }

  .profile-side-stack {
    grid-template-rows: minmax(0, 0.54fr) minmax(0, 1fr);
  }

  .profile-side-stack .profile-snapshot-card {
    padding: clamp(0.68rem, 1.15vw, 0.95rem);
    column-gap: clamp(0.7rem, 1.2vw, 1rem);
    row-gap: 0.44rem;
  }

  .profile-side-stack .profile-snapshot-avatar {
    width: clamp(4.05rem, 5.3vw, 5rem);
    font-size: clamp(1.55rem, 2.1vw, 2.1rem);
  }

  .profile-side-stack .profile-snapshot-list {
    gap: 0.18rem;
  }

  .profile-side-stack .profile-snapshot-list p {
    padding: 0.08rem 0;
  }

  .profile-side-stack .profile-action-btn,
  .profile-side-stack .profile-support-link {
    min-height: 2.3rem;
    padding: 0.5rem 0.76rem;
    font-size: 0.78rem;
  }

  .profile-side-stack .profile-support-card {
    column-gap: clamp(0.72rem, 1.45vw, 1.2rem);
    row-gap: clamp(0.46rem, 0.8vw, 0.68rem);
    padding: clamp(0.7rem, 1.15vw, 0.98rem);
  }

  .profile-side-stack .profile-support-copy strong {
    font-size: clamp(1.15rem, 1.55vw, 1.52rem);
  }

  .profile-side-stack .profile-support-copy p {
    margin-top: 0.42rem;
    font-size: clamp(0.7rem, 0.78vw, 0.82rem);
    line-height: 1.24;
  }

  .profile-side-stack .profile-support-visual {
    width: min(100%, clamp(7.25rem, 17dvh, 13.5rem));
  }

  .profile-side-stack .profile-support-logo {
    width: min(100%, clamp(7.25rem, 17dvh, 13.5rem));
    max-height: clamp(7.25rem, 20dvh, 13.5rem);
  }
}

@media (max-width: 1180px) {
  .profile-table-dashboard {
    grid-template-columns: 1fr;
  }

  .profile-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
}

@media (max-width: 980px) {
  .profile-side-stack {
    grid-template-columns: 1fr;
  }

  .profile-side-stack .profile-support-card {
    grid-template-columns: minmax(0, 1fr) minmax(9rem, 0.45fr);
  }

  .profile-side-stack .profile-support-link {
    min-width: 0;
  }
}

@media (max-width: 860px) {
  .profile-progress-panel-head,
  .profile-points-split {
    grid-template-columns: 1fr;
  }

  .profile-progress-panel-head {
    grid-template-areas:
      "kicker"
      "total"
      "split";
  }

  .profile-stat-summary-bar {
    grid-template-columns: 1fr;
  }

  .profile-stat-summary-item {
    justify-content: flex-start;
    border-left: 0;
    border-top: 1px solid rgba(108, 88, 61, 0.13);
  }

  .profile-stat-summary-item:first-child {
    border-top: 0;
  }
}

@media (max-width: 760px) {
  .profile-view {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(0.62rem, 3.2vw, 0.8rem);
  }

  .profile-progress-panel-head,
  .profile-points-split,
  .profile-stat-tile-grid,
  .profile-side-stack {
    grid-template-columns: 1fr;
  }

  .profile-progress-panel-head {
    grid-template-areas:
      "kicker"
      "total"
      "split";
  }

  .profile-activity-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Learn the Table: normal game shell tour */
.main-grid.board-layout {
  position: relative;
}

body.table-tour-active .app-shell {
  position: relative;
}

body.table-tour-active .pre-game-modal,
body.table-tour-active .opening-deal-overlay {
  display: none !important;
}

body.table-tour-active .main-grid.board-layout {
  overflow: visible;
}

@media (min-width: 900px) {
  body.table-tour-active .app-shell {
    --table-tour-min-height: 760px;
    height: max(100dvh, var(--table-tour-min-height));
    min-height: var(--table-tour-min-height);
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding-bottom: 0.55rem;
  }

  body.table-tour-active .main-grid.board-layout {
    --table-tour-rack-row-height: clamp(290px, 36vh, 368px);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: var(--table-tour-rack-row-height) minmax(0, 1fr);
  }
}

body.table-tour-active .main-grid.board-layout::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.34), rgba(229, 248, 245, 0.28)),
    rgba(236, 231, 220, 0.24);
}

body.table-tour-active .table-tour-stage-bar,
body.table-tour-active .table-tour-hotspots,
body.table-tour-active .table-tour-popover {
  z-index: 64;
}

body.table-tour-active .tile-style-utility .tile-style-chip {
  cursor: default;
  pointer-events: none;
}

body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="sunrise"] {
  color: #004f49;
  background: transparent;
}

body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="sunrise"]::after {
  content: "";
  position: absolute;
  left: calc(0.24rem + 1.24rem + 0.32rem);
  right: 0.2rem;
  bottom: 0.08rem;
  height: 0.17rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #009688, #6d5fd1);
}

body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="midnight"],
body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="midnight"].active,
body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="midnight"][aria-pressed="true"] {
  color: #2f6963;
  background: transparent;
}

body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="midnight"]::after,
body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="midnight"].active::after,
body.table-tour-active .tile-style-utility .tile-style-chip[data-tile-theme="midnight"][aria-pressed="true"]::after {
  content: none;
}

.table-tour-stage-bar {
  position: absolute;
  left: 50%;
  top: calc(var(--table-tour-rack-row-height, clamp(290px, 36vh, 368px)) - clamp(2.7rem, 3.4vw, 3rem));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto minmax(1rem, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: calc(100% - clamp(2rem, 5vw, 5rem));
  max-width: 100%;
  pointer-events: auto;
}

.table-tour-stage-actions {
  grid-column: 1;
  justify-self: start;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.table-tour-stage-label {
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  padding: 0.1rem 0.72rem;
  color: #4f6059;
  font: 900 1.15rem/1.05 var(--button-font);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.table-tour-stage-btn,
.table-tour-stage-bar .table-tour-play-now {
  min-width: 10.8rem;
  min-height: 2.55rem;
  border: 2px solid rgba(0, 150, 136, 0.38);
  border-radius: 14px;
  padding: 0.62rem 1.08rem;
  cursor: pointer;
  font: 900 0.9rem/1 var(--button-font);
  letter-spacing: 0;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.table-tour-stage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: var(--sage-dark);
  opacity: 0.96;
  background: #fff8e8;
  box-shadow: inset 0 -3px 0 rgba(238, 138, 104, 0.18), 0 10px 22px rgba(38, 30, 22, 0.1);
}

.table-tour-stage-charleston {
  border-radius: 14px;
}

.table-tour-stage-regular {
  border-radius: 14px;
}

.table-tour-stage-btn.active {
  color: #fffdf8;
  opacity: 1;
  border-color: rgba(255, 253, 248, 0.5);
  box-shadow: inset 0 -3px 0 rgba(38, 30, 22, 0.12), 0 12px 24px rgba(38, 30, 22, 0.16);
}

.table-tour-stage-btn.active::before {
  content: "\2713";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  font-size: 0.68rem;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(38, 30, 22, 0.14);
}

.table-tour-stage-charleston.active {
  background: #b6634d;
}

.table-tour-stage-charleston.active::before {
  color: #b6634d;
}

.table-tour-stage-regular.active {
  background: #008f83;
}

.table-tour-stage-regular.active::before {
  color: #008f83;
}

.table-tour-stage-charleston:not(.active):hover,
.table-tour-stage-charleston:not(.active):focus-visible {
  color: #7b3c2f;
  background: #fff3d9;
  border-color: rgba(238, 138, 104, 0.5);
  box-shadow: inset 0 -3px 0 rgba(182, 99, 77, 0.24), 0 12px 24px rgba(38, 30, 22, 0.12);
}

.table-tour-stage-regular:not(.active):hover,
.table-tour-stage-regular:not(.active):focus-visible {
  color: #006f67;
  background: #effbf8;
  border-color: rgba(0, 150, 136, 0.48);
  box-shadow: inset 0 -3px 0 rgba(0, 150, 136, 0.22), 0 12px 24px rgba(38, 30, 22, 0.12);
}

.table-tour-stage-bar .table-tour-play-now {
  grid-column: 3;
  justify-self: end;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  color: #6040ad;
  background: linear-gradient(180deg, #fffaf0 0%, #f8f1ff 100%);
  border-color: rgba(116, 82, 190, 0.54);
  box-shadow:
    inset 0 -3px 0 rgba(116, 82, 190, 0.2),
    0 12px 24px rgba(116, 82, 190, 0.14),
    0 4px 12px rgba(38, 30, 22, 0.08);
}

.table-tour-stage-bar .table-tour-play-now span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  color: #fffdf8;
  background: #7452be;
  font-size: 0.92em;
  line-height: 1;
  transform: translateY(-0.01em);
  box-shadow: 0 3px 7px rgba(116, 82, 190, 0.2);
}

.table-tour-stage-btn:hover,
.table-tour-stage-btn:focus-visible,
.table-tour-stage-bar .table-tour-play-now:hover,
.table-tour-stage-bar .table-tour-play-now:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.table-tour-stage-bar .table-tour-play-now:hover,
.table-tour-stage-bar .table-tour-play-now:focus-visible {
  color: #56389f;
  background: linear-gradient(180deg, #fff4dc 0%, #f4eaff 100%);
  border-color: rgba(116, 82, 190, 0.68);
  box-shadow:
    inset 0 -3px 0 rgba(116, 82, 190, 0.26),
    0 15px 28px rgba(116, 82, 190, 0.18),
    0 5px 14px rgba(38, 30, 22, 0.1);
}

.table-tour-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body.table-tour-active .tour-hotspot {
  position: absolute;
  border: 1px solid rgba(67, 92, 88, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: #263532;
  padding: 0.5rem 0.72rem;
  font: 900 0.72rem/1 var(--button-font);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 12px 26px rgba(37, 31, 24, 0.16);
  transform: translate(-50%, -50%);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

body.table-tour-active .tour-hotspot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 1px solid rgba(255, 253, 248, 0.74);
}

body.table-tour-active .tour-hotspot:hover,
body.table-tour-active .tour-hotspot:focus-visible {
  border-color: rgba(149, 192, 203, 0.92);
  transform: translate(-50%, calc(-50% - 1px));
  outline: none;
}

body.table-tour-active .tour-hotspot.selected {
  color: #fffdf8;
  background: linear-gradient(135deg, #7452be 0%, #8e63d7 52%, #d47b5d 100%);
  border-color: rgba(255, 253, 248, 0.9);
  box-shadow:
    0 0 0 4px rgba(255, 253, 248, 0.88),
    0 0 0 8px rgba(116, 82, 190, 0.28),
    0 16px 34px rgba(82, 54, 151, 0.26);
}

body.table-tour-active .tour-hotspot.selected::after {
  inset: -9px;
  border: 2px solid rgba(212, 123, 93, 0.7);
  opacity: 1;
}

body.table-tour-active .tour-hotspot.selected:hover,
body.table-tour-active .tour-hotspot.selected:focus-visible {
  border-color: rgba(255, 253, 248, 0.98);
  box-shadow:
    0 0 0 4px rgba(255, 253, 248, 0.94),
    0 0 0 9px rgba(116, 82, 190, 0.34),
    0 18px 38px rgba(82, 54, 151, 0.3);
}

body.table-tour-active .tour-hotspot[data-table-tour="rack"] { left: 49%; top: 23%; }
body.table-tour-active .tour-hotspot[data-table-tour="exposure"] { left: 32%; top: 18%; }
body.table-tour-active .tour-hotspot[data-table-tour="tile-style"] { left: 12%; top: 8%; }
body.table-tour-active .tour-hotspot[data-table-tour="sort"] { left: 88%; top: 8%; }
body.table-tour-active .tour-hotspot[data-table-tour="card"] { left: 12%; top: 62%; }
body.table-tour-regular .table-tour-hotspots .tour-hotspot[data-table-tour="card"] { left: 18%; top: 79%; }
body.table-tour-active .tour-hotspot[data-table-tour="action"] { left: 74%; top: 56%; }
body.table-tour-active .tour-hotspot[data-table-tour="discards"] { left: 78%; top: 74%; }
body.table-tour-regular .table-tour-hotspots .tour-hotspot[data-table-tour="discards"] { left: 74%; top: 79%; }
body.table-tour-active .tour-hotspot[data-table-tour="counters"] { left: 84%; top: 79%; }
body.table-tour-active .tour-hotspot[data-table-tour="compass"] { left: 24%; top: 55%; }
body.table-tour-active .tour-hotspot[data-table-tour="charleston"] { left: 73%; top: 53%; }
body.table-tour-active .tour-hotspot[data-table-tour="incoming"] { left: 68%; top: 68%; }
body.table-tour-active .tour-hotspot[data-table-tour="pass"] { left: 84%; top: 68%; }
body.table-tour-active .tour-hotspot[data-table-tour="pass-direction"] { left: 84%; top: 76%; }
body.table-tour-active .tour-hotspot[data-table-tour="charleston-compass"] { left: 74%; top: 47%; }

body.table-tour-charleston .table-tour-hotspots .tour-hotspot.tour-hotspot-stage {
  width: max-content;
  max-width: 12rem;
}

body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="card"] {
  left: 24%;
  top: 70%;
}

body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="charleston-compass"] {
  left: 24%;
  top: 54%;
}

body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="charleston"] {
  left: 57%;
  top: 42%;
}

body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="incoming"] {
  left: 60%;
  top: 73%;
}

body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="pass"] {
  left: 75%;
  top: 66%;
}

body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="pass-direction"] {
  left: 77%;
  top: 88%;
}

.table-tour-popover {
  position: absolute;
  width: min(21rem, 28vw);
  min-height: 8.2rem;
  display: grid;
  align-content: center;
  gap: 0.48rem;
  padding: 1rem 1.08rem;
  border: 1px solid rgba(149, 192, 203, 0.42);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 22px 46px rgba(34, 30, 25, 0.18);
  pointer-events: auto;
}

.table-tour-popover-close {
  position: absolute;
  top: 0.42rem;
  right: 0.46rem;
  width: 1.38rem;
  height: 1.38rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(116, 82, 190, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  color: transparent;
  font: 900 0.9rem/1 var(--button-font);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 31, 24, 0.08);
}

.table-tour-popover-close::before {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7452be;
  font: 900 1.08rem/1 Arial, sans-serif;
  transform: translateY(-0.02rem);
}

.table-tour-popover-close:hover,
.table-tour-popover-close:focus-visible {
  background: #7452be;
  border-color: rgba(116, 82, 190, 0.5);
  outline: none;
}

.table-tour-popover-close:hover::before,
.table-tour-popover-close:focus-visible::before {
  color: #fffdf8;
}

.table-tour-popover h3 {
  margin: 0;
  color: #242424;
  font: 900 1.15rem/1.12 var(--button-font);
  padding-right: 1.35rem;
}

.table-tour-popover p {
  margin: 0;
  color: #52615d;
  font-family: "Merriweather", serif;
  font-size: 0.92rem;
  line-height: 1.42;
}

.table-tour-popover-card,
.table-tour-popover-compass {
  left: clamp(11rem, 26vw, 24rem);
  top: 54%;
}

.table-tour-popover-rack {
  left: 50%;
  top: clamp(7rem, 19vh, 12rem);
  transform: translateX(-50%);
}

.table-tour-popover-exposure {
  left: clamp(9.5rem, 20vw, 16rem);
  top: clamp(9rem, 24vh, 13.5rem);
}

.table-tour-popover-sort {
  right: clamp(6.5rem, 16vw, 12rem);
  top: clamp(2rem, 5.5vh, 3rem);
}

.table-tour-popover-tile-style {
  left: clamp(11rem, 18vw, 14rem);
  top: clamp(2rem, 5.5vh, 3rem);
}

.table-tour-popover-action {
  right: clamp(1rem, 3vw, 2rem);
  top: 42%;
}

body.table-tour-charleston .table-tour-popover-charleston {
  left: clamp(47rem, 67vw, 58rem);
  right: auto;
  top: clamp(14rem, 35vh, 20rem);
}

body.table-tour-charleston .table-tour-popover-charleston-compass {
  left: clamp(2rem, 5vw, 4rem);
  right: auto;
  top: clamp(19rem, 48vh, 27rem);
}

.table-tour-popover-discards,
.table-tour-popover-counters,
.table-tour-popover-pass,
.table-tour-popover-pass-direction {
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(3rem, 9vh, 5rem);
}

body.table-tour-charleston .table-tour-popover-incoming {
  left: clamp(23rem, 45vw, 38rem);
  right: auto;
  top: clamp(23rem, 54vh, 32rem);
  bottom: auto;
}

body.table-tour-active .table-tour-demo-hand-tile {
  cursor: default;
}

body.table-tour-active #hand-card-panel .hand-card-scroll {
  overflow: hidden !important;
  pointer-events: none;
  touch-action: none;
  scrollbar-width: none;
}

body.table-tour-active #hand-card-panel .hand-card-scroll::-webkit-scrollbar {
  display: none;
}

body.table-tour-active .table-tour-hand-preview .hand-compass-chip {
  cursor: default;
}

body.table-tour-active .table-tour-hand-preview .hand-compass-chip:hover,
body.table-tour-active .table-tour-hand-preview .hand-compass-chip:focus-visible {
  transform: none;
  outline: none;
}

body.table-tour-active .right-declare-slot {
  display: none;
}

body.table-tour-active .right-table-preview {
  display: block;
}

body.table-tour-active .charleston-guidance-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  background: transparent;
  border: 0;
  padding: 0;
}

body.table-tour-active .charleston-guidance-banner span {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  border: 1px solid rgba(0, 122, 112, 0.2);
  border-radius: 12px;
  padding: 0.32rem 0.52rem;
  color: #006f67;
  background: rgba(236, 250, 251, 0.76);
  font: 900 0.72rem/1 var(--button-font);
}

body.table-tour-regular #charleston-inline-actions {
  display: none !important;
}

body.table-tour-charleston .board-bottom-right > #turn-lane-panel {
  display: none !important;
}

body.table-tour-regular #discard-history-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

body.table-tour-regular #discard-history-row.discard-pool {
  align-items: flex-start;
  padding-top: 0.12rem;
}

@media (min-width: 900px) {
  body.table-tour-charleston .board-bottom-right {
    grid-template-rows: minmax(clamp(20rem, 48vh, 26rem), 1fr);
  }

  body.table-tour-charleston .board-bottom-right > #draw-panel.charleston-incoming-panel {
    min-height: clamp(20rem, 48vh, 26rem);
    height: 100%;
    padding: clamp(0.86rem, 1.5vw, 1.2rem);
  }

  body.table-tour-charleston .board-bottom-right > #draw-panel.charleston-incoming-panel #draw-slot,
  body.table-tour-charleston .board-bottom-right > #draw-panel.charleston-incoming-panel .charleston-simple-split {
    max-height: none;
    overflow: visible;
  }
}

body.table-tour-charleston #charleston-inline-actions {
  display: flex !important;
  margin-top: auto;
}

body.table-tour-charleston #confirm-charleston-btn {
  width: 100%;
  min-height: clamp(3.2rem, 6.4vh, 4.2rem);
  border-radius: 18px;
  opacity: 1;
  filter: none;
  cursor: default;
  background: #ee866a;
  box-shadow:
    inset 0 2px 0 rgba(255, 253, 248, 0.24),
    0 12px 22px rgba(188, 99, 75, 0.18);
}

body.table-tour-charleston .table-tour-charleston-split {
  min-height: clamp(7rem, 18vh, 9.5rem);
  align-items: start;
}

body.table-tour-charleston .table-tour-incoming-row,
body.table-tour-charleston .table-tour-pass-row {
  gap: 0.42rem;
}

.table-tour-pass-instruction {
  margin: 0.4rem 0 0;
  color: #5f554c;
  font: 700 clamp(1rem, 1.2vw, 1.12rem)/1.2 "Merriweather", serif;
}

body.table-tour-charleston .charleston-simple-row {
  min-height: clamp(4.8rem, 11vh, 6.2rem);
  align-items: start;
}

body.table-tour-charleston .table-tour-charleston-split .tile {
  width: clamp(3rem, 4.2vw, 3.8rem);
  height: clamp(4rem, 5.6vw, 5.05rem);
  border-radius: 14px;
}

.table-tour-pass-direction-demo {
  justify-self: start;
  margin: -0.12rem 0 0.08rem;
  padding: 0.26rem 0.62rem;
  border-radius: 999px;
  color: #fffdf8;
  background: rgba(188, 99, 75, 0.78);
  font: 900 0.72rem/1 var(--button-font);
  box-shadow: 0 8px 14px rgba(188, 99, 75, 0.14);
}

@media (max-width: 980px) {
  .table-tour-stage-bar {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    order: 2;
    margin: -0.4rem 0 0.35rem;
    width: 100%;
    max-width: 100%;
  }

  .table-tour-stage-actions {
    grid-column: 1;
    justify-self: start;
  }

  .table-tour-play-now {
    grid-column: 2;
    justify-self: end;
  }

  .table-tour-popover {
    position: fixed;
    left: 1rem !important;
    right: 1rem !important;
    bottom: 1rem !important;
    top: auto !important;
    width: auto;
    transform: none;
  }

  body.table-tour-active .tour-hotspot[data-table-tour="card"] { left: 18%; top: 66%; }
  body.table-tour-regular .table-tour-hotspots .tour-hotspot[data-table-tour="card"] { left: 22%; top: 78%; }
  body.table-tour-active .tour-hotspot[data-table-tour="action"],
  body.table-tour-active .tour-hotspot[data-table-tour="charleston"] { left: 72%; top: 64%; }
  body.table-tour-active .tour-hotspot[data-table-tour="discards"] { left: 76%; top: 82%; }
  body.table-tour-regular .table-tour-hotspots .tour-hotspot[data-table-tour="discards"] { left: 72%; top: 86%; }
  body.table-tour-active .tour-hotspot[data-table-tour="counters"] { left: 84%; top: 86%; }

  body.table-tour-charleston .table-tour-hotspots .tour-hotspot.tour-hotspot-stage {
    width: max-content;
    max-width: 10rem;
  }

  body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="card"] { left: 26%; top: 72%; }
  body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="charleston-compass"] { left: 26%; top: 58%; }
  body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="charleston"] { left: 58%; top: 44%; }
  body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="incoming"] { left: 60%; top: 72%; }
  body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="pass"] { left: 76%; top: 66%; }
  body.table-tour-charleston .table-tour-hotspots .tour-hotspot[data-table-tour="pass-direction"] { left: 76%; top: 84%; }
}

@media (max-width: 640px) {
  .table-tour-stage-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-tour-stage-btn,
  .table-tour-play-now {
    width: 100%;
  }

  body.table-tour-active .tour-hotspot {
    max-width: 7.8rem;
    white-space: normal;
    line-height: 1.05;
    font-size: 0.66rem;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 0.5rem);
  z-index: 200;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--tile-cream);
  font-family: var(--button-font);
  font-size: 0.9rem;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast.hidden {
  display: none;
}

/* Dialog backdrops scroll when the card is taller than the viewport.
   Centering uses auto margins (not place-items) so an overflowing card
   starts at the top instead of being clipped on both ends. */
.profile-modal,
.start-modal,
.charleston-intro-modal,
.pre-game-modal,
.email-gate-modal {
  overflow-y: auto;
  overscroll-behavior: contain;
  align-items: normal;
  justify-items: center;
}

.profile-modal > *,
.start-modal > *,
.charleston-intro-modal > *,
.pre-game-modal > *,
.email-gate-modal > * {
  margin-block: auto;
}

/* Two-path pre-game chooser. The existing controls keep their IDs and state
   classes; this layer only changes the presentation of the entry flow. */
.pre-game-modal {
  padding: clamp(0.75rem, 2.5vw, 1.65rem);
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 150, 136, 0.08), transparent 28rem),
    radial-gradient(circle at 84% 78%, rgba(147, 112, 219, 0.08), transparent 25rem),
    rgba(44, 37, 31, 0.24);
  backdrop-filter: blur(9px);
}

.pre-game-card {
  position: relative;
  width: min(940px, calc(100vw - 2rem));
  max-height: calc(100dvh - clamp(1.5rem, 5vw, 3.2rem));
  display: grid;
  gap: clamp(1rem, 2.2vw, 1.5rem);
  padding: clamp(1.5rem, 3vw, 2.35rem) clamp(1.35rem, 4vw, 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  color: #2f2d2a;
  background:
    radial-gradient(circle at 13% 8%, rgba(32, 201, 195, 0.12), transparent 12rem),
    radial-gradient(circle at 95% 98%, rgba(185, 107, 228, 0.1), transparent 13rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(255, 249, 238, 0.98)),
    #fffdf8;
  border: 1px solid rgba(109, 91, 68, 0.16);
  border-radius: 24px;
  box-shadow:
    0 28px 65px rgba(42, 34, 28, 0.22),
    0 7px 18px rgba(42, 34, 28, 0.1);
}

.pre-game-card::before {
  content: none;
}

.pre-game-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #009688 0 58%, #9370db 58% 100%);
}

.pre-game-copy {
  display: block;
  text-align: left;
}

.pre-game-copy h2 {
  margin: 0;
  color: #2f2d2a;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.35rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  white-space: normal;
}

.pre-game-path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.9rem, 2vw, 1.4rem);
}

.pre-game-path {
  min-width: 0;
  min-height: 445px;
  display: flex;
  flex-direction: column;
  padding: clamp(1.1rem, 2.4vw, 1.55rem);
  border: 1px solid rgba(70, 62, 54, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(61, 48, 36, 0.04);
}

.pre-game-path-daily {
  border-color: rgba(211, 111, 75, 0.22);
  background:
    radial-gradient(circle at 93% 8%, rgba(238, 138, 104, 0.16), transparent 12rem),
    radial-gradient(circle at 12% 91%, rgba(147, 112, 219, 0.08), transparent 11rem),
    linear-gradient(160deg, rgba(255, 253, 248, 0.96), rgba(255, 241, 232, 0.9));
}

.pre-game-path-header {
  min-height: 76px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid rgba(70, 62, 54, 0.12);
}

.pre-game-path-header h3 {
  margin: 0;
  color: #2f2d2a;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.3rem, 2.6vw, 1.72rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.pre-game-tile-mark {
  position: relative;
  width: 72px;
  height: 58px;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(0, 150, 136, 0.08), rgba(32, 201, 195, 0.14));
  box-shadow: inset 0 0 0 1px rgba(0, 150, 136, 0.05);
}

.pre-game-tile-mark img {
  position: absolute;
  top: 8px;
  width: 29px;
  height: 43px;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px rgba(69, 54, 42, 0.14));
}

.pre-game-tile-mark img:nth-child(1) {
  left: 7px;
  transform: rotate(-14deg);
}

.pre-game-tile-mark img:nth-child(2) {
  top: 4px;
  left: 22px;
  z-index: 2;
}

.pre-game-tile-mark img:nth-child(3) {
  right: 7px;
  transform: rotate(14deg);
}

.pre-game-daily-header {
  grid-template-columns: 56px minmax(0, 1fr);
}

.pre-game-daily-header-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #c86443;
  background: rgba(238, 138, 104, 0.17);
}

.pre-game-daily-header-icon svg {
  width: 40px;
  height: 40px;
}

.assist-mode-panel {
  display: grid;
  gap: 0;
  margin-top: 1.1rem;
}

.pre-game-setting-label {
  display: block;
  margin-bottom: 0.78rem;
  color: #5f554c;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.2;
}

.pre-game-hand-card-label {
  margin-top: 1.1rem;
}

.assist-mode-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.mode-choice {
  position: relative;
  min-width: 0;
  min-height: 96px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 0.62rem;
  row-gap: 0.3rem;
  padding: 0.92rem 1rem 0.7rem;
  overflow: visible;
  border: 1px solid rgba(70, 62, 54, 0.13);
  border-radius: 14px;
  color: #2f2d2a;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(61, 48, 36, 0.04);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.mode-choice:hover,
.mode-choice:focus-visible {
  border-color: rgba(0, 150, 136, 0.38);
  background: rgba(255, 255, 255, 0.94);
  outline: none;
  transform: translateY(-1px);
}

.mode-choice.selected,
.mode-choice[aria-pressed="true"] {
  border-color: rgba(0, 150, 136, 0.58);
  background:
    radial-gradient(circle at 18% 48%, rgba(32, 201, 195, 0.11), transparent 8rem),
    linear-gradient(135deg, rgba(0, 150, 136, 0.08), rgba(255, 253, 248, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.08),
    0 9px 22px rgba(0, 122, 112, 0.08);
}

.mode-choice::after,
.mode-choice[aria-pressed="true"]::after {
  content: none;
}

.mode-choice-icon {
  position: relative;
  inset: auto;
  grid-row: 1;
  grid-column: 1;
  width: 32px;
  height: 32px;
  justify-self: start;
  align-self: center;
  color: #009688;
  opacity: 0.42;
  pointer-events: none;
}

.mode-choice.selected .mode-choice-icon,
.mode-choice[aria-pressed="true"] .mode-choice-icon {
  opacity: 0.78;
}

.mode-choice-icon::before,
.mode-choice-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.mode-choice-icon-teacher::before {
  inset: 0;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23009688' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='32' cy='32' r='25' stroke-width='3.5'/%3E%3Ccircle cx='32' cy='32' r='19' stroke-width='2' opacity='.7'/%3E%3Cpath d='M32 10v5M32 49v5M10 32h5M49 32h5' stroke-width='3'/%3E%3Cpath d='m39.5 24.5-4.1 10.9-10.9 4.1 4.1-10.9z' fill='%23009688' fill-opacity='.16' stroke-width='3.5'/%3E%3Cpath d='m39.5 24.5-10.9 4.1 6.8 6.8z' fill='%23009688' stroke='none'/%3E%3Ccircle cx='32' cy='32' r='2.7' fill='%23009688' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
}

.mode-choice-icon-teacher::after {
  content: none;
}

.mode-choice-icon-solo::before {
  left: 50%;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: #76bdb5;
  transform: translateX(-50%);
}

.mode-choice-icon-solo::after {
  left: 50%;
  top: 17px;
  width: 24px;
  height: 14px;
  border: 3px solid #76bdb5;
  border-bottom-width: 4px;
  border-radius: 15px 15px 5px 5px;
  background: transparent;
  transform: translateX(-50%);
}

.mode-choice-copy {
  display: contents;
}

.mode-choice .mode-choice-heading {
  display: block;
  grid-row: 1;
  grid-column: 2;
  justify-self: start;
  align-self: center;
  color: #234f4b;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(0.92rem, 1.5vw, 1.05rem) !important;
  font-weight: 700 !important;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.mode-choice small {
  display: block;
  grid-row: 2;
  grid-column: 2;
  justify-self: start;
  max-width: 11rem;
  color: #6e655f;
  font-family: "Merriweather", serif;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

.mode-choice-badge {
  position: absolute;
  top: -0.7rem;
  left: 0.6rem;
  z-index: 3;
  width: max-content;
  padding: 0.26rem 0.5rem;
  border: 2px solid #fffdf8;
  border-radius: 999px;
  color: #fffdf8;
  background: linear-gradient(90deg, #008f83, #20c9c3);
  box-shadow: 0 7px 14px rgba(0, 122, 112, 0.17);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.5rem !important;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
}

.mode-choice-badge::before {
  content: "★";
  margin-right: 0.24rem;
}

.mode-choice-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  color: transparent;
  background: transparent;
  font: 900 0.62rem/1 "Merriweather Sans", sans-serif;
}

.mode-choice[aria-pressed="true"] .mode-choice-check {
  color: #fffdf8;
  background: #009688;
}

.hand-card-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.hand-card-choice {
  position: relative;
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 0.45rem 1.9rem 0.45rem 0.7rem;
  border: 1px solid rgba(70, 62, 54, 0.13);
  border-radius: 14px;
  color: #2f2d2a;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(61, 48, 36, 0.04);
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.hand-card-choice:hover,
.hand-card-choice:focus-visible {
  border-color: rgba(0, 150, 136, 0.38);
  background: rgba(255, 255, 255, 0.94);
  outline: none;
  transform: translateY(-1px);
}

.hand-card-choice.selected,
.hand-card-choice[aria-pressed="true"] {
  border-color: rgba(0, 150, 136, 0.58);
  background:
    radial-gradient(circle at 18% 48%, rgba(32, 201, 195, 0.11), transparent 8rem),
    linear-gradient(135deg, rgba(0, 150, 136, 0.08), rgba(255, 253, 248, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(0, 150, 136, 0.08),
    0 9px 22px rgba(0, 122, 112, 0.08);
}

.hand-card-choice.selected::after,
.hand-card-choice[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  color: #fffdf8;
  background: #009688;
  box-shadow: none;
  font: 900 0.62rem/1 "Merriweather Sans", sans-serif;
  transform: none;
}

.hand-card-choice-heading {
  font-family: "Merriweather", serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
}

.pre-game-start-btn,
.pre-game-daily-btn {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  margin-top: auto;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 14px;
  color: #fffdf8;
  background: #008f83;
  box-shadow: 0 10px 20px rgba(0, 122, 112, 0.18);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.pre-game-start-btn:hover,
.pre-game-start-btn:focus-visible,
.pre-game-daily-btn:hover,
.pre-game-daily-btn:focus-visible {
  outline: none;
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 13px 24px rgba(0, 122, 112, 0.23);
}

.pre-game-daily-btn {
  background: linear-gradient(90deg, #bd5e40, #df8465);
  box-shadow: 0 10px 20px rgba(174, 79, 49, 0.18);
}

.pre-game-start-btn:active {
  background: linear-gradient(90deg, #007f75, #008f83);
  box-shadow: 0 5px 11px rgba(0, 122, 112, 0.2);
  filter: brightness(0.98);
  transform: translateY(1px) scale(0.99);
}

.pre-game-daily-btn:hover,
.pre-game-daily-btn:focus,
.pre-game-daily-btn:focus-visible {
  background: linear-gradient(90deg, #ad5034, #d47453);
  box-shadow: 0 13px 24px rgba(174, 79, 49, 0.24);
}

.pre-game-daily-btn:active {
  background: linear-gradient(90deg, #a64930, #c96849);
  box-shadow: 0 5px 11px rgba(174, 79, 49, 0.2);
  filter: brightness(0.98);
  transform: translateY(1px) scale(0.99);
}

.pre-game-daily-hero {
  position: relative;
  flex: 1;
  min-height: 276px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1.25rem 1.5rem;
  text-align: center;
}

.pre-game-daily-mark {
  position: relative;
  width: 90px;
  height: 84px;
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.9), rgba(255, 229, 216, 0.86));
}

.pre-game-daily-mark::after,
.pre-game-daily-mark::before {
  content: "✦";
  position: absolute;
  font-family: Georgia, serif;
  line-height: 1;
}

.pre-game-daily-mark::after {
  top: 7px;
  right: 8px;
  color: #c86443;
  font-size: 22px;
  transform: rotate(8deg);
}

.pre-game-daily-mark::before {
  left: 2px;
  bottom: 9px;
  color: #ee8a68;
  font-size: 12px;
  transform: rotate(-10deg);
}

.pre-game-daily-mark img {
  width: 48px;
  height: 70px;
  margin-left: -10px;
  object-fit: contain;
  filter:
    drop-shadow(5px 6px 0 rgba(0, 150, 136, 0.2))
    drop-shadow(0 8px 7px rgba(83, 62, 45, 0.13));
}

.pre-game-daily-kicker {
  margin: 0 0 0.45rem;
  color: #a65036;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pre-game-daily-copy {
  margin: 0;
  color: #5f554c;
  font-family: "Merriweather", serif;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.pre-game-secondary-actions {
  display: none !important;
}

@media (max-width: 700px) {
  .pre-game-card {
    width: min(100%, calc(100vw - 1rem));
    padding: 1.6rem 1rem;
  }

  .pre-game-path-grid {
    grid-template-columns: 1fr;
  }

  .pre-game-path {
    min-height: 0;
  }

  .pre-game-daily-hero {
    min-height: 235px;
  }
}

@media (max-width: 390px) {
  .pre-game-path {
    padding-inline: 0.8rem;
  }

  .pre-game-path-header {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.7rem;
  }

  .pre-game-tile-mark {
    width: 64px;
    transform: scale(0.92);
    transform-origin: left center;
  }

  .pre-game-daily-header {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .pre-game-daily-header-icon {
    width: 48px;
    height: 48px;
  }

  .pre-game-daily-header-icon svg {
    width: 34px;
    height: 34px;
  }
}

/* Shared opponent exposure rail
   Bot melds use the same tile renderer as the rack and remain centered as a
   group, independent of which table seat exposes first. */
.bot-exposure-rail {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.05rem clamp(0.3rem, 1.4vw, 1rem) 0.18rem;
}

.bot-exposure-rail.hidden {
  display: none !important;
}

.bot-exposure-groups {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.85rem, 3.2vw, 2.75rem);
}

.bot-exposure-group {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 0.14rem;
}

.bot-exposure-wind {
  color: #62584f;
  font-family: "Merriweather Sans", sans-serif;
  font-size: clamp(0.56rem, 0.65vw, 0.68rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.bot-exposure-sets {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0.12rem 0.34rem;
}

.bot-exposure-set {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
}

.tile.bot-exposure-tile,
.tile.bot-exposure-tile:hover {
  width: clamp(21px, 1.55vw, 27px);
  height: clamp(29px, 2.1vw, 37px);
  min-width: 0;
  flex: 0 0 auto;
  border-radius: 0;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.tile.bot-exposure-tile.bot-exposure-joker {
  pointer-events: auto;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, outline-color 150ms ease;
}

.tile.bot-exposure-tile.bot-exposure-joker:hover,
.tile.bot-exposure-tile.bot-exposure-joker:focus-visible {
  transform: translateY(-3px) scale(1.08);
  filter: saturate(1.12) drop-shadow(0 7px 7px rgba(0, 116, 107, 0.2));
  outline: 2px solid rgba(0, 150, 136, 0.72);
  outline-offset: 2px;
}

.tile.bot-exposure-tile.bot-exposure-joker:active {
  transform: translateY(-1px) scale(1.02);
}

.bot-exposure-rail[data-exposed-bots="2"] .tile.bot-exposure-tile {
  width: clamp(19px, 1.35vw, 24px);
  height: clamp(26px, 1.84vw, 33px);
}

.bot-exposure-rail[data-exposed-bots="3"] .bot-exposure-groups {
  gap: clamp(0.45rem, 1.7vw, 1.4rem);
}

.bot-exposure-rail[data-exposed-bots="3"] .tile.bot-exposure-tile {
  width: clamp(15px, 1.15vw, 21px);
  height: clamp(21px, 1.57vw, 29px);
}

@media (min-width: 900px) {
  #game-view.board-layout .board-bottom-grid:has(.bot-exposure-rail:not(.hidden)) {
    grid-template-rows: auto minmax(0, 1fr);
    row-gap: clamp(0.25rem, 0.55vw, 0.52rem);
  }
}

body.table-tour-active .bot-exposure-rail {
  display: none !important;
}

/* Joker exchanges use the shared rule dialog, with the app's teal primary
   action and its compact red pass treatment. */
.rule-popup.joker-exchange-confirm-popup .rule-popup-card {
  width: min(520px, 100%);
  justify-items: center;
  gap: 1rem;
  padding: clamp(1.15rem, 3vw, 1.6rem);
  text-align: center;
}

.rule-popup.joker-exchange-confirm-popup #rule-popup-text {
  margin: 0;
  color: #342e2a;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.12rem, 2.2vw, 1.42rem);
  font-weight: 700;
  line-height: 1.3;
}

.rule-popup.joker-exchange-confirm-popup .rule-popup-actions {
  justify-content: center;
  gap: 0.8rem;
}

.rule-popup.joker-exchange-confirm-popup #rule-popup-confirm {
  min-width: 9.5rem;
  min-height: 2.8rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid rgba(0, 119, 111, 0.38);
  border-radius: 999px;
  color: #fffdf8;
  background: var(--sage);
  box-shadow: 0 8px 18px rgba(0, 119, 111, 0.16);
}

.rule-popup.joker-exchange-confirm-popup #rule-popup-confirm:hover,
.rule-popup.joker-exchange-confirm-popup #rule-popup-confirm:focus-visible {
  color: #fffdf8;
  background: var(--sage-dark);
  border-color: rgba(0, 119, 111, 0.5);
  outline: none;
}

.rule-popup.joker-exchange-confirm-popup #rule-popup-close {
  min-width: 4.6rem;
  min-height: 2.1rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(167, 61, 58, 0.28);
  border-radius: 999px;
  color: var(--tile-red);
  background: transparent;
  box-shadow: none;
  font-size: 0.78rem;
}

.rule-popup.joker-exchange-confirm-popup #rule-popup-close:hover,
.rule-popup.joker-exchange-confirm-popup #rule-popup-close:focus-visible {
  color: var(--tile-red);
  background: rgba(167, 61, 58, 0.08);
  border-color: rgba(167, 61, 58, 0.42);
  box-shadow: none;
  outline: none;
}

.tile.rack-transfer-fly-tile {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.tile.rack-transfer-target {
  opacity: 0 !important;
}
