/* ==========================================================================
   HimalTrex Games — Portal Stylesheet
   ========================================================================== */

:root {
  --color-gold: #f5a425;
  --color-gold-light: #ffd166;
  --color-crimson: #c92a42;
  --color-turquoise: #2a9d8f;
  --color-blue-dark: #0b131e;
  --color-blue-card: rgba(18, 29, 44, 0.85);
  --color-blue-card-hover: rgba(28, 44, 66, 0.95);
  --color-border: rgba(245, 164, 37, 0.22);
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Nunito', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-blue-dark);
  color: var(--color-text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Tibetan Prayer Flags Garland ── */
.prayer-flags {
  display: flex;
  width: 100%;
  height: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.flag {
  flex: 1;
  height: 100%;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
  animation: flagWave 3s ease-in-out infinite alternate;
}

.flag.blue { background-color: #1e6fa8; animation-delay: 0s; }
.flag.white { background-color: #f8fafc; animation-delay: 0.3s; }
.flag.red { background-color: #cd2e48; animation-delay: 0.6s; }
.flag.green { background-color: #43a047; animation-delay: 0.9s; }
.flag.yellow { background-color: #f5a425; animation-delay: 1.2s; }

@keyframes flagWave {
  0% { transform: translateY(0) skewY(0deg); }
  100% { transform: translateY(-2px) skewY(1.5deg); }
}

/* ── Himaltrex Official Top Banner (White Strip) ── */
.himaltrex-header-bar {
  height: 50px;
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 120;
  background: #ffffff;
  border-bottom: 2px solid rgba(78, 205, 196, 0.45);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.himaltrex-header-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
  padding: 0 24px;
  gap: 16px;
  transition: all 0.25s ease;
}

.himaltrex-header-bar:hover .himaltrex-header-link {
  background: #f8fafc;
}

.himaltrex-banner-left {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
}

.himaltrex-banner-img {
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.himaltrex-header-bar:hover .himaltrex-banner-img {
  transform: scale(1.02);
}

.himaltrex-slogan {
  display: flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: #102D24;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0.95;
}

.himaltrex-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #102d24 0%, #1a4538 100%);
  border: 1px solid rgba(78, 205, 196, 0.5);
  padding: 6px 14px;
  border-radius: 20px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.himaltrex-header-bar:hover .himaltrex-cta {
  background: linear-gradient(135deg, #0e857b 0%, #102d24 100%);
  border-color: #2dd4bf;
  box-shadow: 0 4px 14px rgba(14, 133, 123, 0.35);
  transform: translateY(-1px);
}

.cta-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ECC71;
  box-shadow: 0 0 8px #2ECC71;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.cta-arrow {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.himaltrex-header-bar:hover .cta-arrow {
  transform: translate(2px, -2px);
}

@media (max-width: 1000px) {
  .himaltrex-slogan { display: none; }
}

@media (max-width: 600px) {
  .himaltrex-header-bar { height: 42px; }
  .himaltrex-header-link { padding: 0 12px; }
  .himaltrex-banner-img { height: 26px; }
  .himaltrex-cta { padding: 4px 10px; font-size: 0.78rem; gap: 5px; }
}

/* ── Header ── */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 19, 30, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 24px;
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.brand-logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 8px rgba(245, 164, 37, 0.4));
}

.brand-title {
  display: block;
  font-family: var(--font-serif), 'Cinzel', 'Nunito', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.brand-accent {
  color: var(--color-gold);
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-item {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
}

.nav-item.active {
  color: var(--color-gold);
  border-bottom: 2px solid var(--color-gold);
  padding-bottom: 2px;
}

.nav-external {
  color: var(--color-gold-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 5px 12px;
  background: rgba(245, 164, 37, 0.12);
  border: 1px solid rgba(245, 164, 37, 0.3);
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-external:hover {
  background: rgba(245, 164, 37, 0.25);
  border-color: var(--color-gold);
}

/* ── Segmented Language Switcher (Rus / Eng) ── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 164, 37, 0.35);
  border-radius: 20px;
  padding: 3px 4px;
  gap: 3px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
  user-select: none;
  margin-left: 8px;
}

.lang-toggle:hover {
  border-color: var(--color-gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 14px rgba(245, 164, 37, 0.25);
}

.lang-option {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.2;
}

.lang-option:hover {
  color: #fff;
}

.lang-option.active {
  background: linear-gradient(135deg, #f5a425 0%, #e07e10 100%);
  color: #0b131e;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(245, 164, 37, 0.5);
}

/* ── Hero Section ── */
.hero-section {
  position: relative;
  padding: 70px 24px 60px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #1a2f4c 0%, #0b131e 75%);
  border-bottom: 1px solid var(--color-border);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mountain-silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(11, 19, 30, 0.9), transparent);
  clip-path: polygon(0 100%, 15% 45%, 32% 80%, 50% 20%, 68% 75%, 85% 35%, 100% 100%);
  opacity: 0.35;
}

.hero-content {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  z-index: 10;
}

.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(245, 164, 37, 0.15);
  border: 1px solid rgba(245, 164, 37, 0.4);
  border-radius: 20px;
  color: var(--color-gold-light);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 18px;
  color: #fff;
}

.gradient-text {
  background: linear-gradient(135deg, #ffd166 0%, #f5a425 50%, #df6a27 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 34px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Account Banner */
.hero-account-banner {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(22, 34, 52, 0.75);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(245, 164, 37, 0.4);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: left;
}

.banner-avatar-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #2d4564, #121c2a);
  border: 2px solid var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.banner-greeting {
  font-size: 0.72rem;
  color: var(--color-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.banner-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.banner-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #df6a27 0%, #f5a425 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 164, 37, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e97a39 0%, #ffb23f 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 164, 37, 0.55);
}

.btn-outline {
  background: transparent;
  color: var(--color-gold-light);
  border: 1px solid rgba(245, 164, 37, 0.4);
}

.btn-outline:hover {
  background: rgba(245, 164, 37, 0.15);
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

/* ── Games Section ── */
.games-section {
  padding: 40px 24px 70px;
}

.section-container {
  max-width: 1240px;
  margin: 0 auto;
}

.section-heading {
  text-align: center;
  margin-bottom: 40px;
}

.section-tag {
  display: inline-block;
  color: var(--color-gold);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: rgba(212, 168, 83, 0.12);
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 20px;
  padding: 4px 16px;
  margin-bottom: 8px;
}

.section-heading h2,
.section-heading h1,
.section-title {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  color: #fff;
  margin: 6px 0 10px;
  letter-spacing: 0.5px;
}

.section-heading p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  gap: 26px;
}

.game-card {
  position: relative;
  background: var(--color-blue-card);
  border: 1.5px solid var(--color-border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.28s ease;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.game-card:hover {
  background: var(--color-blue-card-hover);
  transform: translateY(-6px);
  border-color: rgba(245, 164, 37, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 164, 37, 0.2);
}

.card-trail:hover {
  border-color: rgba(46, 175, 125, 0.45);
  box-shadow: 0 16px 40px rgba(46, 175, 125, 0.15), 0 0 0 1px rgba(46, 175, 125, 0.2);
}

.card-words:hover {
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 16px 40px rgba(45, 212, 191, 0.15), 0 0 0 1px rgba(45, 212, 191, 0.2);
}

.card-puzzle:hover {
  border-color: rgba(224, 86, 36, 0.45);
  box-shadow: 0 16px 40px rgba(224, 86, 36, 0.15), 0 0 0 1px rgba(224, 86, 36, 0.2);
}

.card-ludo:hover {
  border-color: rgba(244, 180, 26, 0.45);
  box-shadow: 0 16px 40px rgba(244, 180, 26, 0.15), 0 0 0 1px rgba(244, 180, 26, 0.2);
}

.card-samrajya:hover {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 16px 40px rgba(220, 38, 38, 0.15), 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-gold-light);
  border: 1px solid rgba(245, 164, 37, 0.2);
}

.card-visual {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 16px;
}

.visual-icon {
  font-size: 3.8rem;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-game-icon {
  height: 76px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.game-card:hover .visual-icon {
  transform: scale(1.1) rotate(4deg);
}

.visual-particles {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  pointer-events: none;
  opacity: 0.4;
  font-size: 1.2rem;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  flex: 1;
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.feature-chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: #cbd5e1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.card-score-preview {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.card-score-preview b {
  color: var(--color-gold-light);
}

.btn-play {
  padding: 8px 18px;
  font-size: 0.9rem;
}

/* ── Leaderboard Section ── */
.leaderboard-section {
  padding: 60px 24px 80px;
  background: rgba(14, 23, 36, 0.6);
  border-top: 1px solid var(--color-border);
}

.leaderboard-page {
  min-height: calc(100vh - 65px - 140px);
  padding: 40px 24px 80px;
  background: transparent;
  border-top: none;
}

.leaderboard-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  background: rgba(22, 34, 52, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
  border-color: rgba(245, 164, 37, 0.4);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(201, 42, 66, 0.3), rgba(245, 164, 37, 0.3));
  border-color: var(--color-gold);
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 164, 37, 0.25);
}

/* Big "Overall" button */
.tab-btn-total {
  padding: 12px 40px;
  font-size: 1.1rem;
  border-radius: 14px;
  min-width: 200px;
}

/* Small game chips row */
.tab-games-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
}

.tab-btn-game {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Board size bar for 2048 */
.board-size-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 8px 16px;
  background: rgba(18, 29, 44, 0.6);
  border-radius: 10px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.board-bar-label {
  font-size: 0.85rem;
  color: var(--color-gold-light);
  font-weight: 700;
}

.board-chips {
  display: flex;
  gap: 6px;
}

.chip-btn {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.chip-btn:hover {
  color: #fff;
}

.chip-btn.active {
  background: var(--color-gold);
  color: #121c2a;
  border-color: var(--color-gold);
}

/* ==========================================================================
   Hall of Fame Card (Зал Славы) — Inspired by Nepal Adventure Screenshot
   ========================================================================== */

.himal-fame-card {
  max-width: 880px;
  margin: 0 auto 30px;
  background: radial-gradient(circle at 50% 0%, #0d221a 0%, #06120d 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 24px;
  padding: 24px 28px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(45, 212, 191, 0.08);
  position: relative;
  overflow: hidden;
}

.himal-fame-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5), transparent);
  pointer-events: none;
}

/* Card Header */
.fame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.fame-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fame-trophy-badge {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.65));
  animation: trophyFloat 3s ease-in-out infinite alternate;
}

@keyframes trophyFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-3px) scale(1.04); }
}

.fame-main-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
  margin-bottom: 2px;
  text-transform: uppercase;
}

.fame-subtitle {
  font-size: 0.88rem;
  color: #8ba59a;
  font-weight: 500;
}

.fame-refresh-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fame-refresh-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: #2dd4bf;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.4);
}

.fame-refresh-btn .refresh-spinner {
  font-size: 1.15rem;
  display: inline-block;
  transition: transform 0.5s ease;
}

.fame-refresh-btn:hover .refresh-spinner,
.fame-refresh-btn.is-spinning .refresh-spinner {
  transform: rotate(180deg);
}

.fame-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

/* ── Top-3 Podium ── */
.fame-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin: 12px 0 28px;
  padding: 0 10px;
  box-sizing: border-box;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 140px;
}

.podium-crown {
  font-size: 1.5rem;
  position: absolute;
  top: -26px;
  animation: floatBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.podium-avatar-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-first .podium-avatar-wrap {
  width: 74px;
  height: 74px;
}

.podium-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #11261d;
  box-sizing: border-box;
}

.podium-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-avatar-circle .avatar-totem {
  font-size: 1.8rem;
  line-height: 1;
}

.podium-first .podium-avatar-circle .avatar-totem {
  font-size: 2.3rem;
}

.podium-first .podium-avatar-circle {
  border: 3.5px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.65);
}

.podium-second .podium-avatar-circle {
  border: 3px solid #c0c0c0;
  box-shadow: 0 0 14px rgba(192, 192, 192, 0.5);
}

.podium-third .podium-avatar-circle {
  border: 3px solid #cd7f32;
  box-shadow: 0 0 14px rgba(205, 127, 50, 0.5);
}

.podium-rank-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.podium-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 3px;
  text-align: center;
  width: 100%;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-xp {
  font-weight: 800;
  font-size: 0.82rem;
  color: #2dd4bf;
  margin-bottom: 8px;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
}

.podium-pillar {
  width: 100%;
  max-width: 130px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 0 6px;
  box-sizing: border-box;
}

.pillar-1 {
  height: 90px;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.45) 0%, rgba(184, 134, 11, 0.35) 100%);
  border-top: 3.5px solid #ffd700;
  border-left: 1px solid rgba(255, 215, 0, 0.25);
  border-right: 1px solid rgba(255, 215, 0, 0.25);
}

.pillar-2 {
  height: 70px;
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.35) 0%, rgba(128, 128, 128, 0.25) 100%);
  border-top: 3px solid #c0c0c0;
  border-left: 1px solid rgba(192, 192, 192, 0.2);
  border-right: 1px solid rgba(192, 192, 192, 0.2);
}

