/* ==========================================================================
   REAL Shahnameh — Season 2
   Premium progression UI: Persian luxury × cinematic fantasy × Web3 mini app
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-0: #04050b;
  --bg-1: #070a18;
  --bg-2: #0c1230;
  --surface: rgba(16, 22, 46, 0.62);
  --surface-strong: rgba(11, 16, 36, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.04);

  /* Accents */
  --gold: #f4c56b;
  --gold-2: #ffd98d;
  --gold-3: #c98e2b;
  --ember: #ff8a3d;
  --crimson: #ff5267;
  --violet: #8c6dff;
  --azure: #5ea2ff;
  --teal: #4be0c4;
  --jade: #53d79c;

  /* Type */
  --text: #f4f7ff;
  --text-dim: #c2cce4;
  --muted: #8b97b8;
  --muted-2: #5a6789;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(244, 197, 107, 0.32);
  --border-violet: rgba(140, 109, 255, 0.32);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* Shadow / Glow */
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.45);
  --glow-gold: 0 0 24px rgba(244, 197, 107, 0.45);
  --glow-violet: 0 0 24px rgba(140, 109, 255, 0.45);

  /* Rarity */
  --rarity-common: #9aa6c4;
  --rarity-rare: #5ea2ff;
  --rarity-epic: #b069ff;
  --rarity-legend: #f4c56b;
  --rarity-mythic: #ff5267;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  letter-spacing: 0.1px;
  background: var(--bg-0);
  background-image:
    radial-gradient(1100px 600px at 50% -8%, rgba(58, 79, 158, 0.45) 0%, transparent 60%),
    radial-gradient(620px 320px at 8% 18%, rgba(140, 109, 255, 0.22) 0%, transparent 70%),
    radial-gradient(620px 320px at 92% 22%, rgba(244, 197, 107, 0.22) 0%, transparent 75%),
    radial-gradient(900px 500px at 50% 110%, rgba(80, 120, 220, 0.25) 0%, transparent 70%),
    linear-gradient(180deg, #04050b 0%, #06091a 60%, #04050b 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 78% 14%, rgba(244, 197, 107, 0.5), transparent 60%),
    radial-gradient(1px 1px at 35% 72%, rgba(140, 109, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 88% 80%, rgba(94, 162, 255, 0.4), transparent 60%),
    radial-gradient(1px 1px at 20% 90%, rgba(255, 255, 255, 0.25), transparent 60%);
  opacity: 0.7;
  z-index: 0;
}

/* Persian-pattern atmospheric overlay — faint geometric khatam motif tiled
   across the viewport. The SVG ships with a hardcoded royal-gold stroke;
   the pseudo-element drops it to ambient opacity so it whispers, not shouts. */
:root {
  --persian-pattern: url("/season2/assets/persian-pattern.svg");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--persian-pattern);
  background-size: 192px 192px;
  background-repeat: repeat;
  opacity: 0.045;
  /* Vignette mask: brighter at the viewport top-centre (where most pages
     have their hero), receding around the edges so it never fights text. */
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, rgba(0,0,0,0.85) 35%, rgba(0,0,0,0.4) 70%, transparent 100%);
          mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, rgba(0,0,0,0.85) 35%, rgba(0,0,0,0.4) 70%, transparent 100%);
  z-index: 0;
}

button { font-family: inherit; }
a { color: inherit; }

/* ----- Layout shell ------------------------------------------------------ */

.app {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 56px 16px calc(72px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Page entrance — cinematic stagger, slower and more intentional */
.app > * { animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.app > *:nth-child(1) { animation-delay: 0.05s; }
.app > *:nth-child(2) { animation-delay: 0.13s; }
.app > *:nth-child(3) { animation-delay: 0.21s; }
.app > *:nth-child(4) { animation-delay: 0.29s; }
.app > *:nth-child(5) { animation-delay: 0.36s; }
.app > *:nth-child(6) { animation-delay: 0.33s; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 0;
}
.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(120deg, #fff 0%, #ffeac7 50%, var(--gold) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.page-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  background: linear-gradient(180deg, rgba(244, 197, 107, 0.18), rgba(244, 197, 107, 0.06));
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* ----- Card surfaces ----------------------------------------------------- */

.card {
  position: relative;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(22, 30, 60, 0.78), rgba(11, 16, 36, 0.78));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card::after {
  /* hairline gloss along the top edge */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}
.gold-edge {
  border-color: var(--border-gold);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 30px rgba(244, 197, 107, 0.07),
    var(--shadow-card);
}
.violet-edge {
  border-color: var(--border-violet);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 30px rgba(140, 109, 255, 0.10),
    var(--shadow-card);
}

/* ----- Top header bar (Play screen) ------------------------------------- */

.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 30%, #2a3658 0%, #111729 70%),
    linear-gradient(160deg, #2b3348, #171d2f);
  border: 1px solid var(--border-gold);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.5px;
  box-shadow: inset 0 0 14px rgba(244, 197, 107, 0.15);
  position: relative;
}
.avatar .avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 18px;
  border: 1px solid rgba(244, 197, 107, 0.35);
  pointer-events: none;
}
.who { flex: 1; min-width: 0; }
.who .name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rank-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.rank-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(140, 109, 255, 0.14);
  border: 1px solid var(--border-violet);
  color: #cdbcff;
  font-weight: 600;
}
.lvl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(244, 197, 107, 0.22), rgba(244, 197, 107, 0.05));
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.lvl-badge .lvl-num { font-size: 14px; }

/* ----- Balance row (Play) ------------------------------------------------ */

.balance-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
.balance {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.balance .label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
}
.balance .value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(120deg, #fff, #ffe5b3 60%, var(--gold));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.balance .value small { font-size: 14px; opacity: 0.85; margin-left: 4px; }
.profit { padding: 14px 16px; }
.profit .value { font-size: 20px; color: var(--jade); font-weight: 800; animation: profit-pulse 4s ease-in-out infinite; }
.profit .delta { font-size: 11px; color: var(--muted); }

.balance .value.flash { animation: balance-flash 0.45s ease-out forwards; }
.coin-float {
  position: absolute;
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(244,197,107,.9), 0 0 5px #fff;
  pointer-events: none;
  z-index: 20;
  animation: coin-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ----- Energy Core orb --------------------------------------------------- */

.core-wrap {
  position: relative;
  margin: 6px auto 0;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  user-select: none;
}
.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
.ring.r1 {
  inset: 4%;
  border: 1px dashed rgba(244, 197, 107, 0.28);
  animation: spin-slow 28s linear infinite;
}
.ring.r2 {
  inset: 12%;
  border: 1px solid rgba(140, 109, 255, 0.35);
  box-shadow: inset 0 0 28px rgba(140, 109, 255, 0.18);
  animation: spin-slow 38s linear infinite reverse;
}
.ring.r3 {
  inset: 20%;
  border: 1px solid rgba(244, 197, 107, 0.45);
  box-shadow: inset 0 0 22px rgba(244, 197, 107, 0.18);
}
.ring.r4 {
  inset: 26%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 234, 199, 0.85) 0%, rgba(244, 197, 107, 0.55) 25%, rgba(180, 110, 30, 0.55) 55%, rgba(40, 25, 8, 0.95) 100%);
  box-shadow:
    0 0 60px rgba(244, 197, 107, 0.55),
    inset 0 0 60px rgba(255, 220, 160, 0.4);
  animation: pulse 2.6s ease-in-out infinite;
}

.energy-orb {
  position: absolute;
  inset: 33%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 250, 235, 0.95) 0%, rgba(244, 197, 107, 0.85) 24%, rgba(120, 70, 18, 0.95) 65%, rgba(20, 12, 5, 1) 100%);
  border: 1px solid rgba(255, 234, 199, 0.4);
  box-shadow:
    inset 0 0 30px rgba(255, 220, 160, 0.5),
    0 0 38px rgba(244, 197, 107, 0.6);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.energy-orb:active {
  transform: scale(0.91);
  box-shadow:
    inset 0 0 44px rgba(255, 220, 160, 0.8),
    0 0 70px rgba(244, 197, 107, 0.95);
  filter: brightness(1.15);
}
.energy-orb .core-icon {
  width: 64%;
  height: 64%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #2f3c67 0%, #0c1530 70%),
    radial-gradient(circle at 70% 80%, #382a55, #0a0e22);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 900;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 1.2px;
  text-shadow: 0 0 12px rgba(244, 197, 107, 0.6);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}

.particle {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 240, 190, 1) 0%, rgba(244, 197, 107, 0.7) 55%, transparent 100%);
  box-shadow: 0 0 10px rgba(244, 197, 107, 0.9), 0 0 4px rgba(255, 255, 255, 0.5);
  animation: drift linear forwards;
}
.spark {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  font-size: 18px;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(244, 197, 107, 0.9), 0 0 6px rgba(255, 255, 255, 0.4);
  animation: rise 850ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
/* Mythic strike — deep royal gold, no white casino flash. Slightly larger
   than a regular spark but with restraint; the glow is warm not neon. */
.spark.crit {
  font-size: 26px;
  color: #f6d690;
  text-shadow:
    0 0 6px rgba(244, 197, 107, 0.95),
    0 0 18px rgba(212, 164, 80, 0.7),
    0 0 36px rgba(244, 197, 107, 0.35);
  animation: rise-crit 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.combo-pop {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  /* Gold parchment instead of red/orange casino flash. */
  background: linear-gradient(140deg, rgba(244, 197, 107, 0.22), rgba(212, 164, 80, 0.18));
  border: 1px solid rgba(244, 197, 107, 0.6);
  color: #f8e9c9;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 0 22px rgba(244, 197, 107, 0.32), inset 0 1px 0 rgba(255, 240, 210, 0.18);
  animation: combo-flash 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ----- Ring flash states ------------------------------------------------- */
.core-wrap.tapped .ring.r3 {
  border-color: rgba(244, 197, 107, 0.9);
  box-shadow: inset 0 0 40px rgba(244, 197, 107, 0.45), 0 0 28px rgba(244, 197, 107, 0.35);
}
.core-wrap.tapped .ring.r2 {
  border-color: rgba(180, 150, 255, 0.65);
  box-shadow: inset 0 0 55px rgba(140, 109, 255, 0.4);
}
/* Mythic-strike rings — softer than before, all warm gold, no white blowout.
   Reads as a "royal sigil" pulse rather than a slot-machine win. */
.core-wrap.crit-burst .ring.r4 {
  box-shadow:
    0 0 60px rgba(244, 197, 107, 0.55),
    inset 0 0 50px rgba(244, 197, 107, 0.35);
}
.core-wrap.crit-burst .ring.r3 {
  border-color: rgba(244, 197, 107, 0.9);
  box-shadow:
    inset 0 0 45px rgba(212, 164, 80, 0.4),
    0 0 28px rgba(244, 197, 107, 0.28);
}
.core-wrap.crit-burst::before {
  /* Brief radial sigil bloom at the core — gold petal, then fade. */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 197, 107, 0.32) 0%, transparent 35%),
    conic-gradient(from 0deg at 50% 50%,
      rgba(244, 197, 107, 0) 0deg, rgba(244, 197, 107, 0.18) 45deg,
      rgba(244, 197, 107, 0) 90deg, rgba(244, 197, 107, 0.18) 135deg,
      rgba(244, 197, 107, 0) 180deg, rgba(244, 197, 107, 0.18) 225deg,
      rgba(244, 197, 107, 0) 270deg, rgba(244, 197, 107, 0.18) 315deg,
      rgba(244, 197, 107, 0) 360deg);
  border-radius: 50%;
  animation: crit-sigil 600ms ease-out forwards;
  z-index: 0;
}
@keyframes crit-sigil {
  0%   { transform: scale(0.6) rotate(0deg);   opacity: 0; }
  35%  { transform: scale(1.05) rotate(20deg); opacity: 1; }
  100% { transform: scale(1.3) rotate(60deg);  opacity: 0; }
}

/* ----- Energy meter ------------------------------------------------------ */

.energy-meta {
  margin-top: 10px;
  padding: 12px 14px;
}
.energy-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.energy-line .e-val { font-weight: 700; color: var(--text); }
.energy-line .e-timer { color: var(--gold); font-weight: 700; }
.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}
.bar .fill {
  display: block;
  height: 100%;
  width: 72%;
  background: linear-gradient(90deg, var(--violet) 0%, var(--gold) 60%, var(--ember) 100%);
  box-shadow: 0 0 12px rgba(244, 197, 107, 0.5);
  transition: width 0.4s ease;
  position: relative;
}
.bar .fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  animation: shimmer 2.4s linear infinite;
}

