/* ══════════════════════════════════════════════════════════
   CWL War Room — Medal Planner 2026 | ClashOS
   CoC Dark Stone & Gold Aesthetic
   Pure Clash of Clans CWL identity with game assets
   ══════════════════════════════════════════════════════════ */

/* ── Fonts ── */
@font-face {
  font-family: 'ClashBold';
  src: url('/Clash_Bold.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* ── CSS Variables ── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:root {
  --stone-bg: #0a0a0f;
  --stone-bg-alt: #0e0e16;
  --card-bg: #12121a;
  --card-border: #1e1e28;
  --card-hover: #181824;
  --gold: #f5a623;
  --gold-dark: #c67b1e;
  --gold-dim: rgba(245, 166, 35, 0.1);
  --gold-glow: rgba(245, 166, 35, 0.2);
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --yellow-glow: rgba(234, 179, 8, 0.15);
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --text: #f0ede8;
  --text-muted: #9a978e;
  --text-dim: #605d55;
  --label-color: #444038;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shield-bg: url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3h1v1H1V3zm2-2h1v1H3V1z' fill='rgba(255,255,255,0.015)' fill-rule='evenodd'/%3E%3C/svg%3E");
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--stone-bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(245, 166, 35, 0.025) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(34, 197, 94, 0.008) 0%, transparent 40%),
    var(--shield-bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('https://qzsvagsxxhecbaxodajw.supabase.co/storage/v1/object/public/assets/background.webp') center/cover fixed no-repeat;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: rgba(245, 166, 35, 0.25);
  color: #fff;
}

/* ── Page Layout ── */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 80px;
  position: relative;
  z-index: 1;
}

/* ── CoC Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a4a;
}

/* ── Header ── */
.os-header {
  background: rgba(10, 10, 15, 0.97);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.os-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.os-header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-right: auto;
  color: var(--gold);
  font-weight: 800;
  font-size: 1.1rem;
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.os-header__brand img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
}

.os-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.os-header__nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.os-header__nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

/* ══════════════════════════════════════
   HERO SEARCH — War Lobby Entrance
   ══════════════════════════════════════ */

.hero-search {
  text-align: center;
  padding: 36px 0 28px;
  position: relative;
}

.hero-search::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.2), rgba(245, 166, 35, 0.3), rgba(245, 166, 35, 0.2), transparent);
}

.hero-search .hero-cwl-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 12px;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(245, 166, 35, 0.02));
  border: 1px solid rgba(245, 166, 35, 0.15);
  border-radius: 999px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.hero-search .hero-cwl-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.05), transparent);
}

.hero-search .hero-cwl-badge .badge-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.hero-search .hero-cwl-badge span {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.62rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.hero-search h1 {
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  font-size: 2.2rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 6px;
  line-height: 1.15;
  text-shadow: 0 0 60px rgba(245, 166, 35, 0.08);
}

.hero-search h1 .gold-accent {
  color: var(--gold);
  text-shadow: 0 0 30px rgba(245, 166, 35, 0.2);
}

.hero-search .hero-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 520px;
  margin: 0 auto 22px;
}

/* ── Search Bar ── */
.search-bar-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--card-bg), #14141f);
  border: 2px solid var(--card-border);
  border-radius: 999px;
  padding: 4px;
  transition: border-color 0.3s, box-shadow 0.3s;
  min-height: 58px;
  position: relative;
}

.search-bar::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  background: linear-gradient(135deg, transparent, rgba(245, 166, 35, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.08);
}

.search-bar:focus-within::before {
  opacity: 1;
}

.search-bar .search-icon {
  width: 18px;
  height: 18px;
  margin: 0 10px 0 16px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.3s;
}

.search-bar:focus-within .search-icon {
  color: var(--gold);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  outline: none;
  padding: 8px 0;
  min-height: 44px;
}

.search-bar input::placeholder {
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.search-bar .search-btn {
  min-width: 96px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold), #d4891a);
  border: none;
  border-radius: 999px;
  color: #0a0a0f;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.search-bar .search-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s;
}

.search-bar .search-btn:hover::after {
  transform: translateX(100%);
}

.search-bar .search-btn:hover {
  background: linear-gradient(135deg, #e0961e, #c67b1e);
  transform: translateY(-1px);
}

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

.search-bar .search-btn .btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(10, 10, 15, 0.2);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
  display: none;
}

.search-bar .search-btn.loading .btn-spinner {
  display: block;
}

.search-bar .search-btn.loading .btn-text {
  display: none;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Quick Tips ── */
.search-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.search-tips .tip-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  padding-top: 4px;
}

.search-tips .tip-tag {
  padding: 3px 10px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.search-tips .tip-tag:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.05);
}

/* ══════════════════════════════════════
   LOADING OVERLAY — CWL War Room
   ══════════════════════════════════════ */

#cwl-loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.97);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
}

#cwl-loading-overlay .load-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 50%;
}

#cwl-loading-overlay h2 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: 'ClashBold', 'Exo 2', sans-serif;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  width: 100%;
  padding: 0 20px;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: all 0.3s;
  opacity: 0.3;
}

.loading-step.active {
  opacity: 1;
  border-color: var(--gold);
  background: rgba(245, 166, 35, 0.04);
  box-shadow: 0 0 20px rgba(245, 166, 35, 0.03);
}

