:root {
  /* === Palette mirrored from root index.html (SHAMO) === */
  --bg: #08070A;
  --s: #0E0C14;
  --p: #131018;
  --p2: #18161F;
  --p3: #1E1B28;
  --bg-elevated: #18161F;
  --bg-grouped: #131018;

  --gold: #E8B84B;
  --gold2: #C8860A;
  --gold3: #F7E07A;
  --gold4: rgba(232, 184, 75, 0.12);

  --cream: #F5EDD8;
  --muted: rgba(245, 237, 216, 0.38);
  --muted2: rgba(245, 237, 216, 0.16);
  --muted3: rgba(245, 237, 216, 0.07);

  --text-primary: #F5EDD8;
  --text-secondary: rgba(245, 237, 216, 0.62);
  --text-tertiary: rgba(245, 237, 216, 0.38);

  --separator: rgba(255, 255, 255, 0.11);
  --separator-light: rgba(255, 255, 255, 0.06);

  --b: rgba(255, 255, 255, 0.06);
  --b2: rgba(255, 255, 255, 0.11);
  --b3: rgba(255, 255, 255, 0.18);

  /* Accent colors (kept iOS-tinted for system chips/icons) */
  --blue: #3B82F6;
  --green: #22C55E;
  --green2: #16A34A;
  --yellow: #ffcc00;
  --orange: #F97316;
  --red: #EF4444;
  --red2: #DC2626;
  --purple: #A855F7;
  --teal: #5ac8fa;
  --pink: #ff2d55;

  /* Ethiopian flag tricolor */
  --er: #E63946;
  --ey: #E8B84B;
  --eg: #22C55E;

  --tab-bar-bg: rgba(14, 12, 20, 0.92);
  --overlay-bg: rgba(0, 0, 0, 0.6);

  /* === Fonts mirrored from root index.html === */
  --font-system: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-accent: 'Playfair Display', Georgia, serif;
  --font-ethiopic: 'Noto Serif Ethiopic', 'Noto Sans Ethiopic', serif;

  /* iOS spacing & radii */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* Transition curves matching iOS */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  /* Disable browser scrollbars + bounce, allow only touch/finger scrolling */
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* IE/Edge legacy */
  overscroll-behavior: none;
  touch-action: pan-y;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;                    /* Chrome / Safari / Edge */
  width: 0;
  height: 0;
}
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
/* Smooth momentum scrolling on iOS */
body, .section, .ov, [data-scroll] {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.section {
  display: none;
  min-height: 100vh;
}

.active-section {
  display: block;
}

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

body {
  font-family: var(--font-system);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  position: relative;
  background-image:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(232, 184, 75, .07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 90%, rgba(34, 197, 94, .05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(168, 85, 247, .025) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Headings & display use Playfair Display */
h1, h2, h3, .hero-name, .section-title, .header-logo {
  font-family: var(--font-accent);
  color: var(--cream);
  letter-spacing: -0.01em;
}
.hero-name, .section-title { font-style: italic; }
.hero-name { color: var(--gold); }
.header-logo { color: var(--gold); letter-spacing: 0.18em; font-style: normal; font-weight: 700; }

/* Brand line moved to header bottom */

/* === SECTIONS (full-screen swappable) === */
.section {
  display: none;
  /* Match the header's full inset stack so content clears it in
     Telegram fullscreen (close/menu pill + device notch) */
  padding-top: calc(
    env(safe-area-inset-top, 0px)
    + var(--tg-safe-top, 0px)
    + var(--tg-content-top, 0px)
    + 110px
  );
  padding-bottom: 32px;
  padding-left: 16px;
  padding-right: 16px;
  animation: sectionIn 350ms var(--ease-spring) both;
}

.section.active-section {
  display: block;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.section-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === TOP HEADER === */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Telegram fullscreen: pad so the header background extends from the
     very top of the viewport (covering the traffic-light / status bar
     zone) while the actual header content sits below it */
  padding-top: calc(
    env(safe-area-inset-top, 0px)
    + var(--tg-safe-top, 0px)
    + var(--tg-content-top, 0px)
    + 16px
  );
  padding-bottom: 16px;
  padding-left: calc(
    20px
    + var(--tg-safe-left, 0px)
    + var(--tg-content-left, 0px)
  );
  padding-right: calc(
    20px
    + var(--tg-safe-right, 0px)
    + var(--tg-content-right, 0px)
  );
  background: rgba(8, 7, 10, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 0.5px solid var(--separator);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--red) 0%, var(--red) 33.333%,
    var(--yellow) 33.333%, var(--yellow) 66.666%,
    var(--green) 66.666%, var(--green) 100%
  );
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hdr-bal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.hdr-bal-amt {
  font-family: var(--font-accent);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.hdr-bal-lbl {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 1px;
}

.header-left {
  display: flex;
  align-items: center;
}

/* === BRAND (header) — mirrors root index.html .hdr-brand / .hdr-logo / .hdr-eth === */
.header-left { display: flex; align-items: center; }
.hdr-brand {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding-left: 2px;
  line-height: 1;
}
.header-logo, .hdr-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: var(--gold);
  background: linear-gradient(135deg, var(--gold3), var(--gold), var(--gold2));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  filter: drop-shadow(0 0 12px rgba(232, 184, 75, 0.25));
}
.hdr-eth {
  font-family: 'Noto Serif Ethiopic', 'Noto Sans Ethiopic', serif;
  font-size: 10px;
  color: var(--gold);
  opacity: .55;
  letter-spacing: 3px;
  margin-top: 3px;
}

/* === TICKER (Header Marquee) === */
.hdr-ticker {
  flex: 1;
  overflow: hidden;
  background: rgba(232, 184, 75, 0.04);
  border: 1px solid rgba(232, 184, 75, 0.1);
  border-radius: 100px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 12px;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
  animation: tickerPulse 1.6s ease infinite;
}

.ticker-inner {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-txt {
  display: inline-block;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.5px;
  font-family: var(--font-system);
  text-transform: uppercase;
  font-weight: 600;
  animation: tickerScroll 20s linear infinite;
  padding-left: 100%;
}

@keyframes tickerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* === PAGE LOADER (mirrors root index.html #loader) === */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity .55s ease;
  background-image:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(232, 184, 75, .07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 90%, rgba(34, 197, 94, .05) 0%, transparent 60%);
}
#loader.out {
  opacity: 0;
  pointer-events: none;
}
.ld-eth {
  font-family: 'Noto Serif Ethiopic', 'Noto Sans Ethiopic', serif;
  font-size: 72px;
  color: var(--gold);
  animation: ldpulse 1.4s ease infinite;
  filter: drop-shadow(0 0 24px rgba(232, 184, 75, .4));
}
.ld-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(232, 184, 75, .12);
  border-top-color: var(--gold);
  animation: spin .75s linear infinite;
}
.ld-txt {
  font-size: 9px;
  letter-spacing: 5px;
  color: var(--muted);
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
}
@keyframes ldpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(.9); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   LIVE GAME SECTION — mirrors root index.html .home-live-sec,
   .home-game-card, .stats-row, .feed-marquee, .feed-row
   ═══════════════════════════════════════════════════════ */

.live-section { padding: 70px 16px 24px; max-width: 680px; margin: 0 auto; }

.sec {
  font-size: 9px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 2px 10px;
  font-family: 'DM Mono', monospace;
}
.home-live-sec { margin-top: 4px; margin-bottom: 10px; }
.home-live-sec .home-live-label {
  color: var(--green);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-live-sec .home-live-label::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: livePulse 2s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.card {
  background: var(--p);
  border: 1px solid var(--b);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}
.card-shine {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
}

/* === Live game cards === */
.home-active-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.home-game-card {
  background: linear-gradient(145deg, var(--p), var(--p2));
  border: 1px solid var(--b2);
  border-top: 3px solid var(--card-brand-color, var(--gold));
  border-bottom: 3px solid var(--card-brand-color, var(--gold));
  border-radius: 18px;
  padding: 16px 14px 0;
  position: relative;
  overflow: hidden;
}
.home-game-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.home-game-card-logo-init {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 800; font-size: 1.2rem; flex-shrink: 0;
  border: 2.5px solid var(--card-brand-color, var(--gold));
  color: var(--card-brand-color, var(--gold));
  background: rgba(255,255,255,.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.home-game-card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--cream);
}
.home-game-card-sponsor {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}
.home-game-card-pool {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 2px;
  filter: drop-shadow(0 0 12px rgba(232, 184, 75, .25));
  line-height: 1;
}
.home-game-card-pool-lbl {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: 'DM Mono', monospace;
}
.home-game-card-live {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-family: 'DM Mono', monospace;
}
.home-game-card-live strong { color: var(--green); }
.home-game-card-countdown {
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
}
.home-game-card-divider {
  border: none;
  border-top: 1px solid var(--b2);
  margin: 10px 0 12px;
}
.home-game-card-footer {
  margin: 0 -14px;
  padding: 10px 14px 12px;
  border-top: 2px solid var(--card-brand-color, var(--b2));
  background: rgba(0,0,0,.15);
  border-radius: 0 0 15px 15px;
}
.home-game-card-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.home-game-card-btn.btn-scan {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #0A0800;
  box-shadow: 0 6px 24px rgba(232, 184, 75, .3);
}
.home-game-card-btn.btn-scan::before {
  content: '';
  position: absolute;
  top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  animation: btnShine 2.5s ease infinite;
}
.home-game-card-btn.btn-scan:active { transform: scale(.97); }
.home-game-card-btn.btn-attend {
  background: rgba(34, 197, 94, .15);
  border: 1px solid var(--green);
  color: var(--green);
}
@keyframes btnShine {
  0%   { left: -60%; }
  60%  { left: 120%; }
  100% { left: 120%; }
}

/* === Stats row === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.stat {
  padding: 12px 6px;
  text-align: center;
  border-radius: 12px;
  background: var(--p);
  border: 1px solid var(--b);
  position: relative;
  overflow: hidden;
}
.stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}
.stat-lbl {
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
  font-family: 'DM Mono', monospace;
}

/* === Recent Wins (Pro Style) === */
.feed-card {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  margin-top: 24px;
}

.feed-marquee-wrap {
  position: relative;
  overflow: hidden;
  height: 280px; /* Legacy Sync: 280px */
  margin-bottom: 14px;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.feed-marquee-inner {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Legacy Sync: 12px */
  animation: feedScroll 25s linear infinite;
}
@keyframes feedScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.feed-row {
  display: flex;
  align-items: center;
  gap: 12px; /* Legacy Sync */
  padding: 8px 12px;
  min-height: 44px;
  background: var(--p) !important;
  border: 1px solid var(--b) !important;
  border-radius: 12px;
  margin-bottom: 0 !important;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

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

.feed-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
}

.feed-row .card-shine {
  opacity: 0.12;
}

.feed-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 900;
  color: #0A0800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

.feed-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 2px;
}

.feed-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-amt {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, .25));
}

/* === NAV SPINNER (page transition overlay) === */
#navSpinner {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(8, 7, 10, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
#navSpinner.show {
  opacity: 1;
  pointer-events: auto;
}
#navSpinner .nav-spin-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(232, 184, 75, .15);
  border-top-color: var(--gold);
  animation: spin .7s linear infinite;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-balance {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--separator);
}

