:root {
  --bg: #050814;
  --bg-soft: #0b1220;
  --surface: rgba(11, 18, 32, 0.92);
  --surface-2: rgba(16, 26, 45, 0.98);
  --border: rgba(140, 171, 221, 0.18);
  --border-strong: rgba(248, 190, 80, 0.35);
  --text: #eef4ff;
  --muted: #9fb0cd;
  --accent: #38bdf8;
  --accent-2: #f59e0b;
  --success: #22c55e;
  --danger: #f87171;
  --felt-1: #0f5b45;
  --felt-2: #083126;
  --shadow: 0 24px 80px rgba(1, 7, 18, 0.58);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 650px at 50% -15%, rgba(56, 189, 248, 0.15), transparent 55%),
    radial-gradient(900px 540px at 100% 0%, rgba(245, 158, 11, 0.12), transparent 45%),
    linear-gradient(180deg, #07101f 0%, #03060d 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.surface {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-banner,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
}

.hero-copy,
.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  color: #08111f;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.22);
}

.brand-copy h1,
.section-title,
.panel-title,
.card-title {
  margin: 0;
  font-size: clamp(1.25rem, 1.4vw, 1.8rem);
  line-height: 1.1;
}

.brand-copy p,
.muted,
.helper,
.footer-note,
.table-note,
.chat-meta,
.rule-list,
.card-copy,
.kicker {
  margin: 0;
  color: var(--muted);
}

.hero-actions,
.stack-inline,
.form-row,
.toolbar,
.actions,
.call-stack,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill,
.badge,
.mini-chip,
.rank-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: rgba(8, 15, 28, 0.74);
  color: var(--text);
  font-size: 0.88rem;
}

.pill strong,
.score-pill strong,
.money {
  color: #fdd173;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #061120;
  box-shadow: 0 18px 36px rgba(56, 189, 248, 0.18);
}

.btn.secondary {
  background: rgba(8, 15, 28, 0.74);
  border-color: var(--border);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.btn.small {
  padding: 8px 12px;
  font-size: 0.88rem;
}

.input,
.select,
textarea.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(5, 10, 20, 0.88);
  color: var(--text);
  outline: none;
}

.input:focus,
.select:focus,
textarea.input:focus {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.grid-3,
.grid-2,
.link-grid,
.stats-grid,
.top-grid,
.bottom-grid {
  display: grid;
  gap: 16px;
}

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

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

.section-block {
  padding: 22px 24px;
}

.link-card,
.info-card,
.stat-card,
.panel-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(9, 16, 30, 0.92), rgba(14, 22, 38, 0.95));
}

.link-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(245, 158, 11, 0.14);
  color: var(--accent-2);
  margin-bottom: 12px;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 900;
}

.flash {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(127, 29, 29, 0.18);
}

.flash.success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(20, 83, 45, 0.22);
}

.flash.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(120, 53, 15, 0.22);
}

.table-wrap {
  overflow: auto;
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

.table th,
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
}

.table th {
  color: #bfd0ee;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(9, 16, 30, 0.82);
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.empty-row {
  text-align: center;
  color: var(--muted);
}

.footer-line {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.feature-list,
.rule-list {
  padding-left: 18px;
  line-height: 1.6;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) 360px;
  gap: 18px;
  margin-top: 18px;
}

.board-surface {
  padding: 18px;
}

.board-top {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.player-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.player-badge {
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 24, 0.82);
  color: var(--muted);
}

.player-badge strong {
  color: var(--text);
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.score-pill {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 24, 0.76);
}

.score-pill span {
  color: var(--muted);
  font-size: 0.82rem;
}

.score-pill strong {
  font-size: 1.5rem;
}

.score-pill.you {
  text-align: right;
}

.room-chip {
  justify-self: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fcd34d;
  font-weight: 800;
}

.table-felt {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 24px;
  min-height: 690px;
  background:
    radial-gradient(520px 280px at 50% 28%, rgba(255,255,255,0.08), transparent 55%),
    radial-gradient(880px 420px at 50% 50%, rgba(255,255,255,0.05), transparent 50%),
    linear-gradient(180deg, var(--felt-1), var(--felt-2));
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.table-felt::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 999px;
  border: 10px solid rgba(3, 25, 19, 0.32);
  box-shadow: inset 0 0 0 2px rgba(236, 253, 245, 0.08);
  pointer-events: none;
}

.felt-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  min-height: 640px;
}

.hand-zone {
  display: grid;
  gap: 10px;
}

.hand-zone.yours {
  align-self: end;
}

.hand-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hand-head strong {
  font-size: 1.04rem;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  min-height: 158px;
}

.cards-player {
  align-items: flex-end;
}