/* ----- Action grid ------------------------------------------------------- */

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.action {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action h4 {
  margin: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.action .ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 14px;
}
.action .copy { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.45; }
.action .row { display: flex; gap: 8px; margin-top: auto; }

/* ----- Buttons ----------------------------------------------------------- */

.primary-btn,
.secondary-btn,
.ghost-btn,
.hero-upgrade {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.primary-btn,
.hero-upgrade {
  background: linear-gradient(140deg, var(--gold-2) 0%, var(--gold) 60%, var(--gold-3) 100%);
  color: #28190a;
  box-shadow: 0 6px 18px rgba(244, 197, 107, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.primary-btn:hover,
.hero-upgrade:hover { transform: translateY(-1px); filter: brightness(1.05); }
.primary-btn:active,
.hero-upgrade:active { transform: translateY(1px); }
.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.secondary-btn:hover { background: rgba(255, 255, 255, 0.1); }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-block { width: 100%; }

/* ----- Stats compact ----------------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat-mini {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-mini .ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: rgba(140, 109, 255, 0.14);
  border: 1px solid var(--border-violet);
}
.stat-mini .ico.warm { background: rgba(244, 197, 107, 0.14); border-color: var(--border-gold); color: var(--gold); }
.stat-mini .ico.cold { background: rgba(94, 162, 255, 0.14); border-color: rgba(94, 162, 255, 0.32); color: var(--azure); }
.stat-mini .ico.lush { background: rgba(83, 215, 156, 0.14); border-color: rgba(83, 215, 156, 0.32); color: var(--jade); }
.stat-mini .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-mini .num { font-size: 16px; font-weight: 800; }

/* ----- ZAR → REAL swap card ---------------------------------------------- */

.swap-card {
  background: linear-gradient(140deg, rgba(16,22,52,.85), rgba(10,14,36,.9));
  border: 1px solid rgba(212,164,80,.25);
  border-radius: var(--r-md, 12px);
  padding: 14px;
}
.swap-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.swap-cell { flex: 1; text-align: center; }
.swap-lbl { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.swap-val { font-size: 18px; font-weight: 800; color: var(--text); }
.swap-val.swap-real-out { color: var(--jade, #4ad8a6); }
.swap-arrow { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.swap-input-row { display: flex; gap: 8px; align-items: center; }
.swap-input-wrap {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(212,164,80,.2);
  border-radius: 8px; padding: 0 10px;
}
.swap-ico { font-size: 14px; flex-shrink: 0; }
.swap-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; font-weight: 600;
  padding: 10px 0; min-width: 0;
}
.swap-input::placeholder { color: var(--muted); }
.swap-btn {
  background: linear-gradient(135deg, var(--gold, #f4c56b), #d4a450);
  color: #07080f; font-size: 13px; font-weight: 800;
  border: none; border-radius: 8px; padding: 10px 16px;
  cursor: pointer; white-space: nowrap;
  transition: opacity .15s;
}
.swap-btn:disabled { opacity: .38; cursor: not-allowed; }
.swap-note { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; transition: color .2s; }

/* ----- Bottom navigation ------------------------------------------------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  background: var(--bg-1, #0e0f1c);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted, #8a7fc4);
  text-decoration: none;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 2px 4px;
  transition: color 0.15s;
  min-width: 0;
}

.nav-item.active {
  color: var(--gold, #f4c56b);
}

.ni-ico {
  font-size: 19px;
  line-height: 1;
  display: block;
}

/* ----- Section heads ----------------------------------------------------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 0;
}
.section-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.section-head .more { font-size: 12px; color: var(--gold); text-decoration: none; }

/* ----- Tabs (Heroes) ----------------------------------------------------- */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tab.active {
  color: var(--gold);
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(244, 197, 107, 0.18), rgba(244, 197, 107, 0.05));
  box-shadow: inset 0 0 12px rgba(244, 197, 107, 0.2);
}

/* ----- Premium banner ---------------------------------------------------- */

.premium-banner {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.premium-banner h3 { margin: 0 0 4px; font-size: 16px; }
.premium-banner p { margin: 0; }
.premium-banner .left { flex: 1; min-width: 0; }
.premium-banner .crest {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, rgba(244, 197, 107, 0.22), rgba(140, 109, 255, 0.18));
  border: 1px solid var(--border-gold);
  font-size: 22px;
  box-shadow: var(--glow-gold);
}

/* ============== LEARN — chapter map ====================================== */

.journey-progress {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.journey-progress .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.journey-progress .pct {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(140, 109, 255, 0.14);
  border: 1px solid var(--border-violet);
  color: #cdbcff;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.chip.warm {
  background: rgba(244, 197, 107, 0.14);
  border-color: var(--border-gold);
  color: var(--gold);
}
.chip.lush {
  background: rgba(83, 215, 156, 0.14);
  border-color: rgba(83, 215, 156, 0.32);
  color: var(--jade);
}

.chapter-map {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 4px 10px;
}
.chapter-map::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 32px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--violet) 50%, rgba(255, 255, 255, 0.08) 100%);
  border-radius: 999px;
  opacity: 0.45;
}

.chapter {
  position: relative;
  padding: 14px 14px 14px 60px;
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(22, 30, 60, 0.78), rgba(11, 16, 36, 0.86));
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.chapter:hover { transform: translateY(-1px); }
.chapter .node {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--gold);
  background: radial-gradient(circle at 30% 30%, #1d2542 0%, #0a1024 70%);
  border: 1px solid var(--border-gold);
  box-shadow: inset 0 0 12px rgba(244, 197, 107, 0.18);
}
.chapter h4 { margin: 0; font-size: 15px; font-weight: 700; }
.chapter .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chapter .copy { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.chapter.done {
  border-color: rgba(83, 215, 156, 0.32);
}
.chapter.done .node {
  color: var(--jade);
  border-color: rgba(83, 215, 156, 0.5);
  background: radial-gradient(circle at 30% 30%, #112e26 0%, #0a1a16 70%);
}
.chapter.active {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 1px rgba(244, 197, 107, 0.18), 0 14px 28px rgba(244, 197, 107, 0.12);
}
.chapter.active .node {
  background: radial-gradient(circle at 30% 30%, #ffe5b3 0%, var(--gold) 60%, #7c4f15 100%);
  color: #2c1e08;
  box-shadow: 0 0 18px rgba(244, 197, 107, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.4);
  animation: pulse 2.4s ease-in-out infinite;
}
.chapter.locked { opacity: 0.55; cursor: not-allowed; }
.chapter.locked .node {
  color: var(--muted);
  border-color: var(--border);
  background: radial-gradient(circle at 30% 30%, #181d35 0%, #0a0e22 70%);
}
.chapter .thumb {
  display: block;
  width: calc(100% + 74px);   /* content-area-width + 60px left + 14px right = card width */
  margin: -14px -14px 10px -60px;  /* escape top / right / spacing / left padding */
  max-height: 140px;
  object-fit: cover;
  /* border-radius omitted — card overflow:hidden clips to card's own 18px corners */
}
.chapter .reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}

/* ============== HEROES =================================================== */

.hero-list { display: grid; gap: 12px; }
.hero-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 14px;
  align-items: center;
}
.hero-card .portrait {
  width: 92px;
  height: 112px;
  aspect-ratio: 92 / 112;
  border-radius: 14px;
  background:
    linear-gradient(160deg, #2a3a66 0%, #131b34 60%, #0b1126 100%);
  border: 1px solid rgba(94, 162, 255, 0.4);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
.hero-card .portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.hero-card .portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(244, 197, 107, 0.18) 0%, transparent 60%),
    radial-gradient(circle at 30% 90%, rgba(140, 109, 255, 0.18) 0%, transparent 60%);
  pointer-events: none;
}
.hero-card .portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid currentColor;
  pointer-events: none;
  opacity: 0.5;
}

.hero-card .body { min-width: 0; }
.hero-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hero-card .role { font-size: 11px; color: var(--muted); letter-spacing: 0.3px; text-transform: uppercase; }
.hero-card .stats { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.hero-card .stat {
  font-size: 11px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hero-card .stat b { color: var(--gold); font-weight: 700; }

.rarity-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
}
.r-common { color: var(--rarity-common); }
.r-rare { color: var(--rarity-rare); }
.r-epic { color: var(--rarity-epic); }
.r-legend { color: var(--rarity-legend); }
.r-mythic { color: var(--rarity-mythic); }

.hero-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 2px 14px rgba(244,197,107,.1); }

.hero-card.r-common .portrait { color: var(--rarity-common); border-color: var(--rarity-common); }
.hero-card.r-rare .portrait { color: var(--rarity-rare); border-color: var(--rarity-rare); animation: glow-rare 3s ease-in-out infinite; }
.hero-card.r-epic .portrait { color: var(--rarity-epic); border-color: var(--rarity-epic); animation: glow-epic 2.8s ease-in-out infinite; }
.hero-card.r-legend .portrait { color: var(--rarity-legend); border-color: var(--rarity-legend); animation: glow-legend 2.4s ease-in-out infinite; }
.hero-card.r-mythic .portrait { color: var(--rarity-mythic); border-color: var(--rarity-mythic); animation: glow-mythic 2s ease-in-out infinite; }

/* Mythic shimmer sweep */
.hero-card.r-mythic .portrait::before {
  background:
    linear-gradient(110deg, transparent 35%, rgba(255,82,103,.22) 48%, rgba(255,220,180,.18) 52%, transparent 65%),
    radial-gradient(circle at 50% 30%, rgba(244,197,107,.18) 0%, transparent 60%),
    radial-gradient(circle at 30% 90%, rgba(255,82,103,.18) 0%, transparent 60%);
  background-size: 300% 100%, 100% 100%, 100% 100%;
  background-position: -100% 0, 0 0, 0 0;
  animation: hero-shimmer 3.5s ease-in-out infinite;
}

.hero-card .upgrade-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.hero-card .lvl-pip {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* Locked/silhouette hero cards (collection cues) */
.hero-card.locked { opacity: 0.55; }
.hero-card.locked .portrait { filter: grayscale(0.6) brightness(0.7); }

/* Collection meter */
.collection-meta {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.collection-meta .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ============== EARN ===================================================== */

.invite-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.invite-card .label {
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.invite-link {
  font-family: "JetBrains Mono", "Menlo", monospace;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px dashed var(--border-gold);
  color: var(--gold-2);
  word-break: break-all;
  user-select: all;
}
.invite-card .row { display: flex; gap: 8px; }
.invite-card .row > * { flex: 1; }

.milestone-list { display: grid; gap: 10px; }
.milestone {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
}
.milestone .crest {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(244, 197, 107, 0.14);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 16px;
  font-weight: 800;
}
.milestone h4 { margin: 0; font-size: 14px; }
.milestone .copy { margin: 4px 0 6px; font-size: 11px; color: var(--muted); }
.milestone .mini-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.milestone .mini-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--gold));
}
.milestone .reward-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
  letter-spacing: 0.3px;
}
.milestone.done {
  border-color: rgba(83, 215, 156, 0.28);
  box-shadow: 0 0 0 1px rgba(83, 215, 156, 0.18);
}
.milestone.done .crest { color: var(--jade); border-color: rgba(83, 215, 156, 0.4); background: rgba(83, 215, 156, 0.12); }

.utility-grid { display: grid; gap: 10px; }
.utility-row {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.utility-row .ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(140, 109, 255, 0.14);
  border: 1px solid var(--border-violet);
  color: #cdbcff;
}
.utility-row h5 { margin: 0; font-size: 13px; }
.utility-row p { margin: 2px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

.airdrop-card {
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}
.airdrop-meter {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--gold) 0% 84%, rgba(255, 255, 255, 0.05) 84% 100%);
  position: relative;
}
.airdrop-meter::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}
.airdrop-meter span {
  position: relative;
  font-weight: 800;
  font-size: 18px;
  color: var(--gold);
}

/* ============== SOCIAL =================================================== */

.lb-list { display: flex; flex-direction: column; }
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.lb-row:last-child { border-bottom: 0; }
.lb-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.lb-row.top1 .lb-rank { background: linear-gradient(140deg, var(--gold-2), var(--gold-3)); color: #28190a; }
.lb-row.top2 .lb-rank { background: linear-gradient(140deg, #d8e0f5, #8995b6); color: #1a1f30; }
.lb-row.top3 .lb-rank { background: linear-gradient(140deg, #d18a4d, #7d4015); color: #1a0d05; }
.lb-name { font-size: 14px; font-weight: 700; }
.lb-sub { font-size: 11px; color: var(--muted); }
.lb-pts { font-size: 13px; font-weight: 700; color: var(--gold); }

.guild-list { display: grid; gap: 10px; }
.guild-row {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
}
.guild-crest {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(140deg, rgba(244, 197, 107, 0.22), rgba(140, 109, 255, 0.18));
  border: 1px solid var(--border-gold);
}
.guild-row h5 { margin: 0; font-size: 14px; font-weight: 700; }
.guild-row .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.feed-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.feed-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
}
.feed-row:hover { background: rgba(255, 255, 255, 0.03); }
.feed-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 13px;
}
.feed-row .text { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.feed-row .text b { color: var(--text); font-weight: 700; }
.feed-row .time { font-size: 11px; color: var(--muted); }

/* ----- Quiz modal -------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 12, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(460px, 100%);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 50%),
    linear-gradient(180deg, rgba(20, 26, 52, 0.96), rgba(8, 12, 28, 0.98));
  border: 1px solid var(--border-gold);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 18px 18px calc(max(28px, env(safe-area-inset-bottom, 0px) + 16px));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(40px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal .grabber {
  width: 38px;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  margin: 0 auto 14px;
}
.modal h3 {
  margin: 0 0 4px;
  font-size: 18px;
  background: linear-gradient(120deg, #fff, #ffe5b3, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal .modal-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.story-block {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.quiz-question {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.quiz-option:hover { background: rgba(255, 255, 255, 0.07); }
.quiz-option:active { transform: scale(0.98); }
.quiz-option.correct {
  background: rgba(83, 215, 156, 0.14);
  border-color: rgba(83, 215, 156, 0.5);
  color: var(--jade);
}
.quiz-option.wrong {
  background: rgba(255, 82, 103, 0.14);
  border-color: rgba(255, 82, 103, 0.5);
  color: var(--crimson);
}
.quiz-option.disabled { pointer-events: none; opacity: 0.55; }
.quiz-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(244, 197, 107, 0.10);
  border: 1px solid var(--border-gold);
  text-align: center;
  display: none;
}
.quiz-result.show { display: block; animation: rise-in 0.4s ease-out both; }
.quiz-result h4 { margin: 0 0 6px; font-size: 16px; color: var(--gold); }
.quiz-result .reward-line {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.94);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: var(--glow-gold);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Unlock burst overlay */
.unlock-burst {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 150;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(244, 197, 107, 0.25), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.unlock-burst.show { opacity: 1; }
.unlock-burst .ring-burst {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: burst 1.1s ease-out forwards;
}
.unlock-burst .label {
  position: absolute;
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(244, 197, 107, 0.8);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ----- Animations -------------------------------------------------------- */

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes drift {
  from { transform: translateY(0) scale(1); opacity: 0.85; }
  to { transform: translateY(-160px) scale(0.4); opacity: 0; }
}
@keyframes rise {
  to { transform: translateY(-56px); opacity: 0; }
}
@keyframes rise-crit {
  0%   { transform: translateY(0) scale(0.5) rotate(-4deg); opacity: 1; }
  25%  { transform: translateY(-28px) scale(1.6) rotate(3deg); opacity: 1; }
  100% { transform: translateY(-100px) scale(0.85) rotate(-2deg); opacity: 0; }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes profit-pulse {
  0%, 100% { color: var(--jade); }
  50%       { color: #6fffd4; text-shadow: 0 0 18px rgba(74,216,166,.65), 0 0 6px rgba(74,216,166,.3); }
}
@keyframes balance-flash {
  0%   { filter: brightness(1.9) drop-shadow(0 0 10px rgba(244,197,107,.9)); }
  100% { filter: brightness(1)   drop-shadow(0 0 0px transparent); }
}
@keyframes coin-rise {
  0%   { transform: translateY(0) scale(0.7); opacity: 1; }
  100% { transform: translateY(-55px) scale(0.9); opacity: 0; }
}
@keyframes glow-rare {
  0%, 100% { box-shadow: inset 0 0 24px rgba(94,162,255,.18); }
  50%       { box-shadow: inset 0 0 36px rgba(94,162,255,.5), 0 0 14px rgba(94,162,255,.28); }
}
@keyframes glow-epic {
  0%, 100% { box-shadow: inset 0 0 24px rgba(176,105,255,.22); }
  50%       { box-shadow: inset 0 0 42px rgba(176,105,255,.6), 0 0 18px rgba(176,105,255,.32); }
}
@keyframes glow-legend {
  0%, 100% { box-shadow: inset 0 0 28px rgba(244,197,107,.32); }
  50%       { box-shadow: inset 0 0 46px rgba(244,197,107,.7), 0 0 22px rgba(244,197,107,.38); }
}
@keyframes glow-mythic {
  0%, 100% { box-shadow: inset 0 0 28px rgba(255,82,103,.32); }
  50%       { box-shadow: inset 0 0 52px rgba(255,82,103,.75), 0 0 28px rgba(255,82,103,.45), 0 0 60px rgba(255,82,103,.18); }
}
@keyframes hero-shimmer {
  0%        { background-position: -100% 0, 0 0, 0 0; }
  50%, 100% { background-position: 200% 0, 0 0, 0 0; }
}
@keyframes rise-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@keyframes combo-flash {
  0% { transform: translateX(-50%) scale(0.8); opacity: 0; }
  18% { transform: translateX(-50%) scale(1.08); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 0; }
}
@keyframes burst {
  0% { transform: scale(0.4); opacity: 0.6; border-width: 4px; }
  100% { transform: scale(2.4); opacity: 0; border-width: 1px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Small phones */
@media (max-width: 360px) {
  .page-title { font-size: 18px; }
  .balance .value { font-size: 22px; }
  .core-wrap { max-width: 280px; }
  .energy-orb .core-icon { font-size: 18px; }
  .hero-card { grid-template-columns: 78px 1fr; }
  .hero-card .portrait { width: 78px; }
  .hero-card .upgrade-col { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .s1-bonus-card { grid-template-columns: 44px 1fr; }
  .s1-crest { width: 44px; height: 44px; font-size: 22px; }
  .premium-banner .primary-btn,
  .premium-banner .secondary-btn { padding: 8px 10px; font-size: 12px; }
}

/* ==========================================================================
   RTL — Persian / Farsi
   ========================================================================== */

html[dir="rtl"] body {
  font-family: "Vazirmatn", "IRANSans", "Tahoma", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

html[dir="rtl"] .top-bar,
html[dir="rtl"] .balance-row,
html[dir="rtl"] .action-grid,
html[dir="rtl"] .stats-grid,
html[dir="rtl"] .page-head,
html[dir="rtl"] .section-head,
html[dir="rtl"] .premium-banner,
html[dir="rtl"] .invite-card,
html[dir="rtl"] .milestone,
html[dir="rtl"] .utility-row,
html[dir="rtl"] .hero-card,
html[dir="rtl"] .guild-row,
html[dir="rtl"] .lb-row,
html[dir="rtl"] .feed-row,
html[dir="rtl"] .bottom-nav {
  direction: rtl;
  text-align: right;
}

/* invite link is a URL — keep it LTR even when surrounding direction flips */
html[dir="rtl"] .invite-link {
  direction: ltr;
  text-align: left;
  unicode-bidi: bidi-override;
}

/* numerical / Latin balance value — keep readable LTR */
html[dir="rtl"] .balance .value,
html[dir="rtl"] .lvl-badge,
html[dir="rtl"] .stat-mini .num,
html[dir="rtl"] .lb-pts {
  direction: ltr;
  unicode-bidi: plaintext;
}

/* Chapter map progression line + nodes — flip absolute positions */
html[dir="rtl"] .chapter-map::before {
  left: auto;
  right: 32px;
}
html[dir="rtl"] .chapter {
  padding: 14px 60px 14px 14px;
}
html[dir="rtl"] .chapter .node {
  left: auto;
  right: 14px;
}

/* Modal grabber stays centered, but result line should center too */
html[dir="rtl"] .modal h3,
html[dir="rtl"] .quiz-result {
  text-align: center;
}

/* Bottom nav: reverse column order so reading goes Play (right) → Social (left) */
html[dir="rtl"] .bottom-nav .nav-item:nth-child(1) { order: 7; }
html[dir="rtl"] .bottom-nav .nav-item:nth-child(2) { order: 6; }
html[dir="rtl"] .bottom-nav .nav-item:nth-child(3) { order: 5; }
html[dir="rtl"] .bottom-nav .nav-item:nth-child(4) { order: 4; }
html[dir="rtl"] .bottom-nav .nav-item:nth-child(5) { order: 3; }
html[dir="rtl"] .bottom-nav .nav-item:nth-child(6) { order: 2; }
html[dir="rtl"] .bottom-nav .nav-item:nth-child(7) { order: 1; }

/* RTL: hamburger moves to the left edge; Hakim orb flips to right */
html[dir="rtl"] .hamburger-btn {
  right: auto;
  left: 14px;
}
html[dir="rtl"] .hamburger-btn:hover,
html[dir="rtl"] .hamburger-btn:active {
  transform: scale(1.07);
}
html[dir="rtl"] .hakim-orb-wrap {
  left: auto;
  right: 16px;
}
html[dir="rtl"] .hakim-orb-label {
  left: auto;
  right: 58px;
}
html[dir="rtl"] .settings-cog {
  right: auto;
  left: 14px;
}

/* RTL: keep podium ranks readable LTR */
html[dir="rtl"] .lb-rank { direction: ltr; }

/* ==========================================================================
   Onboarding overlay (fullscreen)
   ========================================================================== */

body.ob-open { overflow: hidden; }

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 18px;
  animation: ob-in 0.45s ease-out both;
}
.onboarding.closing { animation: ob-out 0.32s ease-in forwards; }
.onboarding .ob-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 540px at 50% -10%, rgba(58, 79, 158, 0.55) 0%, transparent 60%),
    radial-gradient(620px 320px at 18% 30%, rgba(140, 109, 255, 0.28) 0%, transparent 70%),
    radial-gradient(620px 320px at 82% 25%, rgba(244, 197, 107, 0.28) 0%, transparent 75%),
    linear-gradient(180deg, #04050b 0%, #050816 60%, #03040a 100%);
  z-index: -1;
}
.onboarding .ob-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 24%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 78% 14%, rgba(244, 197, 107, 0.7), transparent 60%),
    radial-gradient(1px 1px at 35% 72%, rgba(140, 109, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 88% 80%, rgba(94, 162, 255, 0.6), transparent 60%);
  opacity: 0.85;
  animation: shimmer-stars 6s ease-in-out infinite alternate;
}

.ob-shell {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ob-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ob-crest {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 234, 199, 0.95), rgba(244, 197, 107, 0.6) 50%, rgba(120, 70, 18, 0.95) 100%);
  border: 1px solid rgba(255, 234, 199, 0.5);
  box-shadow: 0 0 30px rgba(244, 197, 107, 0.45), inset 0 0 18px rgba(255, 220, 160, 0.5);
  font-size: 30px;
  color: #1a1106;
  animation: pulse 3s ease-in-out infinite;
}
.ob-brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(120deg, #fff, #ffe5b3, var(--gold));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.ob-brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.ob-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise-in 0.45s ease-out both;
}
.ob-step[hidden] { display: none; }
.ob-h {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(120deg, #fff, #ffe5b3 60%, var(--gold));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.ob-sub {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.ob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ob-card {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(22, 30, 60, 0.85), rgba(11, 16, 36, 0.9));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 148px;
  justify-content: center;
}
.ob-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
  box-shadow: 0 12px 28px rgba(244, 197, 107, 0.18);
}
.ob-card:active { transform: translateY(0); }
.ob-flag, .ob-emblem {
  font-size: 32px;
  line-height: 1;
}
.ob-emblem {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, rgba(244, 197, 107, 0.22), rgba(140, 109, 255, 0.18));
  border: 1px solid var(--border-gold);
  color: var(--gold);
  box-shadow: var(--glow-gold);
}
.ob-card-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.ob-card-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.ob-card.path .ob-card-title { color: var(--gold); }
.ob-foot {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

@keyframes ob-in {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes ob-out {
  to { opacity: 0; transform: scale(0.98); }
}
@keyframes shimmer-stars {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ==========================================================================
   Hamburger menu button + full-screen nav overlay
   ========================================================================== */

/* ── Floating hamburger — adventure menu, right-center ─────────────────── */

@keyframes hbtn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,197,107,0), 0 8px 28px rgba(0,0,0,.55); }
  50%       { box-shadow: 0 0 0 6px rgba(244,197,107,.12), 0 8px 28px rgba(0,0,0,.55); }
}

.hamburger-btn {
  position: fixed;
  top: 12px;
  right: 14px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(12,16,36,.92) 0%, rgba(6,9,22,.96) 100%);
  border: 1px solid rgba(244,197,107,.35);
  color: var(--gold);
  font-size: 22px;
  cursor: pointer;
  z-index: 90;
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 8px 28px rgba(0,0,0,.55), 0 0 0 1px rgba(244,197,107,.06), inset 0 1px 0 rgba(255,255,255,.07);
}
.hamburger-btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(244,197,107,.25) 0%, transparent 50%, rgba(140,109,255,.15) 100%);
  pointer-events: none;
}
.hamburger-btn:hover, .hamburger-btn:active {
  border-color: rgba(244,197,107,.65);
  color: var(--gold-2);
  background: linear-gradient(160deg, rgba(20,26,52,.95) 0%, rgba(12,16,36,.98) 100%);
  transform: scale(1.07);
  box-shadow: 0 0 0 8px rgba(244,197,107,.1), 0 12px 36px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.1);
}

/* Legacy alias — keep .settings-cog working for any page that still uses it */
.settings-cog {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(8, 11, 22, 0.7);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  z-index: 90;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.18s ease, border-color 0.2s ease, color 0.2s ease;
}
.settings-cog:hover {
  border-color: var(--border-gold);
  color: var(--gold);
  transform: rotate(35deg);
}

/* ── Hamburger menu overlay ───────────────────────────────────────── */

.hmenu-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.hmenu-overlay.open { pointer-events: auto; }

.hmenu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.hmenu-overlay.open .hmenu-backdrop { opacity: 1; }

.hmenu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: linear-gradient(180deg, rgba(12, 16, 36, 0.98) 0%, rgba(6, 9, 22, 0.99) 100%);
  border-left: 1px solid var(--border-gold);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.hmenu-panel::-webkit-scrollbar { display: none; }
.hmenu-overlay.open .hmenu-panel { transform: translateX(0); }

.hmenu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.hmenu-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #fff 0%, #ffe5b3 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hmenu-close {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  line-height: 1;
}
.hmenu-close:hover { background: rgba(255,82,103,0.14); color: var(--crimson); border-color: rgba(255,82,103,0.3); }

.hmenu-body { flex: 1; padding: 10px 0 20px; }

.hmenu-section-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 18px 4px;
  font-weight: 700;
}

.hmenu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.hmenu-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.hmenu-link.active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(244,197,107,0.14) 0%, transparent 100%);
}
.hmenu-link.active::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(244,197,107,0.5);
}
.hmenu-link.coming { color: var(--muted-2); cursor: default; }
.hmenu-link.coming:hover { background: none; color: var(--muted-2); }
.hmenu-link-ico {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.hmenu-link.active .hmenu-link-ico {
  background: rgba(244,197,107,0.15);
  border-color: var(--border-gold);
}
.hmenu-link.hakim-link .hmenu-link-ico {
  background: linear-gradient(140deg, rgba(140,109,255,0.2), rgba(94,162,255,0.15));
  border-color: rgba(140,109,255,0.35);
}
.hmenu-link.hakim-link.active .hmenu-link-ico {
  background: linear-gradient(140deg, rgba(140,109,255,0.3), rgba(94,162,255,0.2));
  border-color: rgba(140,109,255,0.5);
}
.hmenu-chip {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.hmenu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 18px;
}

/* Settings section inside menu */
.hmenu-settings {
  padding: 12px 18px;
}
.hmenu-settings-label {
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted-2); font-weight: 700; margin-bottom: 8px;
}
.hmenu-lang-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.hmenu-pick {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex: 1;
  text-align: center;
  min-width: 0;
}
.hmenu-pick.active {
  color: var(--gold);
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(244,197,107,0.18), rgba(244,197,107,0.05));
}
.hmenu-path-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.hmenu-reset {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,82,103,0.08);
  border: 1px solid rgba(255,82,103,0.25);
  color: #ffd0d6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 2px;
  transition: background 0.15s;
}
.hmenu-reset:hover { background: rgba(255,82,103,0.14); }
.hmenu-reset-sub { font-size: 10px; color: rgba(255,208,214,0.65); font-weight: 400; }
html[dir="rtl"] .hmenu-reset { text-align: right; }

