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

:root {
  /* Backgrounds */
  --bg-primary: #0a0f1c;
  --bg-secondary: #0f1729;
  --bg-card: #131c2e;
  --bg-elevated: #1a2540;
  --bg-hover: #1f2d4d;

  /* Accents - Modern Tech */
  --accent-cyan: #00e0ff;
  --accent-electric: #0099ff;
  --accent-lime: #aaff00;
  --accent-green: #00ff88;
  --accent-orange: #ff7b00;
  --accent-amber: #ffaa00;
  --accent-purple: #7c3aed;
  --accent-red: #ff3860;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Borders & Glows */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(0, 224, 255, 0.3);
  --glow-cyan: rgba(0, 224, 255, 0.25);
  --glow-lime: rgba(170, 255, 0, 0.25);
}

html,
body {
  font-family: 'Inter', sans-serif;
  background: #050810;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at top left, rgba(0, 153, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
    #050810;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
}

/* ════════ APP LAYOUT ════════ */
.app {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1729 0%, #0a0f1c 100%);
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  max-width: 100%;
  margin: 0;
  position: relative;
  width: 100%;
}

/* ════════ LEFT SIDEBAR ════════ */
.sidebar-left {
  background: rgba(0, 0, 0, 0.3);
  padding: 25px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-electric));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050810;
  box-shadow:
    0 8px 20px var(--glow-cyan),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  position: relative;
}

.nav-item:hover {
  color: var(--accent-cyan);
  background: rgba(0, 224, 255, 0.08);
}

.nav-item.active {
  color: var(--accent-cyan);
  background: rgba(0, 224, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 224, 255, 0.3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent-cyan);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--accent-cyan);
}

.add-btn {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.add-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  border-style: solid;
}

/* ════════ MAIN CONTENT ════════ */
.main {
  padding: 30px 40px;
  overflow-y: auto;
  max-height: 100vh;
  width: 100%;
}

.main::-webkit-scrollbar {
  width: 6px;
}

.main::-webkit-scrollbar-track {
  background: transparent;
}

.main::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.main::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 224, 255, 0.3);
}

/* ════════ TOP BAR ════════ */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 25px;
  align-items: center;
  margin-bottom: 30px;
}

.greeting .hello {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 400;
}

.greeting .username {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  transition: all 0.3s;
}

.search-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.1);
}

.search-icon {
  color: var(--text-muted);
}

.search-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  flex: 1;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.search-wrapper input::placeholder {
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-btn {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s;
}

.action-btn:hover {
  background: rgba(0, 224, 255, 0.08);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--accent-lime);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px var(--accent-lime);
}

/* ════════ CONTENT GRID ════════ */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  margin-bottom: 25px;
}

/* ════════ HERO CARD ════════ */
.hero-card {
  background: linear-gradient(135deg, #0c1424 0%, #14213d 50%, #1a2845 100%);
  border-radius: 24px;
  padding: 45px;
  position: relative;
  overflow: hidden;
  min-height: 340px;
  margin-bottom: 25px;
  border: 1px solid var(--border);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, transparent, var(--accent-cyan), transparent, var(--accent-purple), transparent);
  border-radius: 24px;
  opacity: 0.3;
  z-index: -1;
  animation: borderRotate 8s linear infinite;
}

@keyframes borderRotate {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}

.hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background:
    radial-gradient(circle at 70% 50%, rgba(0, 224, 255, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 90% 30%, rgba(170, 255, 0, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  width: 280px;
  height: 280px;
  background:
    conic-gradient(from 0deg at 50% 50%,
      transparent 0deg,
      rgba(0, 224, 255, 0.15) 90deg,
      transparent 180deg,
      rgba(170, 255, 0, 0.1) 270deg,
      transparent 360deg);
  border-radius: 50%;
  animation: spin 15s linear infinite;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 10%;
  transform: translateY(-50%);
  width: 200px;
  height: 200px;
  border: 1px solid rgba(0, 224, 255, 0.2);
  border-radius: 50%;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 55%;
}

.hero-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.tag-popular {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-amber));
  color: #050810;
  box-shadow: 0 4px 12px rgba(255, 123, 0, 0.4);
}

