/* Splendor Renaissance Luxury Design System — Mobile & Multi-Resolution Responsive */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1f293d;
  --bg-card: rgba(22, 30, 49, 0.78);
  --border-card: rgba(212, 175, 55, 0.22);
  --border-card-hover: rgba(243, 207, 101, 0.65);

  --gold-primary: #d4af37;
  --gold-light: #fef08a;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gold-gradient: linear-gradient(135deg, #fef08a 0%, #d4af37 50%, #996515 100%);
  --gold-btn: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);

  /* Gem Colors */
  --gem-white: #f8fafc;
  --gem-white-bg: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  --gem-white-border: #94a3b8;

  --gem-blue: #3b82f6;
  --gem-blue-bg: linear-gradient(135deg, #60a5fa 0%, #1d4ed8 100%);
  --gem-blue-border: #1e40af;

  --gem-green: #10b981;
  --gem-green-bg: linear-gradient(135deg, #34d399 0%, #047857 100%);
  --gem-green-border: #065f46;

  --gem-red: #ef4444;
  --gem-red-bg: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
  --gem-red-border: #991b1b;

  --gem-black: #334155;
  --gem-black-bg: linear-gradient(135deg, #475569 0%, #0f172a 100%);
  --gem-black-border: #1e293b;

  --gem-gold: #f59e0b;
  --gem-gold-bg: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
  --gem-gold-border: #78350f;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-gold: #fde047;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-serif: 'Cinzel', serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.65);
  --shadow-gold: 0 0 16px rgba(212, 175, 55, 0.3);

  /* Safe Area Insets for iPhone Dynamic Island / Notch and Samsung Punch Hole */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --app-height: 100dvh;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse 80% 80% at 50% -20%, rgba(212, 175, 55, 0.08), transparent),
    radial-gradient(circle at 10% 90%, rgba(30, 58, 138, 0.12), transparent),
    radial-gradient(circle at 90% 20%, rgba(4, 120, 87, 0.08), transparent);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

.hidden {
  display: none !important;
}

/* DEV STUDIO TOOLBAR (for laptop development) */
.dev-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  font-size: 12px;
}

.dev-toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.dev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.dev-toolbar-buttons {
  display: flex;
  gap: 6px;
}

.dev-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
}

.dev-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
  color: #fff;
}

.dev-btn.active {
  background: var(--gold-btn);
  color: #000;
  border-color: var(--gold-primary);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

.dev-btn.btn-gold {
  background: linear-gradient(135deg, #d4af37 0%, #996515 100%);
  border-color: #fde047;
  color: #fff;
  font-weight: 700;
}

.dev-btn.btn-gold:hover {
  background: linear-gradient(135deg, #fef08a 0%, #d4af37 100%);
  color: #000;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
}

.dev-res-badge {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted);
}

/* When dev toolbar is active on laptop, body gets top margin */
body.has-dev-toolbar {
  padding-top: 42px;
}

/* APP SHELL */
.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: var(--app-height);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  transition: max-width 0.3s ease, margin 0.3s ease;
}

body.mobile-standalone .app-root {
  max-width: 100% !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  overflow-y: auto;
}

body.mobile-standalone .app-root::before {
  display: none !important;
}

/* DEVICE SIMULATOR CONTAINER (Authentic phone frame on laptop) */
body.simulating-iphone .app-root {
  max-width: 393px;
  height: 852px;
  max-height: calc(100vh - 60px);
  margin: 10px auto;
  border: 11px solid #1e293b;
  border-radius: 48px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-primary);
}

/* iPhone Dynamic Island Mock */
body.simulating-iphone .app-root::before {
  content: "";
  position: sticky;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #000000;
  border-radius: 20px;
  z-index: 100;
  margin-bottom: -29px;
  display: block;
  box-shadow: 0 0 1px rgba(255, 255, 255, 0.2);
}

body.simulating-samsung .app-root {
  max-width: 412px;
  height: 915px;
  max-height: calc(100vh - 60px);
  margin: 10px auto;
  border: 8px solid #0f172a;
  border-radius: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-primary);
}