/* RTL menu slides from left */
html[dir="rtl"] .hmenu-panel {
  right: auto; left: 0;
  border-left: 0; border-right: 1px solid var(--border-gold);
  transform: translateX(-100%);
}
html[dir="rtl"] .hmenu-overlay.open .hmenu-panel { transform: translateX(0); }
html[dir="rtl"] .hmenu-link.active::before { left: auto; right: 0; border-radius: 2px 0 0 2px; }
html[dir="rtl"] .hmenu-link.active { background: linear-gradient(270deg, rgba(244,197,107,0.14) 0%, transparent 100%); }

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.settings-panel.open { pointer-events: auto; opacity: 1; }
.settings-panel .sp-bg {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.settings-panel .sp-card {
  position: relative;
  width: min(460px, 100%);
  background: linear-gradient(180deg, rgba(20, 26, 52, 0.96), rgba(8, 12, 28, 0.98));
  border: 1px solid var(--border-gold);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 18px 18px 24px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(40px);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.settings-panel.open .sp-card { transform: translateY(0); }
.settings-panel h3 {
  margin: 4px 0 14px;
  font-size: 17px;
  text-align: center;
  background: linear-gradient(120deg, #fff, #ffe5b3, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sp-section { margin-bottom: 16px; }
.sp-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sp-pick {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.sp-pick.active {
  color: var(--gold);
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(244, 197, 107, 0.18), rgba(244, 197, 107, 0.05));
  box-shadow: inset 0 0 14px rgba(244, 197, 107, 0.18);
}
.sp-reset {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 82, 103, 0.08);
  border: 1px solid rgba(255, 82, 103, 0.32);
  color: #ffd0d6;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  font-size: 13px;
}
.sp-reset:hover { background: rgba(255, 82, 103, 0.14); }
.sp-reset-sub {
  font-size: 11px;
  color: rgba(255, 208, 214, 0.7);
  font-weight: 400;
}
html[dir="rtl"] .sp-reset { text-align: right; }

.sp-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sp-toggle-state {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
}
.sp-toggle.active .sp-toggle-state {
  background: linear-gradient(180deg, rgba(83, 215, 156, 0.22), rgba(83, 215, 156, 0.06));
  border-color: rgba(83, 215, 156, 0.5);
  color: var(--jade);
}

/* ==========================================================================
   Season 1 bonus card
   ========================================================================== */

.s1-bonus-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-gold);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(244, 197, 107, 0.18) 0%, transparent 60%),
    radial-gradient(120% 80% at 100% 100%, rgba(140, 109, 255, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, rgba(22, 30, 60, 0.9), rgba(11, 16, 36, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 38px rgba(244, 197, 107, 0.12),
    0 14px 36px rgba(0, 0, 0, 0.5);
}
.s1-bonus-card::before {
  /* aurora ribbon */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(244, 197, 107, 0.6), rgba(140, 109, 255, 0.5), rgba(244, 197, 107, 0.6));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
  animation: s1-shimmer 4.6s linear infinite;
}
.s1-crest {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 234, 199, 0.95), rgba(244, 197, 107, 0.65) 50%, rgba(120, 70, 18, 0.95) 100%);
  border: 1px solid rgba(255, 234, 199, 0.5);
  box-shadow: 0 0 28px rgba(244, 197, 107, 0.45), inset 0 0 16px rgba(255, 220, 160, 0.5);
  color: #1a1106;
  align-self: start;
}
.s1-body { min-width: 0; }
.s1-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.s1-bonus-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(120deg, #fff, #ffe5b3 60%, var(--gold));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.s1-bonus-card .copy {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
}
.s1-bonus-card .chip-row { margin-bottom: 14px; }
.s1-claim-btn { width: 100%; }
.s1-claimed-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(83, 215, 156, 0.16);
  border: 1px solid rgba(83, 215, 156, 0.5);
  color: var(--jade);
  white-space: nowrap;
}