.cardc,
.mesa-card {
  width: 96px;
  height: 144px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(1, 7, 18, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(4, 10, 20, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, outline-color 0.18s ease;
}

.cardc.playable {
  cursor: pointer;
}

.cardc.playable:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 34px rgba(1, 7, 18, 0.55);
}

.cardc.disabled {
  opacity: 0.78;
}

.mesa-zone {
  display: grid;
  align-content: center;
  gap: 16px;
}

.status-banner {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 9, 18, 0.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.call-stack {
  justify-content: center;
}

.call-pill {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(5, 10, 20, 0.65);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.85rem;
}

.call-pill.active {
  border-color: rgba(245, 158, 11, 0.42);
  color: #fde68a;
}

.mesa-cards {
  display: flex;
  justify-content: center;
  gap: 18px;
  min-height: 154px;
}

.actions {
  justify-content: center;
  min-height: 48px;
}

.actions button {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(3, 9, 18, 0.56);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.actions button.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #05111f;
  border-color: transparent;
}

.actions button.warn {
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.action-caption {
  color: rgba(241, 245, 249, 0.85);
  text-align: center;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.chat-surface,
.rules-surface {
  padding: 20px;
}

.chat-messages {
  margin-top: 14px;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.chat-line {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(6, 12, 24, 0.72);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.92rem;
}

.chat-line b {
  color: #f8fafc;
}

.form-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

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

.rank-chip {
  justify-content: space-between;
}

.hero-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-top: 18px;
}

.copy-stack {
  display: grid;
  gap: 14px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
}

.login-side,
.login-panel {
  padding: 30px;
}

.login-side {
  background:
    radial-gradient(420px 220px at 20% 0%, rgba(245, 158, 11, 0.18), transparent 60%),
    radial-gradient(520px 260px at 100% 100%, rgba(56, 189, 248, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(11, 18, 32, 0.94), rgba(6, 11, 20, 0.98));
}

.legal-note {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--muted);
}

pre.json-box {
  padding: 14px;
  border-radius: 18px;
  overflow: auto;
  background: rgba(6, 12, 24, 0.8);
  border: 1px solid var(--border);
  color: #d7e5ff;
  font-size: 0.84rem;
}

@media (max-width: 1120px) {
  .game-grid,
  .hero-split,
  .login-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    padding-top: 16px;
  }

  .grid-3,
  .grid-2,
  .link-grid,
  .stats-grid,
  .top-grid,
  .side-stack {
    grid-template-columns: 1fr;
  }

  .hero-banner,
  .panel-head,
  .brand-lockup,
  .hand-head,
  .toolbar,
  .hero-actions {
    align-items: flex-start;
  }

  .hero-banner,
  .panel-head {
    flex-direction: column;
  }

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

  .score-pill.you {
    text-align: left;
  }

  .room-chip {
    justify-self: start;
  }

  .table-felt {
    min-height: 0;
    padding: 16px;
  }

  .felt-layout {
    min-height: 0;
  }

  .cardc,
  .mesa-card {
    width: 82px;
    height: 123px;
  }

  .form-inline {
    grid-template-columns: 1fr;
  }

  .invite-buttons {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 24px;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .brand-logo-large {
    width: 90px;
    height: 90px;
    border-radius: 24px;
  }

  .section-block,
  .hero-banner,
  .panel-head,
  .chat-surface,
  .rules-surface {
    padding: 18px;
  }

  .cardc,
  .mesa-card {
    width: 72px;
    height: 108px;
    border-radius: 16px;
  }
}


.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.24);
  background: rgba(8, 15, 28, 0.74);
}

.brand-logo-large {
  width: 112px;
  height: 112px;
  border-radius: 28px;
}

.brand-lockup-top {
  align-items: flex-start;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.invite-strip {
  padding: 22px 24px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.invite-copy {
  display: grid;
  gap: 10px;
}

.invite-actions {
  display: grid;
  gap: 12px;
}

.invite-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.invite-input {
  font-size: 0.92rem;
}

#inviteFeedback.success-text,
#inviteLobbyFeedback.success-text {
  color: #b7f7c4;
}

#inviteFeedback.error-text,
#inviteLobbyFeedback.error-text {
  color: #ffb8b8;
}


@media (max-width: 860px) {
  .invite-buttons {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .brand-logo-large {
    width: 90px;
    height: 90px;
    border-radius: 24px;
  }
}



.player-badge {
  display: grid;
  gap: 4px;
}

.player-badge span {
  font-size: 0.82rem;
  color: var(--muted);
}

.player-badge.you {
  border-color: rgba(245, 158, 11, 0.36);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.16);
}

.team-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.team-pill {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 24, 0.76);
}

.team-pill span {
  color: var(--muted);
  font-size: 0.82rem;
}

.team-pill strong {
  font-size: 1.5rem;
  color: #fdd173;
}

.team-pill.you-team {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.18);
}

.team-pill.winner {
  border-color: rgba(34, 197, 94, 0.34);
}

.felt-layout-modern {
  grid-template-rows: auto 1fr auto;
}

