:root {
  --font-main: "Inter", "Segoe UI", sans-serif;
  --font-display: "Newsreader", Georgia, serif;

  --bg: #f2f4f1;
  --bg-2: #d7ded8;
  --surface: rgba(245, 248, 244, 0.86);
  --surface-soft: rgba(250, 252, 249, 0.94);
  --ink: #203027;
  --muted: #54675b;
  --line: rgba(49, 74, 61, 0.2);
  --gold: #caa800;
  --gold-2: #ffe16d;
  --danger: #b5483f;
  --success: #1f7a48;
  --shadow-soft: 0 12px 35px rgba(10, 25, 18, 0.12);
  --shadow-card: 0 8px 18px rgba(4, 9, 7, 0.26);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-theme="dark"] {
  --bg: #121412;
  --bg-2: #004d2b;
  --surface: rgba(30, 32, 30, 0.68);
  --surface-soft: rgba(41, 42, 40, 0.8);
  --ink: #e2e3df;
  --muted: #c0c9be;
  --line: rgba(143, 147, 137, 0.38);
  --gold: #e9c400;
  --gold-2: #ffe16d;
  --danger: #d57166;
  --success: #78be90;
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.42);
  --shadow-card: 0 12px 24px rgba(0, 0, 0, 0.56);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(170, 243, 193, 0.16), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(255, 225, 109, 0.14), transparent 30%),
    radial-gradient(circle at 50% 85%, rgba(255, 255, 255, 0.08), transparent 36%),
    radial-gradient(circle at center, var(--bg-2) 0%, var(--bg) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.app {
  width: min(1880px, 99.5vw);
  margin: 0.5rem auto 1rem;
  display: grid;
  gap: 0.75rem;
}

#game-screen {
  min-height: calc(100vh - 2rem);
}

.casino-layout {
  display: grid;
  grid-template-columns: minmax(132px, 8.8vw) minmax(0, 1fr) minmax(220px, 14.4vw);
  gap: 0.65rem;
}

.casino-center {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  min-width: 0;
}

.casino-left,
.casino-right {
  min-height: 0;
  position: sticky;
  top: 0.5rem;
  align-self: start;
  padding: 0.7rem;
}

.casino-left {
  padding: 0.55rem 0.55rem 0.65rem;
}

.brand-block {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  justify-items: center;
  text-align: center;
}

.brand-logo {
  width: 100%;
  max-width: 220px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--gold));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.branding-logo-setup {
  display: block;
  margin: 0 auto 0.5rem;
  width: 220px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}

.brand-block h2 {
  font-size: clamp(1.2rem, 1.5vw, 1.45rem);
  color: var(--gold-2);
  font-style: italic;
  line-height: 0.95;
}

.right-nav {
  margin-bottom: 0.25rem;
}

.side-nav {
  display: grid;
  gap: 0.45rem;
}

.side-nav-item {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--gold-2));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
  color: color-mix(in srgb, var(--ink) 90%, var(--gold-2));
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.44rem 0.62rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.side-nav-item:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
}