/* state variants */
.s1-bonus-card.ineligible { opacity: 0.78; }
.s1-bonus-card.ineligible::before { animation: none; opacity: 0.25; }
.s1-bonus-card.ineligible .s1-crest {
  filter: grayscale(0.55) brightness(0.85);
  box-shadow: none;
}
.s1-bonus-card.ineligible h3 {
  background: linear-gradient(120deg, #cdd6ec, #8b97b8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.s1-bonus-card.ineligible .s1-claim-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.s1-bonus-card.claimed { border-color: rgba(83, 215, 156, 0.45); }
.s1-bonus-card.claimed::before {
  background: linear-gradient(120deg, rgba(83, 215, 156, 0.6), rgba(244, 197, 107, 0.5), rgba(83, 215, 156, 0.6));
}
.s1-bonus-card.claimed .s1-claim-btn {
  background: rgba(83, 215, 156, 0.14);
  border: 1px solid rgba(83, 215, 156, 0.45);
  color: var(--jade);
  box-shadow: none;
  cursor: default;
}

@keyframes s1-shimmer {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* small phones */
@media (max-width: 360px) {
  .s1-bonus-card { grid-template-columns: 1fr; }
  .s1-crest { width: 52px; height: 52px; font-size: 24px; }
}


/* ============================================================
   Rewarded ad placeholder overlay (earn.html "Watch & Earn")
   ============================================================ */
.ad-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 3, 8, .82);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.ad-overlay.open { display: flex; }
.ad-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, #0f1326 0%, #070912 100%);
  border: 1px solid rgba(244, 197, 107, .35);
  border-radius: 20px; box-shadow: 0 30px 60px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.ad-stage {
  position: relative; aspect-ratio: 9 / 16; max-height: 70vh;
  background:
    radial-gradient(circle at 30% 30%, rgba(244, 197, 107, .12), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(140, 109, 255, .12), transparent 60%),
    #0a0d1c;
  display: grid; place-items: center; gap: 14px;
  color: var(--gold, #f4c56b);
}
.ad-stage-label { font-size: 14px; letter-spacing: .4px; }
.ad-stage.success { color: #4ad8a6; }
.ad-stage.success::before {
  content: "✓"; font-size: 64px;
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(74, 216, 166, .12);
  border: 1px solid rgba(74, 216, 166, .45);
}
.ad-spinner {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid rgba(244, 197, 107, .18);
  border-top-color: var(--gold, #f4c56b);
  animation: ad-spin .8s linear infinite;
}
@keyframes ad-spin { to { transform: rotate(360deg); } }
.ad-foot {
  display: flex; justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ==========================================================================
   Locale-aware typography
   - English (lang=en): Inter / system stack (set on body in the default rule).
   - Persian (lang=fa): Vazirmatn / Persian-capable stack — handled by the
     existing html[dir="rtl"] rule above.
   - Tajik  (lang=tg): Cyrillic LTR. Rely on Inter, Roboto, and the OS system
     Cyrillic font (Segoe UI / SF Pro / Noto Sans Cyrillic). All modern
     mobile fonts include the extended Tajik Cyrillic letters (ӣ ӯ ҳ ҷ қ ғ).
   ========================================================================== */
html[lang="tg"] body {
  font-family: "Inter", "Roboto", "Segoe UI", -apple-system, BlinkMacSystemFont,
               "Helvetica Neue", "Noto Sans", "Noto Sans Tajik", sans-serif;
  /* feature-settings: enable contextual alternates so Cyrillic ligatures look right */
  font-feature-settings: "kern", "calt";
}

/* Onboarding language grid: with 3 options, lay them out responsively.
   Previous 2-option layout already works; 3 cards just wrap on narrow screens. */
.ob-grid.ob-grid-lang {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.sp-row.sp-row-lang {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sp-row.sp-row-lang .sp-pick {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 96px;
}

/* Settings — tap icon / skin selector */
.sp-skin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sp-skin-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sp-skin-btn.active {
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(244,197,107,.18), rgba(244,197,107,.05));
  box-shadow: inset 0 0 10px rgba(244,197,107,.15);
}
.sp-skin-btn.locked { opacity: .45; cursor: default; }
.sp-skin-lock {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 9px;
  line-height: 1;
}

/* ==========================================================================
   Season 2 — Layered Resource HUD
   Visual hierarchy: Farr / Zar / Gems / XP shown prominently;
   REAL appears as a discreet secondary line below.
   ========================================================================== */

/* Inline reward/balance pill — used in toast lines, reward bursts, lists. */
.r-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04);
  line-height: 1.2;
}
.r-pill .r-ico { font-size: 12px; line-height: 1; }
.r-pill .r-amt { color: var(--text, #f4ecd9); }
.r-pill .r-lbl { color: var(--muted, #8c8b86); font-weight: 600; letter-spacing: .2px; }

/* Per-resource accent — gold for Farr/Zar, violet for Gems, blue for XP, silver for REAL. */
.r-pill.r-farr  { background: linear-gradient(140deg, rgba(244,197,107,.16), rgba(244,197,107,.04)); border-color: rgba(244,197,107,.4); }
.r-pill.r-zar   { background: linear-gradient(140deg, rgba(212,164,80,.18),  rgba(212,164,80,.04));  border-color: rgba(212,164,80,.45); }
.r-pill.r-gems  { background: linear-gradient(140deg, rgba(140,109,255,.18), rgba(140,109,255,.04)); border-color: rgba(140,109,255,.4); }
.r-pill.r-xp    { background: linear-gradient(140deg, rgba(94,162,255,.16),  rgba(94,162,255,.04));  border-color: rgba(94,162,255,.4); }
.r-pill.r-real  { background: linear-gradient(140deg, rgba(220,220,235,.12), rgba(220,220,235,.04)); border-color: rgba(220,220,235,.3); }
.r-pill.r-farr  .r-ico { color: var(--gold, #f4c56b); text-shadow: 0 0 6px rgba(244,197,107,.6); }

/* Multi-resource HUD card — the main balance summary on Home (and any page
   that wants to surface the Five Resources). 4 cells in a grid; REAL is a
   subtle banner below. */
.resource-hud {
  background: linear-gradient(140deg, rgba(16,22,52,.78), rgba(10,14,36,.88));
  border: 1px solid var(--border-gold, rgba(244,197,107,.32));
  border-radius: var(--r-md, 14px);
  padding: 16px 14px 14px;
  box-shadow: var(--shadow-card, 0 8px 24px rgba(0,0,0,.35));
  position: relative;
  overflow: hidden;
}
/* Top hairline ornament — royal-gold "court" line that frames the HUD. */
.resource-hud::before {
  content: "";
  position: absolute;
  top: 0; left: 14%; right: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,197,107,.55), transparent);
  pointer-events: none;
}
/* Persian-pattern flourish — same khatam motif, very subtle, masked away
   from the centre so the cells stay readable. */
.resource-hud::after {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--persian-pattern);
  background-size: 96px 96px;
  background-repeat: repeat;
  opacity: 0.07;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, transparent 0%, transparent 25%, #000 80%);
          mask-image: radial-gradient(ellipse at 50% 50%, transparent 0%, transparent 25%, #000 80%);
  pointer-events: none;
}
.resource-hud .r-cells {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: relative;
}
.r-cell {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.r-cell-ico {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 0 4px currentColor);
}
.r-cell-body { text-align: center; min-width: 0; width: 100%; }
.r-cell-amt {
  font-size: 14px;
  font-weight: 800;
  color: var(--text, #f4ecd9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-cell-lbl {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted, #8c8b86);
  font-weight: 700;
  margin-top: 1px;
}
.r-cell.r-farr .r-cell-ico { color: var(--gold, #f4c56b); }
.r-cell.r-zar  .r-cell-ico { color: #d4a450; }
.r-cell.r-gems .r-cell-ico { color: #8c6dff; }
.r-cell.r-xp   .r-cell-ico { color: #5ea2ff; }
.r-cell.r-farr { border-color: rgba(244,197,107,.28); }
.r-cell.r-zar  { border-color: rgba(212,164,80,.28); }
.r-cell.r-gems { border-color: rgba(140,109,255,.28); }
.r-cell.r-xp   { border-color: rgba(94,162,255,.28); }

/* REAL row — visually demoted: small, subtle silver bar at the bottom of the HUD.
   Reads "◆  1,200  REAL" with no flashy gradient. */
.r-cell-real {
  position: relative;
  margin-top: 10px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(220,220,235,.12);
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted, #8c8b86);
}
.r-cell-real .r-real-ico { color: rgba(220,220,235,.8); font-size: 12px; }
.r-cell-real .r-real-amt { color: var(--text, #f4ecd9); font-weight: 700; }
.r-cell-real .r-real-lbl {
  margin-left: auto;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  color: rgba(220,220,235,.55);
}

/* ==========================================================================
   .lore-card — premium storytelling card.
   A Persian-arch top frame, royal gold accents, parchment-warm body tone.
   Use sparingly: ecosystem explainers, founder messages, one-time disclosures.
   ========================================================================== */
.lore-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(34,28,18,.7) 0%, rgba(20,16,28,.85) 100%);
  border: 1px solid rgba(244,197,107,.32);
  border-top-width: 0;          /* arch substitutes for the top edge */
  border-radius: 18px;
  padding: 26px 18px 18px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(244,197,107,.12),
    0 10px 28px rgba(0,0,0,.45);
}
/* Persian-arch crown — SVG-shaped border drawn with two opposing radial
   gradients that meet at the top centre. Keeps the visual cinematic and
   adds the "royal court" framing without any external image. */
.lore-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  pointer-events: none;
  background:
    /* The arch outline: a thin gold band that curves down at the edges. */
    radial-gradient(120% 32px at 50% 100%, transparent 0 26px, rgba(244,197,107,.55) 26px 27.5px, transparent 27.5px),
    /* Soft fill under the arch */
    linear-gradient(180deg, rgba(244,197,107,.10) 0%, transparent 100%);
}
/* Pattern flourish drifting up from the bottom. */
.lore-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--persian-pattern);
  background-size: 128px 128px;
  background-repeat: repeat;
  opacity: 0.05;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 100%);
  pointer-events: none;
}
.lore-card > * { position: relative; z-index: 1; }
.lore-card .lore-kicker {
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--gold, #f4c56b);
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}
.lore-card .lore-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--text, #f4ecd9);
}
.lore-card .lore-title .gold { color: var(--gold, #f4c56b); }
.lore-card .lore-body {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(244,236,217,.82);
  margin: 0;
}
.lore-card .lore-body + .lore-body { margin-top: 8px; }
.lore-card .lore-author {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  font-style: italic;
  color: var(--muted, #8c8b86);
  letter-spacing: .4px;
}

/* ==========================================================================
   Hakim AI Companion page
   ========================================================================== */

.hakim-hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(140deg, rgba(10,14,36,.95) 0%, rgba(20,10,50,.9) 100%);
  border: 1px solid rgba(140,109,255,.4);
  box-shadow: var(--shadow-card), 0 0 30px rgba(140,109,255,.2);
  padding: 20px 18px 18px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
.hakim-hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 40%, rgba(140,109,255,.18) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(244,197,107,.12) 0%, transparent 55%);
  pointer-events: none;
}
.hakim-portrait {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(140,109,255,.25), rgba(94,162,255,.18));
  border: 1px solid rgba(140,109,255,.45);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 0 18px rgba(140,109,255,.3);
  position: relative; z-index: 1;
}
.hakim-portrait img { width: 100%; height: 100%; object-fit: cover; }
.hakim-hero-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hakim-kicker {
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(140,109,255,.9); font-weight: 700; margin-bottom: 4px;
}
.hakim-name {
  font-size: 22px; font-weight: 800; margin: 0 0 2px;
  background: linear-gradient(120deg, #fff 0%, #d8ccff 50%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hakim-subtitle-text {
  font-size: 12px; color: var(--muted); margin: 0 0 10px;
}
.hakim-intro-text {
  font-size: 12px; line-height: 1.55; color: var(--text-dim); margin: 0;
}

/* Bond level card */
.hakim-bond {
  background: rgba(16,22,52,.7);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.hakim-bond-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.hakim-bond-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.hakim-bond-val { font-size: 13px; font-weight: 800; color: var(--violet); }
.hakim-bond-xp { font-size: 11px; color: var(--muted-2); }

/* Daily wisdom */
.hakim-wisdom {
  background: linear-gradient(140deg, rgba(10,14,36,.94), rgba(20,12,44,.88));
  border: 1px solid var(--border-gold);
  border-radius: var(--r-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.hakim-wisdom::before {
  content: "❝";
  position: absolute; top: 8px; left: 12px;
  font-size: 36px; color: rgba(244,197,107,.12);
  line-height: 1; pointer-events: none;
}
.hakim-wisdom-label {
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin-bottom: 10px;
}
.hakim-wisdom-text {
  font-size: 13px; line-height: 1.6; color: var(--text-dim);
  font-style: italic; margin: 0;
}
.hakim-wisdom-source {
  margin-top: 8px; font-size: 11px; color: rgba(244,197,107,.6);
  font-style: normal;
}

/* Quick action buttons */
.hakim-quick-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.hakim-quick-btn {
  background: rgba(16,22,52,.6);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  transition: background .15s, border-color .15s, color .15s;
  display: flex; align-items: center; gap: 8px;
}
.hakim-quick-btn:hover { background: rgba(140,109,255,.12); border-color: rgba(140,109,255,.3); color: var(--text); }
.hakim-quick-ico { font-size: 15px; flex-shrink: 0; }

/* Chat area */
.hakim-chat {
  background: rgba(8,11,22,.85);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hakim-chat-messages {
  min-height: 100px; max-height: 280px;
  overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.08) transparent;
}
.hakim-chat-messages::-webkit-scrollbar { width: 4px; }
.hakim-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }
.hcm-bubble {
  max-width: 88%; padding: 10px 13px;
  border-radius: 14px; font-size: 13px; line-height: 1.5;
  position: relative;
}
.hcm-bubble.user {
  align-self: flex-end;
  background: linear-gradient(140deg, rgba(140,109,255,.3), rgba(94,162,255,.2));
  border: 1px solid rgba(140,109,255,.3);
  color: var(--text);
  border-radius: 14px 14px 4px 14px;
}
.hcm-bubble.hakim {
  align-self: flex-start;
  background: rgba(22,28,54,.9);
  border: 1px solid rgba(244,197,107,.18);
  color: var(--text-dim);
  border-radius: 14px 14px 14px 4px;
}
.hcm-bubble.hakim .hcm-source {
  font-size: 10px; color: rgba(244,197,107,.5); margin-top: 6px; display: block;
}
.hcm-bubble.loading {
  align-self: flex-start;
  background: rgba(22,28,54,.7);
  border: 1px solid var(--border);
}
.hcm-dots { display: inline-flex; gap: 3px; }
.hcm-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted);
  animation: hcm-bounce 1.2s ease-in-out infinite;
}
.hcm-dots span:nth-child(2) { animation-delay: 0.18s; }
.hcm-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes hcm-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.hakim-chat-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
  background: rgba(4,5,11,.6);
}
.hakim-chat-input {
  flex: 1;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px; color: var(--text);
  font-family: inherit;
  resize: none; outline: none;
  min-height: 38px; max-height: 100px;
  transition: border-color .15s;
}
.hakim-chat-input::placeholder { color: var(--muted-2); }
.hakim-chat-input:focus { border-color: rgba(140,109,255,.4); }
.hakim-chat-send {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(140,109,255,.8), rgba(94,162,255,.7));
  border: none; color: #fff;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(140,109,255,.3);
}
.hakim-chat-send:hover { opacity: .9; transform: scale(1.05); }
.hakim-chat-send:disabled { opacity: .4; cursor: default; transform: none; }

/* Empty chat state */
.hcm-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 20px 14px; color: var(--muted);
  text-align: center;
}
.hcm-empty-ico { font-size: 28px; opacity: .5; }
.hcm-empty-text { font-size: 12px; }

/* ==========================================================================
   Ambient atmosphere — subtle floating particles, candle glow
   ========================================================================== */

@keyframes float-particle {
  0%   { transform: translateY(0)   rotate(0deg);   opacity: 0; }
  10%  { opacity: .5; }
  90%  { opacity: .3; }
  100% { transform: translateY(-90vh) rotate(360deg); opacity: 0; }
}

/* Particle container injected by atmosphere.js (optional).
   Pure-CSS fallback: three fixed pseudo-particles. */
.atm-particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(244,197,107,.55) 0%, transparent 70%);
  animation: float-particle linear infinite;
}

/* Candle glow — static bottom vignette */
body::after {
  /* keep existing pattern overlay */
}

.candle-glow {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 260px; height: 120px;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(244,197,107,.09) 0%,
    rgba(140,109,255,.05) 50%,
    transparent 100%);
  pointer-events: none;
  z-index: 0;
  animation: candle-flicker 4s ease-in-out infinite;
}

@keyframes candle-flicker {
  0%, 100% { opacity: 1; transform: translateX(-50%) scaleX(1); }
  25%       { opacity: .8; transform: translateX(-50%) scaleX(.92); }
  60%       { opacity: .95; transform: translateX(-50%) scaleX(1.05); }
}

/* ==========================================================================
   Hakim Global Companion Orb
   ========================================================================== */

@keyframes hakim-orb-in {
  from { transform: scale(0) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);    opacity: 1; }
}
@keyframes hakim-orb-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes hakim-orb-ring {
  0%   { transform: scale(1);   opacity: .6; }
  100% { transform: scale(1.8); opacity: 0;  }
}

.hakim-orb-wrap {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
  left: 16px;
  z-index: 80;
  animation: hakim-orb-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hakim-orb {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(140,109,255,.9), rgba(94,162,255,.8));
  border: 2px solid rgba(140,109,255,.6);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  position: relative;
  box-shadow: 0 8px 24px rgba(140,109,255,.4), 0 0 0 0 rgba(140,109,255,.3);
  animation: hakim-orb-float 3s ease-in-out infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: visible;
}
.hakim-orb::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(140,109,255,.35);
  animation: hakim-orb-ring 2.5s ease-out infinite;
}
.hakim-orb:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(140,109,255,.55), 0 0 0 8px rgba(140,109,255,.1);
}
.hakim-orb img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.hakim-orb-badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-0);
  font-size: 8px; color: #04050b; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}

/* Orb tooltip mini-label */
.hakim-orb-label {
  position: absolute; left: 58px; top: 50%; transform: translateY(-50%);
  background: rgba(8,11,22,.92);
  border: 1px solid rgba(140,109,255,.35);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; transition: opacity 0.18s;
  backdrop-filter: blur(10px);
}
.hakim-orb-wrap:hover .hakim-orb-label { opacity: 1; }

/* Orb quick-action modal */
.hakim-quick-modal {
  position: fixed;
  bottom: 88px; left: 16px;
  width: min(300px, calc(100vw - 32px));
  background: linear-gradient(160deg, rgba(12,16,36,.97), rgba(6,9,22,.99));
  border: 1px solid rgba(140,109,255,.4);
  border-radius: 20px;
  padding: 16px;
  z-index: 85;
  box-shadow: 0 -8px 40px rgba(140,109,255,.2), 0 20px 60px rgba(0,0,0,.7);
  transform: translateY(10px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.2,0.8,0.2,1), opacity 0.22s ease;
}
.hakim-quick-modal.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.hqm-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.hqm-title {
  font-size: 13px; font-weight: 800;
  background: linear-gradient(120deg, #fff 0%, #d8ccff 60%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hqm-close {
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  color: var(--muted); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.hqm-close:hover { background: rgba(255,82,103,.12); color: var(--crimson); }
.hqm-wisdom {
  font-size: 12px; line-height: 1.55; color: var(--text-dim);
  font-style: italic;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.hqm-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.hqm-action {
  background: rgba(140,109,255,.1);
  border: 1px solid rgba(140,109,255,.25);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; text-align: left;
  transition: background .15s, color .15s, border-color .15s;
  display: flex; align-items: center; gap: 6px;
}
.hqm-action:hover { background: rgba(140,109,255,.2); border-color: rgba(140,109,255,.4); color: var(--text); }
.hqm-action-ico { font-size: 13px; flex-shrink: 0; }
.hqm-ask-row {
  display: flex; gap: 6px; margin-top: 8px;
}
.hqm-ask-input {
  flex: 1; background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px;
  font-size: 12px; color: var(--text); font-family: inherit; outline: none;
  transition: border-color .15s;
}
.hqm-ask-input:focus { border-color: rgba(140,109,255,.4); }
.hqm-ask-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(140deg, rgba(140,109,255,.8), rgba(94,162,255,.7));
  border: none; color: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity .15s;
}
.hqm-ask-btn:hover { opacity: .85; }

/* ==========================================================================
   Regions of Persia page
   ========================================================================== */

.regions-hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 160px;
  background: linear-gradient(140deg, rgba(10,14,36,.95) 0%, rgba(20,12,44,.9) 100%);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-card), var(--glow-gold);
  padding: 20px 18px 18px;
}
.regions-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(244,197,107,.14) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(140,109,255,.12) 0%, transparent 55%);
  pointer-events: none;
}
.regions-kicker {
  font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin-bottom: 6px;
}
.regions-title {
  font-size: 24px; font-weight: 800; margin: 0 0 6px;
  background: linear-gradient(120deg, #fff 0%, #ffe5b3 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.regions-sub {
  font-size: 13px; color: var(--muted); margin: 0 0 14px;
  line-height: 1.5;
}
.regions-stats {
  display: flex; gap: 16px;
}
.regions-stat { font-size: 11px; color: var(--muted-2); }
.regions-stat strong { color: var(--gold); font-weight: 800; font-size: 14px; display: block; }

/* Region cards grid */
.region-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.region-card {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(16,22,52,.7);
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  min-height: 140px;
  display: flex; flex-direction: column;
}
.region-card:hover { transform: translateY(-3px); border-color: var(--border-gold); box-shadow: var(--glow-gold); }
.region-card-img {
  width: 100%; height: 90px;
  background: linear-gradient(140deg, rgba(244,197,107,.15), rgba(140,109,255,.12));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.region-card-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.region-card-img .region-ico { position: relative; z-index: 1; }
.region-card-body { padding: 10px; flex: 1; }
.region-card-name {
  font-size: 13px; font-weight: 800; color: var(--text); margin: 0 0 3px;
}
.region-card-desc {
  font-size: 10px; color: var(--muted); line-height: 1.4;
}
.region-card-tag {
  font-size: 9px; color: var(--gold); letter-spacing: .5px;
  text-transform: uppercase; margin-top: 5px; display: block;
}

/* Region detail modal */
.region-modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(2,4,12,.8);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.region-modal-overlay.open { opacity: 1; pointer-events: auto; }
.region-modal {
  width: min(460px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(14,20,46,.98), rgba(6,9,22,.99));
  border: 1px solid var(--border-gold);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 20px 18px 32px;
  transform: translateY(40px);
  transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1);
}
.region-modal-overlay.open .region-modal { transform: translateY(0); }
.region-modal-grabber {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.12); margin: 0 auto 16px;
}
.region-modal-kicker {
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 6px;
}
.region-modal-title {
  font-size: 22px; font-weight: 800; margin: 0 0 8px;
  background: linear-gradient(120deg, #fff 0%, #ffe5b3 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.region-modal-body {
  font-size: 13px; line-height: 1.65; color: var(--text-dim);
  margin: 0 0 14px;
}
.region-modal-heroes {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.region-hero-chip {
  font-size: 11px; padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244,197,107,.1); border: 1px solid var(--border-gold);
  color: var(--gold); font-weight: 600;
}
.region-modal-close {
  position: absolute; top: 16px; right: 18px;
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ==========================================================================
   Historical Sites page
   ========================================================================== */

.sites-hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(140deg, rgba(10,14,36,.95), rgba(30,8,50,.9));
  border: 1px solid rgba(140,109,255,.4);
  box-shadow: var(--shadow-card), 0 0 30px rgba(140,109,255,.15);
  padding: 20px 18px 18px;
}
.sites-kicker {
  font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--violet); font-weight: 700; margin-bottom: 6px;
}
.sites-title {
  font-size: 24px; font-weight: 800; margin: 0 0 6px;
  background: linear-gradient(120deg, #fff 0%, #d8ccff 50%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sites-sub { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* Site cards — cinematic full-width */
.site-card {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(14,20,46,.8);
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.site-card:hover { transform: translateY(-2px); border-color: rgba(140,109,255,.4); box-shadow: 0 0 20px rgba(140,109,255,.15); }
.site-card-banner {
  width: 100%; height: 110px;
  background: linear-gradient(140deg, rgba(140,109,255,.18), rgba(94,162,255,.12));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; position: relative; overflow: hidden;
}
.site-card-banner img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.site-card-banner-ico { position: relative; z-index: 1; }
.site-card-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(14,20,46,.85) 0%, transparent 60%);
}
.site-card-body { padding: 12px 14px; }
.site-card-kicker {
  font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--violet); font-weight: 700; margin-bottom: 4px;
}
.site-card-name {
  font-size: 16px; font-weight: 800; color: var(--text); margin: 0 0 6px;
}
.site-card-lore {
  font-size: 12px; line-height: 1.55; color: var(--muted); margin: 0 0 10px;
}
.site-card-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.site-timeline-hint {
  font-size: 10px; color: var(--muted-2);
}
.site-hakim-btn {
  font-size: 11px; font-weight: 700;
  color: var(--violet); background: rgba(140,109,255,.1);
  border: 1px solid rgba(140,109,255,.3); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
.site-hakim-btn:hover { background: rgba(140,109,255,.2); border-color: rgba(140,109,255,.5); color: #fff; }

/* sites-hero stats (mirrors regions-stats pattern) */
.sites-stats { display: flex; gap: 16px; margin-top: 14px; }
.sites-stat { font-size: 11px; color: var(--muted-2); }
.sites-stat strong { color: var(--violet); font-weight: 800; font-size: 14px; display: block; }
.sites-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(140,109,255,.18) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(244,197,107,.1) 0%, transparent 55%);
  pointer-events: none;
}

