/* =====================================================
   ArtsDominos · menu.css
   Main menu, character roster cards, ornate frames,
   match-start overlay
   ===================================================== */

/* ===== MAIN MENU — HERO SPLASH LAYOUT ===== */

/* Menu screen is a flex column; hero grows, footer is fixed-height */
#screen-menu {
  align-items: stretch;
  overflow: hidden;
}

/* Hero image zone — fills all space above the footer */
.menu-hero {
  position: relative;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
}

.menu-splash-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
  display: block;
}

/* Music toggle button — floating over splash image */
.music-splash-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.55);
  background: rgba(10,5,2,0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold);
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-mid), border-color var(--t-mid), opacity var(--t-mid);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.music-splash-btn:hover,
.music-splash-btn:active {
  background: rgba(30,15,5,0.82);
  border-color: var(--gold-light);
}
.music-splash-btn.off {
  opacity: 0.42;
  color: var(--text-muted);
  border-color: rgba(201,168,76,0.22);
}
/* Strike-through slash when music is OFF */
.music-splash-btn.off::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 26px;
  background: var(--text-muted);
  border-radius: 1px;
  transform: rotate(40deg);
  pointer-events: none;
}

/* Install / Add to Home Screen button — left side mirror of music btn */
.install-splash-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.55);
  background: rgba(10,5,2,0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-mid), border-color var(--t-mid);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.install-splash-btn:hover,
.install-splash-btn:active {
  background: rgba(30,15,5,0.82);
  border-color: var(--gold-light);
}

/* iOS tooltip that appears below the install button */
.install-ios-tip {
  position: absolute;
  top: 62px;
  left: 10px;
  z-index: 20;
  background: rgba(10,5,2,0.92);
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 10px 36px 10px 12px;
  max-width: 210px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
}
.install-ios-tip strong { color: var(--gold); }
.install-tip-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

/* Gradient fades the image into the dark footer below */
.menu-hero-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(10,5,2,0.00) 0%,
    rgba(10,5,2,0.00) 78%,
    rgba(10,5,2,0.72) 93%,
    #0f0603 100%
  );
}

/* Footer nav zone — sits below the image */
.menu-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-sm) var(--gap-lg)
           calc(var(--gap-lg) + env(safe-area-inset-bottom, 0px));
  background: #0f0603;
  position: relative;
  z-index: 10;
}

/* Italic tagline under the image */
.menu-tagline {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(0.65rem, 1.8vw, 0.8rem);
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--gap-xs);
}

/* Main nav — vertical stack of buttons */
.main-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-md);
  width: 100%;
}

/* How-to-Play + Stats + Settings side by side */
.menu-secondary-row {
  display: flex;
  gap: var(--gap-sm);
  width: 100%;
  max-width: 420px;
}

.menu-secondary-row .btn-secondary {
  flex: 1;
  max-width: none;
  font-size: 0.78rem;
  padding: 11px 6px;
  text-align: center;
}

/* ===== CHARACTER SELECT LAYOUT ===== */
.play-select-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: var(--gap-xl);
  min-height: 100vh;
}

/* ===== CHARACTER GRID ===== */
.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-md);
  width: 100%;
  max-width: 900px;
  padding: var(--gap-md) var(--gap-lg);
}

@media (min-width: 480px) {
  .character-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-lg);
  }
}

@media (min-width: 700px) {
  .character-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.character-grid.small {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-sm);
}

@media (min-width: 480px) {
  .character-grid.small {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--gap-md);
  }
}

/* ===== CHARACTER CARD (Ornate Cuban Portrait Frame) ===== */
.character-card {
  position: relative;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  border-radius: 10px;
  /* Multi-layer gold frame effect */
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 0 5px #0d1f20,
    0 0 0 7px var(--gold-dark),
    0 0 0 8px rgba(0,0,0,0.8),
    0 8px 32px rgba(0,0,0,0.7),
    0 0 24px rgba(201,168,76,0.15);
  transform: translateY(0);
  transition: transform var(--t-mid), box-shadow var(--t-mid);
  overflow: visible;
}

.character-card:hover,
.character-card:active {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 0 0 3px var(--gold-light),
    0 0 0 5px #0d1f20,
    0 0 0 7px var(--gold),
    0 0 0 8px rgba(0,0,0,0.8),
    0 12px 40px rgba(0,0,0,0.8),
    0 0 32px rgba(201,168,76,0.4);
}

