/* ================================================================
   TibiaGames.com — Stylesheet
   Dark fantasy gaming theme inspired by Tibia aesthetics
   ================================================================ */

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

:root {
  /* Core palette */
  --bg-deep: #07070f;
  --bg-main: #0c0c18;
  --bg-card: #12122a;
  --bg-card-hover: #181840;
  --bg-surface: #1a1a3a;

  /* Accent — golden Tibia feel */
  --gold: #d4a537;
  --gold-light: #f0c960;
  --gold-dim: #8a6b1f;
  --gold-glow: rgba(212, 165, 55, 0.15);

  /* Multiplayer accent — purple/blue */
  --mp: #8b5cf6;
  --mp-light: #a78bfa;
  --mp-dim: #5b3aa0;
  --mp-glow: rgba(139, 92, 246, 0.15);

  /* Status colors */
  --green: #22c55e;
  --green-dim: #166534;
  --red: #ef4444;
  --red-dim: #7f1d1d;

  /* Text */
  --text: #e8e6f0;
  --text-dim: #9896a8;
  --text-muted: #5c5a6e;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-gold: rgba(212, 165, 55, 0.25);

  /* Misc */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'MedievalSharp', cursive;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212,165,55,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139,92,246,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
img { display: block; max-width: 100%; }

/* --- Particles Canvas --- */
.tg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* --- Notifications --- */
.tg-notifications {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.tg-notif {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 340px;
}

.tg-notif.show {
  transform: translateX(0);
  opacity: 1;
}

.tg-notif-success {
  background: var(--green-dim);
  border: 1px solid var(--green);
}

.tg-notif-locked {
  background: var(--red-dim);
  border: 1px solid var(--red);
}

.tg-notif-info {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
}

.tg-notif-achievement {
  background: linear-gradient(135deg, #2d1b69, #1a1a3a);
  border: 1px solid var(--mp);
  color: var(--mp-light);
}

/* --- Header --- */
.tg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.tg-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tg-logo-img {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 8px rgba(212,165,55,0.4));
}

.tg-logo-text h1 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.tg-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.tg-nav {
  display: flex;
  gap: 8px;
}

.tg-nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  transition: var(--transition);
}

.tg-nav-link:hover,
.tg-nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.tg-nav-vault {
  color: var(--gold-dim);
}
.tg-nav-vault:hover { color: var(--gold); }

.tg-nav-premium {
  color: var(--mp-light);
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.2);
}
.tg-nav-premium:hover {
  color: #fff;
  background: rgba(139,92,246,0.2);
}

.tg-login-btn {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #0a0a12;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,165,55,0.3);
}

.tg-login-icon { font-size: 16px; }

/* --- Header Profile (logged in) --- */
.tg-player {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tg-header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tg-header-profile:hover {
  background: rgba(255,255,255,0.05);
}

.tg-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-dim);
}

.tg-header-avatar-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 16px;
}

.tg-header-info {
  display: flex;
  flex-direction: column;
}

