:root {
  --bg-table: #141124;
  --bg-surface: #1e1936;
  --bg-surface-hover: #282247;
  --bg-card-cream: #fffcf5;
  --bg-card-tint: #f6efe0;
  --ink-light: #f8f7ff;
  --ink-muted: #c2bddb;
  --ink-card: #171528;
  --ink-card-sub: #4b4668;
  --accent-coral: #ff5757;
  --accent-coral-hover: #ff3d3d;
  --accent-amber: #fbbf24;
  --accent-emerald: #10b981;
  --accent-violet: #8b5cf6;
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-card: rgba(23, 21, 40, 0.12);
  --shadow-card: 0 18px 40px -12px rgba(7, 5, 18, 0.55), 0 4px 12px rgba(7, 5, 18, 0.25);
  --shadow-soft: 0 10px 28px -8px rgba(7, 5, 18, 0.45);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

::selection {
  background: var(--accent-amber);
  color: #171528;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: #141124;
}
::-webkit-scrollbar-thumb {
  background: #3b3461;
  border-radius: 999px;
  border: 2px solid #141124;
}
::-webkit-scrollbar-thumb:hover {
  background: #554c88;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-table);
  color: var(--ink-light);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:focus-visible {
  outline: 3px solid var(--accent-amber);
  outline-offset: 2px;
}

/* Felt tabletop ambient lighting */
.tabletop-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 87, 87, 0.14), transparent 45%),
    radial-gradient(circle at 82% 20%, rgba(139, 92, 246, 0.16), transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(251, 191, 36, 0.08), transparent 50%),
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    var(--bg-table);
  background-size: 100% 100%, 100% 100%, 100% 100%, 26px 26px, 100% 100%;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1200;
}

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.is-active {
  display: block;
}

.page-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

/* ==================== TYPOGRAPHY & BUTTONS ==================== */
h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.02em;
}

.ui-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, box-shadow 0.16s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
  border-radius: 16px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: 11px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent-coral);
  color: #ffffff;
  box-shadow: 0 10px 24px -8px rgba(255, 87, 87, 0.6);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-coral-hover);
  box-shadow: 0 14px 28px -8px rgba(255, 87, 87, 0.72);
}

.btn-secondary {
  background: #362f5c;
  color: var(--ink-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover:not(:disabled) {
  background: #443b73;
}

.btn-accent {
  background: var(--accent-amber);
  color: #171528;
  box-shadow: 0 8px 20px -8px rgba(251, 191, 36, 0.55);
}
.btn-accent:hover:not(:disabled) {
  background: #f59e0b;
}

.btn-reveal {
  background: var(--accent-emerald);
  color: #06281e;
  font-weight: 800;
  box-shadow: 0 10px 24px -8px rgba(16, 185, 129, 0.6);
}
.btn-reveal:hover:not(:disabled) {
  background: #34d399;
}

.btn-turn {
  background: var(--bg-card-cream);
  color: var(--ink-card);
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.35);
}
.btn-turn:hover:not(:disabled) {
  background: #ffffff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-light);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-danger-soft:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
}

.btn-chip {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-light);
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-chip:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.btn-chip-accent {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.42);
}
.btn-chip-accent:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.32);
}

/* ==================== FORM INPUTS ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-light);
}

.field-help {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.field-help code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-amber);
}

.text-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 12, 29, 0.75);
  color: var(--ink-light);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.text-input::placeholder {
  color: #9e97c2;
  font-weight: 500;
}

.text-input:focus {
  border-color: var(--accent-amber);
  background: rgba(15, 12, 29, 0.95);
  outline: none;
}

.textarea-input {
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
  font-size: 0.9rem;
}

.select-input {
  cursor: pointer;
}

.color-picker {
  width: 54px;
  height: 48px;
  padding: 4px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 12, 29, 0.75);
  cursor: pointer;
}

.inline-error {
  margin: 12px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ==================== SCREEN 1: HOME ==================== */
.home-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 20px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.home-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.floating-preview-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  height: 92px;
}

.mini-card {
  width: 78px;
  height: 86px;
  border-radius: 14px;
  background: var(--bg-card-cream);
  color: var(--ink-card);
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 -8px;
  animation: floatCard 4s ease-in-out infinite;
}

.mini-card-1 {
  transform: rotate(-10deg) translateY(6px);
  animation-delay: 0s;
}
.mini-card-2 {
  transform: rotate(-3deg) translateY(-4px);
  animation-delay: 0.45s;
}
.mini-card-3 {
  transform: rotate(4deg) translateY(-2px);
  animation-delay: 0.9s;
}
.mini-card-4 {
  transform: rotate(11deg) translateY(8px);
  animation-delay: 1.35s;
}