/* sites-list — full-width vertical stack */
.sites-list { display: flex; flex-direction: column; gap: 10px; }

/* Extended site-card layout (cinematic) */
.site-card-ico {
  position: relative; z-index: 1; font-size: 42px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}
.site-card-tags {
  position: absolute; bottom: 8px; left: 10px;
  display: flex; gap: 4px; flex-wrap: wrap;
  z-index: 1;
}
.site-tag {
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; color: rgba(255,255,255,.7);
  background: rgba(0,0,0,.45); border-radius: 4px;
  padding: 2px 6px;
}
.site-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 6px;
}
.site-card-era {
  font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--violet); font-weight: 700; margin-top: 2px;
}
.site-card-desc {
  font-size: 12px; line-height: 1.55; color: var(--muted); margin: 0 0 10px;
}
.site-card-modern {
  font-size: 10px; color: var(--muted-2);
}
.site-card-cta {
  font-size: 11px; font-weight: 700; color: var(--violet);
}
.site-card-ico-sm {
  font-size: 20px; opacity: .5; flex-shrink: 0;
}

/* ==========================================================================
   Hakim page expanded — tabs
   ========================================================================== */

.hakim-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 2px; scrollbar-width: none;
  margin-bottom: 0;
}
.hakim-tabs::-webkit-scrollbar { display: none; }
.hakim-tab {
  flex-shrink: 0; padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  white-space: nowrap;
}
.hakim-tab.active {
  color: var(--violet);
  border-color: rgba(140,109,255,.4);
  background: linear-gradient(180deg, rgba(140,109,255,.18), rgba(140,109,255,.05));
}
.hakim-tab-panel { display: none; }
.hakim-tab-panel.active { display: block; }

/* Word of the Day */
.hakim-word-card {
  background: linear-gradient(140deg, rgba(14,20,46,.9), rgba(6,9,22,.95));
  border: 1px solid rgba(140,109,255,.3);
  border-radius: var(--r-md);
  padding: 18px;
}
.hakim-word-persian {
  font-size: 28px; font-weight: 800; color: var(--violet);
  font-family: "Vazir", "Scheherazade New", serif;
  direction: rtl; text-align: center; margin: 0 0 6px;
}
.hakim-word-latin { font-size: 14px; font-weight: 700; color: var(--text); text-align: center; margin: 0 0 12px; }
.hakim-word-def { font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.hakim-word-example {
  margin-top: 10px; padding: 10px 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 10px; font-size: 12px; color: var(--muted);
  font-style: italic;
}

/* Timeline view */
.hakim-timeline { position: relative; padding-left: 24px; }
.hakim-timeline::before {
  content: "";
  position: absolute; left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold) 0%, rgba(244,197,107,.2) 100%);
}
.ht-entry { position: relative; margin-bottom: 16px; }
.ht-dot {
  position: absolute; left: -19px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--bg-0);
  box-shadow: 0 0 8px rgba(244,197,107,.5);
}
.ht-year { font-size: 10px; color: var(--gold); font-weight: 700; margin-bottom: 3px; }
.ht-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.ht-body { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ==========================================================================
   Cinematic Transitions
   ========================================================================== */

@keyframes cinematic-enter-kf {
  from { opacity: 0; transform: translateY(14px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes cinematic-fade-kf {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes manuscript-shimmer-kf {
  0%   { opacity: 0; transform: scaleX(0); transform-origin: left; }
  60%  { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

.cinematic-enter {
  animation: cinematic-enter-kf 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cinematic-fade {
  animation: cinematic-fade-kf 0.3s ease-out both;
}
.manuscript-reveal {
  animation: cinematic-enter-kf 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
}
.manuscript-reveal::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  animation: manuscript-shimmer-kf 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

/* Staggered delays for children */
.cinematic-enter:nth-child(1) { animation-delay: 0s; }
.cinematic-enter:nth-child(2) { animation-delay: 0.06s; }
.cinematic-enter:nth-child(3) { animation-delay: 0.12s; }
.cinematic-enter:nth-child(4) { animation-delay: 0.18s; }
.cinematic-enter:nth-child(5) { animation-delay: 0.24s; }

/* ==========================================================================
   Timeline Page
   ========================================================================== */

.timeline-hero {
  background: linear-gradient(160deg, rgba(244,197,107,.1) 0%, rgba(140,109,255,.07) 100%);
  border: 1px solid rgba(244,197,107,.18);
  border-radius: var(--r-lg);
  padding: 24px 20px 18px;
  position: relative;
  overflow: hidden;
}
.timeline-hero::before {
  content: "⏳";
  position: absolute; right: 16px; top: 14px;
  font-size: 42px; opacity: 0.12; pointer-events: none;
}
.timeline-kicker {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.timeline-h1 {
  font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 6px;
}
.timeline-sub {
  font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0;
}

/* Track */
.timeline-track {
  position: relative;
  padding-bottom: 16px;
}
.timeline-track::before {
  content: "";
  position: absolute;
  left: 21px; top: 12px; bottom: 16px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold) 0%, rgba(244,197,107,.15) 80%, transparent 100%);
  z-index: 0;
}

/* Node row */
.tl-node {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.tl-dot {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(244,197,107,.3);
  background: var(--bg-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--gold);
  box-shadow: 0 0 8px rgba(244,197,107,.12);
  margin-top: 13px;
  position: relative; z-index: 2;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.tl-node.unlocked .tl-dot {
  background: rgba(244,197,107,.14);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(244,197,107,.35);
}
.tl-node.completed .tl-dot {
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  border-color: var(--gold);
  color: #04050b;
  box-shadow: 0 0 20px rgba(244,197,107,.5);
}
.tl-node.locked .tl-dot { opacity: 0.4; }

/* Card */
.tl-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 14px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
.tl-cover {
  margin: -13px -14px 12px;
  width: calc(100% + 28px);
  height: 140px;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: var(--r-md) var(--r-md) 0 0;
  opacity: 0.88;
  transition: opacity 0.25s;
}
.tl-node.locked .tl-cover { opacity: 0.3; filter: grayscale(0.6); }
.tl-node.unlocked .tl-cover { opacity: 0.9; }
.tl-node.completed .tl-cover { opacity: 1; }
.tl-node.unlocked .tl-card {
  border-color: rgba(244,197,107,.2);
}
.tl-node.completed .tl-card {
  border-color: rgba(244,197,107,.28);
  background: rgba(244,197,107,.04);
}
.tl-node.locked .tl-card { opacity: 0.55; }

.tl-status-chip {
  display: inline-block;
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px; margin-bottom: 7px;
}
.tl-node.unlocked .tl-status-chip {
  background: rgba(244,197,107,.12); color: var(--gold);
  border: 1px solid rgba(244,197,107,.28);
}
.tl-node.completed .tl-status-chip {
  background: rgba(83,215,156,.1); color: var(--jade);
  border: 1px solid rgba(83,215,156,.28);
}
.tl-node.locked .tl-status-chip {
  background: rgba(255,255,255,.04); color: var(--muted-2);
  border: 1px solid rgba(255,255,255,.1);
}

.tl-era {
  font-size: 9px; color: var(--muted-2); font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 3px;
}
.tl-title {
  font-size: 15px; font-weight: 800; color: var(--text); margin: 0 0 5px;
}
.tl-lore {
  font-size: 12px; color: var(--text-dim); line-height: 1.55; margin: 0 0 9px;
}
.tl-reward {
  font-size: 11px; color: var(--gold);
  background: rgba(244,197,107,.07);
  border: 1px solid rgba(244,197,107,.14);
  border-radius: 8px; padding: 4px 10px;
  margin-bottom: 9px; display: inline-block;
}
.tl-actions {
  display: flex; gap: 7px; align-items: center; flex-wrap: wrap;
}
.tl-ask-hakim {
  flex: 1; min-width: 90px;
  background: rgba(140,109,255,.1);
  border: 1px solid rgba(140,109,255,.3);
  color: var(--violet); border-radius: 9px;
  padding: 7px 10px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background 0.2s, transform 0.15s;
}
.tl-ask-hakim:hover, .tl-ask-hakim:active {
  background: rgba(140,109,255,.18); transform: scale(0.97);
}
.tl-node.locked .tl-ask-hakim { opacity: 0.35; pointer-events: none; }

/* Hidden lore pill */
.tl-lore-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  cursor: pointer; padding: 6px 10px; border-radius: 9px;
  border: 1px solid rgba(244,197,107,.2);
  background: rgba(244,197,107,.05);
  color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  font-family: inherit;
}
.tl-lore-pill.unlocked {
  border-color: rgba(244,197,107,.4);
  background: rgba(244,197,107,.1);
  color: var(--gold);
}
.tl-lore-pill:hover { transform: scale(0.97); }

/* ==========================================================================
   Hidden Lore Cards (bottom section of timeline page)
   ========================================================================== */

.lore-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 2px 0;
}
.lore-section-title {
  font-size: 13px; font-weight: 800; color: var(--text); margin: 0;
}
.lore-section-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--gold);
  background: rgba(244,197,107,.1);
  border: 1px solid rgba(244,197,107,.2);
  border-radius: 20px; padding: 2px 9px;
}

.lore-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 15px 13px;
  position: relative; overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.lore-cover {
  margin: -15px -15px 13px;
  width: calc(100% + 30px);
  height: 120px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: var(--r-md) var(--r-md) 0 0;
  transition: opacity 0.4s, filter 0.4s;
}
.lore-card.locked .lore-cover   { opacity: 0.25; filter: grayscale(0.7) blur(1px); }
.lore-card.unlocked .lore-cover { opacity: 0.85; filter: none; }
.lore-card.just-unlocked .lore-cover { animation: lore-cover-reveal 0.6s ease-out forwards; }
@keyframes lore-cover-reveal {
  0%   { opacity: 0.25; filter: grayscale(0.7) blur(1px); }
  100% { opacity: 0.85; filter: none; }
}
.lore-card.locked { opacity: 0.72; }
.lore-card.unlocked {
  border-color: rgba(244,197,107,.28);
  box-shadow: 0 0 20px rgba(244,197,107,.06);
}

@keyframes lore-unlock-glow {
  0%   { box-shadow: 0 0 0 rgba(244,197,107,0); border-color: rgba(244,197,107,.28); }
  40%  { box-shadow: 0 0 32px rgba(244,197,107,.45); border-color: rgba(244,197,107,.55); }
  100% { box-shadow: 0 0 20px rgba(244,197,107,.07); border-color: rgba(244,197,107,.28); }
}
.lore-card.just-unlocked {
  animation: lore-unlock-glow 1s ease-out forwards;
}

.lore-lock-icon {
  position: absolute; top: 13px; right: 13px;
  font-size: 16px; opacity: 0.4; transition: opacity 0.3s;
}
.lore-card.unlocked .lore-lock-icon { display: none; }

.lore-kicker {
  font-size: 9px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 5px; display: flex; align-items: center; gap: 5px;
}
.lore-kicker::before { content: "✦"; font-size: 8px; }

.lore-title {
  font-size: 14px; font-weight: 800; color: var(--text); margin: 0 0 7px;
}
.lore-body {
  font-size: 12px; color: var(--text-dim); line-height: 1.6; margin: 0 0 10px;
}
.lore-locked-hint {
  font-size: 11px; color: var(--muted); font-style: italic; margin-bottom: 10px;
}
.lore-reward-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--gold);
  background: rgba(244,197,107,.08);
  border: 1px solid rgba(244,197,107,.18);
  border-radius: 20px; padding: 3px 10px; margin-bottom: 10px;
}
.lore-unlock-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(244,197,107,.12) 0%, rgba(140,109,255,.08) 100%);
  border: 1px solid rgba(244,197,107,.28);
  border-radius: 10px; color: var(--gold);
  font-size: 12px; font-weight: 700; padding: 9px;
  cursor: pointer; font-family: inherit;
  transition: background 0.2s, transform 0.15s;
}
.lore-unlock-btn:hover { background: linear-gradient(135deg, rgba(244,197,107,.2) 0%, rgba(140,109,255,.14) 100%); transform: scale(0.98); }

/* Hakim Bond toast */
.hakim-bond-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: linear-gradient(135deg, rgba(140,109,255,.92), rgba(94,162,255,.85));
  border: 1px solid rgba(140,109,255,.5);
  border-radius: 24px; padding: 8px 18px;
  font-size: 12px; font-weight: 800; color: #fff;
  opacity: 0; pointer-events: none; z-index: 500;
  white-space: nowrap;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(12px);
}
.hakim-bond-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Atmosphere Fog
   ========================================================================== */