.tg-header-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.tg-header-level {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-header-lv {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}

.tg-header-xp-bar {
  width: 60px;
  height: 4px;
  background: rgba(212,165,55,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.tg-header-xp-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* --- Hero --- */
.tg-hero {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.tg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(212,165,55,0.04) 0%,
    transparent 40%,
    rgba(139,92,246,0.03) 100%
  );
  pointer-events: none;
}

.tg-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.tg-hero-content { flex: 1; max-width: 600px; }

.tg-hero-title {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}

.tg-accent { color: var(--gold); }

.tg-hero-desc {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
}

.tg-hero-stats {
  display: flex;
  gap: 32px;
}

.tg-hero-stat {
  display: flex;
  flex-direction: column;
}

.tg-hero-stat-n {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
}

.tg-hero-stat-l {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tg-hero-visual {
  flex-shrink: 0;
  position: relative;
  width: 480px;
  max-width: 50%;
}

.tg-hero-art {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(139,92,246,0.2), 0 0 80px rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.15);
}

/* --- Points Bar --- */
.tg-points-bar {
  position: relative;
  z-index: 1;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.tg-points-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-points-left,
.tg-points-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-points-icon {
  width: 24px;
  height: 24px;
}

.tg-points-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tg-points-value {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
}

/* --- Daily Quests Panel --- */
.tg-quest-panel {
  position: relative;
  z-index: 1;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.tg-quest-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
}

.tg-quest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tg-quest-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
}

.tg-quest-timer {
  font-size: 12px;
  color: var(--text-muted);
}

.tg-quest-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tg-quest {
  flex: 1;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: var(--transition);
}

.tg-quest.done {
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.05);
}

.tg-quest-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.tg-quest-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.tg-quest-reward {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

.tg-quest-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.tg-quest-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.tg-quest.done .tg-quest-bar {
  background: var(--green);
}

.tg-quest-progress {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.tg-quest.done .tg-quest-progress {
  color: var(--green);
}

.tg-quest-bonus {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(212,165,55,0.05);
  border: 1px dashed rgba(212,165,55,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

.tg-quest-bonus.done {
  border-color: rgba(34,197,94,0.3);
  color: var(--green);
  border-style: solid;
  background: rgba(34,197,94,0.05);
}

/* --- Section Header --- */
.tg-section-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.tg-section-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
}

.tg-section-filters {
  display: flex;
  gap: 4px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.tg-filter {
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.tg-filter:hover { color: var(--text); }
.tg-filter.active {
  background: rgba(212,165,55,0.15);
  color: var(--gold);
}

/* --- Games Grid --- */
.tg-games {
  position: relative;
  z-index: 1;
}

.tg-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* --- Game Card --- */
.tg-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.tg-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--border-gold);
  border-color: var(--border-gold);
}

.tg-card-multi:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.3);
  border-color: rgba(139,92,246,0.3);
}

/* Locked card overlay */
.tg-card-locked {
  opacity: 0.6;
}

.tg-card-locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.tg-card-lock {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(7,7,15,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius);
}

.tg-lock-icon {
  font-size: 32px;
  filter: grayscale(0.5);
}

.tg-lock-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tg-card-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 100%;
  background: radial-gradient(ellipse, var(--gold-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tg-card:hover .tg-card-glow { opacity: 1; }
.tg-card-multi:hover .tg-card-glow {
  background: radial-gradient(ellipse, var(--mp-glow) 0%, transparent 70%);
  opacity: 1;
}
.tg-card-locked:hover .tg-card-glow { opacity: 0; }

.tg-card-badge-mp {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--mp);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 2;
}

.tg-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 12px;
  min-height: 100px;
}

.tg-card-img img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  transition: transform 0.3s ease;
}

.tg-card:hover .tg-card-img img {
  transform: scale(1.1);
}
.tg-card-locked:hover .tg-card-img img {
  transform: none;
}

.tg-card-body {
  padding: 0 20px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tg-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

.tg-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}

.tg-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tg-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tg-badge-solo {
  background: rgba(212,165,55,0.1);
  color: var(--gold);
  border: 1px solid rgba(212,165,55,0.2);
}

.tg-badge-multi {
  background: rgba(139,92,246,0.1);
  color: var(--mp-light);
  border: 1px solid rgba(139,92,246,0.2);
}

.tg-card-hi {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tg-hi-icon { color: var(--gold); }

.tg-card-play {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(212,165,55,0.15), rgba(212,165,55,0.05));
  border: 1px solid rgba(212,165,55,0.2);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tg-card-play:hover {
  background: linear-gradient(135deg, rgba(212,165,55,0.25), rgba(212,165,55,0.1));
  box-shadow: 0 0 20px rgba(212,165,55,0.15);
}

.tg-card-play-multi {
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05));
  border-color: rgba(139,92,246,0.25);
  color: var(--mp-light);
}

.tg-card-play-multi:hover {
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(139,92,246,0.1));
  box-shadow: 0 0 20px rgba(139,92,246,0.15);
}

/* Card hidden by filter */
.tg-card[data-hidden="true"] {
  display: none;
}

/* --- Leaderboard --- */
.tg-leaderboard {
  position: relative;
  z-index: 1;
  padding-bottom: 60px;
}

.tg-lb-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.tg-lb-tab {
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.tg-lb-tab:hover { color: var(--text); }
.tg-lb-tab.active {
  background: rgba(212,165,55,0.15);
  color: var(--gold);
}

.tg-lb-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.tg-lb-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* --- Play Overlay --- */
.tg-play-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-deep);
  overflow-y: auto;
}