.loading-step.done {
  opacity: 0.7;
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.03);
}

.loading-step .step-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-step .step-icon .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(245, 166, 35, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: cwl-spin 0.8s linear infinite;
}

.loading-step .step-icon .check {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 700;
}

.loading-step .step-icon .pending {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.loading-step .step-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.loading-step.done .step-text {
  color: var(--text);
}

.loading-step.active .step-text {
  color: var(--text);
}

@keyframes cwl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════
   CLAN INFO CARD — War Lobby
   ══════════════════════════════════════ */

.clan-info-card {
  display: none;
  background: linear-gradient(135deg, var(--card-bg), #14141f);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(16px);
  animation: slideUp 0.5s ease forwards;
  position: relative;
  overflow: hidden;
}

.clan-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.clan-info-card.visible {
  display: block;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.clan-info-card .ci-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.clan-info-card .ci-badge {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.12);
  transition: box-shadow 0.3s ease;
}

.clan-info-card .ci-text {
  flex: 1;
  min-width: 0;
}

.clan-info-card .ci-name {
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.clan-info-card .ci-tag {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  font-weight: 600;
}

.clan-info-card .ci-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.clan-info-card .ci-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.clan-info-card .ci-stat .ci-stat-icon {
  font-size: 0.7rem;
  color: var(--gold);
}

.clan-info-card .ci-stat .ci-stat-value {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.clan-info-card .ci-stat .ci-stat-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clan-info-card .ci-pick-self {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.clan-info-card .ci-pick-self label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.clan-info-card .ci-pick-self select {
  flex: 1;
  min-width: 160px;
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  padding: 10px 12px;
  min-height: 40px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%239a978e'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.clan-info-card .ci-pick-self select:focus {
  border-color: var(--gold);
}

.clan-info-card .ci-pick-self select option {
  background: var(--stone-bg);
  color: var(--text);
}

.ci-assign-btn {
  min-height: 40px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--gold), #d4891a);
  border: none;
  border-radius: var(--radius);
  color: #0a0a0f;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ci-assign-btn:hover {
  background: linear-gradient(135deg, #e0961e, #c67b1e);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.15);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   DASHBOARD CARDS — CWL War Room
   ══════════════════════════════════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.dash-card {
  background: linear-gradient(135deg, var(--card-bg), #14141f);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.06), transparent);
}

.dash-card:hover {
  border-color: #2a2a3a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.dash-card.full-width {
  grid-column: 1 / -1;
}

.dash-card .dash-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.6rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  padding-left: 14px;
}

.dash-card .dash-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  background: linear-gradient(180deg, var(--gold), rgba(245, 166, 35, 0.4));
  border-radius: 2px;
}

/* ══════════════════════════════════════
   MEDAL DISPLAY — Hero Number
   ══════════════════════════════════════ */

.medal-hero {
  text-align: center;
  padding: 6px 0;
  position: relative;
}

.medal-hero .mh-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
  display: inline-block;
  border-radius: 50%;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  filter: drop-shadow(0 4px 12px rgba(245, 166, 35, 0.15));
}

.medal-hero .mh-number {
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 0 40px rgba(245, 166, 35, 0.15), 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: -1px;
  position: relative;
  display: inline-block;
}

.medal-hero .mh-breakdown {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.medal-hero .mh-breakdown .mh-highlight {
  color: var(--gold);
  font-weight: 700;
}

/* Star Yield Bar */
.yield-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.yield-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.yield-header .yield-label {
  font-size: 0.58rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.yield-header .yield-pct {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.yield-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.yield-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease, background 0.3s ease;
  position: relative;
}

.yield-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -1px;
  bottom: -1px;
  width: 8px;
  border-radius: 50%;
  background: inherit;
  filter: blur(4px);
  opacity: 0.6;
}

.yield-fill.low {
  background: linear-gradient(90deg, var(--red), #f87171);
}

.yield-fill.mid {
  background: linear-gradient(90deg, var(--yellow), #facc15);
}

.yield-fill.high {
  background: linear-gradient(90deg, #16a34a, var(--green));
}

/* ══════════════════════════════════════
   VISUAL STAR PICKER — CoC Stars
   ══════════════════════════════════════ */

.star-picker {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  position: relative;
}

/* Star yield path indicator - shows the progression zone */
.star-picker::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 2px;
  background: linear-gradient(90deg, 
    var(--red) 0%, 
    var(--yellow) 24%, 
    var(--green) 38%, 
    var(--gold) 100%
  );
  opacity: 0.15;
  border-radius: 1px;
  transform: translateY(-50%);
  pointer-events: none;
}

.star-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 7px 5px;
  min-width: 44px;
  min-height: 62px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  z-index: 1;
}

.star-pick-btn:hover {
  border-color: #2a2a3a;
  background: rgba(255, 255, 255, 0.015);
  transform: translateY(-2px);
}

.star-pick-btn .sp-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: color 0.2s;
}



/* ── Active star with golden glow ── */
.star-pick-btn.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-dim), rgba(245, 166, 35, 0.03));
  box-shadow: 0 0 20px rgba(245, 166, 35, 0.15), inset 0 0 20px rgba(245, 166, 35, 0.05);
}



.star-pick-btn.active .sp-label {
  color: var(--gold);
}



/* ── Green highlight (8+ stars = max yield) ── */
.star-pick-btn.green-highlight {
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.12), inset 0 0 20px rgba(34, 197, 94, 0.03);
}

.star-pick-btn.green-highlight .sp-label {
  color: var(--green);
}



/* ── Yellow highlight (5-7 stars = good but not max) ── */
.star-pick-btn.yellow-highlight {
  border-color: var(--yellow);
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.08), rgba(234, 179, 8, 0.02));
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.1);
}