.tag-icon {
  background: rgba(0, 0, 0, 0.4);
  color: var(--accent-cyan);
  padding: 6px 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 224, 255, 0.2);
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 0.95;
  margin-bottom: 20px;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ffffff 0%, #00e0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 30px rgba(0, 224, 255, 0.3);
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 420px;
}

.hero-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.players-avatars {
  display: flex;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #14213d;
  margin-left: -8px;
}

.mini-avatar:first-child {
  margin-left: 0;
}

.mini-avatar.more {
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  backdrop-filter: blur(10px);
  border: 2px solid var(--accent-cyan);
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-electric));
  color: #050810;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s;
  box-shadow:
    0 8px 20px var(--glow-cyan),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 30px var(--glow-cyan),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
}

/* ════════ SECTIONS ════════ */
.section {
  margin-bottom: 25px;
}

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

.section-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.see-more {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.3s;
}

.see-more:hover {
  color: var(--accent-lime);
}

/* ════════ GAME CARDS ════════ */
.games-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 50px;
  gap: 15px;
  align-items: center;
}

.game-card-mini {
  background: var(--bg-card);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  border: 1px solid var(--border);
}

.game-card-mini:hover {
  transform: translateY(-4px);
}

.game-card-mini.active-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 30px var(--glow-cyan);
}

.card-bg {
  height: 130px;
  position: relative;
  overflow: hidden;
}

.survive-grad {
  background: linear-gradient(135deg, #00e0ff 0%, #0066ff 100%);
}

.quiz-grad {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
}

.race-grad {
  background: linear-gradient(135deg, #aaff00 0%, #00ff88 100%);
}

.draw-grad {
  background: linear-gradient(135deg, #ff7b00 0%, #ff3860 100%);
}

.gold-grad {
  background: linear-gradient(135deg, #ffaa00 0%, #ff7b00 100%);
}

.blue-grad {
  background: linear-gradient(135deg, #0099ff 0%, #7c3aed 100%);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.85) 100%);
}

.card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.card-play:hover {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #050810;
  box-shadow: 0 0 20px var(--glow-cyan);
}

.live-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  background: var(--accent-lime);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-lime);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card-content {
  padding: 14px 16px;
}

.card-content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-content p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.scroll-arrow {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.scroll-arrow:hover {
  background: var(--accent-cyan);
  color: #050810;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px var(--glow-cyan);
}

/* ════════ ACTIVITY CARD ════════ */
.activity-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 15px;
  align-items: center;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.activity-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

.activity-thumb {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.activity-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.activity-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.time-played {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mini-play {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-electric));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050810;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 12px var(--glow-cyan);
}

.mini-play:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px var(--glow-cyan);
}

/* ════════ QUICK ACCESS (RIGHT) ════════ */
.quick-access {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 25px;
}

.quick-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
}

.quick-card:hover:not(.disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.quick-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.quick-info h5 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.quick-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.live-tag {
  background: rgba(170, 255, 0, 0.12);
  color: var(--accent-lime);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(170, 255, 0, 0.3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ════════ STATS SECTION ════════ */
.stats-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 25px;
  border: 1px solid var(--border);
}

.stats-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.stats-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 25px;
}

.ring-svg {
  width: 100%;
  height: 100%;
}

.ring-progress {
  filter: drop-shadow(0 0 12px var(--glow-cyan));
}

.ring-svg defs linearGradient stop:nth-child(1) {
  stop-color: var(--accent-cyan);
}

.ring-svg defs linearGradient stop:nth-child(2) {
  stop-color: var(--accent-electric);
}

.ring-svg defs linearGradient stop:nth-child(3) {
  stop-color: var(--accent-purple);
}

.ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.ring-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ring-value {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-item {
  text-align: center;
}

.stat-icon-sm {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin: 0 auto 8px;
}

.stat-num {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.stat-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ════════ CONTROLLER BAR ════════ */
.controller-bar {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  gap: 15px;
}

.controller-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-lime));
}

.bar-info {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}

.bar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.bar-link {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  font-weight: 600;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-electric));
  color: #050810;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  box-shadow: 0 4px 12px var(--glow-cyan);
  flex-shrink: 0;
}

.copy-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--glow-cyan);
}