.tg-play-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7,7,15,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-play-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tg-play-back:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.tg-play-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
}

.tg-play-score {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}

.tg-play-area {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

/* --- Modal Base --- */
.tg-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tg-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  max-height: 90vh;
  overflow-y: auto;
}

.tg-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.tg-modal-close:hover { color: var(--text); }

.tg-modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 8px;
}

.tg-modal-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.tg-modal-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  margin-bottom: 12px;
  font-family: var(--font);
}

.tg-modal-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(212,165,55,0.1);
}

.tg-modal-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a12;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.tg-modal-btn:hover {
  box-shadow: 0 4px 20px rgba(212,165,55,0.3);
  transform: translateY(-1px);
}

.tg-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.tg-modal-btn-discord {
  background: #5865F2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tg-modal-btn-discord:hover {
  background: #4752c4;
  box-shadow: 0 4px 20px rgba(88,101,242,0.3);
}

.tg-modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.tg-modal-divider::before,
.tg-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Auth Modal Tabs --- */
.tg-auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
}

.tg-auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.tg-auth-tab:hover { color: var(--text); }
.tg-auth-tab.active {
  background: rgba(212,165,55,0.15);
  color: var(--gold);
}

.tg-auth-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--red);
}

/* --- Profile Modal --- */
.tg-modal-profile {
  max-width: 720px;
  padding: 0 !important;
  overflow: hidden;
}
.tg-modal-profile .tg-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  color: rgba(255,255,255,0.7);
}

/* Profile Hero Banner */
.tg-prof-hero {
  position: relative;
  padding: 28px 24px 20px;
  margin-bottom: 0;
}
.tg-prof-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(212,165,55,0.1), rgba(139,92,246,0.08));
  border-bottom: 1px solid var(--border);
}
.tg-prof-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tg-prof-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* XP Section */
.tg-prof-xp-section {
  padding: 12px 24px 0;
  margin-bottom: 16px;
}

/* Streak + Next row */
.tg-prof-row {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  margin-bottom: 16px;
}
.tg-prof-row > * { flex: 1; }

/* Quick actions row */
.tg-prof-actions-row {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  margin-bottom: 16px;
}
.tg-prof-actions-row .tg-profile-action-btn { flex: 1; }
.tg-prof-act-icon { margin-right: 6px; }
.tg-streak-flame { margin-right: 6px; }

.tg-profile-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 12px;
  padding: 0 24px;
}

.tg-profile-col .tg-equip-section:last-child,
.tg-profile-col .tg-profile-actions { margin-bottom: 0; }

.tg-profile-border {
  border-radius: 50%;
  padding: 3px;
  flex-shrink: 0;
}