.star-pick-btn.yellow-highlight .sp-label {
  color: var(--yellow);
}



/* ── Yield tier indicator dots ── */
/* Star pick button hover effect - glow ring */
.star-pick-btn:hover:not(.active) {
  border-color: rgba(245, 166, 35, 0.2);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.04);
}



/* ── Actual star asset image styles ── */
.star-pick-btn .sp-star-img {
  width: 22px;
  height: 22px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  opacity: 0.8;
  color: #f5a623;
}

.star-pick-btn .sp-star-img.active-img {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.5)) brightness(1.5);
}

.star-pick-btn.active .sp-star-img {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 12px rgba(245, 166, 35, 0.6)) brightness(1.6);
}

.star-pick-btn.active.green-highlight .sp-star-img {
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.4)) brightness(1.4);
}

.star-pick-btn .sp-tier-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.3;
  transition: all 0.2s;
}

.star-pick-btn.active .sp-tier-dot,
.star-pick-btn.green-highlight .sp-tier-dot,
.star-pick-btn.yellow-highlight .sp-tier-dot {
  opacity: 1;
}




/* ── Day timeline enhanced with attack result icons ── */
.day-timeline {
  position: relative;
}

.day-timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, 
    var(--green) 0%, 
    var(--gold) 50%, 
    var(--text-dim) 100%
  );
  opacity: 0.15;
  transform: translateY(-50%);
  pointer-events: none;
}

.day-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  position: relative;
  width: 42px;
  height: 44px;
  border-radius: 50%;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  transition: all 0.2s;
}

.day-dot .dd-label {
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}

.day-dot.future {
  opacity: 0.5;
}

/* Bonus Toggle */
.bonus-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 14px;
  background: rgba(10, 10, 15, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.bonus-row .bonus-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.bonus-toggle {
  position: relative;
  width: 42px;
  height: 22px;
  background: var(--stone-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bonus-toggle.active {
  background: rgba(245, 166, 35, 0.1);
  border-color: var(--gold);
}

.bonus-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.2s;
}

.bonus-toggle.active::after {
  left: 22px;
  background: var(--gold);
}

/* Day Timeline */
.day-timeline {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.day-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  transition: all 0.2s;
  position: relative;
}

.day-dot.win {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  border: 2px solid var(--green);
  color: var(--green);
}

.day-dot.loss {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border: 2px solid var(--red);
  color: var(--red);
}

.day-dot.today {
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.1), rgba(245, 166, 35, 0.02));
  color: var(--gold);
}

.day-dot.future {
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid #1e1e28;
  color: var(--text-dim);
}

/* ══════════════════════════════════════
   LEAGUE SETTINGS — Compact
   ══════════════════════════════════════ */

.league-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.league-settings .ls-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.league-settings .ls-item .ls-label {
  font-size: 0.58rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.league-settings .ls-item select,
.league-settings .ls-item .stepper {
  width: 100%;
}

.league-settings .ls-item .stepper {
  display: flex;
  align-items: center;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 38px;
}

.league-settings .ls-item .stepper button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.league-settings .ls-item .stepper button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold);
}

.league-settings .ls-item .stepper .sv {
  flex: 1;
  text-align: center;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.2s;
}

.league-settings .ls-item select {
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 10px 12px;
  min-height: 38px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%239a978e'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: border-color 0.2s;
}

.league-settings .ls-item select:focus {
  border-color: var(--gold);
}

/* League Badge Preview in League Card */
.league-badge-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(10, 10, 15, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: border-color 0.3s, background 0.3s;
  position: relative;
  overflow: hidden;
}

.league-badge-preview::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.03));
  pointer-events: none;
}

.lbp-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.league-badge-preview:hover .lbp-badge {
  transform: scale(1.12) rotate(-6deg);
  animation: none;
}

.lbp-info {
  flex: 1;
}

.lbp-league-name {
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.3s;
}

.lbp-sub {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1px;
}

/* League color shimmer effect on badge preview */
.league-badge-preview.lbp-shimmer {
  animation: shimmerBorder 0.6s ease;
}

@keyframes shimmerBorder {
  0% { border-color: var(--card-border); }
  50% { border-color: var(--gold); box-shadow: 0 0 30px rgba(245, 166, 35, 0.15); }
  100% { border-color: var(--card-border); }
}



/* ── Placement visual animated climb ── */
.pv-climb {
  animation: pvClimb 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pvClimb {
  0% { transform: scale(0.3) translateY(16px); opacity: 0; }
  60% { transform: scale(1.3) translateY(-4px); opacity: 1; }
  100% { transform: scale(1.2) translateY(0); opacity: 1; }
}

/* ── Flash effect on placement value change ── */
.pv-flash {
  animation: pvFlash 0.5s ease;
}

@keyframes pvFlash {
  0% { color: var(--gold); transform: scale(1); }
  50% { color: #fff; transform: scale(1.15); text-shadow: 0 0 20px rgba(245,166,35,0.5); }
  100% { color: var(--gold); transform: scale(1); }
}

/* ── Placement rung visual - show full ladder with trophy at top ── */
.placement-visual {
  position: relative;
}

.placement-visual::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), var(--card-border));
  transform: translateX(-50%);
  opacity: 0.2;
  border-radius: 1px;
  z-index: 0;
  pointer-events: none;
}