.header-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 0.5px solid var(--separator);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 180ms var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.header-profile:active {
  transform: scale(0.92);
  opacity: 0.75;
}

/* === iOS GROUP HEADERS === */
.ios-group-header {
  padding: 8px 20px 8px 20px;
  margin-top: 12px;
}

.section-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.ios-group-text {
  padding: 16px 20px;
}

.section-title {
  font-family: var(--font-accent);
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.2;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.body-text {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
}

/* === TAB BAR (bottom) === */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 6px 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  background: var(--tab-bar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--separator);
}

.tab-divider {
  width: 0.5px;
  height: 18px;
  background: var(--separator);
  align-self: center;
  opacity: 0.5;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-tertiary);
  transition: color 200ms var(--ease-smooth);
  padding: 4px 10px;
  min-width: 48px;
  -webkit-tap-highlight-color: transparent;
}

.tab-item svg {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
  transition: transform 200ms var(--ease-spring);
}

.tab-item:active svg {
  transform: scale(0.85);
}

.tab-item span {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.05px;
}

.tab-item.active {
  color: var(--blue);
}

/* === HERO SECTION === */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px 32px;
}

/* Avatar ring */
.avatar-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  margin-bottom: 24px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  font-size: 36px;
  color: var(--text-primary);
}

.hero-greeting {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 400;
}

