:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-soft: #101421;
  --panel: #121827;
  --panel-2: #172033;
  --felt: #0d4b3f;
  --felt-dark: #082c31;
  --text: #fffaf0;
  --muted: #a9afc0;
  --gold: #ffd05b;
  --mint: #dff8ea;
  --green: #39c879;
  --red: #d92841;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 208, 91, 0.35);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
  --radius: 24px;
  --motion-fast: 140ms;
  --motion-normal: 240ms;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 208, 91, 0.12), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(57, 200, 121, 0.1), transparent 32rem),
    var(--bg);
  color: var(--text);
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.88rem 1.25rem;
  font-weight: 900;
  color: #10131a;
  background: var(--mint);
  cursor: pointer;
}

@media (hover: hover) {
  button:hover {
    filter: brightness(1.04);
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 208, 91, 0.8);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.app-shell {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.login-screen {
  min-height: calc(100dvh - 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: start;
  gap: 28px;
  padding-block: clamp(18px, 5vh, 54px);
}

.login-copy,
.login-card,
.top-bar,
.panel,
.game-card,
.hand-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 24, 39, 0.92), rgba(10, 14, 25, 0.94));
  box-shadow: var(--shadow);
}

.login-copy {
  padding: clamp(28px, 5vw, 72px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 15%, rgba(255, 208, 91, 0.18), transparent 18rem),
    linear-gradient(145deg, rgba(13, 75, 63, 0.82), rgba(18, 24, 39, 0.96) 58%, rgba(51, 36, 46, 0.9));
  align-self: stretch;
}

.login-brand,
.status,
.panel h2 {
  color: var(--gold);
}

.login-brand {
  font-size: 1.25rem;
  font-weight: 1000;
}

.login-brand span {
  color: var(--green);
}

.login-copy h1 {
  max-width: 820px;
  margin: 18px 0;
  font-size: clamp(44px, 7.2vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1.35;
}

.trust-copy {
  color: var(--text) !important;
  font-weight: 1000;
}

.guest-entry-actions,
.hub-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 4px;
}

.guest-entry-actions button,
.hub-primary-actions button {
  min-height: 48px;
  padding-inline: 22px;
}

.primary-guest-cta,
.hub-primary-actions button:first-child {
  background: var(--gold);
  color: #2a210b;
}

.landing-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
}

.landing-proof span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 999px;
  padding: 10px 13px;
  background: rgba(255, 250, 240, 0.07);
  color: var(--text);
  font-weight: 900;
}

.landing-proof strong {
  color: var(--gold);
}

.landing-preview {
  margin-top: clamp(26px, 6vw, 78px);
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(150px, 230px);
  align-items: end;
  gap: 14px;
}

.preview-table {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 8px solid rgba(70, 42, 24, 0.9);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 35%, rgba(57, 200, 121, 0.18), transparent 11rem),
    linear-gradient(145deg, rgba(13, 75, 63, 0.95), rgba(8, 44, 49, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 208, 91, 0.24);
}

.preview-score {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 250, 240, 0.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(7, 10, 18, 0.56);
}

.preview-score b {
  font-size: 1.1rem;
}

.preview-score span {
  color: var(--gold);
  font-weight: 950;
}

.login-card {
  padding: 26px;
  position: sticky;
  top: 22px;
}

.login-card h2 {
  margin: 0 0 22px;
  font-size: 2rem;
}

.login-helper {
  margin: -12px 0 18px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.oauth-login {
  display: block;
  margin-bottom: 16px;
  border-radius: 999px;
  padding: 14px 16px;
  background: var(--gold);
  color: #1d1606;
  text-align: center;
  text-decoration: none;
  font-weight: 1000;
}

.email-auth-details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.email-auth-details summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.email-auth-details summary::after {
  content: "+";
  color: var(--gold);
  font-size: 1.35rem;
}

.email-auth-details[open] summary::after {
  content: "−";
}

.email-auth-details form {
  padding-top: 16px;
}

.account-later-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.login-actions button {
  width: 100%;
}

.login-card label,
.login-card fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 800;
  border: 0;
  padding: 0;
}

.game-card footer .game-help-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(12px);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 6, 12, 0.86);
  backdrop-filter: blur(12px);
}

.confirm-sheet {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 143, 143, 0.34);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.confirm-sheet h2,
.confirm-sheet p {
  margin-top: 0;
}

.confirm-sheet p {
  color: var(--muted);
  line-height: 1.45;
}

.confirm-sheet div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tutorial-choice-sheet {
  border-color: rgba(255, 211, 90, 0.36);
}

.tutorial-choice-sheet .status {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
}

.tutorial-choice-sheet .tutorial-choice-primary {
  background: var(--gold);
  color: #2a210b;
}

.start-flow-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(12px);
}

.start-flow-sheet {
  width: min(620px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 32px);
  background: linear-gradient(165deg, rgba(13, 75, 63, 0.98), rgba(12, 17, 29, 0.99) 62%);
  box-shadow: var(--shadow);
}