.pv-dot {
  position: relative;
  z-index: 1;
}

.pv-dot.active-dot[data-p="1"] {
  position: relative;
  box-shadow: 0 0 14px rgba(245,166,35,0.35);
}

.pv-dot.active-dot[data-p="1"]::after {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 16px;
  height: 16px;
  background: url('https://qzsvagsxxhecbaxodajw.supabase.co/storage/v1/object/public/assets/icons/Icon_HV_Raid_Medal_small.webp') center/contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.6));
}

/* ── Trophy/Medal decorative elements for stat strip ── */
.stat-strip .ss-item .ss-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 4px;
  opacity: 0.8;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--gold);
}

.stat-strip .ss-item:hover .ss-icon {
  opacity: 1;
  transform: scale(1.2) rotate(-5deg);
  filter: drop-shadow(0 4px 8px rgba(245,166,35,0.2));
}

/* Stat Strip */
.stat-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.stat-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.08), transparent);
}

.stat-strip .ss-item {
  text-align: center;
  position: relative;
}

.stat-strip .ss-item + .ss-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: var(--card-border);
}

.stat-strip .ss-item .ss-label {
  font-size: 0.55rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.stat-strip .ss-item .ss-value {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  transition: color 0.3s, transform 0.2s;
}

.stat-strip .ss-item:hover .ss-value {
  color: #fff;
  transform: scale(1.05);
}

/* ══════════════════════════════════════
   ROSTER — Player Cards (CoC War Map)
   ══════════════════════════════════════ */

.roster-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.roster-actions button {
  padding: 8px 16px;
  min-height: 38px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.roster-actions button:hover {
  border-color: #2a2a3a;
  background: rgba(255, 255, 255, 0.02);
}

.roster-actions button.roster-primary {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(245, 166, 35, 0.02));
  border-color: rgba(245, 166, 35, 0.2);
  color: var(--gold);
  font-weight: 700;
}

.roster-actions button.roster-primary:hover {
  background: rgba(245, 166, 35, 0.1);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.05);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.roster-grid .rg-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-dim);
  font-size: 0.82rem;
  background: rgba(10, 10, 15, 0.3);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
}

.rg-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--stone-bg-alt), #101018);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--text-dim);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.15s, box-shadow 0.2s;
  position: relative;
}

.rg-card:hover {
  border-color: #2a2a3a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.rg-card.rg-red {
  border-left-color: var(--red);
}

.rg-card.rg-green {
  border-left-color: var(--green);
}

.rg-card.rg-yellow {
  border-left-color: var(--yellow);
}

.rg-card.rg-grey {
  border-left-color: var(--text-dim);
}

.rg-card .rg-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rg-card .rg-rank {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 700;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.rg-card .rg-name-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  padding: 2px 2px;
  outline: none;
  transition: border-color 0.2s;
}

.rg-card .rg-name-input:focus {
  border-bottom-color: var(--gold);
}

.rg-card .rg-name-input::placeholder {
  color: var(--text-dim);
}

.rg-card .rg-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.rg-card .rg-remove:hover {
  color: var(--red);
}

.rg-card .rg-stars {
  display: flex;
  gap: 3px;
  min-height: 44px;
  align-items: center;
}

/* Roster Star Stepper */
.rg-star-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2px;
  width: 100%;
}

.rg-star-stepper .rss-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.rg-star-stepper .rss-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.rg-star-stepper .rss-value {
  flex: 1;
  text-align: center;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold);
  min-width: 24px;
}

/* Star picker hint text */
.star-hint {
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.star-hint span {
  color: var(--gold);
  font-weight: 800;
  font-family: 'Exo 2', sans-serif;
}

.rg-card .rg-medals {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
}

/* Roster Totals */
.roster-totals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-align: center;
}

.rt-item .rt-label {
  font-size: 0.55rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.rt-item .rt-value {
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.rt-item .rt-value.gold {
  color: var(--gold);
}

.rt-item .rt-value.red {
  color: var(--red);
}

.rt-item .rt-value.green {
  color: var(--green);
}

/* ══════════════════════════════════════
   PURCHASE PLANNER + SHOP
   ══════════════════════════════════════ */

.planner-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.planner-col {
  background: linear-gradient(135deg, var(--card-bg), #14141f);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.planner-col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.06), transparent);
}

.planner-col:hover {
  border-color: #2a2a3a;
}

.planner-col .pl-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.6rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 14px;
  position: relative;
}

.planner-col .pl-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  background: linear-gradient(180deg, var(--gold), rgba(245, 166, 35, 0.4));
  border-radius: 2px;
}

.planner-col .pl-title .pl-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 0.52rem;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.1), rgba(245, 166, 35, 0.03));
  color: var(--gold);
  border-radius: 4px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(245, 166, 35, 0.1);
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.shop-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.15s;
}