/* ════════ RIGHT SIDEBAR (FRIENDS) ════════ */
.sidebar-right {
  background: rgba(0, 0, 0, 0.3);
  padding: 25px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border-left: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-right::-webkit-scrollbar {
  width: 4px;
}

.sidebar-right::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.friends-header {
  margin-bottom: 15px;
}

.friends-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--accent-lime);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px var(--accent-lime);
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.friend {
  position: relative;
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.friend-avatar:hover {
  transform: scale(1.1);
  border-color: var(--accent-cyan);
}

.grad-1 {
  background: linear-gradient(135deg, #00e0ff, #0099ff);
}

.grad-2 {
  background: linear-gradient(135deg, #aaff00, #00ff88);
}

.grad-3 {
  background: linear-gradient(135deg, #ff7b00, #ffaa00);
}

.grad-4 {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.grad-5 {
  background: linear-gradient(135deg, #0099ff, #7c3aed);
}

.grad-6 {
  background: linear-gradient(135deg, #00e0ff, #aaff00);
}

.grad-7 {
  background: linear-gradient(135deg, #ff3860, #7c3aed);
}

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #475569;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.status-dot.online {
  background: var(--accent-lime);
  box-shadow: 0 0 8px var(--accent-lime);
}

/* ════════ RESPONSIVE ════════ */

/* Ultra-wide screens (2K, 4K) */
@media (min-width: 1920px) {
  .main {
    padding: 40px 60px;
  }

  .content-grid {
    grid-template-columns: 1fr 400px;
    gap: 40px;
  }

  .hero-card {
    padding: 60px;
    min-height: 400px;
  }

  .hero-title {
    font-size: 5.5rem;
  }

  .hero-desc {
    font-size: 1rem;
    max-width: 550px;
  }
}

/* Large Desktop */
@media (max-width: 1600px) {
  .content-grid {
    grid-template-columns: 1fr 320px;
    gap: 25px;
  }

  .hero-title {
    font-size: 4rem;
  }
}

/* Medium Desktop */
@media (max-width: 1400px) {
  .main {
    padding: 25px 30px;
  }

  .content-grid {
    grid-template-columns: 1fr 300px;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .hero-card {
    padding: 35px;
    min-height: 300px;
  }
}

/* Small Desktop / Laptop */
@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar-right {
    display: none;
  }

  .app {
    grid-template-columns: 75px 1fr;
  }

  .right-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
  }

  .quick-access {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 0;
  }

  .stats-section {
    grid-column: 1 / -1;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .main {
    padding: 20px 25px;
  }

  .hero-card {
    padding: 30px;
    min-height: 260px;
  }

  .hero-title {
    font-size: 2.8rem;
    letter-spacing: -1px;
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .hero-visual {
    display: none;
  }

  .hero-content {
    max-width: 100%;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 15px;
  }

  .search-wrapper {
    display: none;
  }

  .games-row {
    grid-template-columns: repeat(2, 1fr) 40px;
    gap: 10px;
  }

  .right-col {
    grid-template-columns: 1fr 1fr;
  }

  .stats-section {
    grid-column: 1 / -1;
  }

  .stats-ring {
    width: 160px;
    height: 160px;
  }
}

/* Mobile Landscape */
@media (max-width: 700px) {
  .app {
    grid-template-columns: 60px 1fr;
  }

  .sidebar-left {
    padding: 20px 0;
    gap: 20px;
  }

  .logo {
    width: 38px;
    height: 38px;
  }

  .nav-item {
    width: 38px;
    height: 38px;
  }

  .main {
    padding: 15px 18px;
  }

  .greeting .hello {
    font-size: 0.7rem;
  }

  .greeting .username {
    font-size: 0.95rem;
  }

  .action-btn {
    width: 36px;
    height: 36px;
  }

  .profile {
    padding: 6px 12px 6px 6px;
  }

  .profile-info {
    display: none;
  }

  .hero-card {
    padding: 25px;
    min-height: 240px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .tag {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .games-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .scroll-arrow {
    display: none;
  }

  .card-bg {
    height: 100px;
  }

  .right-col {
    grid-template-columns: 1fr;
  }

  .controller-bar {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .copy-link-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile Portrait */
@media (max-width: 500px) {
  .app {
    grid-template-columns: 55px 1fr;
  }

  .sidebar-left {
    padding: 15px 0;
    gap: 15px;
  }

  .logo {
    width: 34px;
    height: 34px;
  }

  .nav-item {
    width: 34px;
    height: 34px;
  }

  .main {
    padding: 12px 15px;
  }

  .topbar {
    margin-bottom: 20px;
  }

  .top-actions {
    gap: 6px;
  }

  .action-btn {
    width: 32px;
    height: 32px;
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .hero-card {
    padding: 20px;
    min-height: 220px;
    border-radius: 18px;
  }

  .hero-title {
    font-size: 1.8rem;
    line-height: 1;
  }

  .hero-desc {
    font-size: 0.8rem;
    margin-bottom: 18px;
  }

  .hero-tags {
    gap: 6px;
  }

  .play-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .mini-avatar {
    width: 28px;
    height: 28px;
  }

  .section-header h3 {
    font-size: 1rem;
  }

  .see-more {
    font-size: 0.75rem;
  }

  .stats-section {
    padding: 20px;
  }

  .stats-ring {
    width: 140px;
    height: 140px;
  }

  .ring-value {
    font-size: 1.8rem;
  }

  .stats-row {
    gap: 6px;
  }

  .stat-num {
    font-size: 0.95rem;
  }

  .quick-card {
    padding: 10px 12px;
  }

  .quick-icon {
    width: 36px;
    height: 36px;
  }

  .quick-info h5 {
    font-size: 0.8rem;
  }

  .quick-info p {
    font-size: 0.65rem;
  }

  .controller-bar {
    padding: 15px 18px;
  }

  .bar-info {
    gap: 10px;
  }

  .bar-label {
    font-size: 0.7rem;
  }

  .bar-link {
    font-size: 0.75rem;
    word-break: break-all;
  }

  .activity-card {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 12px;
  }

  .activity-thumb {
    width: 42px;
    height: 42px;
  }

  .activity-info h4 {
    font-size: 0.85rem;
  }

  .activity-info p {
    font-size: 0.7rem;
  }

  .time-played {
    display: none;
  }
}

/* Very small mobile */
@media (max-width: 380px) {
  .main {
    padding: 10px 12px;
  }

  .greeting {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .hero-title {
    font-size: 1.5rem;
  }
}

/* ═══════════════ USER AVATAR & PROFILE MENU ═══════════════ */
.profile-wrapper {
  position: relative;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.3s;
}

.user-avatar:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 224, 255, 0.4);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.default-avatar-icon {
  color: white;
  opacity: 0.9;
}

.profile-menu {
  position: absolute;
  top: 55px;
  right: 0;
  width: 280px;
  background: rgba(19, 28, 46, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: menuSlide 0.2s ease;
}

.profile-menu.hidden {
  display: none;
}

@keyframes menuSlide {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
}

.menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.menu-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
}

.menu-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.menu-item:hover {
  background: rgba(0, 224, 255, 0.08);
  color: var(--accent-cyan);
}

.menu-item svg {
  color: var(--text-muted);
  transition: color 0.2s;
}

.menu-item:hover svg {
  color: var(--accent-cyan);
}

.menu-item-danger:hover {
  background: rgba(255, 56, 96, 0.1);
  color: #ff3860;
}

.menu-item-danger:hover svg {
  color: #ff3860;
}

/* ═══════════════ PROFILE PANEL - ML STYLE ═══════════════ */
.profile-panel {
  padding: 0;
  animation: profileFadeIn 0.4s ease;
}

.profile-panel.hidden {
  display: none;
}

@keyframes profileFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 10px;
  transition: all 0.3s;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.profile-back:hover {
  color: var(--accent-cyan);
  background: rgba(0, 224, 255, 0.08);
  border-color: rgba(0, 224, 255, 0.2);
  transform: translateX(-5px);
}

/* Split Layout */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 30px;
  min-height: 500px;
}

/* LEFT SIDE */
.profile-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* User Card */
.profile-user-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border: 3px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

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

.profile-display-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.profile-email-display {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.profile-badges {
  display: flex;
  gap: 8px;
}

.profile-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-level {
  background: rgba(0, 224, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 224, 255, 0.3);
}

.badge-xp {
  background: rgba(170, 255, 0, 0.15);
  color: var(--accent-lime);
  border: 1px solid rgba(170, 255, 0, 0.3);
}

.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
}

.profile-edit-btn:hover {
  background: rgba(0, 224, 255, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Quick Stats */
.profile-quick-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.quick-stat {
  text-align: center;
  flex: 1;
}

.quick-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.quick-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Edit Form */
.profile-edit-form {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  animation: profileFadeIn 0.3s ease;
}

.profile-edit-form.hidden {
  display: none;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.profile-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}

.profile-form-group input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(0, 224, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.1);
}

.profile-form-group input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.username-input-wrapper {
  position: relative;
}

.username-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-cyan);
  font-weight: 700;
}

.username-input-wrapper input {
  padding-left: 30px;
}

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

.profile-save-btn {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-electric));
  color: var(--bg-primary);
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  min-height: 44px;
}

.profile-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 224, 255, 0.3);
}

.profile-save-btn.loading .btn-text {
  opacity: 0;
}

.profile-save-btn .btn-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid rgba(5, 8, 16, 0.3);
  border-top-color: var(--bg-primary);
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.profile-save-btn.loading .btn-spinner {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.profile-cancel-btn {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.profile-cancel-btn:hover {
  background: rgba(255, 56, 96, 0.1);
  border-color: rgba(255, 56, 96, 0.3);
  color: #ff3860;
}

#profile-message .success-message {
  background: rgba(170, 255, 0, 0.1);
  border: 1px solid rgba(170, 255, 0, 0.3);
  color: #aaff00;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 10px;
}

#profile-message .error-message {
  background: rgba(255, 56, 96, 0.1);
  border: 1px solid rgba(255, 56, 96, 0.3);
  color: #ff3860;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 10px;
}

/* Achievements */
.profile-achievements {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.profile-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: white;
}

.profile-section-title svg {
  color: var(--accent-cyan);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.achievement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s;
  text-align: center;
}

.achievement-item.locked {
  opacity: 0.4;
  filter: grayscale(100%);
}

.achievement-item.unlocked {
  opacity: 1;
  filter: none;
  border-color: rgba(0, 224, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 224, 255, 0.1);
}

.achievement-icon {
  font-size: 2rem;
}

.achievement-item p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* RIGHT SIDE: Character Display */
.profile-right {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.character-display {
  text-align: center;
  position: relative;
}

#character-canvas {
  border-radius: 20px;
  background: transparent;
}

.character-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Responsive */
@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-right {
    order: -1;
  }

  #character-canvas {
    width: 250px;
    height: 320px;
  }

  .achievements-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 500px) {
  .profile-user-card {
    flex-direction: column;
    text-align: center;
  }

  .profile-badges {
    justify-content: center;
  }

  .profile-edit-btn {
    align-self: center;
  }

  .profile-quick-stats {
    flex-wrap: wrap;
    gap: 10px;
  }

  .quick-stat-divider {
    display: none;
  }

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