.pillar-3 {
  height: 54px;
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.35) 0%, rgba(139, 69, 19, 0.25) 100%);
  border-top: 3px solid #cd7f32;
  border-left: 1px solid rgba(205, 127, 50, 0.2);
  border-right: 1px solid rgba(205, 127, 50, 0.2);
}

.podium-current .podium-name {
  color: #ffd700;
}

.you-tag {
  font-size: 0.65rem;
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  color: #0b131e;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 900;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Rankings Table ── */
.fame-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}

.fame-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.fame-table th {
  padding: 12px 14px;
  color: #79988b;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.col-th-rank { width: 70px; text-align: center; }
.col-th-user { min-width: 220px; }
.col-th-level { width: 160px; }
.col-th-score { width: 160px; text-align: right; }

.fame-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fame-row {
  transition: background 0.18s ease;
}

.fame-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.fame-rank {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  text-align: center;
}

.fame-user-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fame-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #11261d;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.fame-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fame-avatar .avatar-totem {
  font-size: 1.35rem;
  line-height: 1;
}

.fame-name-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fame-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.fame-level {
  color: #ffd700;
  font-weight: 700;
  font-size: 0.88rem;
}

.fame-score {
  text-align: right;
}

.fame-score strong {
  color: #2dd4bf;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.fame-extra {
  color: #b0c8be;
  font-size: 0.88rem;
  text-align: right;
}