.shop-item:hover {
  border-color: #2a2a3a;
  background: rgba(10, 10, 15, 0.7);
}

.shop-item .si-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-item .si-top img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.shop-item .si-top .si-name {
  font-size: 0.7rem;
  color: var(--text);
  font-weight: 600;
  flex: 1;
  line-height: 1.2;
}

.shop-item .si-top .si-cost {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.shop-item .si-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  overflow: hidden;
}

.shop-item .si-bar .si-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.shop-item .si-bar .si-fill.green {
  background: linear-gradient(90deg, #16a34a, var(--green));
}

.shop-item .si-bar .si-fill.red {
  background: linear-gradient(90deg, #b91c1c, var(--red));
}

/* Best Combo - Enhanced with game-item card style */
.combo-body-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.combo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(10, 10, 15, 0.5), rgba(20, 20, 30, 0.3));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: comboSlideIn 0.35s ease both;
  position: relative;
  overflow: hidden;
}

/* Rare item shimmer border effect */
.combo-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(245,166,35,0.03) 50%, transparent 60%);
  background-size: 200% 200%;
  pointer-events: none;
}

.combo-item:nth-child(1) { animation-delay: 0.02s; }
.combo-item:nth-child(2) { animation-delay: 0.06s; }
.combo-item:nth-child(3) { animation-delay: 0.1s; }
.combo-item:nth-child(4) { animation-delay: 0.14s; }
.combo-item:nth-child(5) { animation-delay: 0.18s; }

.combo-item:hover {
  border-color: rgba(245, 166, 35, 0.25);
  background: rgba(10, 10, 15, 0.7);
  transform: translateX(3px);
  box-shadow: 0 2px 12px rgba(245, 166, 35, 0.06);
}

.combo-item .ci-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.combo-item:hover .ci-icon {
  transform: scale(1.15) rotate(-5deg);
}

.combo-item .ci-qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: linear-gradient(135deg, var(--gold), #d4891a);
  border-radius: 999px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.55rem;
  font-weight: 800;
  color: #0a0a0f;
  margin-right: 4px;
  flex-shrink: 0;
}

.combo-item .ci-name {
  font-size: 0.75rem;
  color: var(--text);
  flex: 1;
  font-weight: 600;
}

.combo-item .ci-cost {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}

.combo-item .ci-cost::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: url('https://qzsvagsxxhecbaxodajw.supabase.co/storage/v1/object/public/assets/icons/Icon_HV_Raid_Medal_small.webp') center/contain no-repeat;
  opacity: 0.7;
}

.combo-item .ci-qty {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--gold);
}

.combo-spending-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  margin: 8px 0 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.02);
}

.combo-spending-bar .csb-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, var(--green), var(--gold));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.combo-spending-bar .csb-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  bottom: -2px;
  width: 10px;
  background: var(--gold);
  filter: blur(4px);
  opacity: 0.6;
}



.combo-spend-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.combo-spend-stats .css-spent {
  color: var(--gold);
  font-weight: 600;
  font-family: 'Exo 2', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}

.combo-spend-stats .css-spent {
  display: flex;
  align-items: center;
  gap: 4px;
}

.combo-spend-stats .css-coin-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.7;
}

.combo-spend-stats .css-remaining {
  color: var(--text-muted);
}

.combo-leftover {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 10px 34px;
  background: linear-gradient(135deg, rgba(10, 10, 15, 0.4), rgba(20, 20, 30, 0.2));
  border: 1px dashed rgba(245, 166, 35, 0.1);
  border-radius: var(--radius);
  margin-top: 8px;
  animation: comboSlideIn 0.3s ease 0.2s both;
  position: relative;
  overflow: hidden;
}

.combo-leftover .cl-icon-wrap {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.combo-leftover .cl-icon-wrap img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.combo-leftover:hover .cl-icon-wrap img {
  opacity: 1;
  transform: scale(1.3) rotate(-15deg);
  filter: drop-shadow(0 2px 8px rgba(245,166,35,0.4));
}

.combo-leftover .cl-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.combo-leftover .cl-value {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
  transition: color 0.3s;
}

.combo-leftover:hover .cl-value {
  color: #fff;
}

.combo-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(10, 10, 15, 0.3);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  position: relative;
}

.combo-empty::before {
  content: '\1F4B0';
  display: block;
  font-size: 1.5rem;
  margin-bottom: 6px;
  opacity: 0.3;
}

@keyframes comboSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════
   BONUS DISTRIBUTION — Gold Award Ceremony
   ══════════════════════════════════════ */

.bonus-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bonus-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.bonus-entry:hover {
  border-color: #2a2a3a;
  transform: translateX(2px);
}

.bonus-entry.gets {
  border-color: rgba(245, 166, 35, 0.2);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.04), rgba(245, 166, 35, 0.01));
  animation: bonusAward 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
}

.bonus-entry.gets::after {
  content: '';
  position: absolute;
  right: -2px;
  top: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(245,166,35,0.4);
}

.bonus-entry.gets:nth-child(1) { animation-delay: 0.02s; }
.bonus-entry.gets:nth-child(2) { animation-delay: 0.06s; }
.bonus-entry.gets:nth-child(3) { animation-delay: 0.1s; }
.bonus-entry.gets:nth-child(4) { animation-delay: 0.14s; }
.bonus-entry.gets:nth-child(5) { animation-delay: 0.18s; }
.bonus-entry.gets:nth-child(6) { animation-delay: 0.22s; }
.bonus-entry.gets:nth-child(7) { animation-delay: 0.26s; }
.bonus-entry.gets:nth-child(8) { animation-delay: 0.3s; }