@keyframes fog-drift {
  0%   { opacity: 0.7; transform: translateY(0) scaleX(1); }
  50%  { opacity: 1;   transform: translateY(-8px) scaleX(1.02); }
  100% { opacity: 0.7; transform: translateY(0) scaleX(1); }
}
.atmosphere-fog {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 180px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(140,109,255,.04) 0%, rgba(244,197,107,.02) 50%, transparent 80%);
  animation: fog-drift 12s ease-in-out infinite;
  will-change: transform, opacity;
}

/* ==========================================================================
   Cinematic Chapter Reveal Overlay
   ========================================================================== */

@keyframes co-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes co-line { from { width: 0; } to { width: 80%; } }

.co-overlay {
  position: fixed; inset: 0;
  z-index: 800;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}
.co-overlay.co-visible { opacity: 1; pointer-events: auto; }
.co-overlay.co-exit { opacity: 0; transition: opacity 0.5s ease; }

.co-bg {
  position: absolute; inset: 0;
  background: rgba(4,5,11,.96);
  backdrop-filter: blur(8px);
}
.co-content {
  position: relative;
  text-align: center;
  padding: 44px 32px 36px;
  max-width: 360px;
  width: 100%;
}
.co-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: 4px;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 18px;
  opacity: 0;
  animation: co-rise 0.45s ease 0.3s forwards;
}
.co-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  margin: 0 auto 20px;
  width: 0;
  animation: co-line 0.65s ease 0.65s forwards;
}
.co-title {
  font-size: 19px; font-weight: 800; color: var(--text);
  margin-bottom: 18px; line-height: 1.3;
  opacity: 0;
  animation: co-rise 0.45s ease 0.9s forwards;
}
.co-quote {
  font-size: 13px; color: var(--text-dim); font-style: italic;
  line-height: 1.65; margin-bottom: 28px;
  opacity: 0;
  animation: co-rise 0.45s ease 1.2s forwards;
}
.co-skip {
  position: absolute; bottom: 8px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; padding: 8px;
  opacity: 0;
  animation: co-rise 0.3s ease 1.6s forwards;
  transition: color 0.2s;
}
.co-skip:hover { color: var(--text-dim); }

/* ==========================================================================
   Audio Toggle (hamburger menu)
   ========================================================================== */

.hmenu-audio-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
}
.hmenu-audio-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.hmenu-audio-btn.active {
  background: rgba(244,197,107,.08);
  border-color: rgba(244,197,107,.28);
  color: var(--gold);
}
.hmenu-audio-btn [data-audio-icon] { font-size: 16px; }

/* ==========================================================================
   Persia Map Page
   ========================================================================== */

.map-hero {
  background: linear-gradient(160deg, rgba(244,197,107,.1) 0%, rgba(140,109,255,.07) 100%);
  border: 1px solid rgba(244,197,107,.18);
  border-radius: var(--r-lg);
  padding: 22px 20px 18px;
  position: relative; overflow: hidden;
}
.map-hero::before {
  content: "🗺";
  position: absolute; right: 16px; top: 14px;
  font-size: 40px; opacity: 0.12; pointer-events: none;
}
.map-kicker {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.map-h1 {
  font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 5px;
}
.map-sub {
  font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0;
}

/* Map canvas container */
.map-canvas {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(244,197,107,.06) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(140,109,255,.05) 0%, transparent 55%),
    linear-gradient(160deg, rgba(8,12,28,.95) 0%, rgba(4,5,11,1) 100%);
  border: 1px solid rgba(244,197,107,.12);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 400px;
  touch-action: manipulation;
}
.map-canvas-inner {
  position: relative;
  width: 100%;
  height: 400px;
}

/* SVG routes layer */
.map-routes {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

@keyframes route-dash {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0; }
}
.map-route {
  stroke-dasharray: 5 5;
  animation: route-dash 3s linear infinite;
  fill: none;
}
.map-route.unlocked  { stroke: rgba(244,197,107,.35); stroke-width: 1.2; }
.map-route.locked    { stroke: rgba(255,255,255,.08); stroke-width: 0.8; }
.map-route.legendary {
  stroke: rgba(244,197,107,.55); stroke-width: 1.5;
  filter: drop-shadow(0 0 3px rgba(244,197,107,.4));
}

/* Region nodes */
.map-region {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  text-align: center;
  z-index: 2;
}
.map-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin: 0 auto 3px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.map-region.unlocked .map-dot {
  background: var(--gold);
  border: 1.5px solid rgba(244,197,107,.7);
  box-shadow: 0 0 10px rgba(244,197,107,.45), 0 0 20px rgba(244,197,107,.2);
}
.map-region.locked .map-dot {
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
}
.map-region.legendary .map-dot {
  width: 13px; height: 13px;
  background: linear-gradient(135deg, var(--gold), var(--ember));
  border: 2px solid rgba(244,197,107,.8);
  box-shadow: 0 0 16px rgba(244,197,107,.6), 0 0 32px rgba(244,197,107,.25);
}
.map-region.mountain .map-dot {
  width: 12px; height: 12px;
  border-radius: 2px;
  background: rgba(140,109,255,.5);
  border: 1.5px solid rgba(140,109,255,.7);
  box-shadow: 0 0 10px rgba(140,109,255,.4);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-radius: 0;
}
.map-region:hover .map-dot { transform: scale(1.35); }
.map-region-name {
  font-size: 8.5px; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.4px;
  text-shadow: 0 0 8px rgba(0,0,0,.9), 0 0 4px rgba(0,0,0,1);
  white-space: nowrap; line-height: 1;
  pointer-events: none;
}
.map-region.locked .map-region-name { color: var(--muted-2); }
.map-region-era {
  font-size: 7px; color: var(--muted-2);
  margin-top: 1px; white-space: nowrap;
  pointer-events: none;
}

/* @keyframes for region glow pulse */
@keyframes region-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(244,197,107,.45), 0 0 20px rgba(244,197,107,.2); }
  50%       { box-shadow: 0 0 18px rgba(244,197,107,.7), 0 0 32px rgba(244,197,107,.35); }
}
.map-region.unlocked .map-dot { animation: region-pulse 3s ease-in-out infinite; }
.map-region.legendary .map-dot {
  animation: region-pulse 2s ease-in-out infinite;
}

/* Map region detail modal */
.map-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4,5,11,.75);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex; align-items: flex-end; justify-content: center;
}
.map-modal-overlay.open { opacity: 1; pointer-events: auto; }
.map-modal {
  width: min(440px, 100%);
  background: var(--surface-strong);
  border: 1px solid rgba(244,197,107,.2);
  border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 72vh;
  overflow-y: auto;
}
.map-modal-overlay.open .map-modal { transform: translateY(0); }
.map-modal-grabber {
  width: 36px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.15);
  margin: 0 auto 16px;
}
.map-modal-kicker {
  font-size: 9px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.map-modal-title {
  font-size: 20px; font-weight: 800; color: var(--text); margin: 0 0 10px;
}
.map-modal-body {
  font-size: 13px; color: var(--text-dim); line-height: 1.65; margin: 0 0 12px;
}
.map-modal-heroes {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.map-modal-hero-chip {
  background: rgba(244,197,107,.1);
  border: 1px solid rgba(244,197,107,.2);
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; color: var(--gold);
}
.map-modal-hakim {
  width: 100%; display: block;
  background: rgba(140,109,255,.1);
  border: 1px solid rgba(140,109,255,.3);
  border-radius: var(--r-md);
  color: var(--violet); font-size: 13px; font-weight: 700;
  padding: 12px; text-align: center;
  cursor: pointer; font-family: inherit;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.map-modal-hakim:hover, .map-modal-hakim:active {
  background: rgba(140,109,255,.18); transform: scale(0.98);
}
.map-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; color: var(--muted);
  font-family: inherit;
}

/* Map legend */
.map-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.map-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--muted);
}
.map-legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(244,197,107,.5);
}
.map-legend-dot.locked { background: rgba(255,255,255,.15); box-shadow: none; }

/* Map unlock progress bar */
.map-progress {
  padding: 10px 14px 4px;
  display: flex; align-items: center; gap: 10px;
}
.map-progress-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.map-progress-bar { flex: 1; height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; }
.map-progress-fill { height: 100%; border-radius: 2px; background: var(--gold); transition: width 0.6s ease; }

/* ==========================================================================
   Voice Mode Placeholder (Hakim page)
   ========================================================================== */

.hakim-voice-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(94,162,255,.07);
  border: 1px dashed rgba(94,162,255,.3);
  border-radius: var(--r-md);
  padding: 10px 14px;
  width: 100%; color: var(--muted); font-size: 12px;
  font-family: inherit; cursor: default;
  position: relative; overflow: hidden;
}
.hakim-voice-ico { font-size: 18px; }
.hakim-voice-text { flex: 1; text-align: left; }
.hakim-voice-text strong { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 2px; }
.hakim-voice-soon {
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(94,162,255,.12); color: var(--azure);
  border: 1px solid rgba(94,162,255,.25);
  border-radius: 20px; padding: 2px 8px;
}

/* ==========================================================================
   Lore Codex (rarity tiers + categories)
   ========================================================================== */

.lore-rarity {
  display: inline-block;
  font-size: 8px; font-weight: 900; letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px;
  margin-bottom: 6px;
}
.lore-rarity.common   { background: rgba(154,166,196,.12); color: var(--rarity-common); border: 1px solid rgba(154,166,196,.25); }
.lore-rarity.rare     { background: rgba(94,162,255,.1);   color: var(--rarity-rare);   border: 1px solid rgba(94,162,255,.25); }
.lore-rarity.legendary{ background: rgba(244,197,107,.12); color: var(--rarity-legend); border: 1px solid rgba(244,197,107,.3); }

.lore-category {
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px;
}

@keyframes lore-ink-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}
.lore-card.just-unlocked .lore-body {
  animation: lore-ink-reveal 0.8s ease-out both;
}

/* ==========================================================================
   Cinematic Onboarding — New 5-panel emotional flow
   ========================================================================== */

/* Welcome panel — centred title treatment */
.intro-welcome-title {
  margin-top: 36px;
}
.intro-welcome-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: 4px;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 8px;
}
.intro-welcome-h1 {
  font-size: 42px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 60%, var(--gold-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 0 0 10px;
}
.intro-welcome-sub {
  font-size: 14px; color: var(--text-dim); margin: 0;
  font-style: italic;
}

/* Hakim panel orb */
.intro-hakim-orb {
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, rgba(140,109,255,.35), rgba(4,5,11,.9));
  border: 1.5px solid rgba(140,109,255,.4);
  box-shadow: 0 0 28px rgba(140,109,255,.25);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  overflow: hidden;
}
.intro-hakim-orb img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
}
.intro-hakim-quote {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(140,109,255,.06);
  border-left: 2px solid rgba(140,109,255,.4);
  border-radius: 0 8px 8px 0;
}
.intro-hakim-quote p {
  margin: 0 0 4px;
  font-style: italic; font-size: 13px;
  color: var(--text-dim); line-height: 1.6;
}
.intro-hakim-quote span {
  font-size: 11px; color: var(--muted);
}

/* Keeper panel list */
.intro-keeper-list {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; flex-direction: column; gap: 14px;
}
.intro-keeper-list li {
  display: flex; align-items: flex-start; gap: 12px;
}
.intro-keeper-ico {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(244,197,107,.08);
  border: 1px solid rgba(244,197,107,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.intro-keeper-list strong {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 3px;
}
.intro-keeper-list p {
  margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5;
}

/* CTA copy second line */
.cta-copy + .cta-copy { margin-top: 8px; }

/* ── MOMENT 1: Hakim Appears ──────────────────────────────────── */
.ha-overlay {
  position: fixed; inset: 0; z-index: 9900;
  background: rgba(4,5,11,0.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 1.2s ease;
}
.ha-overlay.ha-visible { opacity: 1; pointer-events: auto; }
.ha-overlay.ha-exit { opacity: 0; transition: opacity 0.6s ease; }
.ha-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.ha-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 32px 24px; max-width: 340px;
  gap: 0;
}
.ha-verse {
  font-family: serif; font-size: 20px; color: var(--gold);
  opacity: 0; animation: ha-fade-up 1.2s ease 0.4s forwards;
  direction: rtl; letter-spacing: 0.5px;
}
.ha-verse-trans {
  font-size: 11px; color: var(--muted); letter-spacing: 0.8px;
  margin-top: 6px; margin-bottom: 28px;
  opacity: 0; animation: ha-fade-up 1s ease 0.9s forwards;
}
.ha-orb-wrap {
  margin-bottom: 20px;
  opacity: 0; animation: ha-emerge 1.8s ease 1.1s forwards;
}
.ha-orb {
  width: 88px; height: 88px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, rgba(140,109,255,.4), rgba(4,5,11,.95));
  border: 1.5px solid rgba(140,109,255,.5);
  box-shadow: 0 0 40px rgba(140,109,255,.3), 0 0 80px rgba(140,109,255,.12);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.ha-orb img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ha-orb-glyph {
  position: absolute; font-size: 36px;
  filter: drop-shadow(0 0 12px rgba(140,109,255,.6));
}
.ha-name {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--violet); margin-bottom: 20px;
  opacity: 0; animation: ha-fade-up 0.9s ease 1.5s forwards;
}
.ha-quote {
  font-size: 13px; line-height: 1.7; color: var(--text-dim);
  font-style: italic; min-height: 60px;
  opacity: 0; animation: ha-fade-up 0.9s ease 2.0s forwards;
}
.ha-skip {
  margin-top: 28px; padding: 10px 24px;
  background: transparent; border: 1px solid rgba(140,109,255,.3);
  border-radius: 24px; color: var(--muted); font-size: 12px;
  cursor: pointer; letter-spacing: 0.5px;
  opacity: 0; animation: ha-fade-up 0.8s ease 3.5s forwards;
  transition: border-color 0.2s, color 0.2s;
}
.ha-skip:hover { border-color: rgba(140,109,255,.6); color: var(--text); }
@keyframes ha-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ha-emerge {
  from { opacity: 0; transform: scale(0.75); filter: blur(12px); }
  to   { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ── MOMENT 2: Lore Discovery ─────────────────────────────────── */
.ld-overlay {
  position: fixed; inset: 0; z-index: 9800;
  background: rgba(4,5,11,0.88);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.9s ease;
}
.ld-overlay.ld-visible { opacity: 1; pointer-events: auto; }
.ld-overlay.ld-exit { opacity: 0; transition: opacity 0.5s ease; }
.ld-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.ld-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 36px 28px; max-width: 320px;
}
.ld-glow {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244,197,107,.15), transparent 70%);
  animation: ld-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ld-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.18); opacity: 1; }
}
.ld-kicker {
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
  opacity: 0; animation: ha-fade-up 0.8s ease 0.3s forwards;
}
.ld-title {
  font-size: 22px; font-weight: 700; color: var(--text);
  margin-bottom: 24px; line-height: 1.3;
  opacity: 0; animation: ha-fade-up 1s ease 0.6s forwards;
}
.ld-hakim {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  background: rgba(140,109,255,.06);
  border: 1px solid rgba(140,109,255,.2);
  border-radius: 12px; text-align: left; width: 100%;
  opacity: 0; animation: ha-fade-up 0.8s ease 0.9s forwards;
}
.ld-hakim-name {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--violet);
}
.ld-hakim-words {
  font-size: 12px; color: var(--text-dim); line-height: 1.6;
  font-style: italic; min-height: 40px;
}
.ld-skip {
  margin-top: 24px; padding: 10px 24px;
  background: rgba(244,197,107,.08); border: 1px solid rgba(244,197,107,.28);
  border-radius: 24px; color: var(--gold); font-size: 12px;
  cursor: pointer; letter-spacing: 0.5px;
  opacity: 0; animation: ha-fade-up 0.8s ease 1.8s forwards;
  transition: background 0.2s;
}
.ld-skip:hover { background: rgba(244,197,107,.14); }