.start-flow-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.start-flow-sheet h2 {
  margin: 4px 0 0;
  font-size: clamp(1.65rem, 5vw, 2.4rem);
}

.start-flow-sheet > header button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.55rem;
}

.start-flow-sheet > p {
  color: var(--muted);
  line-height: 1.45;
}

.start-game-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.start-game-choices button {
  min-height: 116px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  border-radius: 16px;
  padding: 18px;
  text-align: left;
}

.start-game-choices span {
  font-size: 1.25rem;
}

.start-game-choices small {
  color: rgba(16, 19, 26, 0.72);
  line-height: 1.35;
}

.help-sheet {
  width: min(780px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 34px);
  background: linear-gradient(165deg, rgba(13, 75, 63, 0.98), rgba(12, 17, 29, 0.99) 58%);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}

.help-sheet > header,
.help-sheet > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.help-sheet h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}

.help-close {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.65rem;
}

.help-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.help-sections section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: rgba(7, 10, 18, 0.38);
}

.help-sections section:last-child {
  grid-column: 1 / -1;
}

.help-sections h3 {
  margin: 0 0 7px;
  color: var(--gold);
}

.help-sections p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-card input:not([type="checkbox"]):not([type="radio"]),
.profile-settings input:not([type="checkbox"]):not([type="radio"]),
.profile-settings select,
.chat-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #090e1a;
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  font-weight: 800;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

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

.avatar-choice {
  position: relative;
  align-items: center;
  justify-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 0.78rem;
}

.avatar-choice input {
  position: absolute;
  opacity: 0;
}

.avatar-choice:has(input:checked),
.avatar-choice.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(255, 208, 91, 0.18);
  background: rgba(255, 208, 91, 0.1);
}

.avatar {
  width: 48px;
  height: 48px;
  position: relative;
  display: inline-block;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  background: var(--avatar-bg);
  color: var(--avatar-fg);
  flex: 0 0 auto;
}

.avatar-emoji {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-block;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.75rem;
  line-height: 1;
  transform: translate(-50%, -50%);
  transform-origin: center;
  white-space: nowrap;
}

.frame {
  display: grid;
  gap: 18px;
}

.top-bar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  backdrop-filter: blur(18px);
}

.brand {
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 1.45rem;
}

.brand small {
  color: var(--green);
}

.top-bar nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}

.top-bar nav button,
.combo-tabs button,
.hand-panel footer button:first-child {
  background: rgba(223, 248, 234, 0.94);
}

.top-bar nav button {
  padding: 0.68rem 1rem;
  white-space: nowrap;
}

.gameplay-top-bar {
  position: relative;
  top: 0;
  display: flex;
  justify-content: space-between;
  min-height: 52px;
  padding: 8px 12px;
  box-shadow: none;
}

.gameplay-brand {
  font-size: 1.05rem;
  font-weight: 1000;
}

.gameplay-brand small {
  color: var(--green);
}

.gameplay-top-bar button {
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  background: transparent;
  color: var(--mint);
  border: 1px solid var(--line);
}

.gameplay-top-bar nav,
.gameplay-top-bar nav button {
  width: auto;
}

.top-bar nav button:first-child,
.game-card footer button,
.hand-panel footer button:last-child,
.turn-banner {
  background: var(--gold);
}

.gameplay-top-bar nav button:first-child {
  background: transparent;
  color: var(--mint);
}

.gameplay-top-bar nav button[data-help-game] {
  background: var(--gold);
  color: #2a210b;
  border-color: rgba(255, 211, 90, 0.78);
}

.hub-grid,
.room-layout,
.page-grid {
  display: grid;
  gap: 18px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.onboarding-card h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0;
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  font-weight: 950;
}

.account-note {
  padding: 12px 14px;
  border: 1px solid rgba(255, 208, 91, 0.28);
  border-radius: 16px;
  background: rgba(255, 208, 91, 0.08);
}

.onboarding-help {
  position: sticky;
  top: 14px;
}

.public-preview,
.profile-overview {
  display: grid;
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.public-preview {
  grid-template-columns: auto 1fr;
}

.public-preview div {
  display: grid;
  gap: 4px;
}

.public-preview span {
  color: var(--muted);
  font-weight: 800;
}

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

.profile-overview span {
  display: grid;
  gap: 4px;
  min-height: 64px;
  align-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.profile-overview small {
  color: var(--muted);
  font-weight: 800;
}

.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 208, 91, 0.14), transparent 18rem),
    linear-gradient(135deg, rgba(13, 75, 63, 0.78), rgba(18, 24, 39, 0.96));
  border: 1px solid var(--line);
}

.hub-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 56px);
  line-height: 1;
}

.hub-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.25;
}

.hub-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
  min-width: min(520px, 46vw);
}

.hub-status span,
.hub-status button {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(4, 8, 16, 0.38);
  color: var(--text);
  padding: 10px 12px;
}

