:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --bg-card-hover: #1a4a7a;
  --accent-primary: #a855f7;
  --accent-secondary: #7c3aed;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;
  --border-color: #2a2a4a;
  --glow-purple: 0 10px 20px rgba(168,85,247,0.3);
  --glow-indigo: 0 10px 20px rgba(124,58,237,0.3);
  --font-display: 'Fredoka One', cursive;
  --font-body: 'Nunito', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Page loading overlay */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.page-loader .loader-logo {
  font-size: 64px;
  margin-bottom: 20px;
  animation: loader-bounce 1s ease-in-out infinite;
}
@keyframes loader-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.05); }
}
.page-loader .loader-text {
  font-family: var(--font-display);
  font-size: 28px;
  color: #ffce00;
  margin-bottom: 16px;
}
.page-loader .loader-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.page-loader .loader-bar-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #ffce00, #ff9f00);
  border-radius: 4px;
  animation: loader-slide 1s ease-in-out infinite;
}
@keyframes loader-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: rgba(8, 11, 20, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #a855f7;
  text-shadow: 3px 3px 0 #0a0a1a;
}

.nav-links {
  display: flex;
  gap: 25px;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent-primary);
}

.user-stats {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--bg-secondary);
  padding: 5px 15px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.xp-bar-mini {
  width: 100px;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.xp-progress-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  width: 0%;
  transition: width 0.5s ease;
}

/* Hero */
.hero {
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  margin-bottom: 20px;
  color: #ffce00;
  text-shadow: 5px 5px 0 #2d3436;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-bottom: 40px;
}

.stat-item h3 {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent-primary);
}

.stat-item p {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: var(--glow-cyan);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0,229,255,0.5);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo .logo {
  margin-bottom: 15px;
}

.footer-links h4 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Cloak Gear */
.cloak-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.cloak-trigger:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: rotate(45deg);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

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

.close-modal {
  cursor: pointer;
  color: var(--text-secondary);
}

/* Login Modal */
.login-modal-content {
  max-width: 360px;
  text-align: center;
}

.login-modal-header {
  margin-bottom: 24px;
}

.login-avatar {
  font-size: 3rem;
  margin-bottom: 12px;
}

.login-modal-header h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-modal-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#login-form {
  text-align: left;
}

#login-form .search-input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 10px;
}

