/* ==========================================================================
   FCBoard Design System Stylesheet
   Grounded in FC Online broadcast and player card visual vernacular.
   Anti-slop tokens, locked typography, and strict 8-state interactions.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Pretendard:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surface Tokens */
  --bg-canvas: #07090e;
  --bg-surface: #0f131c;
  --bg-surface-elevated: #161c28;
  --bg-surface-overlay: #1e2638;
  --bg-surface-glass: rgba(15, 19, 28, 0.85);

  /* Border Tokens */
  --border-subtle: #1e2535;
  --border-default: #2a344a;
  --border-strong: #3f4e6d;
  --border-accent: #00f5d4;

  /* Typography Tokens */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #00f5d4;
  --text-gold: #facc15;

  /* Market Semantic Indicators */
  --market-up: #10b981;
  --market-up-bg: rgba(16, 185, 129, 0.12);
  --market-down: #f43f5e;
  --market-down-bg: rgba(244, 63, 94, 0.12);
  --market-flat: #64748b;

  /* Position Colors */
  --pos-fw: #ef4444;
  --pos-mf: #10b981;
  --pos-df: #3b82f6;
  --pos-gk: #f59e0b;

  /* Grade Accents */
  --grade-bronze-border: #b45309;
  --grade-bronze-bg: linear-gradient(135deg, #78350f 0%, #b45309 100%);
  --grade-silver-border: #cbd5e1;
  --grade-silver-bg: linear-gradient(135deg, #475569 0%, #94a3b8 50%, #e2e8f0 100%);
  --grade-gold-border: #facc15;
  --grade-gold-bg: linear-gradient(135deg, #854d0e 0%, #eab308 50%, #fef08a 100%);
  --grade-plat-border: #38bdf8;
  --grade-plat-bg: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #f0f9ff 100%);

  /* Fonts */
  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sports Broadcast Display Numbers */
.font-display {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Authentic FC Online Card Container */
.fc-card {
  position: relative;
  width: 280px;
  height: 420px;
  background: linear-gradient(145deg, #182032 0%, #0d121c 100%);
  border: 2px solid #2d3852;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.fc-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.fc-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 245, 212, 0.4);
  box-shadow: 0 20px 40px -6px rgba(0, 245, 212, 0.15), 0 0 20px rgba(0, 245, 212, 0.1);
}

/* Card Header (Season Emblem, OVR, Position) */
.fc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.fc-season-badge {
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.fc-pos-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fc-pos-fw { background: var(--pos-fw); color: #fff; }
.fc-pos-mf { background: var(--pos-mf); color: #fff; }
.fc-pos-df { background: var(--pos-df); color: #fff; }
.fc-pos-gk { background: var(--pos-gk); color: #000; }

/* Player Action Image Cutout */
.fc-card-photo-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  z-index: 1;
}

.fc-card-photo-bg {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
  z-index: 0;
}

.fc-card-photo {
  max-height: 220px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
  z-index: 1;
  transition: transform 0.3s ease;
}

.fc-card:hover .fc-card-photo {
  transform: scale(1.04);
}

/* Card Footer */
.fc-card-footer {
  text-align: center;
  z-index: 2;
  background: rgba(11, 15, 24, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.fc-player-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-player-season-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Grade Pills (1강 ~ 10강) */
.grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  background: #182030;
  color: #94a3b8;
  border: 1px solid #2a344a;
}

.grade-pill:hover {
  background: #232d42;
  color: #fff;
  border-color: #475569;
}

.grade-pill:focus-visible {
  outline: 2px solid var(--border-accent);
  outline-offset: 2px;
}

.grade-pill:active {
  transform: scale(0.95);
}

/* Active Grade Themes */
.grade-pill.active-bronze {
  background: var(--grade-bronze-bg);
  border-color: var(--grade-bronze-border);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(180, 83, 9, 0.4);
}

.grade-pill.active-silver {
  background: var(--grade-silver-bg);
  border-color: var(--grade-silver-border);
  color: #0f172a;
  box-shadow: 0 0 12px rgba(203, 213, 225, 0.5);
}

.grade-pill.active-gold {
  background: var(--grade-gold-bg);
  border-color: var(--grade-gold-border);
  color: #422006;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.6);
}

.grade-pill.active-plat {
  background: var(--grade-plat-bg);
  border-color: var(--grade-plat-border);
  color: #082f49;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.7);
}

/* Telegram Modal Grade Pills */
.tg-grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 5px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: #182030;
  color: #94a3b8;
  border: 1px solid #2a344a;
}

.tg-grade-pill:hover {
  background: #232d42;
  color: #fff;
  border-color: #475569;
}

.tg-grade-pill:focus-visible {
  outline: 2px solid var(--border-accent);
  outline-offset: 1px;
}

.tg-grade-pill:active {
  transform: scale(0.95);
}

.tg-grade-pill.active-bronze {
  background: var(--grade-bronze-bg);
  border-color: var(--grade-bronze-border);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(180, 83, 9, 0.4);
}

.tg-grade-pill.active-silver {
  background: var(--grade-silver-bg);
  border-color: var(--grade-silver-border);
  color: #0f172a;
  box-shadow: 0 0 10px rgba(203, 213, 225, 0.5);
}

.tg-grade-pill.active-gold {
  background: var(--grade-gold-bg);
  border-color: var(--grade-gold-border);
  color: #422006;
  box-shadow: 0 0 12px rgba(203, 213, 225, 0.6);
}

.tg-grade-pill.active-plat {
  background: var(--grade-plat-bg);
  border-color: var(--grade-plat-border);
  color: #082f49;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
}

/* Grade Badge in Player Card */
.fc-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
}
.fc-grade-badge.bronze { background: var(--grade-bronze-bg); color: #fff; border: 1px solid var(--grade-bronze-border); }
.fc-grade-badge.silver { background: var(--grade-silver-bg); color: #0f172a; border: 1px solid var(--grade-silver-border); box-shadow: 0 0 8px rgba(203,213,225,0.4); }
.fc-grade-badge.gold { background: var(--grade-gold-bg); color: #422006; border: 1px solid var(--grade-gold-border); box-shadow: 0 0 10px rgba(250,204,21,0.5); }
.fc-grade-badge.plat { background: var(--grade-plat-bg); color: #082f49; border: 1px solid var(--grade-plat-border); box-shadow: 0 0 12px rgba(56,189,248,0.7); }

/* BP Currency Formatting */
.bp-text {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-gold);
}

/* Live Market Delta Badge */
.delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.delta-badge.up {
  background: var(--market-up-bg);
  color: var(--market-up);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.delta-badge.down {
  background: var(--market-down-bg);
  color: var(--market-down);
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.delta-badge.flat {
  background: rgba(100, 116, 139, 0.12);
  color: var(--market-flat);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Cockpit Glass Panel */
.cockpit-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: #2a344a;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f4e6d;
}

/* Search Dropdown & Highlight */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-surface-overlay);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
  z-index: 50;
}

.search-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.search-item:hover, .search-item.selected {
  background: rgba(0, 245, 212, 0.08);
}

/* Button 8-State Presets */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: #00f5d4;
  color: #07090e;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-primary:hover {
  background: #22f7db;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 245, 212, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: #1a2233;
  color: #e2e8f0;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #2d3852;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #25314a;
  border-color: #435479;
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* Live Pulsing Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Broadcast Navigation Tabs */
.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #00f5d4;
  background: rgba(0, 245, 212, 0.08);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #00f5d4;
  box-shadow: 0 0 8px #00f5d4;
  border-radius: 2px;
}

/* Tactical Slider Bar */
.tactic-slider-track {
  width: 100%;
  height: 8px;
  background: #182030;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.tactic-slider-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f5d4 0%, #38bdf8 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Meta Formation Card */
.meta-formation-card {
  background: #111724;
  border: 1px solid #232d42;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meta-formation-card:hover, .meta-formation-card.selected {
  border-color: #00f5d4;
  background: #161f30;
  box-shadow: 0 4px 16px rgba(0, 245, 212, 0.15);
}

/* Squad Slot Anatomy */
.squad-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.squad-slot:hover {
  transform: translate(-50%, -54%) scale(1.06);
  z-index: 20;
}

.squad-slot-empty {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  background: rgba(10, 25, 18, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.squad-slot:hover .squad-slot-empty {
  border-color: #00f5d4;
  background: rgba(0, 245, 212, 0.15);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.3);
}

.squad-slot-filled {
  position: relative;
  width: 72px;
  height: 72px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.squad-slot-avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  background: #0f1624;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.8);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.squad-slot:hover .squad-slot-avatar-wrap {
  border-color: #00f5d4;
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.4);
}

.squad-slot-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.squad-slot-season {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 22px;
  height: 16px;
  object-fit: contain;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}

.squad-slot-grade {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 15;
}

.squad-slot-name {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.squad-slot-meta {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.squad-slot-btn-remove {
  position: absolute;
  top: -6px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  z-index: 25;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.squad-slot-btn-info {
  position: absolute;
  top: -6px;
  left: 24px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  z-index: 25;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.squad-slot-btn-swap {
  position: absolute;
  top: -6px;
  left: 44px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #334155;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  z-index: 25;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.squad-slot:hover .squad-slot-btn-remove,
.squad-slot:hover .squad-slot-btn-info,
.squad-slot:hover .squad-slot-btn-swap {
  display: flex;
}

/* Market Semantic Status Badges */
.badge-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

.badge-surge {
  background: rgba(168, 85, 247, 0.15) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.4) !important;
}

.badge-drop {
  background: rgba(244, 63, 94, 0.15) !important;
  color: #f43f5e !important;
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
}

.badge-normal {
  background: rgba(100, 116, 139, 0.15) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

/* Squad Slot OVR & Interactive Grade */
.squad-slot-ovr {
  position: absolute;
  top: -4px;
  right: -4px;
  background: rgba(15, 23, 42, 0.95);
  color: #00f5d4;
  font-size: 11px;
  font-weight: 900;
  font-family: monospace;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(0, 245, 212, 0.6);
  z-index: 12;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  line-height: 1.1;
}

.squad-slot-ovr.boosted {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.8);
  background: rgba(24, 17, 8, 0.98);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.squad-slot-grade-wrap {
  position: absolute;
  bottom: -4px;
  right: -4px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 1px 4px 1px 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.95);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s;
}

.squad-slot-grade-wrap:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.squad-slot-grade-wrap.active-bronze,
.squad-slot-grade-select.active-bronze {
  background: linear-gradient(135deg, #78350f 0%, #b45309 100%) !important;
  background-color: #9a3412 !important;
  border: 1px solid #d97706 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.6);
}

.squad-slot-grade-wrap.active-silver,
.squad-slot-grade-select.active-silver {
  background: linear-gradient(135deg, #475569 0%, #94a3b8 50%, #e2e8f0 100%) !important;
  background-color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 8px rgba(203, 213, 225, 0.6);
}

.squad-slot-grade-wrap.active-gold,
.squad-slot-grade-select.active-gold {
  background: linear-gradient(135deg, #854d0e 0%, #eab308 50%, #fef08a 100%) !important;
  background-color: #ca8a04 !important;
  border: 1px solid #fde047 !important;
  color: #422006 !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 10px rgba(250, 204, 21, 0.7);
}

.squad-slot-grade-wrap.active-plat,
.squad-slot-grade-select.active-plat {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #f0f9ff 100%) !important;
  background-color: #0284c7 !important;
  border: 1px solid #38bdf8 !important;
  color: #082f49 !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.8);
}

.squad-slot-grade-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: inherit !important;
  font-family: var(--font-display), -apple-system, sans-serif !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  padding: 0 2px !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

.squad-slot-grade-arrow {
  font-size: 8px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.85;
  color: inherit;
  margin-left: 1px;
}

.squad-slot-grade-select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  font-weight: 600;
  font-size: 11px;
}

/* Drag & Drop Feedback States */
.squad-slot[draggable="true"] {
  cursor: grab;
}

.squad-slot.dragging {
  opacity: 0.35 !important;
  transform: translate(-50%, -50%) scale(0.85) !important;
  cursor: grabbing !important;
}

.squad-slot.drag-over {
  transform: translate(-50%, -50%) scale(1.15) !important;
  z-index: 50 !important;
}

.squad-slot.drag-over .squad-slot-filled,
.squad-slot.drag-over .squad-slot-empty {
  border-color: #00f5d4 !important;
  box-shadow: 0 0 24px rgba(0, 245, 212, 0.9), inset 0 0 12px rgba(0, 245, 212, 0.5) !important;
}

/* 1:1 Detailed Compare UI */
.compare-hero-card {
  background: linear-gradient(145deg, #111827 0%, #162235 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.25rem;
}

.compare-bar-bg {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.compare-bar-fill-a {
  height: 100%;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.compare-bar-fill-b {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #00f5d4);
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

/* Detailed Player Stats Modal Styles */
.stat-category-card {
  background: #111726;
  border: 1px solid rgba(55, 65, 81, 0.7);
  border-radius: 0.75rem;
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.stat-category-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
  padding-bottom: 0.375rem;
}

.stat-meter-bg {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 2px;
}

.stat-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease-out;
}

.stat-meter-fill.tier-purple {
  background: linear-gradient(90deg, #a855f7, #c084fc);
}

.stat-meter-fill.tier-gold {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-meter-fill.tier-emerald {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-meter-fill.tier-cyan {
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
}

.stat-meter-fill.tier-white {
  background: #94a3b8;
}

/* Trait Chips & Physical Badges */
.trait-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  transition: all 0.2s ease;
  user-select: none;
}
.trait-chip:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.trait-chip-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

/* Multi-Player Head-to-Head Compare Winner Accents */
.stat-winner-a {
  color: #fbbf24 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}
.stat-winner-b {
  color: #22d3ee !important;
  font-weight: 900 !important;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}
.stat-winner-c {
  color: #34d399 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}
.stat-winner-d {
  color: #c084fc !important;
  font-weight: 900 !important;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}

.stat-cell-winner-a {
  background: rgba(245, 158, 11, 0.1);
  border-radius: 0.375rem;
}
.stat-cell-winner-b {
  background: rgba(6, 182, 212, 0.1);
  border-radius: 0.375rem;
}
.stat-cell-winner-c {
  background: rgba(16, 185, 129, 0.1);
  border-radius: 0.375rem;
}
.stat-cell-winner-d {
  background: rgba(168, 85, 247, 0.1);
  border-radius: 0.375rem;
}

/* Compare Slot Theme Badges */
.cmp-tag-a {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.15);
}
.cmp-tag-b {
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(6, 182, 212, 0.15);
}
.cmp-tag-c {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.15);
}
.cmp-tag-d {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(168, 85, 247, 0.15);
}

/* Compare Multi-Player Physical Specs Table */
.compare-physical-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.compare-physical-table th, .compare-physical-table td {
  padding: 0.65rem 0.875rem;
  border-bottom: 1px solid rgba(55, 65, 81, 0.6);
  word-break: keep-all;
  overflow-wrap: break-word;
}
.compare-physical-table th {
  background: #0d121c;
  font-weight: 700;
  text-align: left;
  color: #94a3b8;
}
.compare-physical-table th:first-child,
.compare-physical-table td:first-child {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
}
.compare-physical-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   Gacha Simulator & 3D Card Animation Styles
   ========================================================================== */

.gacha-package-card {
  background: #111726;
  border: 1px solid rgba(55, 65, 81, 0.7);
  border-radius: 1rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.gacha-package-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 12px 30px -10px rgba(6, 182, 212, 0.25);
}

.gacha-package-thumb {
  width: 100%;
  height: 150px;
  background: radial-gradient(circle at center, #1b253b 0%, #0c101a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gacha-package-thumb img {
  max-height: 120px;
  max-width: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

.gacha-package-card:hover .gacha-package-thumb img {
  transform: scale(1.06);
}

/* 3D Card Stage */
.gacha-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.25rem;
  max-height: 58vh;
  overflow-y: auto;
  padding: 1rem 0.5rem;
  perspective: 1200px;
}

.gacha-card-wrapper {
  perspective: 1000px;
  width: 100%;
  height: 270px;
  cursor: pointer;
}

.gacha-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.gacha-card-inner.flipped {
  transform: rotateY(180deg);
}

.gacha-card-front, .gacha-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-sizing: border-box;
}

/* Card Back (Unopened) */
.gacha-card-back {
  background: linear-gradient(135deg, #182238 0%, #0d121f 50%, #1e2b47 100%);
  border: 2px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 2;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.gacha-card-inner.flipped .gacha-card-back {
  opacity: 0;
  visibility: hidden;
  z-index: 1;
}

.gacha-card-back::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(6, 182, 212, 0.3);
  border-radius: 0.75rem;
  pointer-events: none;
}

.gacha-card-back .card-logo-emblem {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, #06b6d4 0%, #0f172a 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  margin-bottom: 0.75rem;
}

/* Card Front (Revealed Player) */
.gacha-card-front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #182033 0%, #0c101c 100%);
  border: 2px solid rgba(55, 65, 81, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.gacha-card-inner.flipped .gacha-card-front {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* Tier Glows */
.tier-sss-card {
  border-color: #ef4444 !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6), 0 0 60px rgba(245, 158, 11, 0.3) !important;
  animation: sss-card-pulse 2s infinite alternate;
}

.tier-s-card {
  border-color: #f59e0b !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.45) !important;
}

.tier-a-card {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35) !important;
}

@keyframes sss-card-pulse {
  0% { transform: rotateY(180deg) scale(1); filter: brightness(1); }
  100% { transform: rotateY(180deg) scale(1.03); filter: brightness(1.15); }
}

/* Card Grade Badges */
.card-grade-badge {
  font-weight: 900;
  font-size: 0.6875rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

.grade-diamond {
  background: linear-gradient(135deg, #e0e7ff 0%, #6366f1 50%, #d946ef 100%);
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.6);
}

.grade-gold {
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #b45309 100%);
  color: #1e1b4b;
  font-weight: 900;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.grade-silver {
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  color: #0f172a;
}

.grade-bronze {
  background: linear-gradient(135deg, #fdba74 0%, #c2410c 100%);
  color: #fff;
}

/* Player Image in Card */
.gacha-card-player-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.8));
  transition: transform 0.25s ease;
}

.gacha-3d-card:hover .gacha-card-player-img {
  transform: scale(1.08) translateY(-2px);
}

/* Return Rate Banner */
.roi-banner-sss {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.25) 0%, rgba(245, 158, 11, 0.25) 100%);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.roi-banner-s {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.25) 0%, rgba(16, 185, 129, 0.25) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.roi-banner-a {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9;
}

.roi-banner-b {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: #cbd5e1;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile UI/UX Optimizations (Design System Sec 7)
   ========================================================================== */

/* Zero Horizontal Overflow Discipline */
html, body {
  overflow-x: clip;
  max-width: 100vw;
}

.scrollbar-none {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* Mobile Small (< 480px) & Ultra-Compact (< 360px) Card Sizing */
@media (max-width: 480px) {
  .fc-card {
    width: 270px;
    height: 400px;
    padding: 14px;
  }
}

@media (max-width: 360px) {
  .fc-card {
    width: 250px;
    height: 380px;
    padding: 12px;
  }
  .fc-player-name {
    font-size: 16px;
  }
}

/* Squad Pitch Slot Collision Prevention on Mobile (< 640px) */
@media (max-width: 640px) {
  #squadPitchBoard {
    height: 600px;
  }
  .squad-slot {
    width: 74px;
  }
  .squad-slot-empty {
    width: 48px;
    height: 48px;
  }
  .squad-slot-filled {
    width: 52px;
    height: 52px;
  }
  .squad-slot-avatar-wrap {
    width: 46px;
    height: 46px;
  }
  .squad-slot-avatar {
    width: 100%;
    height: 100%;
  }
  .squad-slot-season {
    width: 16px;
    height: 12px;
    top: -2px;
    left: -2px;
  }
  .squad-slot-ovr {
    font-size: 9px;
    padding: 1px 3px;
    top: -2px;
    right: -2px;
  }
  .squad-slot-grade-wrap {
    bottom: -2px;
    right: -2px;
  }
  .squad-slot-grade-select {
    font-size: 9px;
    padding: 1px 12px 1px 4px;
    height: 18px;
  }
  .squad-slot-name {
    font-size: 10px;
    max-width: 68px;
    margin-top: 2px;
    line-height: 1.2;
  }
  .squad-slot-meta {
    font-size: 8px;
    line-height: 1.1;
  }
  .squad-slot-btn-remove,
  .squad-slot-btn-info,
  .squad-slot-btn-swap {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  /* Mobile Grade Selector Touch Targets */
  .grade-pill {
    min-width: 32px;
    height: 30px;
    font-size: 12px;
  }
}