.hub-status span {
  display: grid;
  align-content: center;
  gap: 2px;
}

.hub-status strong {
  color: var(--gold);
  font-size: 1.08rem;
  line-height: 1;
}

.hub-status small {
  color: var(--muted);
  font-weight: 850;
}

.hub-status button {
  grid-column: 1 / -1;
  background: var(--gold);
  color: #1d1606;
}

.next-step-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.next-step-panel article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.next-step-panel article > span {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.next-step-panel strong,
.next-step-panel small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-step-panel small {
  color: var(--muted);
  font-weight: 850;
}

.next-step-panel button {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-width: 96px;
  padding: 0.72rem 0.9rem;
  background: rgba(223, 248, 234, 0.94);
}

.game-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  min-height: 280px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 22px;
}

.game-card h2 {
  margin: 10px 0 4px;
  font-size: 2.45rem;
  line-height: 1;
}

.game-card p,
.panel p,
.seat span,
.seat small,
.game-card footer span,
.chat-log,
.request-row {
  color: var(--muted);
}

.game-art {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-card footer,
.panel header,
.hand-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-actions,
.room-actions-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.room-actions-panel {
  justify-content: space-between;
  padding: 12px 16px;
}

.room-actions-panel div {
  display: grid;
  gap: 2px;
}

.room-actions-panel strong {
  color: var(--gold);
}

.room-actions-panel span,
.room-ended-panel p {
  color: var(--muted);
  font-weight: 800;
}

.connection-banner {
  margin-bottom: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 208, 91, 0.15);
  color: var(--gold);
  font-weight: 1000;
  text-align: center;
}

.room-command-feedback {
  padding: 10px 14px;
  border: 1px solid rgba(255, 143, 143, 0.36);
  border-radius: 14px;
  background: rgba(217, 40, 65, 0.13);
  color: #ffd9d9;
  font-weight: 900;
  text-align: center;
}

.danger-button {
  background: rgba(255, 143, 143, 0.18);
  color: #ffd9d9;
  border-color: rgba(255, 143, 143, 0.34);
}

.game-table {
  border-radius: 34px;
  border: 12px solid rgba(86, 52, 23, 0.45);
  background: #110e11;
  overflow: hidden;
}

.table-felt {
  min-height: 560px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(94, 176, 132, 0.24), transparent 26rem),
    radial-gradient(circle at 50% 50%, rgba(7, 18, 25, 0.1), rgba(6, 22, 31, 0.72)),
    linear-gradient(135deg, var(--felt), var(--felt-dark));
}

.seat {
  position: absolute;
  width: 190px;
  height: 74px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(223, 248, 234, 0.16);
  border-radius: 18px;
  background: rgba(5, 20, 25, 0.62);
  overflow: hidden;
}

.seat.open-seat {
  border-style: dashed;
  opacity: 0.72;
}

.seat.open-seat .avatar {
  filter: grayscale(1);
  opacity: 0.52;
}

.seat-friend-button {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 0.34rem 0.5rem;
  border-radius: 999px;
  background: var(--gold);
  color: #2b210c;
  font-size: 0.62rem;
  line-height: 1;
}

.seat .avatar {
  width: 46px;
  height: 46px;
  place-self: center;
  border-radius: 14px;
}

.seat .avatar-emoji {
  font-size: 1.7rem;
}

.seat > div {
  min-width: 0;
}