.mini-emoji {
  font-size: 1.65rem;
  line-height: 1;
}

.mini-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink-card);
  letter-spacing: -0.01em;
}

@keyframes floatCard {
  0%, 100% {
    margin-top: 0;
  }
  50% {
    margin-top: -8px;
  }
}

.brand-title {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  line-height: 1.05;
}

.brand-subtitle {
  margin: 12px 0 0;
  max-width: 58ch;
  color: var(--ink-muted);
  font-size: 1.03rem;
}

.home-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.avatar-btn {
  height: 52px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 12, 29, 0.55);
  font-size: 1.55rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.avatar-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.avatar-btn.is-selected {
  border-color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.18);
  transform: scale(1.06);
}

.action-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
  padding-top: 6px;
}

.action-box {
  background: rgba(15, 12, 29, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.action-box-primary {
  background: rgba(255, 87, 87, 0.08);
  border-color: rgba(255, 87, 87, 0.28);
}

.action-box-title {
  font-size: 1.2rem;
  color: #ffffff;
}

.action-box-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.action-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

.join-row {
  display: flex;
  gap: 10px;
}

.code-input {
  width: 120px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ==================== TOPBAR ==================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
}

.topbar-brand,
.topbar-actions,
.room-pill-group,
.host-controls-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #ffffff;
  margin-right: 6px;
}

.room-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.84rem;
  color: #fde68a;
}

.room-code-badge strong,
.room-code-pill-btn strong {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: #ffffff;
}

.room-code-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 11px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.room-code-pill-btn:hover {
  background: rgba(251, 191, 36, 0.24);
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-light);
}

.round-badge {
  font-variant-numeric: tabular-nums;
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
}

/* ==================== SCREEN 2: LOBBY ==================== */
.lobby-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 22px;
  align-items: start;
}

.lobby-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header-wrap {
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1.35rem;
  color: #ffffff;
}

.panel-subtitle {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.player-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(15, 12, 29, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.roster-item.is-self {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.09);
}

.roster-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.roster-avatar {
  font-size: 1.45rem;
  flex-shrink: 0;
}

.roster-name {
  font-weight: 700;
  font-size: 0.96rem;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.badge-host {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  font-size: 0.74rem;
  font-weight: 800;
}

.badge-self {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  font-size: 0.74rem;
  font-weight: 800;
}

.rules-box {
  margin-top: 18px;
  padding: 15px 16px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
}

.rules-title {
  font-size: 0.98rem;
  color: #ede9fe;
  margin-bottom: 6px;
}

.rules-text {
  margin: 0;
  font-size: 0.85rem;
  color: #ddd6fe;
  line-height: 1.55;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
}

.theme-card {
  position: relative;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 12, 29, 0.62);
  color: var(--ink-light);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.theme-card:hover:not(:disabled) {
  transform: translateY(-3px);
  background: rgba(34, 28, 62, 0.85);
  border-color: rgba(255, 255, 255, 0.28);
}

.theme-card.is-selected {
  border-color: var(--theme-color, var(--accent-coral));
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
}

.theme-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--theme-color, #6366f1);
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.45);
}

.theme-count-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-light);
  font-variant-numeric: tabular-nums;
}

.theme-name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
}

.theme-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.theme-samples {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.76rem;
  color: #d8d2f0;
  opacity: 0.92;
}

.theme-selected-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: #052e16;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
}

.theme-card.is-selected .theme-selected-check {
  display: flex;
}
.theme-card.is-selected .theme-count-pill {
  margin-right: 30px;
}

.lobby-action-bar {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.selected-theme-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.summary-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.waiting-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-light);
  font-weight: 700;
  font-size: 0.92rem;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-amber);
  animation: pulseDot 1.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

/* ==================== SCREEN 3: GAME TABLE ==================== */
.turn-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, #2b235a 0%, #3d2458 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}

.turn-banner.is-my-turn {
  background: linear-gradient(125deg, #9f1239 0%, #c2410c 100%);
  border-color: rgba(253, 224, 71, 0.55);
}

.turn-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.turn-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.turn-headline {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.turn-subtext {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
}

.game-table-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 26px;
  align-items: start;
}

.my-zone {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zone-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.zone-title {
  font-size: 1.35rem;
  color: #ffffff;
}

.zone-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

.zone-status.is-revealed {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}

.zone-helper {
  font-size: 0.86rem;
  color: var(--ink-muted);
}

/* ==================== 3D FLIP MY CARD ==================== */
.card-3d-scene {
  perspective: 1200px;
  width: 100%;
  height: 440px;
}

.card-3d-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.22, 1.28, 0.36, 1);
}