.tg-border-stone   { background: linear-gradient(135deg, #6b7280, #374151); }
.tg-border-bronze  { background: linear-gradient(135deg, #cd7f32, #8b4513); }
.tg-border-silver  { background: linear-gradient(135deg, #c0c0c0, #808080); }
.tg-border-gold    { background: linear-gradient(135deg, #ffd700, #b8860b); }
.tg-border-diamond { background: linear-gradient(135deg, #b9f2ff, #4dd0e1, #00838f); }
.tg-border-infernal { background: linear-gradient(135deg, #ef4444, #991b1b, #ef4444); }

.tg-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tg-profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tg-profile-avatar-letter {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold);
}

.tg-profile-info {
  flex: 1;
}

.tg-profile-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 2px;
}

.tg-profile-title-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212,165,55,0.12);
  border: 1px solid rgba(212,165,55,0.25);
  padding: 2px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tg-profile-lv {
  font-size: 12px;
  color: var(--text-dim);
}

/* XP Bar */
.tg-profile-xp-wrap {
  margin-bottom: 20px;
}

.tg-profile-xp-bar {
  height: 6px;
  background: rgba(212,165,55,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.tg-profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-light));
  border-radius: 3px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(212,165,55,0.3);
}

.tg-profile-xp-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* Profile Stats */
.tg-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tg-profile-stats {
  padding: 0 24px;
}
.tg-profile-stat {
  text-align: center;
  padding: 12px 4px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.tg-profile-stat:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-gold);
}
.tg-profile-stat-icon {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  opacity: 0.6;
}
.tg-profile-stat-n {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}

.tg-profile-stat-l {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Next Unlock */
.tg-profile-next {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(212,165,55,0.04);
  border: 1px solid rgba(212,165,55,0.12);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: var(--transition);
}
.tg-profile-next:hover { background: rgba(212,165,55,0.08); }
.tg-profile-next-icon { font-size: 14px; }

.tg-profile-next-label {
  color: var(--text-muted);
}

.tg-profile-next-val {
  color: var(--gold);
  font-weight: 600;
}

/* Profile Actions */
.tg-profile-actions {
  margin-bottom: 16px;
}

.tg-profile-action-btn {
  width: 100%;
  padding: 10px;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-sm);
  color: var(--mp-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-profile-action-btn:hover {
  background: rgba(139,92,246,0.15);
}

/* Equipment Section */
.tg-equip-section {
  margin-bottom: 16px;
}

.tg-equip-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.tg-equip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tg-equip-item {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.tg-equip-item:hover {
  border-color: var(--border-gold);
  color: var(--text);
}

.tg-equip-item.active {
  background: rgba(212,165,55,0.15);
  border-color: var(--gold-dim);
  color: var(--gold);
}

.tg-equip-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.tg-equip-item.locked:hover {
  border-color: var(--border);
  color: var(--text-dim);
}

/* Logout */
.tg-profile-logout {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  font-family: var(--font);
}

.tg-profile-logout:hover {
  background: rgba(239,68,68,0.1);
}

/* --- Achievements Modal --- */
.tg-modal-achievements {
  max-width: 500px;
}

.tg-ach-list {
  max-height: 60vh;
  overflow-y: auto;
}

.tg-ach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: var(--transition);
  opacity: 0.4;
}

.tg-ach-item.unlocked {
  opacity: 1;
  background: rgba(212,165,55,0.05);
}

.tg-ach-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

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

.tg-ach-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.tg-ach-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.tg-ach-xp {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

/* --- Premium Modal --- */
.tg-modal-premium {
  max-width: 420px;
  text-align: center;
}

.tg-premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--mp), #7c3aed);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 4px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.tg-premium-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--mp-light);
  margin-bottom: 8px;
}

.tg-premium-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.tg-premium-features {
  text-align: left;
  margin-bottom: 24px;
}

.tg-premium-feat {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  border-left: 3px solid var(--mp);
  margin-bottom: 6px;
  background: rgba(139,92,246,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.tg-premium-coming {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-muted);
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* --- Level Up Overlay --- */
.tg-levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.tg-levelup-box {
  text-align: center;
  position: relative;
}

.tg-levelup-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212,165,55,0.3) 0%, transparent 70%);
  animation: levelPulse 1.5s ease infinite;
}

.tg-levelup-label {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 8px;
  position: relative;
}

.tg-levelup-level {
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 40px rgba(212,165,55,0.5);
  position: relative;
  animation: levelBounce 0.5s ease;
}

.tg-levelup-title {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 8px;
  margin-bottom: 24px;
  position: relative;
}

.tg-levelup-btn {
  padding: 10px 32px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a12;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  font-family: var(--font);
}

.tg-levelup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(212,165,55,0.4);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes levelPulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes levelBounce {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Footer --- */
.tg-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--bg-main);
}

.tg-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.tg-footer-brand {
  font-family: var(--font-display);
  color: var(--gold-dim);
}

.tg-footer-sep { color: var(--text-muted); }

.tg-footer-note { color: var(--text-muted); }

.tg-footer-link {
  font-size: 13px;
  color: var(--text-dim);
  transition: var(--transition);
}

.tg-footer-link:hover { color: var(--gold); }

/* --- Version --- */
.tg-ver {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 9px;
  color: rgba(212,165,55,0.2);
  z-index: 1;
  pointer-events: none;
}

/* --- Leaderboard Page (full page) --- */
.tg-leaderboard-page {
  min-height: 70vh;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* --- Premium Page --- */
.tg-premium-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 80px;
}

.tg-premium-page-inner {
  max-width: 900px;
  text-align: center;
}

.tg-premium-page .tg-premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: 20px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.tg-premium-page .tg-premium-title {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--gold);
  margin-bottom: 8px;
}

.tg-premium-page .tg-premium-desc {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 40px;
}

.tg-premium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.tg-premium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: var(--transition);
}

.tg-premium-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
}

.tg-premium-card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.tg-premium-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--gold);
  margin-bottom: 8px;
}

.tg-premium-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.tg-premium-page .tg-premium-coming {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--mp-light);
  margin-bottom: 8px;
}