.side-nav-item.active {
  background: linear-gradient(150deg, color-mix(in srgb, #004d2b 85%, var(--surface-soft)), color-mix(in srgb, #00391e 85%, var(--surface)));
  border-color: color-mix(in srgb, var(--gold) 40%, #004d2b);
  color: #d5f4df;
}

.hidden {
  display: none !important;
}

.panel {
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 0.9rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.setup-panel {
  max-width: 620px;
  margin: 10vh auto 0;
  display: grid;
  gap: 0.85rem;
  text-align: center;
}

.setup-extra-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

.setup-auth {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
  padding: 0.6rem 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.setup-auth-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.setup-email-auth {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
  display: grid;
  gap: 0.45rem;
}

#auth-status.error {
  color: var(--danger);
}

.setup-panel h1 {
  color: var(--gold-2);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-style: italic;
}

.setup-credit {
  margin-top: 0.25rem;
  text-align: center;
  font-size: 0.84rem;
  color: color-mix(in srgb, var(--muted) 82%, var(--gold-2));
}

.setup-credit strong {
  color: color-mix(in srgb, var(--gold-2) 82%, var(--ink));
}

.setup-credit a {
  color: color-mix(in srgb, var(--gold-2) 88%, var(--ink));
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 72%, transparent);
}

.setup-credit a:hover {
  filter: brightness(1.08);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.setup-name {
  grid-column: 1 / -1;
}

#auth-provider {
  text-transform: none;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

input,
select,
.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
}

input,
select {
  min-height: 2.3rem;
  padding: 0 0.75rem;
  background: var(--surface-soft);
  color: var(--ink);
}

textarea {
  min-height: 5.2rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 0.88rem;
  resize: vertical;
}

input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.btn {
  min-height: 2.2rem;
  cursor: pointer;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  padding: 0 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.btn:hover:enabled {
  transform: translateY(-1px);
  filter: brightness(1.06);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
}

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

.btn.primary {
  background: linear-gradient(160deg, var(--gold-2), var(--gold));
  border-color: color-mix(in srgb, var(--gold) 80%, #4c3f00);
  color: #221b00;
  font-weight: 700;
  text-transform: uppercase;
}

.btn.link {
  background: none;
  border: none;
  color: var(--gold-2);
  min-height: auto;
  padding: 0.2rem 0.5rem;
  text-decoration: underline;
  font-size: 0.8rem;
}

.btn.link:hover:enabled {
  transform: none;
  filter: brightness(1.2);
}

.btn.success {
  background: linear-gradient(160deg, color-mix(in srgb, var(--success) 48%, #dff6ea), color-mix(in srgb, var(--success) 60%, #aaf3c1));
  border-color: color-mix(in srgb, var(--success) 70%, #0f3a23);
  color: color-mix(in srgb, #061c10 72%, var(--ink));
}

.btn.danger {
  border-color: #a9352f;
  color: #e05a54;
}

.btn.danger:hover:enabled {
  background: color-mix(in srgb, #a9352f 18%, var(--surface-soft));
  border-color: #c94040;
  color: #f07070;
}

.settings-danger {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.45rem;
}

.btn.active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 78%, transparent);
}

.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--gold-2));
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 35%),
    color-mix(in srgb, var(--avatar-bg) 88%, #121412);
  color: #fff7df;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  line-height: 1;
  user-select: none;
}

.avatar-xs {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 14px;
}

.top-info {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.7rem;
  align-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface-soft) 94%, transparent));
}

#round-label {
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 1.5vw, 1.34rem);
  color: color-mix(in srgb, var(--ink) 88%, var(--gold-2));
}

.top-info.compact {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.header-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-menu-btn {
  display: none;
  gap: 0.35rem;
}

.mobile-menu-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: url("../assets/branding/cariocas-rm-logo-sq.jpg") center/contain no-repeat;
}

.mobile-menu-close {
  display: none;
}

#btn-toggle-add {
  display: none;
}

.muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.turn-lane {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 84%, transparent), color-mix(in srgb, var(--surface-soft) 92%, transparent));
}

.turn-lane .table-strip {
  margin-bottom: 0;
  gap: 0.3rem;
  overflow-x: auto;
  white-space: nowrap;
  flex-wrap: nowrap;
  padding-bottom: 0.1rem;
}

.turn-lane .player-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
}

.opponents-hands {
  display: none;
  gap: 0.28rem;
}

.opponents-hands.visible {
  display: grid;
}

.opponent-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.opponent-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: color-mix(in srgb, var(--ink) 86%, var(--gold-2));
  font-size: 0.74rem;
  white-space: nowrap;
  min-width: 86px;
}

.opponent-cards {
  display: flex;
  align-items: center;
  min-height: 36px;
  overflow: hidden;
  padding-left: 0.1rem;
}