/* Samsung Punch-hole camera mock */
body.simulating-samsung .app-root::before {
  content: "";
  position: sticky;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  background: #000000;
  border-radius: 50%;
  z-index: 100;
  margin-bottom: -17px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.simulating-iphonese .app-root {
  max-width: 375px;
  height: 667px;
  max-height: calc(100vh - 60px);
  margin: 10px auto;
  border: 10px solid #1e293b;
  border-radius: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-primary);
}

body.simulating-iphone-land .app-root {
  max-width: 852px;
  height: 393px;
  margin: 15px auto;
  border: 11px solid #1e293b;
  border-radius: 44px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-primary);
}

body.simulating-samsung-land .app-root {
  max-width: 915px;
  height: 412px;
  margin: 15px auto;
  border: 8px solid #0f172a;
  border-radius: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-primary);
}

/* Pinned controls inside simulated phone */
body.simulating-iphone .bottom-control-dock,
body.simulating-samsung .bottom-control-dock,
body.simulating-iphonese .bottom-control-dock {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 45 !important;
}

/* Hide dev-toolbar on real mobile devices */
@media (max-width: 768px) {
  .dev-toolbar {
    display: none !important;
  }
  body.has-dev-toolbar {
    padding-top: 0 !important;
  }
}

/* TOP NAVIGATION */
.top-nav {
  height: 54px;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: var(--safe-top);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-gem {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 9px;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-sim-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.device-sim-select option {
  background: #111827;
  color: #fff;
}

.badge {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-connected {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.badge-turn {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.user-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* GLASS CARDS */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

/* BUTTONS */
.btn {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  min-height: 40px;
}

.btn-gold {
  background: var(--gold-btn);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.35);
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.08);
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--gold-primary);
  border: 1px solid var(--gold-primary);
}

.btn-danger-outline {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-large {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
  min-height: 30px;
}

/* LOGIN / LOBBY VIEWS */
.login-card, .lobby-card, .home-card {
  max-width: 480px;
  margin: 30px auto;
  text-align: center;
  width: 100%;
}

.card-hero-icon {
  font-size: 44px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
}

.card-heading {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-gold);
}

.card-subheading {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

.sso-container {
  margin-top: 18px;
}

.divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 11px;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.divider span {
  padding: 0 10px;
}

/* LOBBY */
.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.lobby-code {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--gold-light);
  letter-spacing: 2px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.member-seat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.member-seat.occupied {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.lobby-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* HOME VIEW */
.home-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}

.action-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.action-box h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.action-box p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

/* ============================================================ */
/* GAME TABLE LAYOUT                                           */
/* ============================================================ */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  margin-bottom: 140px; /* Space for bottom dock */
}

/* TURN BANNER */
.turn-banner {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.turn-text {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
}

.grace-alert {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* NOBLES SECTION */
.board-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--gold-primary);
  font-weight: 700;
}

.section-label .sublabel {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 400;
}

.nobles-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.noble-card {
  width: 95px;
  height: 95px;
  border-radius: var(--radius-md);
  background: #1e293b;
  border: 2px solid rgba(212, 175, 55, 0.4);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.noble-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.noble-card.qualified {
  border: 2.5px solid #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.7);
  animation: noblePulse 2s infinite ease-in-out alternate;
}

@keyframes noblePulse {
  0% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); border-color: #10b981; }
  100% { box-shadow: 0 0 18px rgba(16, 185, 129, 0.95); border-color: #34d399; }
}

/* CARDS SECTION & GRID */
.game-board-area {
  min-width: 0;
  width: 100%;
}

.cards-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.tier-row {
  display: grid;
  grid-template-columns: 65px 95px 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.tier-badge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tier-badge {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
}

.tier-3 { color: #38bdf8; }
.tier-2 { color: #facc15; }
.tier-1 { color: #4ade80; }

.tier-name {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.card-deck {
  width: 95px;
  height: 135px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  flex-shrink: 0;
  position: relative;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.card-deck:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.card-deck.empty-deck {
  opacity: 0.25;
  filter: grayscale(0.85);
  cursor: not-allowed;
  pointer-events: none;
}

.deck-count-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(10, 14, 23, 0.88);
  color: #f8fafc;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.tier-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  min-width: 0;
  width: 100%;
}

/* DEVELOPMENT CARD - Pure Board Game Artwork */
.dev-card {
  height: 135px;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-md);
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.dev-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.65);
  z-index: 5;
}

.dev-card.empty-slot {
  opacity: 0.15;
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.2);
  cursor: default;
  pointer-events: none;
}

/* Affordability indicated ONLY via elegant outer borders/glows - NO overlays on card artwork */
.dev-card.affordable {
  border: 2px solid #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
}

.dev-card.affordable:hover {
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.75);
}

.dev-card.affordable-gold {
  border: 2px dashed #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.45);
}

.dev-card.affordable-gold:hover {
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.75);
}

/* SIDEBAR: TOKEN BANK & OPPONENTS */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-md);
}

.sidebar-header {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.sidebar-header h3 {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--gold-primary);
}

.bank-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.bank-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.token-chip-btn {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s;
}

.token-chip-btn:hover:not(:disabled) {
  border-color: var(--gold-primary);
}

.token-chip-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bank-token-circle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gem-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1.5px solid rgba(255,255,255,0.3);
}