.character-card.selected {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 0 0 3px #F5E090,
    0 0 0 5px #0d1f20,
    0 0 0 7px var(--gold),
    0 0 0 8px rgba(0,0,0,0.8),
    0 12px 40px rgba(0,0,0,0.8),
    0 0 50px rgba(245,224,144,0.5);
}

/* Inner card face */
.card-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
  /* Teal jade/marble background — left and right edge panels */
  background:
    linear-gradient(90deg,
      #0d3535 0%,
      #0d3535 16%,
      transparent 16%,
      transparent 84%,
      #0d3535 84%,
      #0d3535 100%
    ),
    linear-gradient(180deg, #123030 0%, #0a2222 100%);
}

/* Compass star (top center) */
.card-star {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-star::before,
.card-star::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.card-star::before {
  transform: rotate(0deg);
}

.card-star::after {
  transform: rotate(45deg);
  background: var(--gold-dark);
}

/* Portrait image */
.card-portrait-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
}

.card-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
}

/* Frame overlay — teal panels left/right with leaf accent */
.card-frame-overlay {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  /* Overlay the left/right teal panels on top of portrait */
  background:
    linear-gradient(90deg,
      rgba(10,40,40,0.88) 0%,
      rgba(10,40,40,0.88) 14%,
      transparent 22%,
      transparent 78%,
      rgba(10,40,40,0.88) 86%,
      rgba(10,40,40,0.88) 100%
    );
}

/* Gold corner accents */
.card-frame-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(201,168,76,0.5);
  border-radius: 8px;
}

/* Building icon at bottom (decorative line) */
.card-frame-overlay::after {
  content: '⌂';
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(201,168,76,0.3);
  font-size: 0.7rem;
}

/* Name plate at bottom */
.card-nameplate {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(0deg,
    rgba(15,6,2,0.98) 0%,
    rgba(26,13,7,0.95) 60%,
    transparent 100%
  );
  padding: 24px var(--gap-sm) var(--gap-sm);
  border-radius: 0 0 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.card-name {
  font-family: var(--font-heading);
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--gold-light);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.card-level-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.diff-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
}