.opponent-card-back {
  width: 26px;
  height: 36px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--gold-2));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-left: -15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(225deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(45deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(145deg, #cb4b42, #b3362f);
}

.opponent-card-back:first-child {
  margin-left: 0;
}

.turn-indicator {
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 88%, var(--gold-2));
  background: linear-gradient(145deg, color-mix(in srgb, #004d2b 55%, var(--surface)), color-mix(in srgb, #121412 72%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--gold-2));
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
}

.turn-indicator.ai-turn {
  color: #ffefd3;
  border-color: color-mix(in srgb, #fbbc00 55%, #402d00);
  background: linear-gradient(145deg, #5c4300, #402d00);
}

.turn-indicator.flash {
  animation: turn-flash 0.6s ease;
}

.ai-action-indicator {
  min-height: 1.05rem;
  color: color-mix(in srgb, var(--ink) 80%, var(--gold-2));
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.settings-card {
  width: min(92vw, 380px);
}

.settings-auth {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.2rem;
}

.settings-auth-actions {
  display: grid;
  gap: 0.4rem;
}

.settings-auth-actions .btn {
  justify-content: center;
}

.settings-appearance {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.2rem;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.qa-settings-panel {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
}

.qa-settings-panel h3 {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 88%, var(--gold-2));
}

.qa-settings-actions {
  display: grid;
  gap: 0.4rem;
}

#qa-settings-status.error {
  color: var(--danger);
}

#qa-settings-status.ok {
  color: var(--success);
}

.report-bug-btn {
  position: fixed;
  right: 0.9rem;
  bottom: 0.8rem;
  z-index: 90;
  background: linear-gradient(160deg, var(--gold-2), var(--gold));
  border-color: color-mix(in srgb, var(--gold) 80%, #4c3f00);
  color: #221b00;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.report-bug-btn:hover:enabled {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.report-card {
  width: min(94vw, 560px);
}

.report-card h2 {
  color: color-mix(in srgb, var(--ink) 88%, var(--gold-2));
}

.qa-auth-card {
  width: min(92vw, 420px);
}

.qa-auth-card h2 {
  color: color-mix(in srgb, var(--ink) 88%, var(--gold-2));
}

.qa-auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.qa-auth-actions .btn {
  min-width: 120px;
}

.report-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#report-status.error {
  color: var(--danger);
}

#report-status.ok {
  color: var(--success);
}

#qa-auth-status.error {
  color: var(--danger);
}

.ai-action-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes turn-flash {
  0% { transform: scale(1); filter: brightness(1); }
  45% { transform: scale(1.02); filter: brightness(1.22); }
  100% { transform: scale(1); filter: brightness(1); }
}

.table-stage {
  background:
    radial-gradient(circle at 16% 18%, rgba(143, 214, 166, 0.18), transparent 35%),
    radial-gradient(circle at 83% 8%, rgba(233, 196, 0, 0.14), transparent 28%),
    linear-gradient(165deg, color-mix(in srgb, #004d2b 70%, var(--surface)), color-mix(in srgb, #121412 76%, var(--surface-soft)));
  border-color: color-mix(in srgb, #8a9389 60%, #004d2b);
  min-height: 420px;
}

.table-strip {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--gold-2));
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  font-size: 0.84rem;
  color: color-mix(in srgb, var(--ink) 86%, var(--gold-2));
}

.player-chip-text {
  white-space: nowrap;
}

.player-chip.active {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 22%, transparent);
}

.player-chip.down {
  border-color: #78c8a0;
}

.table-main {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  min-width: 0;
}

.piles-stack {
  display: grid;
  gap: 0.75rem;
}

.pile {
  min-height: 210px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--gold-2));
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface-soft) 85%, transparent), color-mix(in srgb, var(--surface) 85%, transparent));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0.55rem 0.45rem 0.5rem;
  cursor: pointer;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 88%, var(--gold-2));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pile > span {
  font-size: 1.05rem;
}

.pile small {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.96rem;
}