.other-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mini-seat {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 9, 18, 0.34);
  min-height: 150px;
}

.mini-seat.partner {
  border-color: rgba(56, 189, 248, 0.22);
}

.mini-seat.rival {
  border-color: rgba(245, 158, 11, 0.18);
}

.mini-seat.turn {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.mini-seat.empty-seat {
  place-items: center;
  color: var(--muted);
}

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

.mini-seat-head strong {
  font-size: 0.98rem;
}

.mini-seat-head span {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: capitalize;
}

.cards-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cardc.mini {
  width: 54px;
  height: 82px;
  border-radius: 14px;
}

.mini-empty,
.mesa-placeholder {
  color: var(--muted);
  font-size: 0.9rem;
}

.mesa-card-wrap {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.mesa-owner {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.action-caption {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .team-scoreboard {
    grid-template-columns: 1fr;
  }

  .other-players-grid {
    grid-template-columns: 1fr;
  }

  .cardc.mini {
    width: 48px;
    height: 74px;
  }
}

@media (max-width: 560px) {
  .team-pill {
    padding: 12px 14px;
  }

  .cardc.mini {
    width: 42px;
    height: 64px;
    border-radius: 12px;
  }
}


body.login-page,
body.game-page {
  padding-bottom: 0;
}

.page-shell-app {
  padding-bottom: 86px;
}

.top-nav {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(5, 10, 20, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 18px 36px rgba(1, 7, 18, 0.35);
}

.top-nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  border: 1px solid transparent;
}

.top-nav-link.active {
  color: #07101f;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.18);
}

.hero-banner-glow {
  position: relative;
  overflow: hidden;
}

.hero-banner-glow::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 68%);
  pointer-events: none;
}

.hero-brand {
  width: 100px;
  height: 100px;
}

.badge-glow {
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 0 32px rgba(245, 158, 11, 0.12);
}

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

.mini-feature {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(6, 12, 24, 0.68);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
}

.login-copy-block {
  margin-top: 20px;
}

.modern-login-card {
  position: relative;
}

.brand-logo-hero {
  width: 148px;
  height: 148px;
  border-radius: 32px;
}

.gsi-box {
  margin-top: 18px;
}

.demo-login-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(6, 12, 24, 0.68);
}

.btn-block {
  width: 100%;
  justify-content: center;
  display: inline-flex;
}

.deck-spotlight,
.deck-mini-panel {
  display: grid;
  gap: 14px;
}

.deck-preview-image {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 13, 25, 0.72);
  box-shadow: 0 22px 42px rgba(1, 7, 18, 0.32);
}

.deck-preview-image.compact {
  border-radius: 18px;
}

.spotlight-head,
.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.rooms-grid,
.market-grid,
.owned-decks-grid {
  display: grid;
  gap: 16px;
}

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

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

.owned-decks-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.room-card,
.market-card,
.owned-deck-card,
.empty-state-card {
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(9, 16, 30, 0.94), rgba(12, 20, 35, 0.96));
  padding: 18px;
}

.room-card-head,
.market-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.room-card-metrics,
.market-meta,
.room-card-actions,
.market-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.room-card-actions,
.market-actions {
  margin-top: 16px;
}

.market-card {
  overflow: hidden;
  padding: 0;
}

.market-card-media {
  position: relative;
  padding: 14px;
  background: rgba(4, 9, 18, 0.72);
}

.market-card-media img {
  width: 100%;
  border-radius: 20px;
}

.market-badge {
  position: absolute;
  top: 24px;
  left: 24px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(6, 12, 24, 0.86);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fdd173;
  font-size: 0.82rem;
  font-weight: 700;
}

.market-card-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.owned-deck-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.owned-deck-card img {
  width: 100%;
  border-radius: 16px;
}

.owned-deck-card.active {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 16px 30px rgba(245, 158, 11, 0.08);
}

.owned-deck-copy {
  display: grid;
  gap: 4px;
}

.owned-deck-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}

.invite-strip-compact {
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
}

.actions-sticky-mobile {
  position: relative;
}

.emotes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.emote-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(8, 15, 28, 0.74);
  color: var(--text);
  cursor: pointer;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
}

.mobile-tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 50;
  display: none;
  gap: 8px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(5, 10, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 42px rgba(1, 7, 18, 0.55);
}