.hero-name {
  font-family: var(--font-accent);
  font-size: clamp(36px, 8vw, 48px);
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 300px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 17px;
  font-weight: 500;
  font-family: var(--font-system);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 180ms var(--ease-spring);
  letter-spacing: -0.2px;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
  opacity: 0.85;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--blue);
  border: 1px solid var(--separator);
}

.btn-full {
  width: 100%;
}

/* === HERO STATS === */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  margin: 12px 20px 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--separator);
}

/* === IOS CARD GRID (About photo) === */
.ios-card-grid {
  display: flex;
  padding: 0 20px;
  margin-bottom: 0;
}

.ios-image-card {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e8d5c4 0%, #d4a574 100%);
}

/* === IOS LIST ITEMS (Skills) === */
.ios-card-list {
  margin: 0 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ios-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 56px;
  transition: background 150ms ease;
}

.ios-list-item:active {
  background: var(--separator-light);
}

.ios-list-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 60px;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--separator);
}

.ios-list-item {
  position: relative;
  border-bottom: 0.5px solid var(--separator);
}

.ios-list-item:last-child {
  border-bottom: none;
}

.item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.item-icon-blue { background: var(--blue); }
.item-icon-green { background: var(--green); }
.item-icon-orange { background: var(--orange); }
.item-icon-purple { background: var(--purple); }