.pile-preview {
  width: 88px;
  height: 124px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--gold-2));
  box-shadow: var(--shadow-card);
  background: linear-gradient(180deg, #fffefc, #f4efe2);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pile-preview .card-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.pile-preview-empty {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 700;
}

.pile-preview-back {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.17) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(225deg, rgba(255, 255, 255, 0.17) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.17) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(45deg, rgba(255, 255, 255, 0.17) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(145deg, #cb4b42, #b3362f);
  border-color: #a9352f;
}

.pile.drop-target {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.meld.drop-target {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.meld-area {
  min-height: 355px;
  border: 1px dashed color-mix(in srgb, var(--line) 70%, var(--gold-2));
  border-radius: 12px;
  padding: 0.7rem;
  background: color-mix(in srgb, #121412 58%, transparent);
  min-width: 0;
}

.meld-area.drop-target {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.meld-area.group-drop-ready {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--gold) 85%, var(--line));
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--gold) 30%, transparent),
    0 0 0 2px color-mix(in srgb, var(--gold) 26%, transparent);
}

.table-melds {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  min-width: 0;
}

.meld-side {
  border: 1px dashed color-mix(in srgb, var(--line) 75%, var(--gold-2));
  border-radius: 10px;
  padding: 0.5rem;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  min-height: 170px;
}

.meld-side.ai-side {
  order: 1;
}

.meld-side.player-side {
  order: 2;
  position: relative;
}

.meld-side-title {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  color: color-mix(in srgb, var(--ink) 86%, var(--gold-2));
}

.meld-side-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-content: start;
  align-items: flex-start;
  min-width: 0;
}

.empty-side {
  border: 1px dashed color-mix(in srgb, var(--line) 70%, var(--gold-2));
  border-radius: 8px;
  padding: 0.55rem;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--ink) 75%, var(--gold-2));
  overflow-wrap: anywhere;
}

.meld {
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--gold-2));
  border-radius: 10px;
  padding: 0.5rem;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  width: fit-content;
  max-width: 100%;
  min-width: 200px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
  min-width: 0;
}

.meld-title {
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--ink) 70%, var(--gold));
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meld-cards,
.hand-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meld-cards {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  gap: 0;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.meld-cards .card {
  margin-left: -16px;
  flex-shrink: 0;
}

.meld-cards .card:first-child {
  margin-left: 0;
}

.meld-side.draft-drop-target {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.meld-side.player-side.group-drop-ready {
  border-style: solid;
  border-color: color-mix(in srgb, var(--gold) 85%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, transparent), transparent 38%),
    color-mix(in srgb, var(--surface) 62%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--gold) 46%, transparent),
    0 0 0 2px color-mix(in srgb, var(--gold) 34%, transparent);
}