.mobile-tab {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  text-align: center;
  border-radius: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.mobile-tab.active {
  color: #07101f;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.app-toast-stack {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.app-toast {
  min-width: 220px;
  max-width: min(92vw, 360px);
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(6, 12, 24, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 42px rgba(1, 7, 18, 0.45);
  animation: toastIn .18s ease;
}

.app-toast.success {
  border-color: rgba(34, 197, 94, 0.34);
}

.app-toast.error {
  border-color: rgba(248, 113, 113, 0.34);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  .rooms-grid,
  .market-grid,
  .owned-decks-grid {
    grid-template-columns: 1fr;
  }

  .invite-strip-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .top-nav {
    display: none;
  }

  .mobile-tabbar {
    display: flex;
  }

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

  .hero-brand,
  .brand-logo-hero {
    width: 92px;
    height: 92px;
  }

  .actions-sticky-mobile {
    position: sticky;
    bottom: 8px;
    padding: 12px;
    border-radius: 20px;
    background: rgba(3, 9, 18, 0.72);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
  }
}

@media (max-width: 560px) {
  .page-shell-app {
    padding-bottom: 96px;
  }

  .mobile-tabbar {
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 18px;
  }

  .market-card-body,
  .room-card {
    padding: 16px;
  }

  .hero-actions {
    width: 100%;
  }
}


.login-actions-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.login-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(148, 163, 184, 0.18);
}

.login-divider::before {
  margin-right: 10px;
}

.login-divider::after {
  margin-left: 10px;
}

.google-btn-mount {
  min-height: 46px;
  display: flex;
  align-items: center;
}

.login-cta-row {
  display: grid;
  gap: 10px;
}

/* Final polish: mobile table, classic cards, compact UI, voice toggle */
.cardc,
.mesa-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 16%, rgba(255,255,255,0.92), rgba(255,255,255,0) 24%),
    linear-gradient(180deg, rgba(255,248,232,0.98), rgba(243,229,199,0.96));
  border: 1px solid rgba(255, 214, 150, 0.24);
  box-shadow:
    0 18px 34px rgba(1, 7, 18, 0.42),
    0 0 0 1px rgba(255, 226, 164, 0.08) inset;
}

.cardc::before,
.mesa-card::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  border: 1px solid rgba(255, 216, 151, 0.26);
  pointer-events: none;
  z-index: 2;
}

.cardc::after,
.mesa-card::after {
  content: "";
  position: absolute;
  inset: auto -8% 54% auto;
  width: 76%;
  height: 62%;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 68%);
  pointer-events: none;
  z-index: 2;
}

.cardc img,
.mesa-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  position: relative;
  z-index: 1;
  filter: saturate(1.06) contrast(1.02);
}

.card-art.suit-oro {
  box-shadow:
    0 18px 34px rgba(245, 158, 11, 0.18),
    0 18px 34px rgba(1, 7, 18, 0.42),
    0 0 0 1px rgba(255, 226, 164, 0.08) inset;
}

.card-art.suit-espada {
  box-shadow:
    0 18px 34px rgba(59, 130, 246, 0.16),
    0 18px 34px rgba(1, 7, 18, 0.42),
    0 0 0 1px rgba(255, 226, 164, 0.08) inset;
}

.card-art.suit-copa {
  box-shadow:
    0 18px 34px rgba(244, 63, 94, 0.14),
    0 18px 34px rgba(1, 7, 18, 0.42),
    0 0 0 1px rgba(255, 226, 164, 0.08) inset;
}

.card-art.suit-basto {
  box-shadow:
    0 18px 34px rgba(34, 197, 94, 0.14),
    0 18px 34px rgba(1, 7, 18, 0.42),
    0 0 0 1px rgba(255, 226, 164, 0.08) inset;
}

.cards-player {
  gap: 0;
  padding: 10px 12px 2px;
  perspective: 960px;
}

.cards-player .cardc {
  --fan-rotate: 0deg;
  --fan-offset: 0px;
  margin-inline: -6px;
  transform-origin: center 120%;
  transform: translateY(var(--fan-offset)) rotate(var(--fan-rotate));
}

.cards-player .cardc:nth-child(1) {
  --fan-rotate: -10deg;
  --fan-offset: 10px;
}

.cards-player .cardc:nth-child(2) {
  --fan-rotate: 0deg;
  --fan-offset: 0px;
  z-index: 2;
}

.cards-player .cardc:nth-child(3) {
  --fan-rotate: 10deg;
  --fan-offset: 10px;
}

.cardc.playable:hover {
  transform: translateY(calc(var(--fan-offset, 0px) - 18px)) rotate(var(--fan-rotate, 0deg)) scale(1.03);
  box-shadow: 0 26px 42px rgba(1, 7, 18, 0.56);
}

.cardc.playable:active {
  transform: translateY(calc(var(--fan-offset, 0px) - 10px)) rotate(var(--fan-rotate, 0deg)) scale(0.99);
}

.cards-mini {
  gap: 0;
}

.cards-mini .cardc.mini {
  margin-right: -10px;
  box-shadow: 0 12px 24px rgba(1, 7, 18, 0.36);
}

.cards-mini .cardc.mini:last-child {
  margin-right: 0;
}

.mesa-zone {
  gap: 18px;
}

.mesa-cards {
  align-items: flex-start;
}

.mesa-card-wrap {
  min-width: 96px;
}