.login-toggle {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-toggle a {
  color: var(--accent-color);
  text-decoration: none;
  margin-left: 5px;
}

.login-toggle a:hover {
  text-decoration: underline;
}

.login-error {
  margin-top: 15px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.85rem;
  text-align: left;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--accent-success);
  border-radius: 12px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10001;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toast.show {
  transform: translateX(0);
}

.toast-icon {
  font-size: 1.5rem;
}

.toast-content h4 {
  font-size: 0.9rem;
  color: var(--accent-success);
}

.toast-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Hamburger Menu */
.mobile-menu-btn {
  display: flex;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--bg-card);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mobile - Tablet */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .search-wrapper {
    margin-bottom: 15px;
  }
  
  .search-input {
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  .filters-container {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .filter-tab {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }
  
  .footer-logo {
    grid-column: 1 / -1;
  }
  
  .profile-panel {
    width: 85%;
    left: -85%;
  }
}

/* Mobile - Small */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .hero h1 {
    font-size: 1.6rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .footer-links h4 {
    font-size: 1rem;
  }
  
  .footer-links ul li a {
    font-size: 0.9rem;
    padding: 6px 0;
  }
  
  .footer-bottom p {
    font-size: 0.8rem;
  }
  
  .section-title {
    font-size: 1.2rem;
  }
}

/* ============================================

/* Video on hover */
.card-thumb {
  position: relative;
  overflow: hidden;
}

.card-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.activity-card:hover .card-video {
  opacity: 1;
}

.activity-card:hover .thumb-static {
  opacity: 0;
}

.thumb-static {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* Privacy Settings */
.privacy-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 990;
  font-size: 18px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.privacy-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.privacy-popup {
  position: fixed;
  bottom: 70px;
  left: 20px;
  width: 280px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  z-index: 991;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.privacy-popup.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.privacy-popup-content h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.privacy-popup-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.privacy-close-btn {
  width: 100%;
  padding: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.privacy-close-btn:hover {
  background: var(--border-color);
}

/* Search Panel */
.search-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.search-panel.open ~ .search-backdrop {
  opacity: 1;
  visibility: visible;
}

.search-panel {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background: var(--bg-secondary);
  box-shadow: 5px 0 30px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  transition: left 0.3s ease;
  overflow-y: auto;
}

.search-panel.open {
  left: 0;
}

.search-panel-content {
  padding: 20px;
}

.search-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.search-panel-header h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
}

.search-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
}

.search-panel-close:hover {
  color: var(--text-primary);
}

#search-panel-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin-bottom: 24px;
}

#search-panel-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.search-panel-categories h4 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.search-panel-categories ul {
  list-style: none;
}

.search-panel-categories ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.search-panel-categories ul li a:hover {
  background: var(--bg-primary);
}

/* Profile Side Panel */
.panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.profile-panel.open ~ .panel-backdrop {
  opacity: 1;
  visibility: visible;
}

.profile-panel {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100%;
  background: var(--bg-secondary);
  box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  transition: left 0.3s ease;
  overflow-y: auto;
}

.profile-panel.open {
  left: 0;
}

.panel-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.panel-logo {
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
  border-bottom: none;
}

.panel-menu {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.panel-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.panel-menu li a:hover {
  background: var(--bg-primary);
}

.panel-menu li a.active {
  color: var(--accent-primary);
}

.panel-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px;
  padding: 14px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-close-btn:hover {
  background: var(--border-color);
}

.panel-close-btn svg {
  width: 18px;
  height: 18px;
}

/* AI Game Central Cross-Promotion Banner */
.agc-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 52, 96, 0.6), rgba(26, 26, 46, 0.8));
  border: 2px solid var(--border-color);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.agc-banner:hover {
  border-color: #ffce00;
  box-shadow: 0 0 20px rgba(255, 206, 0, 0.15);
  transform: translateY(-1px);
}

.agc-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.agc-banner:hover .agc-banner-icon {
  transform: scale(1.15);
}

.agc-banner-text {
  flex: 1;
  min-width: 0;
}

.agc-banner-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  margin-bottom: 2px;
}

.agc-banner:hover .agc-banner-title {
  color: #ffce00;
}

.agc-banner-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.agc-banner-cta {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 12px;
  background: #ffce00;
  color: #1a1a2e;
  font-weight: 800;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.agc-banner:hover .agc-banner-cta {
  background: #ffdd44;
  box-shadow: 0 0 16px rgba(255, 206, 0, 0.4);
}

@media (max-width: 600px) {
  .agc-banner {
    padding: 12px 14px;
    gap: 12px;
  }
  .agc-banner-title {
    font-size: 0.9rem;
  }
  .agc-banner-cta {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

/* Screen-reader only (SEO H1) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Dashboard, Leaderboard, Achievements */

/* Leaderboard Table */
.leaderboard-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

th {
  padding: 15px 20px;
  font-family: var(--font-display);
  color: var(--text-secondary);
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-body);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-card-hover);
}

.rank-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
  width: 80px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.vip-badge {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 900;
}

.score-cell {
  font-family: var(--font-mono);
  color: var(--accent-success);
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}

.achievement-card.locked {
  filter: grayscale(1);
  opacity: 0.6;
}

.achievement-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1rem;
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.achievement-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.achievement-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.achievement-xp {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  background: var(--bg-secondary);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Daily Challenge */
.daily-banner {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(123, 47, 255, 0.1));
  border: 1px solid var(--accent-primary);
  border-radius: 20px;
  padding: 40px;
  display: flex;
  gap: 40px;
  align-items: center;
  margin-bottom: 60px;
  position: relative;
  overflow: hidden;
}

.daily-banner::before {
  content: 'DAILY CHALLENGE';
  position: absolute;
  top: 10px;
  right: -30px;
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-weight: 900;
  padding: 5px 40px;
  transform: rotate(45deg);
  font-size: 0.7rem;
}

.daily-thumb {
  width: 300px;
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--glow-cyan);
}