.item-content {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1px;
}

.item-desc {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
}

.item-chevron svg {
  width: 100%;
  height: 100%;
}

/* === PROJECT CARDS === */
.project-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 20px;
}

.proj-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform 200ms var(--ease-spring);
}

.proj-card:active {
  transform: scale(0.98);
}

.proj-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  position: relative;
}

.proj-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.proj-overlay-tag {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.3px;
}

.proj-body {
  padding: 16px;
}

.proj-top-row {
  margin-bottom: 6px;
}

.proj-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.proj-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.proj-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.proj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.proj-chips span {
  font-size: 13px;
  padding: 4px 12px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.proj-actions {
  display: flex;
  gap: 10px;
}

.proj-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  flex: 1;
  justify-content: center;
  transition: all 180ms var(--ease-spring);
}

.proj-btn:active {
  transform: scale(0.96);
  opacity: 0.8;
}

.proj-btn-primary {
  background: var(--blue);
  color: #fff;
}

.proj-btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
}

/* === CONTACT FORM === */
.contact-card {
  margin: 0 20px;
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-system);
  font-size: 17px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.form-group textarea {
  resize: vertical;
  line-height: 1.55;
}

.form-status {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-secondary);
  min-height: 20px;
}

/* === SOCIAL LINKS === */
.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 32px 20px 8px;
}

.social-link {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 50%;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 180ms var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.social-link:active {
  background: var(--blue);
  color: #fff;
  transform: scale(0.92);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* === BOTTOM SPACER === */
.bottom-spacer {
  height: calc(83px + env(safe-area-inset-bottom));
}

/* === DESKTOP === */
@media (min-width: 768px) {
  .tab-bar {
    top: 66px;
    bottom: auto;
    border-top: none;
    border-bottom: 0.5px solid var(--separator);
    gap: 0;
    padding: 12px 32px;
    background: rgba(242, 242, 247, 0.85);
  }

  .section {
    padding-top: 126px;
  }

  .app-header {
    top: 4px;
  }

  .tab-item {
    flex-direction: row;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-md);
  }

  .tab-item svg {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
  }

  .tab-item span {
    font-size: 13px;
  }

  .tab-item.active {
    background: rgba(0, 122, 255, 0.08);
  }

  .section {
    padding-top: calc(70px + env(safe-area-inset-top));
  }

  .section-content {
    max-width: 560px;
  }

  .ios-card-grid {
    justify-content: center;
  }

  .ios-image-card {
    max-width: 480px;
  }

  .about-photo {
    border-radius: var(--radius-lg);
  }

  .hero-stats {
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
  }

  .proj-chips {
    margin-bottom: 12px;
  }

  .proj-btn {
    flex: unset;
  }

  .proj-actions {
    gap: 8px;
  }

  .bottom-spacer {
    height: 0;
  }
}

/* === ADVANCED PROFILE FLOW === */

.prof-hero {
  background: var(--bg-elevated);
  border: 1px solid var(--b2);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.prof-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.prof-av-wrap {
  position: relative;
}

.prof-av {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold3));
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  border: 2px solid var(--gold2);
  overflow: hidden;
}

.prof-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prof-av-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
}

.prof-identity {
  flex: 1;
}

.prof-name {
  color: var(--cream);
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-accent);
}

.prof-handle {
  color: var(--gold);
  font-size: 14px;
  opacity: 0.8;
}