.meld-side.player-side.group-drop-ready::after {
  content: 'Suelta aquí el grupo';
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 82%, var(--line));
  background: color-mix(in srgb, var(--surface) 84%, #000);
  color: color-mix(in srgb, var(--gold) 86%, var(--ink));
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.meld-area.add-drop-ready {
  border-style: solid;
  border-color: color-mix(in srgb, var(--gold) 60%, var(--line));
}

.meld-side.player-side.add-drop-ready {
  border-style: solid;
  border-color: color-mix(in srgb, var(--gold) 85%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent 38%),
    color-mix(in srgb, var(--surface) 62%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent),
    0 0 0 2px color-mix(in srgb, var(--gold) 28%, transparent);
}

.meld-side.player-side.add-drop-ready::after {
  content: 'Suelta aquí la carta';
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 82%, var(--line));
  background: color-mix(in srgb, var(--surface) 84%, #000);
  color: color-mix(in srgb, var(--gold) 86%, var(--ink));
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.meld-side.player-side.add-mode-active {
  border-style: solid;
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
}

.status {
  margin-top: 0.75rem;
  min-height: 1.9rem;
  color: color-mix(in srgb, var(--ink) 80%, var(--gold-2));
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.hand-panel.simplified {
  padding-top: 0.7rem;
}

.rules-view {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.opponents-view {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.rules-view-head {
  display: grid;
  gap: 0.2rem;
}

.opponents-view-head {
  display: grid;
  gap: 0.2rem;
}

.rules-view-head h2 {
  color: color-mix(in srgb, var(--ink) 88%, var(--gold-2));
}

.rules-content {
  display: grid;
  gap: 0.65rem;
}

.opponents-content {
  display: grid;
  gap: 0.65rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.rules-card {
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--gold-2));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  padding: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.opponents-summary {
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--gold-2));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  padding: 0.65rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.opponents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.opponent-card-panel {
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--gold-2));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  padding: 0.65rem;
  display: grid;
  gap: 0.55rem;
}

.opponent-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  align-items: flex-start;
}

.opponent-card-name {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.opponent-card-name small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.opponent-card-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  justify-content: flex-end;
}

.opponent-badge {
  border: 1px solid color-mix(in srgb, var(--line) 80%, var(--gold-2));
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
}

.opponent-badge.turn {
  border-color: color-mix(in srgb, var(--gold) 70%, var(--line));
}

.opponent-badge.down {
  border-color: color-mix(in srgb, var(--success) 70%, var(--line));
}

.opponent-card-stack {
  min-height: 48px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 0.1rem 0.1rem 0.2rem;
}

.opponent-mini-back {
  width: 30px;
  height: 42px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--gold-2));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-left: -16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(225deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(45deg, rgba(255, 255, 255, 0.19) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(145deg, #cb4b42, #b3362f);
}

.opponent-mini-back:first-child {
  margin-left: 0;
}

.opponent-card-foot {
  color: var(--muted);
  font-size: 0.76rem;
}

.opponent-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.rules-card h3 {
  color: color-mix(in srgb, var(--ink) 85%, var(--gold));
  font-size: 1.05rem;
}

.rules-card ul,
.rules-card ol {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.28rem;
  font-size: 0.9rem;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.rules-table th,
.rules-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.42rem;
  text-align: left;
}

.rules-table th {
  color: color-mix(in srgb, var(--ink) 85%, var(--gold-2));
}

.rules-table.rounds td:first-child {
  font-weight: 700;
}

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

.hand-cards {
  margin-top: 0.55rem;
  padding: 0.3rem 0.3rem 0.65rem;
  overflow-x: auto;
  overflow-y: visible;
  flex-wrap: nowrap;
  min-height: 152px;
  scrollbar-gutter: stable;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.hand-cards.drop-zone-active {
  outline: 2px dashed var(--gold);
  outline-offset: 3px;
  border-radius: 10px;
}

.hand-cards .card {
  margin-left: -24px;
}

.hand-cards .card:first-child {
  margin-left: 0;
}

.card {
  border: 1px solid color-mix(in srgb, var(--line) 72%, #cabda0);
  background: #ffffff;
  border-radius: 12px;
  width: 90px;
  height: 126px;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

html[data-theme="dark"] .card {
  background: #f7f2e5;
}

.hand-cards .card {
  cursor: pointer;
}

.hand-cards .card:hover {
  transform: translateY(-10px);
  z-index: 2;
}

.card.draggable {
  cursor: grab;
}

.card.dragging {
  opacity: 0.6;
  transform: rotate(-2deg);
}

.card.drop-before {
  box-shadow: inset 5px 0 0 var(--gold), var(--shadow-card);
}

.card.drop-after {
  box-shadow: inset -5px 0 0 var(--gold), var(--shadow-card);
}

.card.joker {
  background: #fffaf0;
}

.card.card-back {
  background: linear-gradient(145deg, #2d8a74, #1a6554);
  border-color: #3a9c83;
}

.card-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.card-back-pattern {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(225deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(45deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(145deg, #cb4b42, #b3362f);
}

.card-fallback {
  padding: 0.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #2a2a2a;
}

.card.selected {
  border-color: var(--gold);
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  transform: translateY(-11px) scale(1.03);
  z-index: 3;
  box-shadow: 0 0 22px rgba(233, 196, 0, 0.55), 0 14px 22px rgba(0, 0, 0, 0.24);
}

.selection-feedback {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.go-down-draft {
  display: none;
  margin: 0.25rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 85%, transparent);
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
  color: var(--ink);
  gap: 0.2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.go-down-draft.visible {
  display: grid;
}

.go-down-draft.complete {
  border-color: #79bf95;
  box-shadow: inset 0 0 0 1px rgba(121, 191, 149, 0.42);
}

.go-down-draft .draft-title {
  font-weight: 700;
  color: var(--ink);
}

.go-down-draft .draft-row {
  color: var(--muted);
}

.go-down-draft .draft-foot {
  font-weight: 700;
}

.selection-feedback.ok {
  color: var(--success);
}

.selection-feedback.error {
  color: var(--danger);
}

.side-data details > summary {
  cursor: pointer;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 84%, var(--gold));
}

.side-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.side-grid.single-col {
  margin-top: 0;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 0.58rem;
}

.quick-actions .btn {
  width: 100%;
}

.profile-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  padding: 0.45rem 0.55rem;
  display: grid;
  gap: 0.35rem;
}

.profile-summary {
  display: grid;
  gap: 0.15rem;
  font-size: 0.84rem;
}

.profile-summary .muted {
  font-size: 0.76rem;
}

.profile-stats {
  display: grid;
  gap: 0.18rem;
  font-size: 0.78rem;
  color: color-mix(in srgb, var(--ink) 84%, var(--gold-2));
}

.side-data h3 {
  margin-bottom: 0.35rem;
  color: color-mix(in srgb, var(--ink) 85%, var(--gold-2));
}

.activity-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  padding: 0.35rem 0.5rem 0.5rem;
}

.activity-panel > summary {
  cursor: pointer;
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 82%, var(--gold-2));
  list-style: none;
}

.activity-panel > summary::-webkit-details-marker {
  display: none;
}

.activity-panel > summary::before {
  content: "▸ ";
  color: color-mix(in srgb, var(--gold) 80%, var(--ink));
}

.activity-panel[open] > summary::before {
  content: "▾ ";
}

.scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.scoreboard th,
.scoreboard td {
  border-bottom: 1px solid var(--line);
  padding: 0.4rem;
  text-align: left;
}

#log-list {
  margin: 0;
  padding-left: 1rem;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.all-hands {
  display: grid;
  gap: 0.4rem;
}

.all-hands-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  display: grid;
  gap: 0.25rem;
}

.all-hands-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.77rem;
  color: var(--muted);
}

.score-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.all-hands-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.all-hands-cards .card {
  width: 36px;
  height: 50px;
  cursor: default;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 9, 0.78);
  display: grid;
  place-items: center;
  z-index: 220;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 9, 0.72);
  z-index: 109;
}

.mobile-menu-backdrop.hidden {
  display: none;
}

.mobile-menu-backdrop.visible {
  display: block;
}

body.mobile-menu-open {
  overflow: hidden;
}

.overlay-card {
  width: min(92vw, 450px);
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.final-ranking {
  margin: 0;
  padding-left: 1rem;
}

.pulse {
  animation: pile-pulse 0.26s ease;
}

.ai-step {
  animation: ai-step-flash 0.58s ease;
}

@keyframes pile-pulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

@keyframes ai-step-flash {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 208, 109, 0); }
  40% { transform: scale(1.025); box-shadow: 0 0 0 6px rgba(255, 208, 109, 0.2); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 208, 109, 0); }
}