.daily-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.daily-info h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.daily-timer {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent-warning);
  margin-bottom: 20px;
}

.daily-stats {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Activity Page */
.activity-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-top: 30px;
}

.iframe-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.iframe-container.tall {
  aspect-ratio: unset;
  height: 750px;
  width: 390px;
  min-height: unset;
  margin: 0 auto;
  overflow: hidden;
}

.iframe-container.tall iframe {
  height: 1050px;
  margin-top: -280px;
  width: 100%;
  border: none;
  display: block;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  overflow-y: auto;
}

.iframe-container:-webkit-full-screen,
.iframe-container:-moz-full-screen,
.iframe-container:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
}

.iframe-container:-webkit-full-screen iframe,
.iframe-container:-moz-full-screen iframe,
.iframe-container:fullscreen iframe {
  width: 100% !important;
  height: 100% !important;
}

.activity-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  background: var(--bg-card);
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.control-btns {
  display: flex;
  gap: 15px;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: color 0.2s;
}

.control-btn:hover {
  color: var(--accent-primary);
}

.activity-details {
  margin-top: 30px;
}

.activity-details h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-card h3 {
  font-family: var(--font-display);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

@media (max-width: 1024px) {
  .activity-layout { grid-template-columns: 1fr; }
  .daily-banner { flex-direction: column; text-align: center; padding: 30px; }
  .daily-thumb { width: 100%; max-width: 400px; }
}
/* Activities Grid */
.activities-section {
  padding: 40px 0;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Filters */
.filters-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 15px;
  margin-bottom: 30px;
  scrollbar-width: none;
}

.filters-container::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.filter-tab.active {
  background: #a855f7;
  color: #2d3436;
  border-color: #2d3436;
  box-shadow: 4px 4px 0 #2d3436;
}

/* Search */
.search-wrapper {
  position: relative;
  margin-bottom: 40px;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px 20px 15px 50px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--glow-cyan);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Grid */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: 140px;
  gap: 10px;
  grid-auto-flow: dense;
}

@media (min-width: 1200px) {
  .activities-grid {
    grid-template-columns: repeat(9, 1fr);
    grid-auto-rows: minmax(140px, 1fr);
  }
}