.seat strong {
  display: block;
  font-size: 1rem;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat span {
  display: block;
  font-size: 0.76rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat small {
  display: inline-block;
  margin-top: 2px;
  color: var(--gold);
  font-size: 0.76rem;
  line-height: 1.1;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.murlan-felt .seat {
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  height: 88px;
  min-width: 0;
  min-height: 0;
}

.murlan-felt .seat > div {
  display: grid;
  align-content: center;
}

.murlan-seat-score {
  display: block;
  margin-top: 2px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.68rem;
  line-height: 1.05;
  font-style: normal;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 208, 91, 0.16), 0 0 34px rgba(255, 208, 91, 0.18);
}

.seat-1 { bottom: 26px; left: 50%; transform: translateX(-50%); }
.seat-2 { left: 28px; top: 50%; transform: translateY(-50%); }
.seat-3 { top: 26px; left: 50%; transform: translateX(-50%); }
.seat-4 { right: 28px; top: 50%; transform: translateY(-50%); }

.murlan-felt {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  place-items: stretch;
  gap: 14px;
}

.murlan-felt .table-center {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: start;
  margin-top: 8px;
}

.table-center {
  width: min(580px, 94vw);
  display: grid;
  gap: 12px;
  z-index: 2;
}

.turn-banner {
  width: 100%;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0.82rem 1rem;
  border-radius: 999px;
  background: var(--gold);
  font-size: 1.08rem;
  font-weight: 1000;
  color: #564014;
  text-align: center;
}

.turn-status {
  cursor: default;
  user-select: none;
}

.hint {
  margin: 0;
  text-align: center;
  font-weight: 900;
  color: rgba(255, 250, 240, 0.7);
}

.katsh-table-renderer,
.murlan-table-renderer,
.demo-table-renderer {
  align-self: center;
}

.combo-tabs button {
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  background: rgba(223, 248, 234, 0.88);
  color: #10131a;
  font-weight: 1000;
}

.combo-tabs button.active {
  background: var(--gold);
}

.turn-timer {
  width: min(100%, 360px);
  justify-self: center;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-weight: 1000;
  font-size: 0.88rem;
}

.turn-timer i {
  height: 7px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--gold) calc(var(--turn-progress) * 100%), rgba(255, 255, 255, 0.13) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.katsh-trick-pile {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.katsh-trick-pile article {
  min-height: 124px;
  display: grid;
  grid-template-rows: 18px 62px 32px;
  place-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(4, 25, 28, 0.72);
}

.katsh-trick-pile article.taking-positive {
  background: rgba(58, 103, 69, 0.72);
  box-shadow: inset 0 0 0 1px rgba(103, 218, 128, 0.7), 0 0 18px rgba(103, 218, 128, 0.18);
}

.katsh-trick-pile article.taking-negative {
  background: rgba(102, 39, 46, 0.76);
  box-shadow: inset 0 0 0 1px rgba(255, 103, 116, 0.74), 0 0 18px rgba(255, 103, 116, 0.18);
}

.katsh-trick-pile small {
  color: var(--muted);
  font-weight: 1000;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.katsh-trick-pile b {
  display: grid;
  place-items: center;
  gap: 1px;
  font-size: 0.8rem;
  line-height: 1.05;
  color: var(--gold);
  max-width: 100%;
  overflow: hidden;
}

.katsh-trick-pile b span,
.katsh-trick-pile b em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.katsh-trick-pile b em {
  color: var(--text);
  font-style: normal;
  opacity: 0.8;
}

.table-card-slot {
  --card-w: 42px;
  --card-h: 62px;
  width: var(--card-w);
  height: var(--card-h);
  display: inline-grid;
  place-items: center;
  border: 1px dashed rgba(255, 250, 240, 0.17);
  border-radius: 10px;
  background: rgba(255, 250, 240, 0.025);
  color: rgba(255, 250, 240, 0.3);
  font-size: 1.2rem;
  font-weight: 1000;
}

.katsh-trick-pile article:not(.has-card) .table-card-slot {
  opacity: 0.22;
}

.katsh-trick-pile .playing-card,
.katsh-trick-pile .table-card-slot {
  grid-row: 2;
}

.sevens-board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(223, 248, 234, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.sevens-lane {
  display: grid;
  grid-template-rows: auto 58px 58px 58px;
  justify-items: center;
  align-items: center;
  min-height: 204px;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 16px;
  background: rgba(4, 25, 28, 0.54);
}

.sevens-up,
.sevens-down {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 58px;
}

.sevens-up {
  justify-content: center;
}

.sevens-down {
  justify-content: center;
}

.sevens-seven {
  display: grid;
  place-items: center;
  width: 68px;
  height: 58px;
}

.rotated-seven {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 58px;
}

.rotated-seven .playing-card {
  transform: rotate(90deg);
  transform-origin: center;
}

.sevens-lane small {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.72rem;
  text-align: center;
}

.exchange-line {
  min-height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 208, 91, 0.1);
  color: rgba(255, 250, 240, 0.78);
  font-weight: 1000;
  text-align: center;
}

.move-grid {
  display: grid;
  gap: 8px;
}

.move-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(4, 25, 28, 0.72);
}

.move-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-row > div {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.murlan-table-renderer .move-row {
  grid-template-columns: minmax(72px, 130px) minmax(72px, auto);
}

.murlan-table-renderer .move-row > div {
  min-width: 72px;
  height: 62px;
}

.murlan-table-renderer .move-row .playing-card,
.murlan-table-renderer .move-row .table-card-slot {
  flex: 0 0 var(--card-w);
}

.murlan-table-renderer .move-row .pass-chip {
  width: 42px;
  height: 62px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  padding: 0;
  border-radius: 8px;
}

.pass-chip {
  color: var(--gold);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 14px;
}

.hand-panel {
  padding: 20px;
}

.hand-panel h2,
.panel h2 {
  margin: 0;
}

.combo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.hand-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  min-height: 128px;
}

.hand-panel-compact .hand-cards {
  --hand-card-slot: 76px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--hand-card-slot), 1fr));
  align-items: end;
}

.hand-card-button {
  display: inline-grid;
  justify-self: center;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
}

.hand-card-button:disabled {
  opacity: 1;
}

.hand-panel footer {
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) 1fr;
  gap: 12px;
  margin-top: 16px;
}

.hand-panel footer.murlan-hand-footer {
  grid-template-columns: minmax(108px, 0.32fr) 1fr;
}

.panel {
  padding: 18px;
}

