/* ==========================================================================
   TBD SMP - Main Stylesheet
   Modern Medieval Theme Design Rework
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties (Theme Variables)
   ========================================================================== */

:root {
  /* Dark Theme (Default) - Royal Medieval Palette */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-elevated: #242424;
  --bg-hover: #2e2e2e;

  --text-primary: #f5f0e6;
  --text-secondary: #8a8580;
  --text-muted: #5c5955;

  --accent-gold: #d4a853;
  --accent-gold-dim: rgba(212, 168, 83, 0.15);
  --accent-copper: #b87333;
  --accent-copper-dim: rgba(184, 115, 51, 0.15);

  --status-danger: #c92a2a;
  --status-danger-dim: rgba(201, 42, 42, 0.15);
  --status-success: #2f9e44;
  --status-success-dim: rgba(47, 158, 68, 0.15);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(212, 168, 83, 0.2);

  /* Borders */
  --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
  --border-accent: 1px solid rgba(212, 168, 83, 0.3);

  /* Font Families */
  --font-display: "Pirata One", cursive;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f8f5f0;
  --bg-secondary: #ffffff;
  --bg-elevated: #faf9f7;
  --bg-hover: #f0ebe3;

  --text-primary: #2c2416;
  --text-secondary: #6b6358;
  --text-muted: #9a9184;

  --accent-gold: #b8860b;
  --accent-gold-dim: rgba(184, 134, 11, 0.1);
  --accent-copper: #8b4513;
  --accent-copper-dim: rgba(139, 69, 19, 0.1);

  --status-danger: #c92a2a;
  --status-danger-dim: rgba(201, 42, 42, 0.1);
  --status-success: #2f9e44;
  --status-success-dim: rgba(47, 158, 68, 0.1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(184, 134, 11, 0.15);

  /* Borders */
  --border-subtle: 1px solid rgba(0, 0, 0, 0.06);
  --border-accent: 1px solid rgba(184, 134, 11, 0.3);
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

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

html {
  font-size: 16px;
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit;
  line-height: 1.2;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.app {
  min-height: 100vh;
  padding: var(--space-md);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-slow);
}

@media (min-width: 768px) {
  .app {
    padding: var(--space-xl);
  }
}

.container {
  max-width: 80rem;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Theme Toggle
   ========================================================================== */

.theme-toggle-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-lg);
}

.theme-toggle {
  position: relative;
  width: 4.5rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: var(--border-subtle);
  padding: 0.25rem;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  box-shadow: var(--shadow-md);
}

.theme-toggle-knob {
  position: absolute;
  top: 50%;
  left: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--transition-normal),
    background var(--transition-normal);
  background: var(--accent-gold);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(2.25rem) translateY(-50%);
  background: var(--bg-hover);
}

[data-theme="light"] .theme-toggle-knob {
  transform: translateX(0) translateY(-50%);
  background: var(--accent-gold);
}

.icon-sun,
.icon-moon {
  position: absolute;
  width: 1rem;
  height: 1rem;
}

.icon-sun {
  color: var(--text-primary);
}

.icon-moon {
  color: var(--accent-gold);
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: none;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  text-align: center;
  padding: var(--space-xl) 0;
  margin-bottom: var(--space-2xl);
}

.header-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: 0.05em;
  background: linear-gradient(
    135deg,
    var(--accent-gold) 0%,
    var(--accent-copper) 50%,
    var(--accent-gold) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--space-sm);
  animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

[data-theme="dark"] .header-title {
  text-shadow: 0 0 60px rgba(212, 168, 83, 0.3);
  filter: drop-shadow(0 0 20px rgba(212, 168, 83, 0.2));
}

.header-subtitle {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--text-secondary);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  margin-bottom: var(--space-2xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--accent-gold);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-lg);
}

.section-header .section-title {
  margin-bottom: 0;
}

.section-title-muted {
  opacity: 0.7;
}

.section-title-centered {
  text-align: center;
  width: 100%;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: var(--border-accent);
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Map Section
   ========================================================================== */

.map-container {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-secondary);
  border: var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.map-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: var(--bg-secondary);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.map-iframe.loaded {
  opacity: 1;
}

.map-label {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  background: rgba(15, 15, 15, 0.7);
  border: var(--border-subtle);
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .map-label {
  background: rgba(255, 255, 255, 0.85);
}

.map-label span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) 0;
}

.loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent-gold);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.error-state {
  text-align: center;
  padding: var(--space-xl) 0;
  color: var(--status-danger);
  font-weight: 500;
}

.no-players {
  grid-column: 1 / -1;
  padding: var(--space-2xl);
  text-align: center;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: var(--border-subtle);
}

/* ==========================================================================
   Players Grid
   ========================================================================== */

.players-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .players-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .players-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.offline-section {
  padding-top: var(--space-md);
}

/* ==========================================================================
   Player Card
   ========================================================================== */

.player-card {
  position: relative;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.player-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(212, 168, 83, 0.2);
}

.player-card.offline {
  opacity: 0.6;
  filter: grayscale(60%);
}

.player-card.offline:hover {
  opacity: 0.8;
  filter: grayscale(30%);
}

/* Status Badges on Cards */
.player-card .offline-badge,
.player-card .online-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.player-card .offline-badge {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.player-card .online-badge {
  background: var(--status-success-dim);
  color: var(--status-success);
  border: 1px solid var(--status-success);
}

.player-card-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.player-avatar {
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  border: var(--border-subtle);
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Health Bar */
.player-health {
  margin-bottom: var(--space-sm);
}

.name-wrapper {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  overflow: hidden;
}

.preferred-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.original-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.health-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.health-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.heart-icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--status-danger);
}