/* ── MOMENT 3: Damavand Memory ────────────────────────────────── */
.dm-overlay {
  position: fixed; inset: 0; z-index: 9700;
  background: linear-gradient(180deg, #020408 0%, #071018 60%, #0a1a28 100%);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 1.4s ease;
}
.dm-overlay.dm-visible { opacity: 1; pointer-events: auto; }
.dm-overlay.dm-exit { opacity: 0; transition: opacity 0.6s ease; }
.dm-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.dm-mountain {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; height: 65%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 260'%3E%3Cpolygon points='200,0 350,260 50,260' fill='%23060d16'/%3E%3Cpolygon points='200,10 310,260 90,260' fill='%23040a12'/%3E%3C/svg%3E") center bottom / contain no-repeat;
  opacity: 0; animation: dm-rise 3s ease 0.6s forwards;
}
@keyframes dm-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to   { opacity: 0.7; transform: translateX(-50%) translateY(0); }
}
.dm-fog-layer {
  position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(to top, rgba(160,185,200,.06) 0%, transparent 100%);
  animation: dm-fog-drift 8s ease-in-out infinite alternate;
}
@keyframes dm-fog-drift {
  from { opacity: 0.4; transform: scaleX(1); }
  to   { opacity: 0.9; transform: scaleX(1.05); }
}
.dm-content {
  position: relative; z-index: 1;
  padding: 0 28px 52px; max-width: 340px; text-align: center;
}
.dm-kicker {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--azure); margin-bottom: 6px;
  opacity: 0; animation: ha-fade-up 1s ease 0.8s forwards;
}
.dm-subtitle {
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 28px;
  opacity: 0; animation: ha-fade-up 0.9s ease 1.1s forwards;
}
.dm-narration {
  font-size: 13px; line-height: 1.75; color: var(--text-dim);
  font-style: italic; min-height: 80px; margin-bottom: 28px;
  opacity: 0; animation: ha-fade-up 0.9s ease 1.4s forwards;
}
.dm-skip {
  padding: 10px 24px;
  background: transparent; border: 1px solid rgba(94,162,255,.25);
  border-radius: 24px; color: var(--muted); font-size: 12px;
  cursor: pointer; letter-spacing: 0.5px;
  opacity: 0; animation: ha-fade-up 0.8s ease 4s forwards;
  transition: border-color 0.2s, color 0.2s;
}
.dm-skip:hover { border-color: rgba(94,162,255,.5); color: var(--text); }

/* ── LORE WHISPERS ────────────────────────────────────────────── */
.lore-whisper {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 1.2px;
  color: rgba(140,109,255,.35);
  pointer-events: none; z-index: 2;
  white-space: nowrap; text-align: center;
  opacity: 0;
}
.lore-whisper-in {
  animation: whisper-in 1.8s ease forwards;
}
.lore-whisper-out {
  animation: whisper-out 1.8s ease forwards;
}
@keyframes whisper-in {
  from { opacity: 0; letter-spacing: 2.5px; }
  to   { opacity: 1; letter-spacing: 1.2px; }
}
@keyframes whisper-out {
  from { opacity: 1; letter-spacing: 1.2px; }
  to   { opacity: 0; letter-spacing: 0.2px; }
}

/* ── OFFERINGS PAGE ───────────────────────────────────────────── */
.offerings-hero {
  text-align: center; padding: 28px 0 8px;
}
.offerings-flame {
  font-size: 48px; line-height: 1;
  filter: drop-shadow(0 0 18px rgba(255,138,61,.55));
  animation: flame-breathe 3.2s ease-in-out infinite;
}
@keyframes flame-breathe {
  0%, 100% { transform: scaleY(1) scaleX(1); filter: drop-shadow(0 0 18px rgba(255,138,61,.55)); }
  50%       { transform: scaleY(1.06) scaleX(0.97); filter: drop-shadow(0 0 30px rgba(255,138,61,.8)); }
}
.offerings-title {
  font-size: 20px; font-weight: 700; color: var(--text); margin-top: 14px;
}
.offerings-sub {
  font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6;
}
.offerings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 0 4px;
}
.offering-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.offering-card:hover { border-color: var(--border-gold); box-shadow: var(--glow-gold); }
.offering-card.offering-featured {
  grid-column: 1 / -1;
  border-color: rgba(244,197,107,.25);
  background: linear-gradient(135deg, rgba(244,197,107,.06), rgba(140,109,255,.04));
}
.offering-ico { font-size: 28px; line-height: 1; }
.offering-name { font-size: 13px; font-weight: 700; color: var(--text); }
.offering-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }
.offering-cost {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--gold);
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.offering-cost-ico { font-size: 14px; }
.offering-btn {
  width: 100%; padding: 9px; border-radius: var(--r-sm);
  background: rgba(244,197,107,.1); border: 1px solid rgba(244,197,107,.25);
  color: var(--gold); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
  letter-spacing: 0.3px;
}
.offering-btn:hover { background: rgba(244,197,107,.18); }
.offerings-hakim-quote {
  margin: 8px 4px 0;
  padding: 14px 16px;
  background: rgba(140,109,255,.05);
  border-left: 2px solid rgba(140,109,255,.3);
  border-radius: 0 10px 10px 0;
  font-size: 12px; color: var(--muted); line-height: 1.65;
  font-style: italic;
}