.activity-card {
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

.activity-card.size-small { grid-column: span 1; grid-row: span 1; }
.activity-card.size-medium { grid-column: span 2; grid-row: span 2; }
.activity-card.size-wide { grid-column: span 2; grid-row: span 1; }
.activity-card.size-tall { grid-column: span 1; grid-row: span 2; }

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.activity-card:hover {
  transform: scale(1.02) rotate(1deg);
  border-color: var(--card-accent);
  box-shadow: 0 10px 0 var(--card-accent);
  z-index: 10;
}

.card-thumb {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  z-index: 2;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s, opacity 0.3s ease;
}

.thumb-preview {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.thumb-static {
  z-index: 0;
}

.activity-card:hover .thumb-static {
  opacity: 0;
}

.activity-card:hover .thumb-preview {
  opacity: 1;
  transform: scale(1.1);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  z-index: 4;
  border: 2px solid #2d3436;
  color: white;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.badge-arcade { background: #ff4757; }
.badge-puzzle { background: #2ed573; }
.badge-action { background: #ffa502; }
.badge-sports { background: #1e90ff; }
.badge-strategy { background: #7b2fff; }

.hot-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4757;
  color: white;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 900;
  animation: pulse 2s infinite;
  z-index: 4;
  border: 2px solid #2d3436;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 12px;
  color: white;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.activity-card:hover .card-info {
  opacity: 1;
  transform: translateY(0);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.card-desc {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-warning);
}

/* Featured Row */
.featured-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 0 30px;
  scrollbar-width: none;
}

.featured-row::-webkit-scrollbar {
  display: none;
}

.featured-card {
  min-width: 350px;
}

/* User Sections (Recently Played, Favorites) */
.user-section {
  margin-bottom: 15px;
}

.user-section .section-title {
  margin-bottom: 8px;
  font-size: 1rem;
}

.user-games-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.user-games-row::-webkit-scrollbar {
  height: 6px;
}

.user-games-row::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.user-games-row .activity-card {
  min-width: 80px;
  max-width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.user-games-row .activity-card .card-info {
  display: none;
}

.user-games-row .activity-card .card-thumb img {
  width: 80px;
  height: 80px;
}

.user-games-row .activity-card .fav-btn {
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  font-size: 12px;
}

/* Favorite Button */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  padding: 0;
}

.fav-btn:hover {
  transform: scale(1.15);
  background: rgba(0,0,0,0.6);
}

.fav-btn.active {
  background: rgba(255,100,100,0.3);
}

.activity-card {
  position: relative;
}

.card-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Profile Card */
.profile-card {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
  border: 3px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4), 0 0 40px rgba(239, 68, 68, 0.2);
}

.profile-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5), 0 0 50px rgba(239, 68, 68, 0.3);
}

.profile-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 12px;
  width: 100%;
  height: 100%;
  justify-content: space-between;
}

.profile-card-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  color: white;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.logo-emoji {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 2.4rem;
  position: relative;
  display: inline-block;
}

/* Steam Animation */
.steam-container {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  pointer-events: none;
}

.steam {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  filter: blur(3px);
  animation: steam-rise 2s ease-out infinite;
}

.steam:nth-child(1) { left: 4px; }
.steam:nth-child(2) { left: 12px; }
.steam-delay { animation-delay: 0.4s; }
.steam-delay-2 { animation-delay: 0.8s; }

@keyframes steam-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scaleX(1);
  }
  15% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.5;
    transform: translateY(-15px) scaleX(1.5) translateX(3px);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scaleX(2) translateX(-3px);
  }
}

.profile-card-actions {
  display: flex;
  width: 100%;
  gap: 8px;
}

.profile-card-btn {
  flex: 1;
  height: 56px;
  border-radius: 14px;
  border: none;
  background: rgba(255,255,255,0.25);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-card-btn:hover {
  background: rgba(255,255,255,0.4);
}

.profile-card-btn:active {
  transform: scale(0.96);
}

.profile-card-btn svg {
  width: 24px;
  height: 24px;
  stroke: white;
}

/* Load More */
.load-more-container {
  text-align: center;
  margin-top: 50px;
}

/* Responsive Grid */
@media (max-width: 1200px) {
  .activities-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); grid-auto-rows: 130px; }
}

@media (max-width: 768px) {
  .activities-grid { 
    grid-template-columns: repeat(3, 1fr); 
    grid-auto-rows: 130px;
    gap: 8px;
  }
  .featured-card { min-width: 280px; }
  .card-title { font-size: 0.85rem; }
  .card-desc { display: none; }
  .card-meta { font-size: 0.7rem; }
  .profile-card-logo { font-size: 1.6rem; }
  .profile-card-btn { height: 44px; }
  .profile-card-btn svg { width: 20px; height: 20px; }
}

@media (max-width: 480px) {
  .activities-grid { 
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    grid-auto-rows: 150px;
  }
  .card-info { padding: 8px; }
  .card-title { font-size: 0.8rem; }
  .card-views { font-size: 0.65rem; }
  .profile-card-content { padding: 16px 12px 8px; }
  .profile-card-logo { font-size: 1rem; }
}