.diff-badge.beginner  { background: rgba(76,175,80,0.3);  color: #81C784; border: 1px solid #4CAF50; }
.diff-badge.easy      { background: rgba(139,195,74,0.3); color: #AED581; border: 1px solid #8BC34A; }
.diff-badge.medium    { background: rgba(255,193,7,0.3);  color: #FFD54F; border: 1px solid #FFC107; }
.diff-badge.hard      { background: rgba(255,87,34,0.3);  color: #FF8A65; border: 1px solid #FF5722; }
.diff-badge.expert    { background: rgba(224,64,251,0.3); color: #EA80FC; border: 1px solid #E040FB; }
.diff-badge.master    { background: rgba(207,20,43,0.3);  color: #FF5369; border: 1px solid #CF142B; }

.card-level-num {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.card-record {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Locked card state */
.character-card.locked .card-portrait {
  filter: grayscale(1) brightness(0.35);
}

.card-lock-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 2rem;
  z-index: 15;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

/* ===== PARTNER SECTION ===== */
.partner-section {
  width: 100%;
  max-width: 900px;
  padding: 0 var(--gap-lg);
}

.partner-title {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: var(--gap-md);
}

/* ===== MATCH START OVERLAY ===== */
.match-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10,5,2,0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-lg);
}

.match-overlay-card {
  background: linear-gradient(160deg, #2C1810 0%, #1A0D07 100%);
  border: 2px solid var(--gold);
  border-radius: var(--r-lg);
  padding: var(--gap-xl) var(--gap-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-gold-lg), var(--shadow-deep);
}

.overlay-vs-row {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  width: 100%;
  justify-content: center;
}

.overlay-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
}

.overlay-portrait-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow-gold);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.overlay-portrait-ring.you {
  background: linear-gradient(135deg, var(--felt-dark), var(--felt));
  color: var(--gold-light);
}

.overlay-portrait-ring.npc {
  background: #1a2030;
}

.overlay-portrait-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay-vs {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: var(--shadow-gold);
}

.overlay-npc-name {
  font-family: var(--font-heading);
  color: var(--gold-light);
  font-size: 0.9rem;
  text-align: center;
}

.overlay-format {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* ===== TEAMS STEP INDICATOR ===== */
.teams-step-indicator {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--gold);
  text-align: center;
  padding: 6px var(--gap-md);
  letter-spacing: 0.04em;
  width: 100%;
  max-width: 900px;
}

/* ===== TEAMS MATCH OVERLAY ===== */
.overlay-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
}

.overlay-team-portraits {
  display: flex;
  gap: 8px;
}

.overlay-team-name {
  font-family: var(--font-heading);
  color: var(--gold-light);
  font-size: 0.78rem;
  text-align: center;
  max-width: 140px;
}

.overlay-portrait-ring.small {
  width: 64px;
  height: 64px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

/* ===== TUTORIAL DIFFICULTY BADGE ===== */
.diff-badge.tutorial {
  background: rgba(120,144,156,0.2);
  color: #b0bec5;
  border: 1px solid #78909c;
}

/* ===== CHARACTER PROFILE MODAL ===== */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8,4,2,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  transition: opacity var(--t-mid);
}

.profile-modal.hidden {
  display: none !important;
}

.profile-card {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(170deg, #2C1810 0%, #1a0c06 60%, #0f0603 100%);
  border: 1px solid var(--gold-dim);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow:
    0 -8px 48px rgba(0,0,0,0.9),
    0 0 0 1px rgba(201,168,76,0.15) inset,
    0 0 60px rgba(201,168,76,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
  animation: profileSlideUp var(--t-slow) forwards;
}

@keyframes profileSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.profile-card::-webkit-scrollbar {
  width: 4px;
}
.profile-card::-webkit-scrollbar-track {
  background: transparent;
}
.profile-card::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 2px;
}

/* Top bar with back button */
.profile-topbar {
  width: 100%;
  padding: var(--gap-md) var(--gap-md) var(--gap-sm);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  flex-shrink: 0;
}

/* Portrait */
.profile-portrait-wrap {
  position: relative;
  width: min(240px, 60vw);
  height: min(240px, 60vw);
  margin: var(--gap-lg) auto var(--gap-md);
  flex-shrink: 0;
}

.profile-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--r-md);
  display: block;
}

.profile-portrait-frame {
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
  pointer-events: none;
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 0 5px #0d1f20,
    0 0 0 7px var(--gold-dark),
    0 0 24px rgba(201,168,76,0.4);
}

/* Name + meta */
.profile-identity {
  width: 100%;
  padding: 0 var(--gap-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
}

.profile-name {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 900;
  color: var(--gold-light);
  text-align: center;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
  line-height: 1.1;
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.profile-level {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.profile-archetype {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Quote box */
.profile-quote-box {
  width: calc(100% - var(--gap-lg) * 2);
  margin: 0 var(--gap-lg) var(--gap-lg);
  padding: var(--gap-md) var(--gap-lg);
  border-left: 3px solid var(--gold);
  background: rgba(201,168,76,0.06);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  display: flex;
  gap: var(--gap-xs);
  align-items: baseline;
}

.profile-quote-mark {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--gold);
  line-height: 0.8;
  flex-shrink: 0;
}

.profile-quote-text {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: var(--text-light);
  line-height: 1.5;
}

/* Generic section */
.profile-section {
  width: 100%;
  padding: 0 var(--gap-lg) var(--gap-lg);
}

.profile-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: var(--gap-sm);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(201,168,76,0.2);
}

.profile-bio {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.65;
}

/* Playstyle badge */
.profile-playstyle-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--gold-dim);
  background: rgba(201,168,76,0.1);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: var(--gap-sm);
}

/* Skills list */
.profile-skills {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

.profile-skills li {
  font-size: 0.85rem;
  color: var(--text-light);
  padding-left: 20px;
  position: relative;
  line-height: 1.4;
}

.profile-skills li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.55rem;
  top: 4px;
}

/* Special ability box */
.profile-ability-box {
  width: calc(100% - var(--gap-lg) * 2);
  margin: 0 var(--gap-lg) var(--gap-lg);
  padding: var(--gap-md) var(--gap-lg);
  background: rgba(201,140,20,0.1);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: var(--r-md);
  box-shadow: 0 0 16px rgba(201,140,20,0.12) inset;
}

.ability-header {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}

.ability-icon {
  font-size: 1rem;
  color: var(--gold-light);
}

.ability-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
}

.ability-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(201,168,76,0.3);
}

.ability-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.55;
}

/* Weakness section */
.profile-weakness-section .weakness-label {
  color: #FF8A65;
  border-bottom-color: rgba(255,138,101,0.2);
}

.profile-weakness-text {
  font-size: 0.85rem;
  color: #FFAB91;
  line-height: 1.5;
}

/* Challenge button row */
.profile-challenge-row {
  width: 100%;
  padding: 0 var(--gap-lg) var(--gap-xl);
  display: flex;
  justify-content: center;
}