.meld-landed {
  animation: meld-landed-flash 0.9s ease;
}

@keyframes meld-landed-flash {
  0%   { box-shadow: 0 0 0 rgba(80, 220, 120, 0); }
  30%  { box-shadow: 0 0 0 8px rgba(80, 220, 120, 0.35); }
  100% { box-shadow: 0 0 0 rgba(80, 220, 120, 0); }
}

.meld-new-entry {
  animation: meld-new-entry-pop 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes meld-new-entry-pop {
  0%   { transform: scale(0.88); opacity: 0.4; box-shadow: 0 0 0 rgba(80, 220, 120, 0); }
  50%  { transform: scale(1.04); opacity: 1;   box-shadow: 0 0 0 5px rgba(80, 220, 120, 0.4); }
  100% { transform: scale(1);    opacity: 1;   box-shadow: 0 0 0 rgba(80, 220, 120, 0); }
}

@media (max-width: 980px) {
  body {
    overflow-x: hidden;
  }

  .app {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0.35rem;
    gap: 0.45rem;
  }

  #game-screen {
    min-height: auto;
  }

  .casino-layout {
    grid-template-columns: 1fr;
  }

  .casino-left,
  .casino-right {
    position: static;
  }

  .casino-left,
  .casino-right {
    display: none;
  }

  .casino-left {
    min-height: 0;
  }

  .casino-right.mobile-open {
    display: block;
    position: fixed;
    top: 0.25rem;
    right: 0.25rem;
    bottom: 0.25rem;
    width: min(90vw, 320px);
    overflow: auto;
    z-index: 110;
    border-radius: 12px;
    padding: 0.55rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .report-bug-btn {
    right: 0.45rem;
    top: calc(8px + env(safe-area-inset-top));
    bottom: auto;
    min-height: 1.95rem;
    font-size: 0.78rem;
    padding: 0 0.62rem;
    z-index: 95;
  }

  .mobile-menu-close {
    display: inline-flex;
    width: 100%;
    justify-content: center;
  }

  .casino-center {
    gap: 0.45rem;
  }

  .panel {
    border-radius: 12px;
    padding: 0.65rem;
  }

  .side-nav {
    grid-template-columns: 1fr;
    gap: 0.38rem;
  }

  .side-nav-item {
    text-align: left;
    font-size: 0.8rem;
    padding: 0.5rem 0.45rem;
  }

  .top-info {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .header-actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: thin;
  }

  .header-actions .btn {
    flex: 0 0 auto;
    min-height: 1.95rem;
    font-size: 0.78rem;
    white-space: nowrap;
    padding: 0 0.72rem;
  }

  .turn-lane {
    gap: 0.3rem;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }

  .turn-indicator {
    font-size: 0.92rem;
    padding: 0.38rem 0.75rem;
  }

  .ai-action-indicator {
    min-height: 0.9rem;
    font-size: 0.76rem;
  }

  .opponent-meta {
    min-width: 72px;
    font-size: 0.68rem;
  }

  .opponent-cards {
    min-height: 32px;
  }

  .table-stage {
    min-height: auto;
  }

  .table-main {
    grid-template-columns: minmax(100px, 116px) minmax(0, 1fr);
    gap: 0.55rem;
  }

  .piles-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .pile {
    min-height: 136px;
    border-radius: 12px;
    gap: 0.26rem;
    padding: 0.35rem 0.35rem 0.38rem;
  }

  .pile > span {
    font-size: 0.98rem;
  }

  .pile small {
    font-size: 0.86rem;
  }

  .pile-preview {
    width: 60px;
    height: 84px;
    border-radius: 9px;
  }

  .meld-area {
    min-height: 220px;
    padding: 0.45rem;
  }

  .table-melds {
    grid-template-columns: 1fr;
  }

  .meld-side {
    min-height: 116px;
    padding: 0.4rem;
  }

  .meld-side-title {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
  }

  .meld-side-list {
    gap: 0.38rem;
  }

  .meld {
    min-width: 138px;
    padding: 0.38rem;
  }

  .meld-title {
    font-size: 0.68rem;
    margin-bottom: 0.28rem;
  }

  .card {
    width: 62px;
    height: 88px;
    border-radius: 9px;
  }

  .hand-cards .card {
    margin-left: -15px;
  }

  .hand-panel {
    padding-top: 0.58rem;
    padding-bottom: 0.56rem;
  }

  .hand-head {
    gap: 0.45rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .hand-head h2 {
    font-size: 1.52rem;
    line-height: 1;
  }

  .hand-head .muted {
    font-size: 0.76rem;
  }

  .hand-cards {
    min-height: 108px;
    margin-top: 0.35rem;
    padding: 0.2rem 0.2rem calc(0.55rem + env(safe-area-inset-bottom));
  }

  .card.selected {
    transform: translateY(-8px) scale(1.02);
    outline-width: 2px;
    outline-offset: 2px;
  }

  .side-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .scoreboard {
    font-size: 0.8rem;
  }

  .scoreboard th,
  .scoreboard td {
    padding: 0.3rem;
  }

  #log-list {
    max-height: 170px;
    font-size: 0.78rem;
  }

  .opponent-card-back {
    width: 24px;
    height: 34px;
    margin-left: -13px;
  }

  .rules-table {
    font-size: 0.8rem;
  }

  .opponent-mini-back {
    width: 26px;
    height: 38px;
    margin-left: -14px;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 0.24rem;
    gap: 0.38rem;
  }

  .brand-block h2 {
    font-size: 1.45rem;
  }

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

  .report-bug-btn {
    right: 0.35rem;
    top: calc(6px + env(safe-area-inset-top));
    bottom: auto;
    min-height: 1.8rem;
    font-size: 0.72rem;
    padding: 0 0.52rem;
  }

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

  .hand-cards .card {
    margin-left: -12px;
  }

  .top-info.compact {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .header-actions .btn {
    min-height: 1.85rem;
    font-size: 0.74rem;
    padding: 0 0.58rem;
  }

  .turn-indicator {
    font-size: 0.84rem;
    padding: 0.34rem 0.6rem;
  }

  .table-main {
    grid-template-columns: 1fr;
    gap: 0.34rem;
  }

  .piles-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.34rem;
  }

  .pile {
    min-height: 110px;
    padding: 0.32rem 0.26rem;
  }

  .pile > span {
    font-size: 0.88rem;
  }

  .pile small {
    font-size: 0.8rem;
  }

  .pile-preview {
    width: 44px;
    height: 62px;
    border-radius: 8px;
  }

  .meld-area {
    min-height: 164px;
    padding: 0.38rem;
  }

  .meld-side {
    min-height: 98px;
    padding: 0.3rem;
  }

  .meld-side-title {
    font-size: 0.82rem;
    margin-bottom: 0.26rem;
  }

  .meld {
    min-width: 96px;
    padding: 0.28rem;
  }

  .meld-title {
    font-size: 0.62rem;
  }

  .card {
    width: 44px;
    height: 62px;
    border-radius: 8px;
  }

  .hand-panel {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .hand-head h2 {
    font-size: 1.34rem;
  }

  .hand-head .muted {
    font-size: 0.72rem;
  }

  .hand-cards {
    min-height: 74px;
  }

  .hand-cards .card:hover {
    transform: translateY(-4px);
  }

  .card.selected {
    transform: translateY(-5px) scale(1.01);
  }

  .header-actions {
    gap: 0.22rem;
  }

  .turn-lane .player-chip {
    font-size: 0.68rem;
    padding: 0.16rem 0.36rem;
  }

  .opponent-card-back {
    width: 20px;
    height: 28px;
    margin-left: -10px;
  }

  .casino-right.mobile-open {
    width: calc(100vw - 0.4rem);
  }
}

@media (max-width: 420px) {
  .pile {
    min-height: 104px;
  }

  .card {
    width: 40px;
    height: 56px;
  }

  .hand-cards .card {
    margin-left: -9px;
  }

  .header-actions .btn {
    font-size: 0.7rem;
    padding: 0 0.5rem;
  }

  .turn-indicator {
    font-size: 0.78rem;
  }
}