.stat-grid,
.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat-grid span,
.score-grid article,
.profile-game-tabs article {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.stat-grid small,
.score-grid small,
.profile-game-tabs small {
  color: var(--muted);
  font-weight: 800;
}

.profile-game-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-game-tabs article {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-game-tabs strong,
.profile-game-tabs small {
  grid-column: 1 / -1;
}

.profile-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.profile-form-grid label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-identity-card {
  padding: 12px 14px;
  border: 1px solid rgba(223, 248, 234, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.profile-section h3 {
  margin: 0;
  color: var(--gold);
  font-size: 1rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-pill {
  display: grid;
  gap: 2px;
  min-width: 136px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 208, 91, 0.1);
  border: 1px solid rgba(255, 208, 91, 0.24);
}

.badge-pill small {
  color: var(--muted);
  font-weight: 800;
}

.history-list,
.leaderboard-list,
.task-list {
  display: grid;
  gap: 8px;
}

.history-list article,
.leaderboard-list article,
.task-list article {
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.history-list article {
  grid-template-columns: 1fr auto;
}

.history-list span {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.leaderboard-panel header,
.task-panel header {
  gap: 12px;
}

.leaderboard-list article {
  grid-template-columns: 34px minmax(0, 1fr) repeat(3, auto);
}

.leaderboard-list b {
  color: var(--gold);
}

.leaderboard-list span {
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.task-list article {
  grid-template-columns: 34px 1fr;
}

.task-list article > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-weight: 1000;
}

.task-list article.done {
  border-color: rgba(57, 200, 121, 0.35);
}

.task-list small {
  color: var(--muted);
  font-weight: 800;
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.segmented button {
  padding: 8px 11px;
  min-height: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.segmented button.active {
  background: var(--gold);
  color: #20180a;
}

.profile-settings {
  display: grid;
  gap: 14px;
  margin: 14px 0 16px;
}

.profile-settings label,
.profile-settings fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  border: 0;
  padding: 0;
}

.profile-avatar-grid {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  max-height: 310px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.privacy-option {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.privacy-option input {
  margin-top: 4px;
}

.privacy-option span {
  display: grid;
  gap: 3px;
}

.privacy-option small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.25;
}

.profile-settings button {
  justify-self: start;
  min-width: 180px;
}

.score-grid article {
  grid-template-columns: 1fr auto;
}

.score-grid article.rank-1 {
  border: 1px solid rgba(57, 200, 121, 0.45);
}

.score-grid article.rank-2 {
  border: 1px solid rgba(255, 208, 91, 0.45);
}

.score-grid article.rank-3 {
  border: 1px solid rgba(255, 147, 80, 0.42);
}

.score-grid article.rank-4 {
  border: 1px solid rgba(217, 40, 65, 0.42);
}

.score-grid small {
  grid-column: 1;
}

.score-grid b {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--gold);
  font-size: 1.8rem;
}

.friend-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.friend-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.lobby-friend-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.friend-list article div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lobby-friend-list article div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.friend-list article small {
  color: var(--muted);
  font-weight: 800;
}

.lobby-friend-list article small {
  color: var(--muted);
  font-weight: 800;
}

.friend-list button,
.request-list button,
.friend-form button {
  padding: 0.55rem 0.85rem;
}

.friends-panel header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.social-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.social-summary span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  align-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.social-summary strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.social-summary small {
  color: var(--muted);
  font-weight: 850;
}

.friend-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.friend-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

.friend-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #090e1a;
  color: var(--text);
  padding: 12px 14px;
  font-weight: 900;
  outline: none;
}

.friend-form button,
.friend-actions button:first-child {
  background: var(--gold);
}

.friend-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.friend-actions small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.friend-actions button:last-child,
.request-list button:last-child {
  background: rgba(223, 248, 234, 0.94);
}

.social-section {
  margin-top: 18px;
}

.social-section h3 {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.86rem;
}

.request-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.request-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 208, 91, 0.08);
}

.request-card div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.request-card small {
  color: var(--muted);
  font-weight: 800;
}

.room-invite-status {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 208, 91, 0.28);
  border-radius: 14px;
  background: rgba(255, 208, 91, 0.08);
}

.room-invite-status strong {
  color: var(--gold);
}

.room-invite-status small {
  color: var(--muted);
  font-weight: 800;
}

.request-list.compact p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #6f7787;
}

.dot.on {
  background: #22d47b;
  box-shadow: 0 0 14px rgba(34, 212, 123, 0.75);
}

.request-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-weight: 900;
}

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

.matchmaking-panel p {
  margin: 0;
}

.matchmaking-panel button {
  justify-self: start;
  background: var(--gold);
}

.chat-panel form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.chat-panel header {
  align-items: center;
}

.chat-toggle {
  padding: 10px 14px;
  min-height: 42px;
}

.chat-toggle span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #17130a;
  font-size: 0.8rem;
}