.health-label span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.health-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.health-bar-container {
  position: relative;
  height: 0.5rem;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-elevated);
}

.health-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--status-danger), #ff6b6b);
  transition: width var(--transition-slow);
  box-shadow: 0 0 8px rgba(201, 42, 42, 0.4);
}

/* Player Stat Preview */
.player-stat-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.player-stat-preview {
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--accent-gold-dim);
  border: 1px solid rgba(212, 168, 83, 0.1);
}

.stat-name {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.125rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-copper);
}

/* ==========================================================================
   Social Cards
   ========================================================================== */

.socials-section {
  padding: var(--space-xl) 0;
}

.socials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .socials-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.social-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: var(--border-subtle);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.social-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.social-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.social-card:hover::before {
  opacity: 1;
}

.social-card[data-color="#9146FF"]:hover {
  border-color: rgba(145, 70, 255, 0.4);
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(145, 70, 255, 0.2);
}

.social-card[data-color="#FF0000"]:hover {
  border-color: rgba(255, 0, 0, 0.4);
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(255, 0, 0, 0.2);
}

.social-card[data-color="#1DA1F2"]:hover {
  border-color: rgba(29, 161, 242, 0.4);
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(29, 161, 242, 0.2);
}

.social-card[data-color="#E4405F"]:hover {
  border-color: rgba(228, 64, 95, 0.4);
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(228, 64, 95, 0.2);
}

.social-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: var(--border-subtle);
  transition: all var(--transition-normal);
}

.social-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform var(--transition-normal);
}

.social-card:hover .social-icon {
  transform: scale(1.1);
}

.social-info {
  text-align: center;
}

.social-platform {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-gold);
  letter-spacing: 0.03em;
  margin-bottom: 0.125rem;
}

.social-username {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  padding: var(--space-2xl) 0 var(--space-lg);
  text-align: center;
}

.footer p {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  backdrop-filter: blur(16px) saturate(150%);
  animation: fadeIn 200ms ease;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(15, 15, 15, 0.85);
}

[data-theme="light"] .modal-overlay {
  background: rgba(248, 245, 240, 0.85);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 32rem;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  border: 2px solid var(--accent-gold);
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(212, 168, 83, 0.15);
  animation: modalSlideIn 300ms ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

[data-theme="light"] .modal-content {
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(184, 134, 11, 0.1);
}

[data-theme="light"] .modal-skin-wrapper {
  background: radial-gradient(
    circle at center,
    var(--accent-gold-dim) 0%,
    var(--bg-elevated) 70%
  );
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .stat-card {
  background: var(--bg-hover);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .modal-social-link {
  background: var(--bg-hover);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-social-link:hover {
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--accent-gold);
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .modal-body {
    flex-direction: row;
    align-items: flex-start;
  }
}

.modal-skin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.modal-skin-wrapper {
  width: 7rem;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(
    circle at center,
    var(--accent-gold-dim) 0%,
    transparent 70%
  );
  border: var(--border-subtle);
}

.modal-skin-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
}

.modal-info {
  width: 100%;
  text-align: center;
}

@media (min-width: 640px) {
  .modal-info {
    text-align: left;
    align-self: flex-start;
  }
}

.modal-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

@media (min-width: 640px) {
  .modal-header-info {
    align-items: flex-start; /* Left align on desktop */
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
  }
}

.modal-username {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  margin-bottom: 0;
  display: flex; /* Allow inline image alignment */
  align-items: center;
  gap: var(--space-sm);
  justify-content: center; /* Center on mobile */
}

@media (min-width: 640px) {
  .modal-username {
    justify-content: flex-start;
  }
}

.modal-username-flag {
  height: 0.75em; /* Scale closely with text */
  width: auto;
  aspect-ratio: 3 / 2;
  object-fit: fill;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  display: inline-block;
  opacity: 0.9;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .modal-badges {
    justify-content: flex-start;
  }
}

.modal-badge {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal-badge.pronouns {
  background: var(--accent-copper-dim);
  color: var(--accent-copper);
  border: 1px solid rgba(184, 115, 51, 0.3);
}

.modal-badge.offline-badge {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.modal-badge.online-badge {
  background: var(--status-success-dim);
  color: var(--status-success);
  border: 1px solid var(--status-success);
}

/* Removed modal-health and modal-deaths styles as they are no longer used */

.modal-stats-section {
  margin-top: var(--space-lg);
}

.modal-socials-section {
  margin-top: var(--space-xl);
}

.modal-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-md);
}

.modal-stats-section-inline {
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.stat-card {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: var(--border-subtle);
  text-align: center;
}

.stat-card .stat-name {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.125rem;
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.modal-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Center the group of buttons */
  gap: var(--space-sm);
  width: 100%;
}

.modal-social-link {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: var(--border-subtle);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.modal-social-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card); /* Slightly lighter */
  border-color: var(--border-highlight);
}

.modal-social-link svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

/* Discord copy button */
.modal-social-copy {
  cursor: pointer;
  position: relative;
}

.modal-social-copy.copied {
  background: var(--status-success-dim);
  border-color: var(--status-success);
}

.modal-social-copy.copied::after {
  content: "✓";
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1rem;
  height: 1rem;
  background: var(--status-success);
  color: var(--bg-primary);
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 200ms ease;
}

@keyframes popIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Selection Styling
   ========================================================================== */

::selection {
  background: var(--accent-gold);
  color: var(--bg-primary);
}