.challenge-btn {
  max-width: 280px;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

/* ===== STATS SCREEN ===== */

.stats-content {
  width: 100%;
  padding: 0 var(--gap-lg) var(--gap-xl);
}

.stats-summary {
  display: flex;
  justify-content: space-around;
  padding: var(--gap-lg) 0;
  gap: var(--gap-sm);
}

.stats-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.stats-value {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
}

.stats-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
}

.streak-vs {
  display: block;
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
}

.stats-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold-dim);
  text-transform: uppercase;
  padding: var(--gap-md) 0 var(--gap-sm);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  margin-bottom: var(--gap-sm);
}

.stats-roster {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--gap-md);
}

.stats-char-row {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding: 10px var(--gap-sm);
  border-radius: var(--r-sm);
  transition: background var(--t-mid);
}

.stats-char-row:hover {
  background: rgba(201,168,76,0.06);
}

.stats-roster.unplayed .stats-char-row {
  opacity: 0.38;
}

.stats-portrait {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--gold-dim);
  flex-shrink: 0;
}

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

.stats-char-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold-light);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-char-record {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stats-streak {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

.stats-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: var(--gap-xl) 0;
  font-style: italic;
}

/* ===== NAME ENTRY MODAL ===== */
.name-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8,4,2,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-lg);
}
.name-modal.hidden { display: none !important; }

.name-modal-card {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(160deg, #2C1810 0%, #1a0c06 60%, #0f0603 100%);
  border: 2px solid var(--gold);
  border-radius: var(--r-lg);
  padding: var(--gap-xl) var(--gap-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-md);
  box-shadow: 0 0 60px rgba(201,168,76,0.18), 0 24px 80px rgba(0,0,0,0.9);
}

.name-modal-logo {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 24px rgba(201,168,76,0.5);
  letter-spacing: 0.04em;
}

.name-modal-sub {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-top: -8px;
}

.name-modal-prompt {
  font-size: 0.88rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.5;
}

.name-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: var(--r-sm);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
}
.name-input::placeholder { color: var(--text-dim); font-style: italic; }
.name-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.25);
}

/* ===== LEADERBOARD SCREEN ===== */
.leaderboard-content {
  width: 100%;
  padding: 0 var(--gap-lg) var(--gap-xl);
}

.leaderboard-loading,
.leaderboard-empty,
.leaderboard-offline {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: var(--gap-xl) 0;
  font-style: italic;
}

.lb-my-card {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: var(--r-md);
  padding: var(--gap-md) var(--gap-lg);
  margin-bottom: var(--gap-lg);
  display: flex;
  justify-content: space-around;
  gap: var(--gap-sm);
}

.lb-my-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.lb-my-val {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold-light);
}

.lb-my-lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.lb-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-header {
  display: grid;
  grid-template-columns: 36px 1fr 72px 36px 52px;
  gap: 4px;
  padding: 6px var(--gap-sm);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  margin-bottom: 4px;
}

.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr 72px 36px 52px;
  gap: 4px;
  padding: 9px var(--gap-sm);
  border-radius: var(--r-sm);
  align-items: center;
  transition: background var(--t-mid);
}
.lb-row:hover { background: rgba(201,168,76,0.05); }

.lb-row.lb-you {
  background: rgba(201,168,76,0.11);
  border: 1px solid rgba(201,168,76,0.30);
}

.lb-rank {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}
.lb-row:nth-child(1) .lb-rank { font-size: 1.1rem; }
.lb-row:nth-child(2) .lb-rank { font-size: 1.0rem; }
.lb-row:nth-child(3) .lb-rank { font-size: 0.95rem; }

.lb-name {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  color: var(--text-light);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-row.lb-you .lb-name { color: var(--gold-light); }

.lb-pts {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--gold-light);
  text-align: right;
}

.lb-wins {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.lb-streak {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: right;
}

.menu-lb-btn {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ===== LEADERBOARD PLAYSTYLE CARD ===== */
.lb-playstyle-card {
  margin-top: var(--gap-xl);
  padding: var(--gap-md) var(--gap-lg);
  background:
    linear-gradient(160deg, rgba(44,24,16,0.70) 0%, rgba(15,6,3,0.80) 100%);
  border: 1px solid rgba(201,168,76,0.28);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-md);
  box-shadow: 0 0 20px rgba(201,168,76,0.06) inset;
}

.lb-playstyle-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--gap-sm);
}

.lb-playstyle-text {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
}