.card-3d-inner.is-flipped {
  transform: rotateY(180deg);
}

.card-3d-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

/* Mystery Front Face */
.card-3d-front {
  background: linear-gradient(155deg, #251d4d 0%, #171232 55%, #2b153c 100%);
  border: 2px solid rgba(251, 191, 36, 0.36);
  align-items: center;
  text-align: center;
  justify-content: space-between;
  overflow: hidden;
}

.mystery-foil {
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(251, 191, 36, 0.1) 55deg,
    transparent 110deg,
    rgba(255, 87, 87, 0.1) 210deg,
    transparent 280deg
  );
  animation: foilRotate 10s linear infinite;
  pointer-events: none;
}

@keyframes foilRotate {
  to {
    transform: rotate(360deg);
  }
}

.mystery-top-tag,
.mystery-emblem,
.mystery-heading,
.mystery-desc,
.card-3d-front .btn {
  position: relative;
  z-index: 1;
}

.mystery-top-tag {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fde68a;
}

.mystery-emblem {
  width: 94px;
  height: 94px;
  border-radius: 26px;
  background: rgba(251, 191, 36, 0.14);
  border: 2px dashed rgba(251, 191, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: mysteryBounce 2.6s ease-in-out infinite;
}

@keyframes mysteryBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.04);
  }
}

.mystery-heading {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.mystery-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #d8d2f0;
  line-height: 1.5;
}

/* Revealed Back Face */
.card-3d-back {
  transform: rotateY(180deg);
  background: var(--bg-card-cream);
  color: var(--ink-card);
  border: 3px solid var(--accent-emerald);
  justify-content: flex-start;
  gap: 10px;
}

.revealed-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.revealed-rank-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.78rem;
  font-weight: 800;
}

.revealed-theme-mini {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-card-sub);
}

.revealed-emoji-circle {
  width: 66px;
  height: 66px;
  margin: 6px auto 0;
  border-radius: 20px;
  background: var(--bg-card-tint);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
}

.revealed-card-name {
  text-align: center;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink-card);
  line-height: 1.15;
}

.revealed-card-sub {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-card-sub);
}

.revealed-facts-list {
  margin: 8px 0 0;
  padding: 12px 14px 12px 26px;
  border-radius: 14px;
  background: var(--bg-card-tint);
  color: var(--ink-card);
  font-size: 0.82rem;
  line-height: 1.48;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

/* ==================== SCRATCHPAD ==================== */
.scratchpad-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scratchpad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scratchpad-title {
  font-size: 1.08rem;
  color: #ffffff;
}

.btn-link-clear {
  background: transparent;
  border: 0;
  color: #fca5a5;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
}
.btn-link-clear:hover {
  text-decoration: underline;
}

.scratchpad-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.clue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.clue-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 12, 29, 0.55);
  color: var(--ink-light);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.clue-chip:hover {
  background: rgba(255, 255, 255, 0.14);
}

.clue-chip.is-active {
  background: rgba(251, 191, 36, 0.22);
  border-color: var(--accent-amber);
  color: #fde68a;
}

.clue-form {
  display: flex;
  gap: 8px;
}

.clue-text-input {
  padding: 9px 12px;
  font-size: 0.86rem;
  border-radius: 11px;
}

.clue-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clue-note-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(15, 12, 29, 0.6);
  font-size: 0.83rem;
  color: var(--ink-light);
}

.btn-remove-note {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  cursor: pointer;
  font-weight: 700;
  padding: 2px 5px;
}
.btn-remove-note:hover {
  color: #fca5a5;
}

/* ==================== FRIENDS' CARDS GRID ==================== */
.friends-zone {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 18px;
}