.prof-phone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.prof-phone {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.prof-phone-action {
  font-size: 11px;
  color: var(--blue);
  background: rgba(0, 122, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

.prof-bal-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--b2);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.prof-bal-amt {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  font-family: var(--font-accent);
}

.prof-bal-lbl {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.prof-withdraw-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
  transition: transform 0.1s;
}

.prof-withdraw-btn:active {
  transform: scale(0.96);
}

.telebirr-logo {
  height: 20px;
  width: auto;
  border-radius: 4px;
}

/* === GAME HISTORY STATS === */
.gh-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.gh-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--b2);
  padding: 8px 12px;
  border-radius: 100px;
  font-size: 11px;
  color: var(--muted);
}

.gh-stat b {
  color: var(--gold);
}

.gh-stat-circle {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.5;
}

/* === MODAL OVERLAYS === */
.ov {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 7, 10, 0.94);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.ov.show {
  display: flex;
}

.withdraw-popup, .withdraw-pending-modal {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg));
  border: 1px solid var(--b2);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.withdraw-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.withdraw-header h3 {
  color: var(--cream);
  font-size: 18px;
  font-family: var(--font-accent);
}

.telebirr-logo-wrap {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.telebirr-logo-modal {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.withdraw-summary {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--cream);
}

.withdraw-form label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.withdraw-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--b2);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--cream);
  font-size: 15px;
  margin-bottom: 16px;
}

.withdraw-err {
  font-size: 12px;
  color: #ef4444;
  margin-top: -8px;
  margin-bottom: 12px;
  display: none;
}

.withdraw-actions {
  display: flex;
  gap: 12px;
}

.withdraw-cancel, .withdraw-submit {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.withdraw-cancel {
  background: var(--bg-elevated);
  border: 1px solid var(--b2);
  color: var(--text-secondary);
}

.withdraw-submit {
  background: var(--gold);
  color: #000;
}

/* === LOGOUT & DANGER ZONE === */
.logout-btn-new {
  width: 100%;
  padding: 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
}

.delete-account-btn {
  width: 100%;
  background: transparent;
  color: #666;
  border: none;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 8px;
}

/* ─────────────────────────────────────────────
   TELEGRAM MINI APP — FULLSCREEN COVERAGE
   ───────────────────────────────────────────── */
:root {
  --tg-viewport-height: 100vh;
  --tg-viewport-stable-height: 100vh;
}

html {
  height: 100%;
  height: -webkit-fill-available;
  height: 100dvh;
  background: #08070A;
}

body {
  width: 100vw;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
  background: #08070A;
  /* iOS safe areas (notch / home indicator) */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

#app, .app-container, #loader {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* ─────────────────────────────────────────────
   GLOBAL BUTTON LOADING STATE
   ───────────────────────────────────────────── */
.btn-loading {
  position: relative !important;
  color: transparent !important;
  overflow: hidden !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpinner 0.6s linear infinite;
  z-index: 10;
}

/* Special Case: Gold buttons should have a dark spinner */
.btn-gold.btn-loading::after, 
[style*="--gold"].btn-loading::after {
  border-top-color: #000;
}

@keyframes btnSpinner {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────
   SKELETON LOADING (PRO UPGRADE)
   ───────────────────────────────────────────── */
.skeleton {
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-card {
  width: 100%;
  height: 190px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-row {
  width: 100%;
  height: 56px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─────────────────────────────────────────────
   PULL TO REFRESH (PRO UPGRADE)
   ───────────────────────────────────────────── */
#hero {
  position: relative;
}

.ptr-indicator {
  position: absolute;
  top: 40px; /* Above the games list, below the status bar */
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-20px) scale(0.8);
  transition: opacity 0.2s; /* No transform transition for pull responsiveness */
  z-index: 99;
  will-change: transform, opacity;
}

.ptr-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(232, 184, 75, 0.1);
  border-top-color: var(--gold);
  animation: ptrSpin 0.75s linear infinite;
  box-shadow: 0 0 15px rgba(232, 184, 75, 0.15);
}

.ptr-text {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-top: 8px;
  font-weight: 700;
}

@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}

/* === FULL PAGE LOADER (RELOAD) === */
#full-page-loader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#full-page-loader.active {
  opacity: 1;
  pointer-events: all;
}

.loader-content {
  text-align: center;
  transform: translateY(-20px);
  animation: loaderEntry 0.4s var(--ease-spring) forwards;
}

@keyframes loaderEntry {
  to { transform: translateY(0); }
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(232, 184, 75, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
  margin-bottom: 20px;
  box-shadow: 0 0 30px rgba(232, 184, 75, 0.2);
}

.loader-text {
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(232, 184, 75, 0.5);
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}