.bank-token-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  pointer-events: none;
  transition: transform 0.15s ease;
}

.token-chip-btn:hover:not(:disabled) .bank-token-img,
.mobile-token-btn:hover:not(:disabled) .bank-token-img {
  transform: scale(1.1);
}

.token-stock {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 800;
}

/* STAGING DOCK */
.staging-dock {
  margin-top: 12px;
  padding: 10px;
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
}

.staging-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.staged-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.staged-chip {
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 3px;
}

.staging-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* OPPONENTS LIST */
.opponents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opponent-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.opponent-card.active-turn {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.06);
}

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

.opp-name {
  font-size: 12px;
  font-weight: 700;
}

.opp-pts {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-light);
}

.opp-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.opp-bonuses {
  display: flex;
  gap: 3px;
}

.mini-bonus-pill {
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 9px;
}

/* LOG BOX */
.log-stream {
  height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
}

.log-entry {
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  line-height: 1.35;
}

.log-entry.success { color: #6ee7b7; border-left: 2px solid #10b981; }
.log-entry.warning { color: #fde047; border-left: 2px solid #eab308; }

/* ============================================================ */
/* BOTTOM FIXED DOCK: PLAYER TABLEAU                            */
/* ============================================================ */
.player-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 2px solid var(--gold-primary);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7);
  z-index: 40;
  display: flex;
  align-items: center;
  padding: 0 16px;
  padding-bottom: var(--safe-bottom);
}

.dock-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 180px 220px 1fr 220px;
  gap: 16px;
  align-items: center;
}

.dock-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 4px 10px;
}

.score-pts {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
}

.score-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dock-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar-wrap {
  width: 90px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
}

.dock-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.chip-row, .bonus-row, .reserved-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.dock-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.dock-token-img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  flex-shrink: 0;
}

.dock-token-count {
  font-weight: 800;
  line-height: 1;
}

.dock-bonus {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.15);
}

.dock-reserved-card {
  width: 44px;
  height: 60px;
  border-radius: 5px;
  border: 1px solid var(--gold-primary);
  background: #1e293b;
  background-size: 100% 100%;
  background-position: center;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px;
  flex-shrink: 0;
}