.bonus-entry .be-medal {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  object-fit: contain;
}

.bonus-entry .be-medal--plain {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  color: var(--text-dim);
}

.bonus-entry.gets .be-medal {
  background: transparent;
  border-color: rgba(245, 166, 35, 0.3);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.1);
  transform: scale(1.05);
}

.bonus-entry:hover .be-medal {
  transform: scale(1.15) rotate(-8deg);
}

.bonus-entry .be-name {
  color: var(--text);
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonus-entry.gets .be-name {
  color: var(--gold);
}

.bonus-entry .be-stars {
  font-family: 'Exo 2', sans-serif;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.68rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.bonus-entry .be-stars::before {
  content: '\2605';
  font-size: 0.7rem;
  opacity: 0.4;
}

.bonus-entry .be-badge {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: #0a0a0f;
  background: linear-gradient(135deg, var(--gold), #d4891a);
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,166,35,0.15);
}

/* ── Podium visual for top 3 ── */
.bonus-entry.gets:nth-child(1) .be-name {
  font-weight: 800;
}

.bonus-entry.gets:nth-child(1) .be-name::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  background: url('https://qzsvagsxxhecbaxodajw.supabase.co/storage/v1/object/public/assets/th-images/WarChampionIII.webp') center/contain no-repeat;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.4));
}

.bonus-entry.gets:nth-child(2) .be-name {
  font-weight: 700;
}

.bonus-entry.gets:nth-child(3) .be-name {
  color: #d4c8a0 !important;
}

/* ── Award entry highlight bar ── */
.bonus-entry.gets::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.25), transparent);
}

/* Bonus pool meter — enhanced with trophy icon */
.bonus-pool-meter {
  display: flex;
  gap: 2px;
  margin: 10px 0 12px;
  padding: 8px 10px;
  background: rgba(10, 10, 15, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  align-items: center;
  position: relative;
}

.bonus-pool-meter::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url('https://qzsvagsxxhecbaxodajw.supabase.co/storage/v1/object/public/assets/icons/Icon_HV_Raid_Medal_small.webp') center/contain no-repeat;
  opacity: 0.2;
  pointer-events: none;
}

.bonus-pool-meter .bpm-slot {
  flex: 1;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.3s;
  position: relative;
}

.bonus-pool-meter .bpm-slot.filled {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.2);
  animation: bpmFill 0.4s ease both;
}