.mesa-card-wrap.enter {
  animation: mesaDrop 320ms cubic-bezier(.2, .85, .2, 1) both;
  animation-delay: calc(var(--card-index, 0) * 70ms);
}

.mesa-card-wrap:nth-child(odd) .mesa-card {
  transform: rotate(-4deg);
}

.mesa-card-wrap:nth-child(even) .mesa-card {
  transform: rotate(4deg);
}

@keyframes mesaDrop {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.table-felt {
  background:
    radial-gradient(480px 220px at 50% 42%, rgba(34, 197, 94, 0.14), transparent 64%),
    radial-gradient(240px 140px at 50% 45%, rgba(245, 158, 11, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(8, 26, 20, 0.34), rgba(4, 12, 10, 0.14));
}

.status-banner {
  background:
    linear-gradient(180deg, rgba(10, 19, 34, 0.86), rgba(6, 12, 24, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 14px 30px rgba(1, 7, 18, 0.22);
}

.call-pill {
  background: rgba(5, 10, 20, 0.84);
}

.side-stack-game {
  align-content: start;
}

.table-tools-panel {
  gap: 14px;
}

.compact-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.compact-input {
  flex: 1 1 220px;
}

.small-text {
  font-size: 0.84rem;
}

.pill.soft {
  background: rgba(9, 16, 30, 0.78);
  border-color: rgba(255, 255, 255, 0.08);
}

.compact-note {
  min-height: 20px;
  margin-top: 0;
}

.deck-preview-image-game {
  max-height: 178px;
  object-fit: cover;
}

.emote-pill {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.emote-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.18);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.08);
}

[data-voice-toggle].is-muted {
  opacity: 0.82;
  border-color: rgba(248, 113, 113, 0.22);
}

@media (max-width: 860px) {
  .cards-player {
    padding: 6px 2px 0;
  }

  .cards-player .cardc {
    margin-inline: -10px;
  }

  .mesa-card-wrap {
    min-width: 82px;
  }

  .compact-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .cards-player .cardc {
    margin-inline: -12px;
  }

  .cardc::before,
  .mesa-card::before {
    inset: 2px;
  }

  .mesa-card-wrap {
    min-width: 72px;
  }
}

/* --- final live/spectator polish --- */
.room-card.is-live {
  border-color: rgba(56, 189, 248, 0.26);
  box-shadow: 0 18px 36px rgba(56, 189, 248, 0.08);
}

.room-card.is-yours {
  border-color: rgba(245, 158, 11, 0.34);
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.1);
}

.status-live,
.live-chip {
  border-color: rgba(56, 189, 248, 0.28);
  color: #bfe8ff;
}

.full-chip {
  border-color: rgba(245, 158, 11, 0.3);
}

.owner-chip {
  border-color: rgba(245, 158, 11, 0.34);
  color: #ffe08a;
}

.live-pill {
  border-color: rgba(56, 189, 248, 0.3);
  color: #c6eeff;
}

.rooms-floating-dock {
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 50;
  display: grid;
  gap: 10px;
  justify-items: end;
  pointer-events: none;
}

.rooms-floating-label {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 15, 28, 0.84);
  border: 1px solid rgba(140, 171, 221, 0.16);
  color: var(--muted);
  font-size: 0.78rem;
  box-shadow: 0 16px 34px rgba(1, 7, 18, 0.22);
}

.room-fab {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  text-align: center;
  background: linear-gradient(180deg, rgba(8, 15, 28, 0.94), rgba(12, 22, 40, 0.96));
  border: 1px solid rgba(140, 171, 221, 0.18);
  box-shadow: 0 18px 32px rgba(1, 7, 18, 0.26);
  pointer-events: auto;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.room-fab:hover {
  transform: translateY(-2px) scale(1.02);
}

.room-fab.is-open {
  border-color: rgba(34, 197, 94, 0.28);
}

.room-fab.is-live {
  border-color: rgba(56, 189, 248, 0.34);
}

.room-fab.is-yours {
  border-color: rgba(245, 158, 11, 0.38);
}

.room-fab-code {
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
}

.room-fab-count {
  font-size: 0.68rem;
  color: var(--muted);
}

.clock-banner {
  display: none;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 16px;
  border: 1px solid rgba(140, 171, 221, 0.16);
  background: rgba(8, 15, 28, 0.74);
  color: #dbeafe;
  font-size: 0.9rem;
  text-align: center;
}

.clock-banner.visible {
  display: block;
}

.clock-banner.danger {
  border-color: rgba(248, 113, 113, 0.34);
  color: #ffd1d1;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.08);
}

.spectator-hand {
  min-height: 122px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border-radius: 24px;
  border: 1px dashed rgba(140, 171, 221, 0.18);
  background: rgba(8, 15, 28, 0.46);
  padding: 18px;
}

.chat-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
}

.chat-line.spectator {
  border-left: 2px solid rgba(56, 189, 248, 0.26);
  padding-left: 10px;
}