.tg-premium-sub {
  color: var(--text-muted);
  font-size: 14px;
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
  .tg-header-inner { padding: 0 16px; }

  .tg-nav { gap: 4px; }
  .tg-nav-link { font-size: 11px; padding: 6px 8px; }
  .tg-nav-vault { display: none; }

  .tg-hero-inner {
    flex-direction: column;
    padding: 40px 16px 32px;
    text-align: center;
  }

  .tg-hero-title { font-size: 30px; }
  .tg-hero-desc { margin: 0 auto 24px; }
  .tg-hero-stats { justify-content: center; }

  .tg-hero-visual { max-width: 100%; width: 100%; }

  .tg-section-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 16px 16px;
  }

  .tg-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    padding: 0 16px 40px;
    gap: 14px;
  }

  .tg-card-img { padding: 16px 16px 8px; min-height: 80px; }
  .tg-card-img img { width: 56px; height: 56px; }
  .tg-card-body { padding: 0 16px 12px; }
  .tg-card-title { font-size: 16px; }
  .tg-card-play { margin: 0 8px 8px; }

  .tg-points-inner { padding: 10px 16px; }

  .tg-quest-list { flex-direction: column; }
  .tg-quest { min-width: unset; }

  .tg-footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .tg-footer-left { flex-wrap: wrap; justify-content: center; }

  .tg-modal { padding: 24px; max-width: 95%; }

  .tg-profile-columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tg-profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .tg-notifications {
    right: 8px;
    left: 8px;
  }

  .tg-notif {
    max-width: 100%;
  }

  .tg-premium-grid {
    grid-template-columns: 1fr;
  }

  .tg-premium-page .tg-premium-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .tg-grid {
    grid-template-columns: 1fr;
  }

  .tg-card {
    flex-direction: row;
    align-items: center;
  }

  .tg-card-img {
    padding: 12px;
    min-height: unset;
    flex-shrink: 0;
  }

  .tg-card-img img { width: 48px; height: 48px; }

  .tg-card-body { padding: 12px 0; }

  .tg-card-badge-mp {
    top: 8px;
    right: 8px;
    font-size: 9px;
    padding: 2px 8px;
  }

  .tg-card-play {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: auto;
    margin: 0;
    padding: 6px 14px;
    font-size: 12px;
  }

  .tg-card-meta { display: none; }

  .tg-card-lock {
    flex-direction: row;
    gap: 8px;
  }

  .tg-lock-icon { font-size: 20px; }
}

/* ================================================================
   NEW FEATURES — v0.3.0
   Avatar picker, settings, game stats, leaderboard, public profile,
   streak calendar, friends, notifications center
   ================================================================ */

/* --- Loading --- */
.tg-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* --- Header Notification Bell --- */
.tg-header-notif-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 6px 10px;
  font-size: 18px;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}
.tg-header-notif-btn:hover { background: rgba(255,255,255,0.05); }

.tg-notif-bell { filter: grayscale(0.3); }
.tg-notif-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Profile Streak Bar --- */
.tg-profile-streak-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(239,147,43,0.06);
  border: 1px solid rgba(239,147,43,0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gold-light);
  transition: var(--transition);
}
.tg-profile-streak-bar:hover { background: rgba(239,147,43,0.12); }
.tg-profile-streak-arrow { font-size: 16px; margin-left: auto; color: var(--text-muted); }