.bonus-pool-meter .bpm-slot.filled:nth-child(1) { animation-delay: 0.02s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(2) { animation-delay: 0.04s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(3) { animation-delay: 0.06s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(4) { animation-delay: 0.08s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(5) { animation-delay: 0.1s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(6) { animation-delay: 0.12s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(7) { animation-delay: 0.14s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(8) { animation-delay: 0.16s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(9) { animation-delay: 0.18s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(10) { animation-delay: 0.2s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(11) { animation-delay: 0.22s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(12) { animation-delay: 0.24s; }
.bonus-pool-meter .bpm-slot.filled:nth-child(13) { animation-delay: 0.26s; }

@keyframes bpmFill {
  from { opacity: 0; transform: scaleY(0.3); }
  to { opacity: 1; transform: scaleY(1); }
}

.bonus-threshold {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(10, 10, 15, 0.4);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  position: relative;
}

.bonus-threshold::before {
  content: '\2605';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: rgba(245, 166, 35, 0.2);
}

.bonus-threshold strong {
  color: var(--gold);
  font-family: 'Exo 2', sans-serif;
}

/* Enhanced bonus pool display */
#bonus-pool-display {
  animation: fadeSlideIn 0.3s ease;
}



/* ── Crown icon for #1 bonus recipient ── */
.bonus-entry .be-crown {
  width: 14px;
  height: 14px;
  margin-left: 2px;
  vertical-align: middle;
  display: inline-block;
  filter: drop-shadow(0 0 4px rgba(245,166,35,0.5));
}

@keyframes bonusAward {
  from { opacity: 0; transform: translateX(-12px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ══════════════════════════════════════
   GEO COMPARISON TABLE
   ══════════════════════════════════════ */

.geo-card {
  background: linear-gradient(135deg, var(--card-bg), #14141f);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 24px;
  overflow-x: auto;
  position: relative;
}

.geo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.06), transparent);
}

.geo-card h3 {
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  font-size: 0.65rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 14px;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.comp-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.55rem;
  color: var(--label-color);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: left;
  font-weight: 700;
}

.comp-table th:nth-child(n+2) {
  text-align: center;
}

.comp-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(30, 30, 40, 0.5);
  color: var(--text);
  transition: background 0.1s;
}

.comp-table td:nth-child(n+2) {
  text-align: center;
}

.comp-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.comp-table tr.highlight td {
  color: var(--gold);
  font-weight: 600;
}

.comp-table tr.highlight {
  background: rgba(245, 166, 35, 0.02);
}

.comp-table .bonus-cell {
  color: var(--gold);
  font-weight: 700;
}

/* ══════════════════════════════════════
   ALERTS
   ══════════════════════════════════════ */

.alert-area {
  margin-top: 10px;
}

.alert-card {
  padding: 10px 14px;
  border-radius: var(--radius);
  border-left: 4px solid;
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: 8px;
}

.alert-card:first-child {
  margin-top: 0;
}

.alert-card.red {
  background: rgba(239, 68, 68, 0.035);
  border-color: var(--red);
  color: #fca5a5;
}

.alert-card.yellow {
  background: rgba(234, 179, 8, 0.035);
  border-color: var(--yellow);
  color: #fde68a;
}

.alert-card.green {
  background: rgba(34, 197, 94, 0.035);
  border-color: var(--green);
  color: #86efac;
}

.alert-card .alert-title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

/* ══════════════════════════════════════
   ACTION BAR
   ══════════════════════════════════════ */

.action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  min-height: 44px;
  padding: 10px 20px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.action-btn:hover {
  border-color: #2a2a3a;
  background: rgba(255, 255, 255, 0.02);
}

.action-btn.primary {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(245, 166, 35, 0.02));
  border-color: rgba(245, 166, 35, 0.2);
  color: var(--gold);
}

.action-btn.primary:hover {
  background: rgba(245, 166, 35, 0.1);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.05);
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */

.os-footer {
  border-top: 1px solid var(--card-border);
  padding: 24px 16px;
  margin-top: 40px;
}

.os-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.os-footer__name {
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.os-footer__copy {
  color: var(--text-dim);
  font-size: 0.68rem;
  margin: 8px 0 12px;
}

.os-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.os-footer__nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.7rem;
  transition: color 0.15s;
}

.os-footer__nav a:hover {
  color: var(--text-muted);
}

/* ══════════════════════════════════════
   TOAST
   ══════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, var(--card-bg), #181824);
  border: 1px solid var(--card-border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 768px) {
  body::before {
    background-attachment: scroll;
    opacity: 0.025;
  }

  .hero-search {
    padding: 24px 0 20px;
  }

  .hero-search h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }

  .hero-search .hero-sub {
    font-size: 0.8rem;
  }

  .search-bar {
    min-height: 50px;
  }

  .search-bar input {
    font-size: 0.85rem;
  }

  .search-bar .search-btn {
    min-width: 76px;
    height: 44px;
    font-size: 0.65rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .planner-section {
    grid-template-columns: 1fr;
  }

  .star-picker {
    gap: 3px;
  }

  .star-pick-btn {
    min-width: 40px;
    padding: 7px 4px;
  }

  .star-pick-btn .sp-star-img {
    width: 20px;
    height: 20px;
  }

  .star-pick-btn .sp-label {
    font-size: 0.6rem;
  }

  .day-timeline {
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 4px;
  }

  .day-timeline::-webkit-scrollbar {
    display: none;
  }

  .day-dot {
    width: 34px;
    height: 34px;
    font-size: 0.62rem;
  }

  .league-settings {
    grid-template-columns: 1fr;
  }

  .stat-strip {
    gap: 6px;
    padding: 10px;
  }

  .stat-strip .ss-item .ss-value {
    font-size: 1rem;
  }

  .roster-grid {
    grid-template-columns: 1fr;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .medal-hero .mh-number {
    font-size: 2.6rem;
  }

  .medal-hero .mh-icon {
    width: 60px;
    height: 60px;
  }

  .clan-info-card {
    padding: 16px;
  }

  .clan-info-card .ci-badge {
    width: 42px;
    height: 42px;
  }

  .clan-info-card .ci-name {
    font-size: 0.9rem;
  }

  .geo-card {
    padding: 14px;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 12px 12px 60px;
  }

  .hero-search {
    padding: 16px 0 14px;
  }

  .hero-search h1 {
    font-size: 1.15rem;
    letter-spacing: 1px;
  }

  .hero-search .hero-sub {
    font-size: 0.72rem;
  }

  .search-bar {
    min-height: 44px;
    border-radius: 999px;
  }

  .search-bar input {
    font-size: 1rem;
    letter-spacing: 0.5px;
  }

  .search-bar .search-icon {
    margin: 0 6px 0 10px;
    width: 14px;
    height: 14px;
  }

  .search-bar .search-btn {
    min-width: 54px;
    height: 44px;
    font-size: 0.55rem;
    letter-spacing: 1px;
  }

  .medal-hero .mh-number {
    font-size: 2rem;
  }

  .medal-hero .mh-icon {
    width: 44px;
    height: 44px;
  }

  .day-dot {
    width: 30px;
    height: 30px;
    font-size: 0.58rem;
  }

  .star-pick-btn {
    min-width: 40px;
    padding: 7px 3px;
    border-radius: var(--radius);
  }

  .star-pick-btn .sp-star-img {
    width: 20px;
    height: 20px;
  }

  .star-pick-btn .sp-label {
    font-size: 0.55rem;
  }

  .day-timeline {
    gap: 5px;
  }

  .dash-card {
    padding: 14px;
    border-radius: var(--radius-lg);
  }

  .planner-col {
    padding: 14px;
  }

  .rg-card {
    padding: 10px 12px;
  }

  .rg-card .rg-stars button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    font-size: 0.75rem;
  }

  .geo-card {
    padding: 12px;
  }

  .toast {
    left: 12px;
    right: 12px;
    transform: translateY(80px);
    text-align: center;
  }

  .toast.show {
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════════════════════
   HELP ICONS — Info Tooltips
   ══════════════════════════════════════════════════════════ */

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  cursor: help;
  vertical-align: middle;
  margin-left: 3px;
  transition: all 0.15s;
  line-height: 1;
  font-family: 'Inter', sans-serif;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.help-icon:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-dim);
}

/* ══════════════════════════════════════════════════════════
   GUIDE SECTION — How CWL Medal Calculation Works
   ══════════════════════════════════════════════════════════ */

.guide-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--card-border);
  position: relative;
}

.guide-section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 1px;
}

.guide-section__title {
  font-family: 'ClashBold', 'Exo 2', sans-serif;
  font-size: 1.3rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 8px;
}

.guide-section__sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

/* ── Glossary Grid ── */
.glossary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Glossary Card (Expandable) ── */
.glossary-card {
  background: linear-gradient(135deg, var(--card-bg), #14141f);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.glossary-card:hover {
  border-color: #2a2a3a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.glossary-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.glossary-card__header:hover {
  background: rgba(255, 255, 255, 0.01);
}

.glossary-card__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.glossary-card__title {
  flex: 1;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.glossary-card__toggle {
  font-size: 0.6rem;
  color: var(--text-dim);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.glossary-card.expanded .glossary-card__toggle {
  transform: rotate(180deg);
  color: var(--gold);
}

.glossary-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.glossary-card.expanded .glossary-card__body {
  max-height: 1200px;
  padding: 0 16px 16px;
}

.glossary-card__body p {
  margin-bottom: 8px;
}

.glossary-card__body p:last-child {
  margin-bottom: 0;
}

.glossary-card__body ul,
.glossary-card__body ol {
  margin: 6px 0 10px;
  padding-left: 18px;
}

.glossary-card__body li {
  margin-bottom: 4px;
  color: var(--text-muted);
}

.glossary-card__body strong {
  color: var(--text);
}

.glossary-card__body .tip-text {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(245, 166, 35, 0.04);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.glossary-card__body .tip-text strong {
  color: var(--gold);
}

/* ── Formula Box ── */
.formula-box {
  margin: 10px 0;
  padding: 12px 16px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text);
}

.formula-box code {
  display: inline-block;
  background: rgba(245, 166, 35, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--gold);
  font-size: 0.75rem;
  font-family: 'Exo 2', sans-serif;
  font-weight: 600;
}

/* ── Mini Table (inside glossary cards) ── */
.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.72rem;
}

.mini-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--card-border);
  color: var(--label-color);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  text-align: left;
}

.mini-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(30, 30, 40, 0.3);
  color: var(--text-muted);
}

.mini-table tr:last-child td {
  border-bottom: none;
}

.mini-table .highlight-cell {
  color: var(--gold);
  font-weight: 700;
}

/* ── Glossary Definition List ── */
.glossary-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 6px 0;
}

.glossary-dl dt {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.72rem;
  white-space: nowrap;
  padding: 4px 0;
}

.glossary-dl dd {
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 4px 0;
  margin: 0;
}

/* ══════════════════════════════════════
   MODIFIER BANNER — Titan/Legend Ranked Battle
   ══════════════════════════════════════ */

.modifier-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.02));
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-left: 3px solid #ef4444;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 0.75rem;
  line-height: 1.5;
  animation: fadeSlideIn 0.3s ease;
  position: relative;
  overflow: hidden;
}