@media (max-width: 860px) {
  .rooms-floating-dock {
    right: 12px;
    bottom: 92px;
  }

  .room-fab {
    width: 60px;
    height: 60px;
  }

  .rooms-floating-label {
    display: none;
  }
}

@media (max-width: 560px) {
  .rooms-floating-dock {
    right: 10px;
    bottom: 92px;
    gap: 8px;
  }

  .room-fab {
    width: 56px;
    height: 56px;
  }

  .room-fab-code {
    font-size: 0.76rem;
  }

  .room-fab-count {
    font-size: 0.62rem;
  }
}


/* --- production copy and focused board layout --- */
.game-page .hero-banner {
  padding: 14px 16px;
  gap: 12px;
}

.game-page .hero-banner .brand-copy p {
  font-size: 0.92rem;
}

.game-page .game-grid {
  grid-template-columns: minmax(0, 1120px);
  justify-content: center;
  max-width: 1120px;
  margin: 18px auto 0;
}

.game-page .board-surface {
  padding: 16px;
}

.game-page .table-felt {
  max-width: 1040px;
  margin: 0 auto;
}

.game-page .side-stack-game {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1120px;
  margin: 0 auto;
}

.game-page .chat-surface,
.game-page .deck-mini-panel {
  min-height: 100%;
}

.game-page .section-title {
  line-height: 1.05;
}

@media (max-width: 1120px) {
  .game-page .side-stack-game {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .game-page .hero-banner {
    padding: 12px 14px;
  }

  .game-page .game-grid,
  .game-page .side-stack-game {
    max-width: none;
    margin-inline: 0;
  }

  .game-page .side-stack-game {
    grid-template-columns: 1fr;
  }
}

/* --- TRUCOYA PRO: immersive table + wallet polish --- */
.logout-inline-form {
  margin: 0;
  display: inline-flex;
}

button,
.btn,
.cardc,
.emote-pill,
.amount-chip,
.action-btn {
  touch-action: manipulation;
}

.cardc,
.action-btn,
.emote-pill,
.amount-chip {
  user-select: none;
}

.game-shell {
  width: min(1380px, calc(100% - 24px));
}

.game-page .game-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
  max-width: 1320px;
}

.board-surface-immersive {
  padding: 18px;
}

.board-top-immersive {
  gap: 12px;
}