/* --- Profile Bottom Buttons --- */
.tg-profile-bottom-btns {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.tg-profile-settings-btn {
  flex: 1;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}
.tg-profile-settings-btn:hover { border-color: var(--border-gold); color: var(--text); }
.tg-profile-bottom-btns .tg-profile-logout { flex: 1; margin-top: 0; }

/* --- Profile Action Buttons (stacked) --- */
.tg-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.tg-btn-friends {
  background: rgba(212,165,55,0.1);
  border-color: rgba(212,165,55,0.2);
  color: var(--gold);
}
.tg-btn-friends:hover { background: rgba(212,165,55,0.15); }

/* --- Game Stats in Profile --- */
.tg-gs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.tg-gs-name { color: var(--text); font-weight: 500; flex: 1; }
.tg-gs-val { color: var(--text-dim); margin: 0 12px; }
.tg-gs-best { color: var(--gold); font-weight: 600; }
.tg-gs-empty { color: var(--text-muted); font-size: 12px; padding: 8px 0; }

/* --- Avatar Picker --- */
.tg-modal-avatars { max-width: 500px; }
.tg-avpick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.tg-avpick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.tg-avpick-item:hover { border-color: var(--border-gold); background: var(--bg-card-hover); }
.tg-avpick-item.active { border-color: var(--gold); background: rgba(212,165,55,0.1); }
.tg-avpick-item img { width: 40px; height: 40px; object-fit: contain; }
.tg-avpick-item span { font-size: 9px; color: var(--text-muted); text-align: center; line-height: 1.2; }

/* --- Settings Modal --- */
.tg-modal-settings { max-width: 420px; }
.tg-settings-group { margin-bottom: 16px; }
.tg-settings-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block; }
.tg-settings-row { display: flex; gap: 8px; }
.tg-settings-row .tg-modal-input { margin-bottom: 0; }
.tg-settings-save {
  padding: 0 20px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a12;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
}
.tg-settings-reset-btn {
  width: 100%;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}
.tg-settings-reset-btn:hover { border-color: var(--border-gold); color: var(--text); }
.tg-settings-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
}
.tg-settings-msg-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.tg-settings-msg-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }

/* --- Streak Calendar --- */
.tg-modal-streak { max-width: 500px; }
.tg-scal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 16px;
}
.tg-scal-nav {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tg-scal-month {
  font-family: 'MedievalSharp', cursive;
  font-size: 16px;
  color: var(--gold);
}
.tg-scal-arrow {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--gold);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.tg-scal-arrow:hover { background: rgba(255,255,255,0.06); }
.tg-scal-header {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  padding-bottom: 2px;
}
.tg-scal-day.empty { background: transparent; }
.tg-scal-day {
  width: 100%;
  height: 24px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}
.tg-scal-day.active { background: var(--gold-dim); color: #fff; }
.tg-scal-day.missed { background: rgba(239,68,68,0.15); color: rgba(239,68,68,0.6); }
.tg-scal-day.future { color: rgba(255,255,255,0.12); }
.tg-scal-day.empty { background: transparent; }
.tg-scal-legend { grid-column: 1/-1; display: flex; gap: 16px; margin-bottom: 8px; }
.tg-scal-leg { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.tg-scal-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.tg-scal-dot.active { background: var(--gold-dim); }
.tg-scal-dot.missed { background: rgba(239,68,68,0.35); }
.tg-scal-dot.today-dot { background: rgba(255,255,255,0.04); outline: 2px solid var(--gold); outline-offset: -1px; }
.tg-scal-day.today { outline: 2px solid var(--gold); outline-offset: -1px; }
.tg-scal-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.tg-scal-info b { color: var(--gold); }

/* Mini calendar (in public profile) */
.tg-scal-mini {
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 8px;
}
.tg-scal-sm { border-radius: 2px; height: 18px; font-size: 8px; }

/* --- Leaderboard Rows --- */
.tg-lb-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tg-lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.tg-lb-row:last-child { border-bottom: none; }
.tg-lb-row:hover { background: rgba(255,255,255,0.03); }
.tg-lb-gold { background: rgba(255,215,0,0.05); }
.tg-lb-silver { background: rgba(192,192,192,0.03); }
.tg-lb-bronze { background: rgba(205,127,50,0.03); }
.tg-lb-rank {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold);
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.tg-lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.tg-lb-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 16px;
}
.tg-lb-info { flex: 1; min-width: 0; }
.tg-lb-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.tg-lb-prem {
  font-size: 9px;
  background: var(--mp);
  color: #fff;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
}
.tg-lb-meta { font-size: 11px; color: var(--text-muted); }
.tg-lb-score {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold);
  white-space: nowrap;
}

/* --- Public Profile --- */
.tg-modal-public-profile { max-width: 480px; padding: 0 !important; overflow: hidden; }
.tg-modal-public-profile .tg-modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; color: rgba(255,255,255,0.7); }