/* ── Final Encounter card ──────────────────────────────────────────────── */
.fe-card {
  border-radius: 14px;
  padding: 16px;
  margin: 10px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(14,18,40,.6);
}
.fe-card.fe-locked {
  border-color: rgba(255,255,255,.07);
  opacity: .88;
}
.fe-card.fe-active {
  border-color: rgba(244,197,107,.35);
  background: linear-gradient(140deg, rgba(30,22,4,.7) 0%, rgba(20,14,2,.6) 100%);
  box-shadow: 0 0 28px rgba(244,197,107,.07) inset;
}
.fe-card.fe-complete {
  border-color: rgba(74,216,166,.3);
  background: linear-gradient(140deg, rgba(4,26,18,.65) 0%, rgba(2,14,10,.6) 100%);
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.fe-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.fe-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
.fe-body { flex: 1; }
.fe-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted, #6c7287);
  margin-bottom: 3px;
}
.fe-card.fe-active  .fe-kicker { color: rgba(244,197,107,.7); }
.fe-card.fe-complete .fe-kicker { color: rgba(74,216,166,.7); }
.fe-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #e8eaf0);
}
.fe-sub {
  font-size: 12px;
  color: rgba(74,216,166,.8);
  margin-top: 4px;
}
.fe-reqs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fe-req {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted, #6c7287);
}
.fe-req.fe-done { color: var(--text, #e8eaf0); }
.fe-check {
  font-size: 11px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.fe-req.fe-done .fe-check { color: rgba(74,216,166,.9); }
.fe-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  background: linear-gradient(135deg, #c9a227 0%, #f4c542 60%, #d4a017 100%);
  color: #0a0800;
  box-shadow: 0 2px 18px rgba(244,197,107,.35);
  transition: opacity .15s, transform .1s;
}
.fe-btn:active:not(:disabled) { transform: scale(.97); }
.fe-btn.fe-btn-locked {
  background: rgba(255,255,255,.06);
  color: var(--muted, #6c7287);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
  cursor: not-allowed;
  font-weight: 500;
  letter-spacing: 0;
}

/* ── Daily Check-in ─────────────────────────────────────────────────── */
.checkin-card { padding: 14px; }
.checkin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.checkin-streak {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.ci-streak-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}
.ci-streak-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.checkin-btn {
  flex: 1;
  font-size: 13px;
  padding: 10px 12px;
}
.checkin-btn.ci-claimed {
  background: rgba(255,255,255,.06);
  color: var(--muted);
  border-color: rgba(255,255,255,.1);
  box-shadow: none;
  cursor: default;
}
.checkin-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.checkin-days::-webkit-scrollbar { display: none; }
.ci-day {
  flex: 0 0 calc(14.28% - 6px);
  min-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: 7px 4px;
  transition: border-color .2s, background .2s;
}
.ci-day.ci-done {
  background: rgba(83,215,156,.1);
  border-color: rgba(83,215,156,.35);
}
.ci-day.ci-active {
  background: rgba(244,197,107,.12);
  border-color: rgba(244,197,107,.5);
  box-shadow: 0 0 10px rgba(244,197,107,.15);
}
.ci-ico {
  font-size: 14px;
  font-weight: 900;
  color: var(--muted);
  line-height: 1;
}
.ci-day.ci-done  .ci-ico { color: var(--jade, #53d79c); }
.ci-day.ci-active .ci-ico { color: var(--gold); }
.ci-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ci-val { font-size: 9px; font-weight: 700; color: var(--text-dim); text-align: center; line-height: 1.2; }
.ci-day.ci-active .ci-val { color: var(--gold); }

/* ── Social Tasks & Partner rows ─────────────────────────────────────── */
.task-list, .partner-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.task-ico {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.task-body { flex: 1; min-width: 0; }
.task-label { font-size: 13px; font-weight: 700; color: var(--text); }
.task-reward {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.task-action { flex-shrink: 0; }
.task-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.task-btn:active { opacity: .8; }
.task-go {
  background: linear-gradient(135deg, var(--violet), #5ea2ff);
  color: #fff;
}
.task-pending {
  background: rgba(255,255,255,.08);
  color: var(--muted);
  cursor: not-allowed;
}
.task-check {
  background: linear-gradient(135deg, var(--jade, #53d79c), #3cb87c);
  color: #021a0b;
  font-weight: 800;
}
.task-done {
  background: rgba(83,215,156,.12);
  color: var(--jade, #53d79c);
  border: 1px solid rgba(83,215,156,.3);
  cursor: default;
}
.partner-row { align-items: flex-start; }
.partner-row .task-body { padding-top: 2px; }

/* ── Milestone claim button ─────────────────────────────────────────── */
.milestone.ms-reachable {
  border-color: rgba(83, 215, 156, .5);
  box-shadow: 0 0 12px rgba(83, 215, 156, .12);
}
.ms-claim-btn {
  margin-top: 10px;
  width: 100%;
  background: linear-gradient(135deg, var(--jade, #53d79c), #3cb87c);
  color: #02150a;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  padding: 9px 0;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: .3px;
}
.ms-claim-btn:active { opacity: .85; }

/* ── My Clan section ─────────────────────────────────────────────────── */
.clan-list { padding: 0; }
.clan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.clan-row:last-child { border-bottom: none; }
.clan-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(140,109,255,.4), rgba(94,162,255,.3));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.clan-info { flex: 1; min-width: 0; }
.clan-name { font-size: 13px; font-weight: 700; color: var(--text); }
.clan-stats { font-size: 11px; color: var(--muted); margin-top: 2px; }
.clan-tag {
  font-size: 10px; font-weight: 700; padding: 3px 7px;
  border-radius: 6px; white-space: nowrap; flex-shrink: 0;
}
.clan-verified {
  background: rgba(83,215,156,.18);
  border: 1px solid rgba(83,215,156,.4);
  color: var(--jade, #53d79c);
}
.clan-pending {
  background: rgba(244,197,107,.10);
  border: 1px solid rgba(244,197,107,.28);
  color: var(--gold);
}
.clan-empty {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* ── Social Hub: LIVE pill states ───────────────────────────────────── */
.pill.live-off {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.pill.live-off::before {
  background: var(--muted);
  box-shadow: none;
}

/* ── Social Hub: current-user leaderboard row ───────────────────────── */
.lb-row.lb-me {
  background: rgba(244, 197, 107, 0.06);
  border-radius: var(--r-sm, 8px);
}
.you-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Social Hub: skeleton loading rows ──────────────────────────────── */
@keyframes skel-shimmer {
  0%   { opacity: 0.3; }
  50%  { opacity: 0.7; }
  100% { opacity: 0.3; }
}
.skel {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  animation: skel-shimmer 1.4s ease-in-out infinite;
  display: inline-block;
}
.skel-name { width: 110px; height: 12px; }
.skel-sub  { width: 70px;  height: 10px; margin-top: 4px; }
.skel-pts  { width: 60px;  height: 12px; }

/* ── Adsgram Watch & Earn ────────────────────────────────────────────── */
.adsgram-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.adsgram-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.adt-left { flex: 1; min-width: 0; }
.adt-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  border-radius: 5px;
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 4px;
}
.bronze-badge {
  background: rgba(205,127,50,.22);
  border: 1px solid rgba(205,127,50,.45);
  color: #cd7f32;
}
.silver-badge {
  background: rgba(192,192,192,.18);
  border: 1px solid rgba(192,192,192,.4);
  color: #c0c0c0;
}
.gold-badge {
  background: rgba(244,197,107,.18);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}
.adt-reward {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.adt-duration {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.adt-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.adt-btn {
  font-size: 13px;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  padding: 8px 20px;
  cursor: pointer;
  letter-spacing: .3px;
  transition: opacity .2s, transform .1s;
  white-space: nowrap;
}
.adt-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}
.adt-btn:not(:disabled):active { transform: scale(.96); }
.bronze-btn {
  background: linear-gradient(135deg, #8b5e30, #cd7f32);
  color: #fff;
}
.silver-btn {
  background: linear-gradient(135deg, #6e6e6e, #c0c0c0);
  color: #111;
}
.gold-btn {
  background: linear-gradient(135deg, var(--gold), #f5a623);
  color: #1a1200;
}
.adt-cooldown {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.bronze-tier { border-left: 2px solid #cd7f32; }
.silver-tier { border-left: 2px solid #c0c0c0; }
.gold-tier   { border-left: 2px solid var(--gold); }

/* ── Global economy icon helpers ─────────────────────────────────────── */
/* REAL token — use actual token image wherever supported */
.real-coin,
.real-tok-img {
  display: inline-block;
  width: 16px; height: 16px;
  vertical-align: middle;
  object-fit: contain;
  margin: 0 2px;
}
.real-coin {
  background: url('/assets/images/tokens/realtoken.png') center / contain no-repeat;
  font-size: 0; /* hide any text inside the <i> */
}
.real-ico {
  display: inline-block; font-style: normal; font-weight: 900;
  color: #f4c542; text-shadow: 0 0 8px rgba(244,197,107,.5);
  letter-spacing: 0; margin-right: 2px; font-size: .95em;
}
.zar-ico {
  display: inline-block; font-style: normal;
  font-size: .88em; margin-right: 2px; vertical-align: middle;
}

/* ── Profile Page ────────────────────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 8px;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(244,197,107,.28), rgba(140,109,255,.2));
  border: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-identity { flex: 1; min-width: 0; }
.profile-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-username {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.profile-path-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--violet);
  border: 1px solid var(--border-violet);
  background: rgba(140,109,255,.12);
  border-radius: 999px;
  padding: 3px 10px;
}
.profile-path-tag.hero    { color: var(--gold);   border-color: var(--border-gold);   background: rgba(244,197,107,.1); }
.profile-path-tag.heroine { color: #ff82b0;        border-color: rgba(255,130,176,.35); background: rgba(255,130,176,.1); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-card {
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-ico { font-size: 18px; line-height: 1; }
.stat-val { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-lbl { font-size: 11px; color: var(--muted); }

/* Badge grid */
.badge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.badge-card {
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: border-color .2s;
}
.badge-card.earned {
  border-color: var(--border-gold);
  background: linear-gradient(160deg, rgba(244,197,107,.09), rgba(255,255,255,0));
}
.badge-ico-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.badge-card.earned .badge-ico-wrap {
  background: rgba(244,197,107,.16);
  box-shadow: 0 0 12px rgba(244,197,107,.18);
}
.badge-card.locked-badge .badge-ico-wrap { opacity: 0.35; }
.badge-name { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.2; }
.badge-card.locked-badge .badge-name { color: var(--muted); }
.badge-desc { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.badge-earned-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 3px;
  letter-spacing: 0.3px;
}

/* ── Back button (profile page) ─────────────────────────────────────── */
.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}
.back-btn:hover, .back-btn:active { color: var(--text); }

/* ── Clan modal overlay ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(4, 5, 11, 0.82);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-sheet {
  background: linear-gradient(180deg, rgba(18,24,52,.98), rgba(10,14,36,.99));
  border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 24px 20px calc(max(36px, env(safe-area-inset-bottom, 0px) + 20px));
  width: 100%;
  max-width: 480px;
  animation: sheet-up .22s cubic-bezier(.22,1,.36,1);
}
@keyframes sheet-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-close {
  background: rgba(255,255,255,.07);
  border: none;
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: grid; place-items: center;
}
.modal-desc { font-size: 12px; color: var(--muted); margin: 0 0 18px; }
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.modal-required { color: var(--ember); }
.modal-input-wrap { position: relative; }
.modal-input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 36px 10px 12px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.modal-input:focus { border-color: var(--border-gold); }
.name-check-icon {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.name-check-msg { font-size: 11px; margin-top: 5px; min-height: 16px; }
.name-check-msg.ok    { color: var(--jade); }
.name-check-msg.error { color: var(--ember); }
.name-check-msg.muted { color: var(--muted); }
.modal-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 6px;
  padding: 10px 14px;
  background: rgba(244,197,107,.07);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-sm);
}
.modal-cost-lbl { font-size: 12px; color: var(--muted); }
.modal-cost-val { font-size: 14px; font-weight: 800; color: var(--gold); }
.modal-balance-row { font-size: 12px; color: var(--muted); margin-bottom: 18px; }

/* ── Clan cards on Social page ───────────────────────────────────────── */
.clan-founded-card { padding: 16px; }
.clan-founded-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.clan-badge-large {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(244,197,107,.28), rgba(140,109,255,.2));
  border: 2px solid var(--border-gold);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: var(--gold);
  flex-shrink: 0;
}
.clan-founded-name { font-size: 16px; font-weight: 800; color: var(--text); }
.clan-founded-motto { font-size: 11px; color: var(--muted); margin-top: 3px; font-style: italic; }
.clan-founded-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.clan-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.clan-stat-ico  { font-size: 14px; }
.clan-stat-val  { font-size: 13px; font-weight: 700; color: var(--text); }
.clan-stat-lbl  { font-size: 10px; color: var(--muted); text-align: center; }
.clan-leader-tag { font-size: 10px; color: var(--gold); }

/* Clan photo on profile */
.clan-photo-img {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--border-gold, rgba(244,197,107,.3));
}
.clan-photo-upload-btn {
  position: absolute;
  bottom: -4px; right: -4px;
  background: var(--card-bg, #14162a);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; line-height: 1;
}
.clan-avatar-wrap .clan-badge-large {
  width: 48px; height: 48px;
  border-radius: 10px;
  font-size: 22px;
}
.clan-create-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-top: 10px;
}
.clan-cta-left { display: flex; align-items: center; gap: 12px; }
.clan-cta-ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(244,197,107,.1);
  border: 1px solid var(--border-gold);
  display: grid; place-items: center;
  font-size: 16px;
}
.clan-cta-title { font-size: 13px; font-weight: 700; color: var(--text); }
.clan-cta-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Browse Clans ────────────────────────────────────────────────────── */
.clan-browse-list  { padding: 0; }
.clan-browse-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.clan-browse-row:last-child { border-bottom: none; }
.clan-browse-rank {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  min-width: 18px;
  text-align: center;
}
.clan-rank-1 .clan-browse-rank { color: var(--gold); }
.clan-rank-2 .clan-browse-rank { color: #aaa; }
.clan-rank-3 .clan-browse-rank { color: #c87d3a; }
.clan-browse-badge-lg {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(244,197,107,.22), rgba(255,138,61,.14));
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}
.clan-browse-info { flex: 1; min-width: 0; }
.clan-browse-name { font-size: 13px; font-weight: 700; color: var(--text); }
.clan-browse-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.clan-browse-action { flex-shrink: 0; }

/* ── Leader Dashboard ────────────────────────────────────────────────── */
.clan-leader-tag {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  margin-top: 4px;
}
.clan-app-row { align-items: center; }

/* ── REAL Balance Card ────────────────────────────────────────────────── */
.real-balance-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px;
  background: linear-gradient(135deg, rgba(244,197,107,.10) 0%, rgba(140,109,255,.07) 100%);
  border-color: var(--border-gold);
  box-shadow: 0 0 24px rgba(244,197,107,.12), inset 0 0 0 1px rgba(244,197,107,.18);
}
.rbc-glow {
  position: absolute;
  top: -30px; right: -20px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,197,107,.18) 0%, transparent 70%);
  pointer-events: none;
}
.rbc-left { display: flex; flex-direction: column; gap: 4px; }
.rbc-label { font-size: 11px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.rbc-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.rbc-clan-bonus {
  font-size: 11px;
  color: #5ea2ff;
  font-weight: 600;
  margin-top: 2px;
}
.rbc-token {
  width: 64px;
  height: 64px;
  object-fit: contain;
  opacity: .92;
  filter: drop-shadow(0 0 10px rgba(244,197,107,.35));
}

/* ── Earnings Meter ───────────────────────────────────────────────────── */
.earnings-meter-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.em-row { display: flex; align-items: center; justify-content: space-between; }
.em-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.em-live-val {
  font-size: 20px;
  font-weight: 700;
  color: #5ea2ff;
  font-variant-numeric: tabular-nums;
}
.em-divider { height: 1px; background: rgba(255,255,255,.07); margin: 0 -2px; }
.em-sub-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.em-sub-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ── Stat clan bonus line ─────────────────────────────────────────────── */
.stat-clan-bonus {
  font-size: 9px;
  color: #5ea2ff;
  font-weight: 600;
  margin-top: 1px;
  text-align: center;
  white-space: nowrap;
}

/* ── Rich Warrior badge token image ──────────────────────────────────── */
.badge-token-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(244,197,107,.4));
}

/* ── Offline Mining Bonus Banner ─────────────────────────────────────── */
#real-offline-bonus {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 420px;
  animation: rob-slidein 0.35s cubic-bezier(.22,1,.36,1) both;
}
@keyframes rob-slidein {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.rob-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(20,22,38,.97) 0%, rgba(30,32,50,.97) 100%);
  border: 1px solid rgba(94,162,255,.35);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 0 0 1px rgba(94,162,255,.12);
  backdrop-filter: blur(12px);
}
.rob-ico {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.rob-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rob-text strong {
  font-size: 13px;
  font-weight: 800;
  color: #5ea2ff;
  letter-spacing: .02em;
}
.rob-text span {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #e8e8f0);
}
.rob-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: var(--muted, #6c7287);
  font-size: 13px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.rob-close:hover { background: rgba(255,255,255,.14); color: var(--text, #e8e8f0); }

/* ── TrustAI Verified Human badge ────────────────────────────────────── */
.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.trustai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #3ef0c0;
  background: rgba(62,240,192,.12);
  border: 1px solid rgba(62,240,192,.35);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Clan action row (Share + Chat buttons) ──────────────────────────── */
.clan-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ── Clan button system ──────────────────────────────────────────────── */
.clan-btn {
  border: 0;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.clan-btn:active { transform: scale(0.96); }
.clan-btn:disabled { opacity: 0.5; pointer-events: none; }

/* Apply — gold-tinted, compact */
.clan-btn-apply {
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(244,197,107,.14), rgba(244,197,107,.07));
  color: var(--gold);
  border: 1px solid var(--border-gold);
}
.clan-btn-apply:hover { background: rgba(244,197,107,.22); }

/* Chat — teal social */
.clan-btn-chat {
  background: linear-gradient(135deg, rgba(75,224,196,.14), rgba(75,224,196,.06));
  color: var(--teal);
  border: 1px solid rgba(75,224,196,.32);
  flex: 1;
  min-width: 0;
}
.clan-btn-chat:hover { background: rgba(75,224,196,.22); filter: brightness(1.06); }
.clan-btn-chat:active { background: rgba(75,224,196,.28); }

/* Share — azure/violet gradient */
.clan-btn-share {
  background: linear-gradient(135deg, rgba(94,162,255,.12), rgba(140,109,255,.1));
  color: var(--azure);
  border: 1px solid rgba(94,162,255,.3);
  flex: 1;
  min-width: 0;
}
.clan-btn-share:hover { filter: brightness(1.1); }

/* Manage — ember leader authority */
.clan-btn-manage {
  background: linear-gradient(135deg, rgba(255,138,61,.12), rgba(255,82,103,.07));
  color: var(--ember);
  border: 1px solid rgba(255,138,61,.32);
  width: 100%;
  margin-top: 10px;
  box-shadow: 0 2px 10px rgba(255,138,61,.1);
}
.clan-btn-manage:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(255,138,61,.2); }
.clan-btn-manage.is-open {
  background: rgba(255,82,103,.1);
  color: var(--crimson);
  border-color: rgba(255,82,103,.32);
  box-shadow: none;
}

/* Accept — jade confirm */
.clan-btn-accept {
  background: linear-gradient(135deg, rgba(83,215,156,.15), rgba(75,224,196,.08));
  color: var(--jade);
  border: 1px solid rgba(83,215,156,.32);
  flex: 1;
}
.clan-btn-accept:hover { filter: brightness(1.1); }

/* Decline — crimson danger */
.clan-btn-decline {
  background: rgba(255,82,103,.08);
  color: var(--crimson);
  border: 1px solid rgba(255,82,103,.25);
  flex: 1;
}
.clan-btn-decline:hover { background: rgba(255,82,103,.16); }

/* Join — full gold primary (profile invite inbox) */
.clan-btn-join {
  background: linear-gradient(140deg, var(--gold-2) 0%, var(--gold) 60%, var(--gold-3) 100%);
  color: #28190a;
  box-shadow: 0 4px 14px rgba(244,197,107,.28), inset 0 1px 0 rgba(255,255,255,.35);
  flex: 1;
}
.clan-btn-join:hover { transform: translateY(-1px); filter: brightness(1.05); }
.clan-btn-join:active { transform: translateY(1px); box-shadow: none; }

/* Decline soft — muted, hover reveals red */
.clan-btn-decline-soft {
  background: rgba(255,255,255,.04);
  color: var(--muted);
  border: 1px solid var(--border);
  flex: 1;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.clan-btn-decline-soft:hover {
  background: rgba(255,82,103,.1);
  color: var(--crimson);
  border-color: rgba(255,82,103,.28);
}

/* Invite-to-clan button on visitor profile */
.clan-btn-invite {
  background: linear-gradient(135deg, rgba(140,109,255,.14), rgba(94,162,255,.1));
  color: var(--violet);
  border: 1px solid var(--border-violet);
  white-space: nowrap;
  font-size: 11px;
  padding: 7px 13px;
  border-radius: 10px;
}
.clan-btn-invite:hover { filter: brightness(1.1); }
.clan-btn-invite:disabled { opacity: 0.6; }

/* Browse badges — status pills */
.clan-browse-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.clan-browse-badge.mine    { background: rgba(244,197,107,.15); color: var(--gold);   border: 1px solid var(--border-gold); }
.clan-browse-badge.taken   { background: rgba(255,255,255,.05); color: var(--muted);  border: 1px solid var(--border); }
.clan-browse-badge.pending { background: rgba(140,109,255,.13); color: #a989ff;       border: 1px solid var(--border-violet); }

/* ── Clan mining power stat ──────────────────────────────────────────── */
.clan-power-stat {
  color: #f4c56b;
  font-weight: 700;
}

/* ── Clan settings label ─────────────────────────────────────────────── */
.clan-setting-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

/* ── Leader Dashboard slide-down panel ───────────────────────────────── */
.leader-dashboard-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .35s ease, opacity .25s ease;
}
.leader-dashboard-panel.open {
  max-height: 2000px;
  opacity: 1;
}

/* ── Activity feed scroll cap ─────────────────────────────────────────── */
#activity-feed { max-height: 320px; overflow-y: auto; }

/* ── Clickable event cards ───────────────────────────────────────────── */
.event-card { cursor: pointer; transition: background .15s; position: relative; }
.event-card:active { background: rgba(255,255,255,.05); }
.event-chevron {
  font-size: 18px;
  color: var(--muted);
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
}

/* ── Event detail modal ──────────────────────────────────────────────── */
.event-modal-sheet {
  max-height: 85vh;
  overflow-y: auto;
}
.event-progress-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 6px;
}
.event-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  border-radius: 4px;
  transition: width .4s ease;
  min-width: 4px;
}
.event-progress-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}
.event-chapter-list { display: flex; flex-direction: column; gap: 6px; }
.event-chapter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.event-chapter-check {
  width: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
}
.event-chapter-row.done { color: var(--text); }
.event-chapter-row.done .event-chapter-check { color: var(--gold); font-weight: 700; }

/* ── Player Medallion Badge (top-bar) ────────────────────────────────── */
.player-medallion {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(244,197,107,.5));
}

/* ── Hero Spotlight — 3-card horizontal row ──────────────────────────── */
.hs-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.hs-row::-webkit-scrollbar { display: none; }
.hs-card {
  flex: 0 0 calc(50% - 5px);
  min-width: 150px;
  background: linear-gradient(140deg, rgba(16,22,52,.9), rgba(10,14,36,.95));
  border: 1px solid rgba(244,197,107,.2);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hs-card .hs-portrait {
  width: 48px; height: 48px; border-radius: 10px;
  background: linear-gradient(140deg, rgba(244,197,107,.18), rgba(140,109,255,.14));
  border: 1px solid var(--border-gold);
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.hs-card .hs-portrait img { width: 100%; height: 100%; object-fit: cover; }
.hs-card .hs-body { flex: 1; min-width: 0; }
.hs-card .hs-kicker { font-size: 9px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.hs-card .hs-name { font-size: 13px; font-weight: 800; margin: 2px 0 5px; }
.hs-card .hs-passive {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--jade); font-weight: 600;
  background: rgba(83,215,156,.1); border: 1px solid rgba(83,215,156,.25);
  border-radius: 20px; padding: 2px 8px;
}
.hs-card .hs-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; flex-shrink: 0; }
.hs-lvl-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.hs-lvl-num { font-size: 18px; font-weight: 800; color: var(--gold); line-height: 1.1; }
.hs-upgrade-link { font-size: 10px; color: var(--violet); text-decoration: none; margin-top: 4px; }
.hs-empty { padding: 14px; color: var(--muted); font-size: 12px; text-align: center; }

/* ── REAL token badge (Treasury HUD) ─────────────────────────────────── */
.r-real-token-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}
.real-tok-svg {
  display: block;
  filter: drop-shadow(0 0 5px rgba(244,197,107,.5));
}
.r-real-chain {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(94,162,255,.6);
  text-transform: uppercase;
}

/* ── Task reward modal ─────────────────────────────────────────────────── */
.trm-amount {
  font-size: 28px;
  font-weight: 900;
  color: #f4c56b;
  text-shadow: 0 0 28px rgba(244,197,107,.55);
  margin: 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.trm-bonus {
  font-size: 15px;
  font-weight: 700;
  color: var(--jade, #4ad8a6);
  margin: 4px 0;
}

/* ── Leaderboard + clan member avatars ────────────────────────────────── */
.lb-avatar, .lb-avatar-init {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(244,197,107,.25);
}
.lb-avatar-init {
  background: linear-gradient(135deg, rgba(244,197,107,.25), rgba(140,109,255,.2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--gold, #f4c56b);
}
.lb-player-link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.clan-avatar-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
