:root {
  --gold: #c9a24b;
  --gold-bright: #f0cf7a;
  --bg-deep: #0a0906;
  --bg-panel: rgba(20, 18, 14, 0.22);
  --border: rgba(240, 207, 122, 0.22);
  --text-dim: #b8ac91;
  --radius: 16px;
}

#light-layer { position: fixed; inset: 0; pointer-events: none; z-index: 999; }
.cursor-light {
  position: fixed;
  width: 260px; height: 260px;
  margin-left: -130px; margin-top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,207,122,0.08), transparent 70%);
  pointer-events: none;
}

#main {
  position: relative;
  z-index: 0; /* establishes a stacking context so the negative z-index
                 background image paints above body's own background
                 instead of being hidden behind it (root cause of the
                 long-standing "background stays empty" bug) */
  min-height: 100vh;
  padding: 32px 24px 48px;
}

.main-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  z-index: -2;
  filter: brightness(1.08) saturate(1.1) contrast(1.02);
}

.main-bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at top, rgba(0,0,0,0.05), rgba(0,0,0,0.35) 70%),
    linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.4));
}

.left-panel, .right-panel { display: flex; flex-direction: column; gap: 16px; }
.center-panel { display: flex; flex-direction: column; gap: 16px; }

.widget h2 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-badge { display: inline-flex; width: 15px; height: 15px; }
.icon-badge svg { width: 100%; height: 100%; fill: var(--gold); }

.widget .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.widget .row:last-child { border-bottom: none; }
.widget .row span:first-child { color: var(--text-dim); }
.widget .row span:last-child { color: var(--gold-bright); font-weight: 600; }

#rain { z-index: 0; opacity: 0.7; }

/* Light mode: lighter glass panels + darker text, background image untouched */
body.light-mode {
  --gold: #8a6a1e;
  --gold-bright: #6e5416;
  --text-dim: #5a5240;
  --border: rgba(60, 45, 10, 0.18);
  --bg-panel: rgba(255, 250, 235, 0.55);
  color: #2b2413;
}
body.light-mode .main-bg-overlay {
  background:
    radial-gradient(ellipse at top, rgba(255,255,255,0.12), rgba(255,255,255,0.32) 70%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.25));
}
body.light-mode .glass { border-color: rgba(60,45,10,0.18); }
body.light-mode .profile-box h1,
body.light-mode h1,
body.light-mode .corner-clock,
body.light-mode .nav-btn { color: #3a2e10; }
body.light-mode .profile-quote,
body.light-mode .tg-meta,
body.light-mode .friend-game,
body.light-mode .widget-error { color: #6b5f45; }
body.light-mode .corner-clock-date { color: #7a6d52; }
.bio-text { color: #c9bd9c; }
body.light-mode .bio-text { color: #4a4230; }

.lang-toggle {
  position: fixed;
  top: 18px;
  inset-inline-end: 20px;
  z-index: 50;
  padding: 6px 16px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, transform 0.15s;
}
.lang-toggle:hover { border-color: var(--gold); transform: translateY(-1px); }

/* Space for bottom mini-player */
#main { padding-bottom: 110px; }
@media (max-width: 760px) {
  #main { padding-bottom: 120px; }
}


/* Kill default blue mobile tap / focus flash */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}
button, a, .nav-btn, .playlist-item, .radio-card, .bg-swatch, .mnp-btn, .dp-btn {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
button:focus-visible, a:focus-visible, .nav-btn:focus-visible {
  outline: 1px solid rgba(240, 207, 122, 0.55);
  outline-offset: 2px;
}
/* Soft gold press feedback instead of blue flash */
.nav-btn:active, .playlist-item:active, .radio-card:active, .mnp-btn:active, .dp-btn:active {
  transform: scale(0.96);
  filter: brightness(1.15);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.intro-line .intro-fa {
  display: block;
  direction: rtl;
  unicode-bidi: isolate;
  font-size: 1.05em;
  margin-bottom: 12px; /* more gap before English */
  line-height: 1.55;
}
.intro-line .intro-en {
  display: block;
  direction: ltr; /* force LTR so badge stays at the END (right) */
  unicode-bidi: isolate;
  font-size: 0.72em;
  opacity: 0.88;
  letter-spacing: 0.015em;
  font-weight: 400;
  line-height: 1.5;
  max-width: min(92vw, 520px);
  margin-inline: auto;
  text-align: center;
}
.intro-line .intro-badge {
  display: inline-flex;
  flex-direction: row; /* 🕊 then flag, always left-to-right inside badge */
  direction: ltr;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  white-space: nowrap;
  margin-inline-start: 6px;
}
.intro-line .lion-sun-flag {
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
  object-fit: cover;
}