.friend-card-slot {
  background: var(--bg-card-cream);
  color: var(--ink-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.friend-card-slot.is-dealing {
  animation: dealCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.friend-card-slot:hover {
  transform: translateY(-4px);
}

.friend-card-slot.is-turn {
  border-color: var(--accent-amber);
  box-shadow: 0 20px 44px -10px rgba(251, 191, 36, 0.35), 0 4px 12px rgba(0, 0, 0, 0.35);
}

@keyframes dealCardIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.94) rotate(-1.5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.friend-card-banner {
  padding: 12px 16px;
  color: #ffffff;
  background: var(--theme-color, #e11d48);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.friend-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.friend-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.friend-player-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-status-pill {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(15, 12, 29, 0.32);
  color: #ffffff;
  flex-shrink: 0;
}

.friend-status-pill.is-done {
  background: #d1fae5;
  color: #065f46;
}

.friend-card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.friend-character-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-char-emoji {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: var(--bg-card-tint);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  flex-shrink: 0;
}

.friend-char-name {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--ink-card);
  line-height: 1.15;
}

.friend-char-sub {
  margin: 3px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-card-sub);
  line-height: 1.35;
}

.friend-facts-box {
  margin-top: auto;
  padding: 11px 12px 11px 24px;
  border-radius: 13px;
  background: var(--bg-card-tint);
  color: var(--ink-card);
  font-size: 0.81rem;
  line-height: 1.46;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.friend-turn-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.76rem;
  font-weight: 800;
  align-self: flex-start;
}

.empty-friends-state {
  grid-column: 1 / -1;
  padding: 40px 24px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  text-align: center;
  color: var(--ink-muted);
}

/* ==================== DEALING OVERLAY ==================== */
.deal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(14, 11, 28, 0.84);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
}

.deal-overlay.is-visible {
  display: flex;
}

.deal-stage {
  position: relative;
  width: 280px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deal-deck {
  position: relative;
  width: 220px;
  height: 280px;
}

.deal-core-card {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background: linear-gradient(155deg, #292154 0%, #171232 100%);
  border: 2px solid var(--accent-amber);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  animation: deckShake 0.45s ease-in-out infinite alternate;
}

.deal-core-badge {
  font-size: 3.1rem;
}
.deal-core-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}
.deal-core-sub {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fde68a;
}

.deal-fly-card {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: var(--bg-card-cream);
  color: var(--ink-card);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  z-index: 2;
}

.fly-1 {
  animation: flyLeft 0.9s ease-in-out infinite;
}
.fly-2 {
  animation: flyRight 0.9s ease-in-out 0.15s infinite;
}
.fly-3 {
  animation: flyTop 0.9s ease-in-out 0.3s infinite;
}
.fly-4 {
  animation: flyBottom 0.9s ease-in-out 0.45s infinite;
}

@keyframes deckShake {
  from {
    transform: rotate(-3deg) scale(0.98);
  }
  to {
    transform: rotate(3deg) scale(1.03);
  }
}
@keyframes flyLeft {
  0% { transform: translate(0, 0) rotate(0); opacity: 0.95; }
  100% { transform: translate(-150px, -20px) rotate(-25deg); opacity: 0; }
}
@keyframes flyRight {
  0% { transform: translate(0, 0) rotate(0); opacity: 0.95; }
  100% { transform: translate(150px, 20px) rotate(25deg); opacity: 0; }
}
@keyframes flyTop {
  0% { transform: translate(0, 0) rotate(0); opacity: 0.95; }
  100% { transform: translate(40px, -130px) rotate(14deg); opacity: 0; }
}
@keyframes flyBottom {
  0% { transform: translate(0, 0) rotate(0); opacity: 0.95; }
  100% { transform: translate(-45px, 130px) rotate(-14deg); opacity: 0; }
}

/* ==================== MODALS & TOASTS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(11, 9, 22, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.modal-card-lg {
  max-width: 640px;
}
.modal-card-sm {
  max-width: 440px;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 1.25rem;
  color: #ffffff;
}

.btn-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-light);
  font-weight: 800;
  cursor: pointer;
}
.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-row-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
}

.icon-color-row {
  display: flex;
  gap: 8px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-counter-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  font-size: 0.76rem;
  font-weight: 800;
}

.confirm-text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.modal-footer {
  padding: 14px 22px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  padding: 12px 16px;
  border-radius: 14px;
  background: #282247;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-soft);
  font-size: 0.88rem;
  font-weight: 700;
  animation: toastSlide 0.25s ease-out;
}

.toast.is-success {
  border-color: rgba(16, 185, 129, 0.55);
  background: #064e3b;
}

.toast.is-error {
  border-color: rgba(239, 68, 68, 0.55);
  background: #7f1d1d;
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== TIMER & COMPLETION LEADERBOARD ==================== */
.timer-badge {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #a7f3d0;
}

.leaderboard-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.leaderboard-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.finished-count-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.leaderboard-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.leaderboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.leaderboard-empty {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 12, 29, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 15px;
  background: rgba(15, 12, 29, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.leaderboard-item.rank-1 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(15, 12, 29, 0.72));
  border-color: rgba(251, 191, 36, 0.55);
}

.leaderboard-item.rank-2 {
  background: linear-gradient(135deg, rgba(203, 213, 225, 0.15), rgba(15, 12, 29, 0.72));
  border-color: rgba(203, 213, 225, 0.42);
}

.leaderboard-item.rank-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.18), rgba(15, 12, 29, 0.72));
  border-color: rgba(217, 119, 6, 0.45);
}