.chat-preview {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-log {
  min-height: 72px;
  max-height: 220px;
  overflow: auto;
  overscroll-behavior: contain;
}

.game-log-panel div {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.game-log-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.events-panel div {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.events-panel p {
  margin: 0;
}

.events-panel p span {
  display: inline-grid;
  min-width: 42px;
  place-items: center;
  margin: 0 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 208, 91, 0.13);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 1000;
}

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

.lobby-panel header {
  align-items: center;
}

.lobby-panel header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.lobby-panel header button {
  min-width: 168px;
  background: var(--gold);
}

.setup-row {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr;
  gap: 12px;
}

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

.setup-panel label,
.setup-seat label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.setup-panel select,
.setup-panel input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #090e1a;
  color: var(--text);
  padding: 10px 12px;
  font-weight: 900;
}

.setup-panel input:disabled,
.setup-panel select:disabled {
  opacity: 0.55;
}

.setup-seat {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) minmax(96px, 0.78fr) minmax(124px, 0.82fr);
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.setup-seat.solo-setup-seat {
  grid-template-columns: minmax(120px, 1fr) minmax(128px, 0.9fr);
}

.setup-seat.open-seat {
  border: 1px dashed rgba(223, 248, 234, 0.22);
  background: rgba(255, 255, 255, 0.035);
}

.setup-seat-person {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding-bottom: 2px;
}

.setup-seat strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.96rem;
}

.setup-seat span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-friend-list {
  display: grid;
  gap: 8px;
}

.lobby-friend-list .friend-card {
  margin: 0;
}

.waiting-social-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.waiting-social-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.waiting-social-panel h3,
.waiting-social-panel p {
  margin: 0;
}

.waiting-social-panel h3,
.waiting-social-panel > header > strong {
  color: var(--gold);
}

.waiting-social-panel p,
.waiting-room-meta {
  color: var(--muted);
  font-weight: 800;
}

.waiting-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.waiting-share-actions button,
.waiting-share-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--mint);
  color: #102016;
  font-weight: 1000;
  text-decoration: none;
}

.waiting-room-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.waiting-invites {
  color: var(--gold) !important;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.hand-note {
  margin: 12px 0;
  color: var(--muted);
  font-weight: 900;
}

.tap-to-play-note {
  margin: 12px 0 0;
  color: var(--gold);
  font-weight: 1000;
}

.katsh-hand-footer {
  margin-top: 14px;
}

.katsh-hand-footer button {
  width: 100%;
}

.tutorial-strip,
.guest-signup-prompt,
.guest-progress-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.tutorial-strip strong,
.guest-signup-prompt strong {
  color: var(--gold);
}

.tutorial-strip span,
.guest-signup-prompt span {
  color: var(--muted);
  font-weight: 850;
}

.tutorial-strip,
.guest-signup-prompt {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.tutorial-strip div,
.guest-signup-prompt div {
  display: grid;
  gap: 4px;
}

.suggested-move {
  margin: 10px 0 0;
  color: var(--gold);
  font-weight: 1000;
}

.hand-card-button.is-legal .playing-card {
  box-shadow: 0 0 0 3px rgba(101, 213, 139, 0.55), 0 12px 24px rgba(0, 0, 0, 0.25);
}

.hand-card-button.is-recommended .playing-card {
  transform: translateY(-5px);
}

.hand-card-button.is-illegal .playing-card {
  filter: grayscale(0.18);
}

.hand-card-button.is-submitting .playing-card {
  animation: submitting-card var(--motion-normal) ease-in-out infinite alternate;
}

@keyframes submitting-card {
  to { transform: translateY(-4px); filter: brightness(1.08); }
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-health {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 208, 91, 0.22);
  border-radius: 16px;
  background: rgba(255, 208, 91, 0.07);
}

.admin-health h3 {
  margin: 0;
  color: var(--gold);
  font-size: 1rem;
}

.admin-health div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-health span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(4, 8, 16, 0.22);
}

.admin-health small {
  color: var(--muted);
  font-weight: 850;
}

.admin-grid section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-grid h3 {
  margin: 0;
  color: var(--gold);
  font-size: 0.95rem;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-list article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-list strong,
.admin-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playing-card {
  --card-w: 76px;
  --card-h: 112px;
  width: var(--card-w);
  height: var(--card-h);
  position: relative;
  display: inline-grid;
  grid-template-rows: auto 1fr;
  padding: 8px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.86), transparent 42%),
    linear-gradient(145deg, #fffef8 0%, #fff6df 56%, #dcc895 100%);
  color: #10131a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.82), inset 0 0 0 4px rgba(18,24,39,0.07), 0 10px 22px rgba(0,0,0,0.28);
  font-weight: 1000;
  overflow: hidden;
}

.playing-card.red {
  color: var(--red);
}

.card-table {
  --card-w: 42px;
  --card-h: 62px;
  padding: 5px;
  border-radius: 8px;
}

.card-rank {
  position: relative;
  z-index: 2;
  font-size: 1.05rem;
  line-height: 1;
}

.card-table .card-rank {
  font-size: 0.78rem;
}

.card-suit {
  place-self: center;
  font-size: 3.25rem;
  line-height: 1;
}

.card-table .card-suit {
  font-size: 1.95rem;
}

.playing-card.joker {
  color: #111;
}

.playing-card.joker.red {
  color: var(--red);
}

.joker-head {
  position: absolute;
  inset: 18px 9px 9px;
  display: grid;
  place-items: center;
}

.card-table .joker-head {
  inset: 13px 5px 4px;
}

.joker-head svg {
  width: 100%;
  height: 100%;
}

.joker-wing,
.joker-head circle {
  fill: currentColor;
}

.joker-mask {
  fill: #fffaf0;
  stroke: currentColor;
  stroke-width: 2;
}

.joker-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-back {
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 208, 91, 0.16), transparent),
    #152034;
  color: var(--gold);
  border: 1px dashed rgba(255, 255, 255, 0.22);
}