.game-page .player-strip {
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.immersive-felt {
  min-height: 790px;
}

.felt-layout-immersive {
  position: relative;
  min-height: 742px;
  padding: 6px 6px 0;
}

.seat-anchor {
  position: absolute;
  z-index: 2;
}

.seat-anchor.is-hidden {
  display: none;
}

.seat-top {
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.seat-left {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.seat-right {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.seat-card {
  width: min(220px, 24vw);
  min-height: 144px;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 15, 28, 0.86), rgba(5, 10, 20, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 38px rgba(1, 7, 18, 0.32);
  backdrop-filter: blur(18px);
}

.seat-card.partner,
.seat-card.you-team,
.seat-card.team_1 {
  border-color: rgba(56, 189, 248, 0.28);
}

.seat-card.rival,
.seat-card.team_2 {
  border-color: rgba(245, 158, 11, 0.24);
}

.seat-card.turn {
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.24),
    0 0 0 10px rgba(245, 158, 11, 0.08),
    0 18px 38px rgba(1, 7, 18, 0.4);
}

.seat-card.mano {
  background: linear-gradient(180deg, rgba(11, 20, 38, 0.94), rgba(6, 12, 24, 0.92));
}

.seat-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #07101f;
  font-weight: 900;
  letter-spacing: 0.04em;
}

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

.seat-copy strong {
  font-size: 0.96rem;
}

.seat-copy span {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: capitalize;
}

.seat-hand {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-height: 70px;
  margin-top: 12px;
}

.seat-hand .cardc.mini {
  width: 56px;
  height: 84px;
  margin-right: -16px;
  border-radius: 14px;
  box-shadow: 0 14px 22px rgba(1, 7, 18, 0.3);
}

.seat-hand .cardc.mini:last-child {
  margin-right: 0;
}

.mesa-zone-immersive {
  width: min(640px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 108px;
  padding-bottom: 14px;
  gap: 14px;
}

.trick-tracker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tracker-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.tracker-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 12, 24, 0.84);
  font-size: 0.82rem;
  color: #dbeafe;
}

.tracker-pill.win,
.tracker-pill.team-a {
  border-color: rgba(34, 197, 94, 0.28);
  color: #bbf7d0;
}

.tracker-pill.lose,
.tracker-pill.team-b {
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.tracker-pill.tie,
.tracker-pill.neutral {
  color: var(--muted);
}

.mesa-cards-immersive {
  position: relative;
  width: min(560px, 100%);
  min-height: 296px;
  margin: 0 auto;
}

.mesa-placeholder {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(6, 12, 24, 0.62);
  border: 1px dashed rgba(255,255,255,0.12);
}

.mesa-card-wrap {
  position: absolute;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.mesa-card-wrap.placement-bottom {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.mesa-card-wrap.placement-top {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.mesa-card-wrap.placement-left {
  left: 4%;
  top: 50%;
  transform: translateY(-50%);
}

.mesa-card-wrap.placement-right {
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
}

.mesa-card-wrap .mesa-card {
  transform-origin: center center;
}

.mesa-card-wrap.enter .mesa-card {
  animation: mesaPop 340ms cubic-bezier(.2, .85, .2, 1) both;
  animation-delay: calc(var(--card-index, 0) * 70ms);
}

.mesa-card-wrap.enter .mesa-owner {
  animation: fadeSeatLabel 260ms ease both;
  animation-delay: calc(var(--card-index, 0) * 70ms + 80ms);
}

@keyframes mesaPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeSeatLabel {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.mesa-owner {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.84);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.9);
}

.immersive-hand-zone {
  position: relative;
  z-index: 3;
  align-self: end;
  width: min(700px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 18px calc(14px + env(safe-area-inset-bottom));
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(8, 15, 28, 0.82), rgba(4, 9, 18, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px rgba(1, 7, 18, 0.36);
  backdrop-filter: blur(16px);
}

.game-page.is-your-turn .immersive-hand-zone {
  border-color: rgba(56, 189, 248, 0.32);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 20px 44px rgba(56, 189, 248, 0.12),
    0 18px 42px rgba(1, 7, 18, 0.36);
}

.cards-player-large {
  min-height: 214px;
  padding: 12px 16px 4px;
}

.cards-player-large .cardc {
  width: 118px;
  height: 178px;
  margin-inline: -10px;
}

.cards-player-large .cardc:nth-child(1) {
  --fan-rotate: -12deg;
  --fan-offset: 14px;
}

.cards-player-large .cardc:nth-child(2) {
  --fan-rotate: 0deg;
  --fan-offset: 0px;
}

.cards-player-large .cardc:nth-child(3) {
  --fan-rotate: 12deg;
  --fan-offset: 14px;
}

.cardc.is-playing {
  opacity: 0.55;
  transform: translateY(calc(var(--fan-offset, 0px) - 24px)) rotate(var(--fan-rotate, 0deg)) scale(1.05);
}

.action-dock {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(3, 9, 18, 0.76);
  box-shadow: 0 18px 38px rgba(1, 7, 18, 0.32);
  backdrop-filter: blur(16px);
}

.game-page.is-response-pending .action-dock {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.12),
    0 18px 38px rgba(1, 7, 18, 0.32);
}

.action-dock .action-caption {
  width: 100%;
  margin-bottom: 2px;
}

.action-btn {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(8, 15, 28, 0.86);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

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

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #061120;
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(56, 189, 248, 0.16);
}

.action-btn.warn {
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.action-btn.soft {
  background: rgba(8, 15, 28, 0.86);
}

.game-page .chat-surface,
.game-page .deck-mini-panel {
  background: linear-gradient(180deg, rgba(9, 16, 30, 0.94), rgba(5, 10, 20, 0.98));
}

.wallet-page .wallet-top-grid {
  align-items: stretch;
}

.wallet-panel {
  display: grid;
  gap: 10px;
}

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

.amount-chip {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 15, 28, 0.84);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.amount-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 14px 24px rgba(56, 189, 248, 0.1);
}

.wallet-form-row {
  align-items: stretch;
}

.wallet-form-row .input {
  min-height: 52px;
}

.wallet-form-row .btn {
  min-height: 52px;
}

.wallet-inline-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.wallet-flow {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.wallet-step {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 15, 28, 0.54);
}

.wallet-step strong {
  display: block;
  margin-bottom: 6px;
}

.wallet-session-card {
  display: grid;
  gap: 14px;
}

.wallet-session-head {
  padding: 0;
}

.wallet-session-grid {
  justify-content: flex-end;
}

.wallet-debug-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.wallet-debug-panel .json-box {
  margin-top: 10px;
}

@media (max-width: 1180px) {
  .game-page .game-grid {
    grid-template-columns: 1fr;
  }

  .seat-card {
    width: min(200px, 28vw);
  }

  .side-stack-game {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .immersive-felt {
    min-height: 820px;
  }

  .felt-layout-immersive {
    min-height: 770px;
  }

  .seat-top {
    top: 0;
  }

  .seat-left,
  .seat-right {
    top: 154px;
    transform: none;
  }

  .seat-left {
    left: 0;
  }

  .seat-right {
    right: 0;
  }

  .seat-card {
    width: min(172px, 45vw);
    min-height: 132px;
    padding: 12px;
    border-radius: 20px;
  }

  .seat-hand .cardc.mini {
    width: 44px;
    height: 66px;
    margin-right: -18px;
  }

  .mesa-zone-immersive {
    width: min(640px, calc(100% - 8px));
    padding-top: 246px;
  }

  .mesa-cards-immersive {
    min-height: 238px;
  }

  .mesa-card-wrap.placement-left {
    left: 2%;
  }

  .mesa-card-wrap.placement-right {
    right: 2%;
  }

  .immersive-hand-zone {
    width: min(100%, calc(100% - 8px));
    padding-inline: 12px;
  }

  .cards-player-large {
    min-height: 184px;
    padding: 8px 4px 0;
  }

  .cards-player-large .cardc {
    width: 102px;
    height: 154px;
    margin-inline: -14px;
  }

  .action-dock {
    position: sticky;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

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

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

@media (max-width: 560px) {
  .board-surface-immersive {
    padding: 12px;
  }

  .game-page .hero-banner {
    gap: 12px;
  }

  .seat-left,
  .seat-right {
    top: 144px;
  }

  .seat-card {
    width: min(142px, 43vw);
    min-height: 126px;
    padding: 10px;
  }

  .seat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

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

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

  .seat-hand {
    min-height: 56px;
  }

  .seat-hand .cardc.mini {
    width: 38px;
    height: 58px;
    margin-right: -18px;
    border-radius: 12px;
  }

  .mesa-zone-immersive {
    padding-top: 220px;
    gap: 12px;
  }

  .mesa-cards-immersive {
    min-height: 214px;
  }

  .mesa-card-wrap {
    gap: 6px;
  }

  .mesa-card {
    width: 86px;
    height: 130px;
    border-radius: 18px;
  }

  .mesa-owner {
    font-size: 0.72rem;
    padding: 4px 8px;
  }

  .cards-player-large {
    min-height: 162px;
  }

  .cards-player-large .cardc {
    width: 90px;
    height: 138px;
    margin-inline: -16px;
  }

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

  .action-btn {
    min-height: 44px;
    width: calc(50% - 5px);
    justify-content: center;
  }

  .action-caption {
    font-size: 0.86rem;
  }

  .quick-amount-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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


/* === Admin + PWA extensions === */
.success-text {
  color: #8df7af;
  font-weight: 800;
}

.error-text {
  color: #ff9a9a;
  font-weight: 800;
}

.admin-nav {
  position: sticky;
  top: 12px;
  z-index: 42;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(5, 10, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 36px rgba(1, 7, 18, 0.35);
  backdrop-filter: blur(16px);
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 800;
  background: rgba(8, 15, 28, 0.64);
}

.admin-nav-link:hover {
  border-color: rgba(56, 189, 248, 0.22);
}

.admin-nav-link.active {
  color: #07101f;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.18);
}

.admin-nav-link-back {
  margin-left: auto;
}

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

.check-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 12, 24, 0.68);
}

.check-card.is-ok {
  border-color: rgba(34, 197, 94, 0.26);
  background: linear-gradient(180deg, rgba(10, 28, 18, 0.76), rgba(12, 24, 26, 0.94));
}

.check-card.is-warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(180deg, rgba(34, 20, 8, 0.76), rgba(12, 24, 26, 0.94));
}

.check-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.12);
}

.check-card.is-ok .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

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

.admin-mini-stack {
  display: grid;
  gap: 16px;
}

.copy-url-grid {
  display: grid;
  gap: 12px;
}

.copy-url-item {
  display: grid;
  gap: 8px;
}

.copy-url-input {
  cursor: copy;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

.copy-url-input:focus {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.truncate-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-search-row {
  align-items: end;
}

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

.stat-card.compact {
  padding: 18px;
  border-radius: 22px;
}

.stat-card.compact .stat-value {
  font-size: 1.32rem;
}

.admin-ordered-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
  line-height: 1.6;
}

.install-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}

.install-sheet.visible {
  display: block;
}

.install-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 7, 18, 0.78);
  backdrop-filter: blur(10px);
}

.install-sheet-card {
  position: relative;
  width: min(92vw, 440px);
  margin: max(7vh, 58px) auto 0;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.install-sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(8, 15, 28, 0.84);
  color: var(--text);
  cursor: pointer;
}

.install-steps {
  display: grid;
  gap: 10px;
}

.install-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 12, 24, 0.68);
}

.install-step strong {
  color: var(--accent-2);
}

.install-sheet-copy {
  line-height: 1.55;
}

@media (max-width: 960px) {
  .check-grid,
  .admin-link-grid,
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }

  .admin-nav-link-back {
    margin-left: 0;
  }

  .truncate-cell {
    max-width: 180px;
  }
}

@media (max-width: 720px) {
  .admin-nav,
  .install-sheet-card {
    border-radius: 18px;
  }

  .check-card,
  .copy-url-item {
    padding: 14px;
  }
}