.leaderboard-item.is-self {
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.45);
}

.lb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lb-rank {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.lb-player {
  min-width: 0;
}

.lb-player-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.92rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-card-label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.still-playing-strip {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-muted);
  font-size: 0.83rem;
  font-weight: 600;
}

.friends-cards-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== MOBILE CONTROLS (HIDDEN ON DESKTOP) ==================== */
.mobile-tab-bar,
.mobile-mycard-peek,
.mobile-sticky-bar {
  display: none;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 1024px) {
  .lobby-layout,
  .game-table-layout {
    grid-template-columns: 1fr;
  }

  .my-zone {
    position: static;
  }
}

@media (max-width: 768px) {
  .page-container {
    padding: 12px 12px 96px;
  }

  .home-shell {
    padding: 20px 14px 48px;
    gap: 20px;
  }

  .home-card {
    padding: 18px;
    gap: 18px;
  }

  .text-input {
    font-size: 1rem;
    padding: 12px 14px;
  }

  .topbar {
    padding: 12px 14px;
    margin-bottom: 14px;
    gap: 10px;
  }

  .topbar-logo {
    font-size: 1.08rem;
  }

  .turn-banner {
    padding: 12px 14px;
    margin-bottom: 14px;
  }

  .turn-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .turn-headline {
    font-size: 1.04rem;
  }

  .turn-subtext {
    font-size: 0.8rem;
  }

  .btn-turn {
    width: 100%;
    min-height: 42px;
  }

  .action-split,
  .modal-row-2 {
    grid-template-columns: 1fr;
  }

  .action-divider {
    padding: 2px 0;
  }

  .join-row {
    flex-direction: column;
  }

  .code-input {
    width: 100%;
  }

  /* Sticky Lobby Start Bar on mobile */
  .lobby-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 40;
    margin: 16px -14px -14px;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: rgba(30, 25, 54, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }

  .lobby-action-bar #host-start-controls,
  .lobby-action-bar #btn-start-game,
  .lobby-action-bar .waiting-pill {
    width: 100%;
  }

  /* Mobile Segmented Tab Bar */
  .mobile-tab-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
    position: sticky;
    top: 8px;
    z-index: 45;
    box-shadow: var(--shadow-soft);
  }

  .mobile-tab-btn {
    border: 0;
    border-radius: 11px;
    padding: 10px 6px;
    min-height: 44px;
    background: transparent;
    color: var(--ink-muted);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .mobile-tab-btn.is-active {
    background: var(--accent-coral);
    color: #ffffff;
  }

  .mobile-tab-count {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  /* Tab-based visibility on mobile */
  .game-table-layout[data-active-mobile-tab="friends"] [data-mobile-view="mycard"],
  .game-table-layout[data-active-mobile-tab="friends"] [data-mobile-view="leaderboard"],
  .game-table-layout[data-active-mobile-tab="mycard"] [data-mobile-view="friends"],
  .game-table-layout[data-active-mobile-tab="mycard"] [data-mobile-view="leaderboard"],
  .game-table-layout[data-active-mobile-tab="leaderboard"] [data-mobile-view="friends"],
  .game-table-layout[data-active-mobile-tab="leaderboard"] [data-mobile-view="mycard"] {
    display: none;
  }

  .mobile-mycard-peek {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #251d4d, #2b153c);
    border: 1px solid rgba(251, 191, 36, 0.35);
  }

  .mobile-peek-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mobile-peek-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
  }

  .mobile-peek-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-peek-text strong {
    font-size: 0.88rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-peek-text span {
    font-size: 0.76rem;
    color: #fde68a;
  }

  .card-3d-scene {
    height: 410px;
  }

  .friends-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  /* Mobile Sticky Bottom Bar */
  .mobile-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(20, 17, 36, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .mobile-sticky-main {
    flex: 1.5;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.86rem;
  }

  .mobile-sticky-sub {
    flex: 0.9;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 0.82rem;
  }
}