.card-back span {
  font-size: 1.5rem;
}

.playing-card.is-selected {
  transform: translateY(-8px);
  box-shadow: inset 0 0 0 2px var(--gold), 0 18px 32px rgba(255, 208, 91, 0.2);
}

.playing-card.is-muted {
  opacity: 0.42;
}

.local-win-feedback .turn-banner,
.local-win-feedback .hint {
  animation: local-win-pulse 780ms ease-out both;
}

@keyframes local-win-pulse {
  0% { transform: scale(0.98); box-shadow: 0 0 0 rgba(57, 200, 121, 0); }
  45% { transform: scale(1.01); box-shadow: 0 0 28px rgba(57, 200, 121, 0.34); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(57, 200, 121, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 18px, 680px);
    padding: 10px 0 18px;
  }

  .login-screen,
  .game-list,
  .stat-grid,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .login-screen {
    padding-block: 0;
  }

  .login-copy {
    padding: 24px 20px;
  }

  .login-card {
    position: static;
  }

  .login-copy h1 {
    font-size: 3.3rem;
  }

  .login-copy p {
    font-size: 1.05rem;
  }

  .landing-preview {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .preview-table {
    min-height: 126px;
    border-width: 6px;
  }

  .preview-score {
    display: none;
  }

  .top-bar {
    position: relative;
    top: 0;
    display: block;
    padding: 8px;
  }

  .top-bar .brand {
    display: none;
  }

  .top-bar nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    justify-content: stretch;
    gap: 5px;
  }

  .top-bar nav button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.42rem 0.24rem;
    font-size: clamp(0.64rem, 2.7vw, 0.82rem);
  }

  .gameplay-top-bar {
    display: flex;
    align-items: center;
    padding: 6px 10px;
  }

  .gameplay-top-bar button {
    width: auto;
    min-height: 40px;
    padding-inline: 0.8rem;
    font-size: 0.78rem;
  }

  .gameplay-top-bar nav {
    width: auto;
    display: flex;
    grid-template-columns: none;
    gap: 5px;
  }

  .brand {
    font-size: 1.15rem;
    padding: 0.2rem 0.4rem;
  }

  .hub-hero {
    grid-template-columns: 1fr;
    padding: 16px 18px;
    border-radius: 20px;
  }

  .hub-hero h1 {
    font-size: clamp(1.55rem, 8vw, 2.25rem);
  }

  .hub-status {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hub-status span,
  .hub-status button {
    min-height: 50px;
    padding: 8px;
    border-radius: 14px;
  }

  .hub-status strong {
    font-size: 0.86rem;
  }

  .hub-status small {
    font-size: 0.68rem;
  }

  .next-step-panel article {
    grid-template-columns: 1fr;
  }

  .next-step-panel button {
    grid-column: auto;
    grid-row: auto;
  }

  .hub-hero h1 {
    font-size: 2rem;
  }

  .hub-hero p {
    font-size: 0.9rem;
  }

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

  .onboarding-help {
    position: relative;
    top: 0;
  }

  .onboarding-card h1 {
    font-size: 2.15rem;
  }

  .profile-avatar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 260px;
  }

  .social-summary,
  .admin-health div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-felt {
    min-height: 530px;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    place-items: stretch;
    gap: 8px;
  }

  .table-felt:not(.murlan-felt) {
    min-height: 430px;
  }

  .murlan-felt {
    gap: 8px;
  }

  .seat {
    position: relative;
    inset: auto;
    transform: none;
    width: 100%;
    height: 58px;
    min-width: 0;
    min-height: 0;
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 7px 8px;
    gap: 7px;
    border-radius: 14px;
  }

  .seat .avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .seat .avatar-emoji {
    font-size: 1.38rem;
  }

  .seat strong {
    font-size: 0.84rem;
  }

  .seat span {
    font-size: 0.66rem;
  }

  .seat small {
    font-size: 0.66rem;
    margin-top: 1px;
  }

  .murlan-felt .seat {
    height: 66px;
  }

  .murlan-seat-score {
    font-size: 0.58rem;
  }

  .seat-friend-button {
    right: 5px;
    bottom: 5px;
    padding: 0.28rem 0.42rem;
    font-size: 0.55rem;
  }

  .table-center {
    grid-column: 1 / -1;
    width: min(100%, 560px);
    margin-top: 2px;
  }

  .katsh-trick-pile {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .katsh-trick-pile article {
    min-height: 104px;
    grid-template-rows: 16px 54px 28px;
    padding: 6px;
  }

  .move-row {
    grid-template-columns: 86px 1fr;
    min-height: 54px;
    padding: 7px 9px;
  }

  .murlan-table-renderer .move-row {
    grid-template-columns: minmax(72px, 86px) minmax(58px, auto);
  }

  .murlan-table-renderer .move-row > div {
    min-width: 58px;
    height: 53px;
  }

  .murlan-table-renderer .move-row .pass-chip {
    width: 36px;
    height: 53px;
    flex-basis: 36px;
    border-radius: 8px;
    font-size: 0.78rem;
  }

  .hand-panel {
    padding: 15px;
  }

  .hand-cards {
    gap: 8px;
  }

  .hand-panel-compact .hand-cards {
    --hand-card-slot: 60px;
  }

  .playing-card {
    --card-w: 60px;
    --card-h: 88px;
    border-radius: 9px;
  }

  .card-table {
    --card-w: 36px;
    --card-h: 53px;
  }

  .table-card-slot {
    --card-w: 36px;
    --card-h: 53px;
  }

  .sevens-seven,
  .rotated-seven {
    width: 58px;
    height: 54px;
  }

  .card-suit {
    font-size: 2.55rem;
  }

  .chat-panel form,
  .friend-form {
    grid-template-columns: 1fr;
  }

  .hand-panel footer:not(.murlan-hand-footer) {
    grid-template-columns: 1fr;
  }

  .hand-panel footer.murlan-hand-footer {
    grid-template-columns: minmax(96px, 0.35fr) 1fr;
    gap: 8px;
  }

  .friend-list article,
  .request-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .friend-actions,
  .request-list button {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .leaderboard-list article {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .leaderboard-list article span:nth-of-type(2),
  .leaderboard-list article span:nth-of-type(3) {
    grid-column: 2 / -1;
    font-size: 0.78rem;
  }

  .history-list article {
    grid-template-columns: 1fr;
  }

  .history-list span {
    text-align: left;
  }

  .friend-actions button,
  .request-list button {
    flex: 1;
  }

  .setup-row {
    grid-template-columns: 1fr;
  }

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

  .setup-seat {
    grid-template-columns: minmax(88px, 1fr) minmax(76px, 0.78fr) minmax(92px, 0.82fr);
    min-height: 52px;
    padding: 8px;
    gap: 7px;
  }

  .setup-seat.solo-setup-seat {
    grid-template-columns: minmax(108px, 1fr) minmax(104px, 0.86fr);
  }

  .setup-panel label,
  .setup-seat label {
    font-size: 0.72rem;
    gap: 4px;
  }

  .setup-panel select,
  .setup-panel input {
    padding: 8px 9px;
    border-radius: 11px;
    font-size: 0.82rem;
  }

  .setup-seat strong {
    font-size: 0.86rem;
  }

  .setup-seat span {
    font-size: 0.7rem;
  }

  .lobby-panel header {
    flex-direction: column;
    align-items: stretch;
  }

  .lobby-panel header button {
    width: 100%;
    min-width: 0;
  }

  .room-actions-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .tutorial-strip {
    gap: 8px;
    padding: 12px;
  }

  .tutorial-strip strong,
  .tutorial-strip span {
    font-size: 0.82rem;
  }

  .guest-entry-actions,
  .hub-primary-actions,
  .tutorial-strip,
  .guest-signup-prompt {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .guest-entry-actions button,
  .hub-primary-actions button,
  .tutorial-strip button,
  .guest-signup-prompt button {
    width: 100%;
    justify-content: center;
  }

  .room-actions-panel button,
  .panel-actions button {
    width: 100%;
  }

  .waiting-share-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .waiting-share-actions button,
  .waiting-share-actions a {
    min-width: 0;
    padding-inline: 0.35rem;
    font-size: 0.72rem;
  }

  .help-overlay {
    align-items: end;
    padding: 8px;
  }

  .start-flow-overlay {
    align-items: end;
    padding: 8px;
  }

  .confirm-overlay {
    align-items: end;
    padding: 8px;
  }

  .confirm-sheet div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .start-flow-sheet {
    border-radius: 18px;
    padding: 20px 16px;
  }

  .start-game-choices {
    grid-template-columns: 1fr;
  }

  .start-game-choices button {
    min-height: 96px;
  }

  .help-sheet {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
    padding: 20px 16px;
  }

  .help-sections {
    grid-template-columns: 1fr;
  }

  .help-sections section:last-child {
    grid-column: auto;
  }

  .help-sheet > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .help-sheet > footer button {
    width: 100%;
  }
}