.tg-pub-hero {
  position: relative;
  padding: 28px 24px 20px;
}
.tg-pub-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(212,165,55,0.08), rgba(139,92,246,0.06));
  border-bottom: 1px solid var(--border);
}
.tg-pub-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tg-pub-info { flex: 1; }
.tg-pub-badges { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.tg-pub-joined { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.tg-pub-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tg-online { color: var(--green); }
.tg-offline { color: var(--text-muted); }

.tg-modal-public-profile .tg-profile-stats,
.tg-modal-public-profile .tg-prof-xp-section {
  padding: 0 24px;
}
.tg-modal-public-profile .tg-prof-xp-section { padding-top: 12px; }

.tg-pub-streak {
  padding: 12px 14px;
  background: rgba(239,147,43,0.04);
  border: 1px solid rgba(239,147,43,0.12);
  border-radius: var(--radius-sm);
  margin: 0 24px 16px;
}
.tg-pub-streak-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.tg-pub-streak-longest { color: var(--text-muted); }
.tg-pub-gs { margin: 0 24px 16px; }
.tg-pub-gs h4 { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.tg-pub-friend-btn {
  width: calc(100% - 48px);
  margin: 0 24px 24px;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a12;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}
.tg-pub-friend-btn:hover { box-shadow: 0 4px 16px rgba(212,165,55,0.3); transform: translateY(-1px); }
.tg-pub-friend-added { background: var(--bg-card); color: var(--green); border: 1px solid rgba(34,197,94,0.3); cursor: default; }
.tg-pub-friend-added:hover { transform: none; box-shadow: none; }

/* --- Friends --- */
.tg-modal-friends { max-width: 460px; }
.tg-fr-search { display: flex; gap: 8px; margin-bottom: 12px; }
.tg-fr-search .tg-modal-input { margin-bottom: 0; }
.tg-fr-search-btn {
  padding: 0 16px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a12;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
}
.tg-fs-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text);
}
.tg-fs-result:hover { border-color: var(--border-gold); }
.tg-fs-lv { font-size: 11px; color: var(--gold); }
.tg-fs-empty { color: var(--text-muted); font-size: 12px; padding: 8px 0; }
.tg-friends-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }
.tg-fr-section-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 16px 0 8px; }
.tg-fr-req {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(139,92,246,0.05);
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.tg-fr-req-name { font-size: 13px; color: var(--text); font-weight: 500; }
.tg-fr-req-btns { display: flex; gap: 6px; }
.tg-fr-accept, .tg-fr-decline {
  padding: 4px 12px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}
.tg-fr-accept { background: var(--green); color: #fff; }
.tg-fr-decline { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.tg-fr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.tg-fr-left { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.tg-fr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--bg-card);
  flex-shrink: 0;
}
.tg-fr-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 16px;
}
.tg-fr-info { min-width: 0; }
.tg-fr-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.tg-fr-meta { display: block; font-size: 11px; color: var(--text-muted); }
.tg-fr-remove {
  padding: 4px 10px;
  background: none;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  color: var(--red);
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}
.tg-fr-remove:hover { background: rgba(239,68,68,0.1); }

/* --- Notification Center --- */
.tg-modal-notifs { max-width: 440px; }
.tg-nc-list { max-height: 60vh; overflow-y: auto; }
.tg-nc-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; }
.tg-nc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: var(--transition);
}
.tg-nc-item.unread { background: rgba(212,165,55,0.05); }
.tg-nc-icon { font-size: 20px; flex-shrink: 0; }
.tg-nc-body { flex: 1; min-width: 0; }
.tg-nc-msg { display: block; font-size: 13px; color: var(--text); }
.tg-nc-time { display: block; font-size: 10px; color: var(--text-muted); margin-top: 2px; }