/* GEM THEME COLORS */
.color-white { background: var(--gem-white-bg); color: #0f172a; }
.color-blue  { background: var(--gem-blue-bg); color: #ffffff; }
.color-green { background: var(--gem-green-bg); color: #ffffff; }
.color-red   { background: var(--gem-red-bg); color: #ffffff; }
.color-black { background: var(--gem-black-bg); color: #ffffff; }
.color-gold  { background: var(--gem-gold-bg); color: #000000; }

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-modal-dialog {
  width: 100%;
  max-width: 440px;
  position: relative;
  padding: 20px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid var(--gold-primary);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-card-body {
  margin: 12px 0 16px;
}

.modal-card-top {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.modal-card-image {
  width: 105px;
  height: 148px;
  border-radius: 8px;
  background-size: 100% 100%;
  background-position: center;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.modal-card-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-card-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
}

.modal-card-points {
  font-size: 13px;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-card-bonus {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.modal-bonus-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.modal-bonus-chip.chip-white { background: var(--gem-white-bg); color: #0f172a; border: 1px solid var(--gem-white-border); }
.modal-bonus-chip.chip-blue  { background: var(--gem-blue-bg); color: #ffffff; border: 1px solid var(--gem-blue-border); }
.modal-bonus-chip.chip-green { background: var(--gem-green-bg); color: #ffffff; border: 1px solid var(--gem-green-border); }
.modal-bonus-chip.chip-red   { background: var(--gem-red-bg); color: #ffffff; border: 1px solid var(--gem-red-border); }
.modal-bonus-chip.chip-black { background: var(--gem-black-bg); color: #ffffff; border: 1px solid var(--gem-black-border); }

.modal-decision-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.35;
}

.modal-decision-banner.decision-ready {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid #10b981;
  color: #a7f3d0;
}

.modal-decision-banner.decision-gold {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid #f59e0b;
  color: #fde68a;
}

.modal-decision-banner.decision-missing {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid #ef4444;
  color: #fecaca;
}

.modal-decision-banner.decision-turn {
  background: rgba(100, 116, 139, 0.22);
  border: 1px solid #64748b;
  color: #cbd5e1;
}

.decision-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.modal-req-section {
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.modal-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--gold-primary);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-req-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-req-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 12px;
}

.modal-req-col-color {
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.token-pill-badge.color-white { background: var(--gem-white-bg); color: #0f172a; border: 1px solid var(--gem-white-border); }
.token-pill-badge.color-blue  { background: var(--gem-blue-bg); color: #fff; border: 1px solid var(--gem-blue-border); }
.token-pill-badge.color-green { background: var(--gem-green-bg); color: #fff; border: 1px solid var(--gem-green-border); }
.token-pill-badge.color-red   { background: var(--gem-red-bg); color: #fff; border: 1px solid var(--gem-red-border); }
.token-pill-badge.color-black { background: var(--gem-black-bg); color: #fff; border: 1px solid var(--gem-black-border); }
.token-pill-badge.color-gold  { background: var(--gem-gold-bg); color: #000; border: 1px solid var(--gem-gold-border); }

.modal-req-col-have {
  font-size: 11px;
  color: #cbd5e1;
}

.modal-req-col-status {
  display: flex;
  align-items: center;
}

.badge-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}

.badge-status.badge-covered {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.badge-status.badge-gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.badge-status.badge-missing {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.modal-inventory-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-inventory-title {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.modal-inventory-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.inv-pill.active {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

.final-scoreboard {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-rank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  font-size: 13px;
}

.score-rank-row.winner {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
}

.trophy-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

/* ============================================================ */
/* MOBILE ARCHITECTURE (Default Portrait Layout)               */
/* Always active on real phones and in laptop mobile simulator  */
/* ============================================================ */

.top-nav {
  height: 48px;
  padding: 0 12px;
  padding-top: max(4px, var(--safe-top));
  flex-shrink: 0;
}

.brand-title {
  font-size: 14px;
  letter-spacing: 1px;
}
.brand-gem { font-size: 17px; }
.brand-subtitle { display: none; }

.main-content {
  padding: 4px 6px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#game-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Switch grid to vertical stack - exact fit to page without overflow */
.game-layout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  flex: 1;
  min-height: 0;
}

/* Hide Desktop Sidebar in Mobile Portrait */
.game-sidebar {
  display: none !important;
}

/* OPPONENTS TABLE FRAME (Surrounding the central game board) */
.opponents-table-frame,
.mobile-opponents-strip {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 5px;
  width: 100%;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.opp-station {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  min-width: 0;
  overflow: hidden;
}

.opp-station.active-turn {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.14);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.opp-station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 20px;
}

.opp-station-id {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.opp-avatar-sm {
  width: 18px;
  height: 18px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-light);
  flex-shrink: 0;
}

.opp-name-sm {
  font-weight: 700;
  font-size: 11px;
  color: #f1f5f9;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opp-turn-indicator {
  background: var(--gold-btn);
  color: #000;
  font-size: 7px;
  font-weight: 900;
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  line-height: 1;
  animation: pulse-turn 1.5s infinite alternate;
}

@keyframes pulse-turn {
  from { opacity: 0.8; }
  to { opacity: 1; filter: drop-shadow(0 0 4px var(--gold-primary)); }
}

.opp-score-col {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.opp-trophy-pts {
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.opp-res-badge {
  font-size: 9px;
  color: var(--text-muted);
}

.opp-station-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 1px 0;
}

/* Tokens held: 6-column grid with icon on top, count centered underneath */
.opp-tokens-held-wrap {
  width: 100%;
}

.opp-tokens-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  align-items: center;
  width: 100%;
}

.opp-token-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}

.opp-token-img {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.opp-token-num {
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  text-align: center;
}

.opp-token-col.zero-token .opp-token-img {
  opacity: 0.3;
  filter: grayscale(0.6);
}

.opp-token-col.zero-token .opp-token-num {
  opacity: 0.3;
  color: var(--text-muted);
}

/* Card bonus stacks: 5-column grid with gem on top, +count centered underneath */
.opp-card-stacks-wrap {
  width: 100%;
}

.opp-stacks-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  align-items: center;
  width: 100%;
}

.opp-stack-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 1px;
  min-width: 0;
}

.opp-stack-card.has-bonus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.opp-stack-card.zero-bonus {
  opacity: 0.35;
}

.opp-stack-card.color-white { border-color: rgba(248, 250, 252, 0.3); }
.opp-stack-card.color-blue  { border-color: rgba(59, 130, 246, 0.45); }
.opp-stack-card.color-green { border-color: rgba(16, 185, 129, 0.45); }
.opp-stack-card.color-red   { border-color: rgba(239, 68, 68, 0.45); }
.opp-stack-card.color-black { border-color: rgba(120, 80, 50, 0.45); }

.opp-stack-token-img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: contain;
}

.opp-stack-count {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  text-align: center;
}

.opp-stack-card.has-bonus .opp-stack-count {
  color: var(--gold-light);
}

.turn-banner {
  padding: 2px 8px;
  margin-bottom: 2px;
  min-height: 18px;
  flex-shrink: 0;
}

.turn-text {
  font-size: 11px;
}

.badge-turn {
  font-size: 9px;
  padding: 1px 5px;
}

/* Nobles Section - Compact noble plates to save vertical space */
.nobles-section {
  padding: 2px 6px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.nobles-section .section-label {
  margin-bottom: 1px;
  font-size: 8px;
}

.nobles-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1px;
}

.noble-card {
  width: 44px !important;
  height: 44px !important;
  border-radius: var(--radius-sm);
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  position: relative;
  flex-shrink: 0;
}

/* Tier Rows - Expanded cards to ensure complete artwork display without trimming */
.cards-section {
  gap: 5px;
  padding: 2px 6px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tier-row {
  grid-template-columns: 62px 1fr !important;
  gap: 5px !important;
  align-items: center;
  width: 100%;
}

.tier-badge-col {
  display: none !important;
}

.card-deck {
  width: 62px !important;
  height: 104px !important;
  aspect-ratio: 1128 / 1580;
  border-radius: var(--radius-sm);
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.tier-cards-row {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 4px !important;
  width: 100%;
}

.dev-card {
  height: 104px !important;
  width: 100% !important;
  min-width: 0;
  aspect-ratio: 1128 / 1580;
  border-radius: var(--radius-sm);
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* UNIFIED BOTTOM CONTROL PANEL (Token Bank + Player Dashboard) */
.bottom-control-dock {
  position: sticky !important;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1.5px solid var(--gold-primary);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.65);
  flex-shrink: 0;
  margin-top: auto;
}

body.simulating-iphone .bottom-control-dock,
body.simulating-samsung .bottom-control-dock,
body.simulating-iphonese .bottom-control-dock {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 40 !important;
}

.mobile-gem-bar {
  display: flex !important;
  flex-direction: column;
  position: static !important;
  background: transparent !important;
  border-top: none !important;
  box-shadow: none !important;
  padding: 3px 8px 2px !important;
  z-index: auto !important;
}

.mobile-gem-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 2px;
}

.mobile-gem-hint {
  font-size: 8px;
  color: var(--text-muted);
}

.mobile-gem-piles {
  display: flex;
  justify-content: space-around;
  gap: 3px;
}

.mobile-token-btn {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 2px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #fff;
  cursor: pointer;
  min-height: 33px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.mobile-token-btn:hover:not(:disabled) {
  border-color: var(--gold-primary);
  background: rgba(31, 41, 61, 0.95);
  transform: translateY(-1px);
}

.mobile-token-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.mobile-token-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mobile-token-btn .bank-token-img {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.bank-token-count {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
}

.staged-token-img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  vertical-align: middle;
}

.pill-token-img {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  vertical-align: middle;
}

.inv-token-img {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  vertical-align: middle;
}

.mobile-staging-dock {
  margin-top: 4px;
  padding: 4px 6px;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* MOBILE PLAYER DOCK (Tableau) */
.player-dock {
  position: static !important;
  height: auto !important;
  min-height: 48px !important;
  background: rgba(0, 0, 0, 0.35) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  padding: 2px 8px !important;
  padding-bottom: max(4px, var(--safe-bottom)) !important;
  z-index: auto !important;
  display: flex !important;
  align-items: center !important;
}

.dock-container {
  width: 100%;
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 6px;
  align-items: center;
}

.dock-profile {
  gap: 4px;
}

.score-display {
  padding: 2px 5px;
  border-radius: 4px;
}

.score-pts {
  font-size: 16px;
}

.score-label {
  font-size: 7px;
}

.dock-name {
  display: none;
}

.progress-bar-wrap {
  width: 28px;
}

.dock-tokens, .dock-bonuses, .dock-reserved {
  min-width: 0;
}

.dock-section-label {
  font-size: 8px;
  margin-bottom: 2px;
}

.chip-row, .bonus-row, .reserved-row {
  display: flex;
  gap: 3px;
  align-items: center;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.dock-chip {
  padding: 2px 3px;
  font-size: 9px;
  gap: 2px;
}

.dock-token-img {
  width: 15px;
  height: 15px;
}

.dock-bonus {
  padding: 2px 3px;
  font-size: 9px;
  gap: 2px;
}

.dock-reserved-card {
  width: 26px;
  height: 36px;
  border-radius: 3px;
  flex-shrink: 0;
}

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

/* ============================================================ */
/* MOBILE LANDSCAPE OPTIMIZATION                               */
/* max-height: 520px and landscape, or landscape simulation   */
/* ============================================================ */
@media (max-height: 520px) and (orientation: landscape), body.simulating-iphone-land, body.simulating-samsung-land {
  .mobile-gem-bar {
    display: none !important;
  }

  .mobile-opponents-strip {
    display: none !important;
  }

  .game-sidebar {
    display: flex !important;
  }

  .top-nav {
    height: 42px;
    padding: 0 12px;
  }

  .brand-gem { font-size: 16px; }
  .brand-title { font-size: 13px; }
  .brand-subtitle { display: none; }

  .main-content {
    padding: 6px 12px;
  }

  .game-layout {
    display: grid !important;
    grid-template-columns: 1fr 240px !important;
    gap: 10px;
    margin-bottom: 70px;
  }

  .turn-banner {
    padding: 4px 10px;
    margin-bottom: 6px;
  }

  .turn-text { font-size: 13px; }

  .nobles-section {
    padding: 4px 8px;
    margin-bottom: 6px;
  }

  .section-label {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .nobles-row {
    gap: 6px;
  }

  .noble-card {
    width: 58px;
    height: 58px;
  }

  .cards-section {
    gap: 6px;
    padding: 6px 8px;
  }

  .tier-badge-col {
    display: none !important;
  }

  .tier-row {
    grid-template-columns: 60px 1fr !important;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .card-deck {
    width: 60px;
    height: 76px;
  }

  .deck-count-badge {
    font-size: 9px;
    padding: 1px 4px;
    bottom: 2px;
    right: 2px;
  }

  .tier-cards-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .dev-card {
    height: 76px;
    width: 100%;
    min-width: 0;
  }

  .bank-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .token-chip-btn {
    padding: 4px 2px;
  }

  .gem-icon-circle {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .token-stock { font-size: 10px; }

  .player-dock {
    height: 62px !important;
    padding: 0 10px;
  }

  .dock-container {
    grid-template-columns: 120px 140px 1fr 140px !important;
    gap: 8px;
  }

  .score-pts { font-size: 16px; }
  .dock-chip { font-size: 9px; padding: 1px 4px; }
  .dock-bonus { font-size: 9px; padding: 1px 4px; }
  .dock-reserved-card { width: 28px; height: 38px; }
}