/* Highlighted Current User Row */
.fame-row-current {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.18) 0%, rgba(245, 164, 37, 0.16) 100%) !important;
  border-left: 4px solid #ffd700 !important;
  border-right: 4px solid #2dd4bf !important;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.25);
  position: relative;
}

.fame-row-current td {
  color: #fff !important;
}

.fame-row-current .fame-name {
  color: #fff;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.fame-row-current .fame-avatar {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.6);
}

.fame-badge-you {
  font-size: 0.68rem;
  background: linear-gradient(135deg, #ffd700 0%, #ff6b6b 100%);
  color: #0b131e;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.6);
  letter-spacing: 0.5px;
}

/* ── Sticky Current User Card at Bottom ── */
.fame-current-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, rgba(14, 45, 36, 0.95) 0%, rgba(22, 38, 30, 0.95) 100%);
  border: 1.5px solid #ffd700;
  border-radius: 16px;
  padding: 14px 20px;
  margin-top: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.2);
}

.fame-sticky-rank {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffd700;
  min-width: 48px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.fame-sticky-info {
  flex: 1;
  text-align: left;
}

.fame-sticky-name {
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.fame-sticky-details {
  font-size: 0.82rem;
  color: #b0c8be;
}

.fame-sticky-score {
  text-align: right;
  white-space: nowrap;
}

.fame-sticky-score strong {
  font-size: 1.25rem;
  color: #2dd4bf;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(45, 212, 191, 0.35);
}

.fame-loading, .fame-empty {
  padding: 30px;
  text-align: center;
  color: #8ba59a;
  font-size: 0.95rem;
}

/* ── Footer ── */
.portal-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: #080e16;
  padding: 34px 24px;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-weight: 800;
  color: var(--color-gold);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.footer-desc {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  max-width: 440px;
}

.footer-right {
  text-align: right;
}

.footer-link {
  color: var(--color-gold-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-copy {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.78rem;
  margin-top: 6px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .header-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    justify-content: space-between;
    align-items: center;
  }
  .brand-box {
    flex: 1 1 auto;
    min-width: 0;
  }
  .brand-title {
    font-size: 1rem;
  }
  .brand-sub {
    font-size: 0.65rem;
  }
  .portal-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
  }
  .nav-item {
    font-size: 0.82rem;
    padding: 4px 8px;
  }
  .lang-toggle {
    margin-left: 4px;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  .footer-right {
    text-align: center;
  }
  .himal-fame-card {
    padding: 18px 12px;
  }
  .fame-podium {
    gap: 6px;
    padding: 0;
  }
  .podium-name {
    font-size: 0.76rem;
    max-width: 92px;
  }
  .podium-xp {
    font-size: 0.72rem;
  }
  .podium-pillar {
    font-size: 0.68rem;
    padding: 0 2px;
  }
  .col-th-extra, .fame-extra {
    display: none;
  }
  .fame-main-title {
    font-size: 1.12rem;
  }
  .fame-trophy-badge {
    font-size: 2.2rem;
  }
  .fame-current-user-card {
    padding: 12px 14px;
    gap: 10px;
  }
  .fame-sticky-rank {
    font-size: 1.1rem;
    min-width: 36px;
  }
  .fame-sticky-score strong {
    font-size: 1.05rem;
  }
  .games-section {
    padding: 24px 12px 50px;
  }
  .games-grid {
    gap: 16px;
  }
  .game-card {
    padding: 18px 16px;
  }
  .card-visual {
    height: 80px;
  }
  .visual-icon {
    font-size: 3rem;
  }
  .section-heading {
    margin-bottom: 24px;
  }
  .col-th-level {
    display: none;
  }
  .fame-level {
    display: none;
  }
}

#boardSizeBar[hidden] {
  display: none;
}

/* ── Falling Snow Effect ────────────────────────────────────────────── */
.portal-snowflakes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.portal-snowflake {
  position: absolute;
  top: -16px;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  animation: portalSnowfall linear infinite;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
}

.portal-snowflake > span {
  display: inline-block;
  animation: portalSnowSpin linear infinite;
  will-change: transform;
}

@keyframes portalSnowfall {
  0%   { transform: translate3d(0, -16px, 0); opacity: 0; }
  10%  { opacity: 0.9; }
  28%  { transform: translate3d(var(--gust-a, 34px), 26vh, 0); }
  54%  { transform: translate3d(var(--gust-b, -28px), 54vh, 0); }
  78%  { transform: translate3d(var(--gust-c, 42px), 79vh, 0); }
  92%  { opacity: 0.75; }
  100% { transform: translate3d(var(--gust-d, -12px), 104vh, 0); opacity: 0; }
}

@keyframes portalSnowSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