.modifier-banner::before {
  content: '\26A0';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  opacity: 0.15;
}

.modifier-banner .modifier-label {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.55rem;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 800;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modifier-banner .modifier-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
}

/* ── Modifier banner icon ── */
.modifier-banner .mb-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.12;
  pointer-events: none;
}

.modifier-banner .mb-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.modifier-banner p {
  color: #fca5a5;
  margin: 0;
  font-weight: 500;
  font-size: 0.72rem;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════
   FORMAT WARNING — 30v30
   ══════════════════════════════════════ */

.format-warning {
  animation: fadeSlideIn 0.3s ease;
}

.format-warning strong {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
}

/* ══════════════════════════════════════
   PLACEMENT VISUAL — Ladder Dots
   ══════════════════════════════════════ */

.placement-visual {
  gap: 3px !important;
}

.pv-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.pv-dot.active-dot {
  color: #0a0a0f;
  background: linear-gradient(135deg, var(--gold), #d4891a);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(245,166,35,0.35);
  transform: scale(1.2);
  position: relative;
}

.pv-dot:hover {
  border-color: #2a2a3a;
}

/* ── Responsive for Glossary ── */
@media (max-width: 768px) {
  .glossary-grid {
    grid-template-columns: 1fr;
  }

  .guide-section__title {
    font-size: 1rem;
  }

  .glossary-card__title {
    font-size: 0.72rem;
  }

  .glossary-card__body {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .guide-section {
    margin-top: 32px;
    padding-top: 24px;
  }

  .guide-section__title {
    font-size: 0.9rem;
  }

  .glossary-card__header {
    padding: 12px 14px;
  }

  .glossary-card__body {
    font-size: 0.72rem;
  }

  .formula-box {
    font-size: 0.72rem;
    padding: 10px 12px;
  }
}