/* Main Content Spacing - Reduced padding between header and profile */
main.container {
  margin-top: 8px;
}

/* Photo Banner Section */
.photo-banner {
  margin-bottom: 16px; /* reduce spacing beneath banner to keep section compact */
}

/* Carousel banner */
.banner-carousel {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--c-accent);
}

/* Desktop ratio by default; mobile ratios handled by picture source */
.banner-carousel { aspect-ratio: 2400 / 640; width: 100%; }

/* Fallback fixed height for browsers without aspect-ratio */
.banner-carousel { /* height derived from aspect-ratio */ }

.banner-carousel .carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  will-change: transform;
}

.banner-carousel .carousel-slide {
  min-width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.banner-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.banner-carousel .carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.banner-carousel .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
}

.banner-carousel .dot.active { background: var(--c-white); }

@media (max-width: 768px) {
  .banner-carousel { 
    aspect-ratio: auto; 
    height: auto;
  }
  
  .banner-carousel .carousel-slide {
    height: auto;
  }
  
  .banner-carousel img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }
}

/* User Profile & Balance Section - Reduced top margin */
.profile-balance-section {
  margin: 8px 0 24px 0;
}

.profile-card {
  background: var(--c-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--c-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex: 1;
}

.user-avatar {
  position: relative;
}

.user-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--c-primary);
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.online-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--c-primary);
  border-radius: 50%;
  border: 2px solid var(--c-accent);
}

.user-details h3 {
  margin: 0 0 4px 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  background: linear-gradient(135deg, #ff85a2, #ff6b9d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-details p {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--c-text-muted);
  opacity: 1;
}

.balance-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.balance-item .balance-label {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
  color: var(--c-text-muted);
  opacity: 1;
  display: block;
  margin-bottom: 4px;
}

.balance-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.balance-value .currency {
  font-size: var(--font-size-sm);
  color: var(--c-primary);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
}

.balance-value .amount {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--c-text);
}

.balance-topup-btn {
  background: var(--c-primary);
  color: var(--c-white);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.balance-topup-btn:hover {
  background: var(--c-secondary);
}

@media (max-width: 520px) {
  .profile-card {
    padding: 16px;
    gap: 16px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .user-info {
    gap: 12px;
    justify-content: flex-start;
  }
  
  .user-img {
    width: 50px;
    height: 50px;
  }
  
  .user-details h3 {
    font-size: var(--font-size-base);
  }
  
  .user-details p {
    font-size: var(--font-size-xs);
  }
  
  .balance-info {
    gap: 12px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .balance-item .balance-label {
    font-size: var(--font-size-xs);
  }
  
  .balance-value .amount {
    font-size: var(--font-size-xl);
  }
  
  .balance-value .currency {
    font-size: var(--font-size-sm);
  }
  
  .balance-topup-btn {
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }
}

/* Games Grid Section */
.games-grid {
  margin-top: 16px;
  max-width: 1200px; /* match site container width */
  margin-left: auto;
  margin-right: auto;
  padding: 0; /* align grid with container edge for full-width feel */
  width: 100%;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* all icons in one row on desktop */
  gap: 16px;
  justify-items: stretch; /* let items span full cell width */
  align-items: start;
  padding: 0;
  width: 100%;
  margin: 0;
}

.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.app-item:hover {
  transform: translateY(-2px);
}

.app-icon {
  width: clamp(80px, 75%, 120px); /* smaller, professional size on desktop */
  aspect-ratio: 1 / 1; /* keep square */
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
  transition: all 0.3s ease;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-border);
}

.game-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.app-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ml-icon,
.pubg-icon,
.ff-icon,
.topup-icon,
.bigo-icon,
.love-deepspace-icon {
  background: transparent;
  border: none;
}

.app-label {
  text-align: center;
  margin-top: 4px;
}

.app-label p {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1;
  transition: color 0.3s ease;
}

/* Hover effect for app-grid cards - change text to black */
.app-item:hover .app-label p {
  color: black;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .app-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 icons per row on mobile */
    gap: 8px;
    padding: 0; /* remove inner padding to let icons match section width */
  }
  .app-item { padding: 0; min-width: 0; } /* remove per-item padding so icons fill cells */
  .app-icon { width: 85%; aspect-ratio: 1 / 1; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
  .app-label { max-width: 100%; }
  .app-label p { font-size: 10px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
}

@media (max-width: 480px) {
  .app-grid { grid-template-columns: repeat(4, 1fr); gap: 8px !important; padding: 0 !important; }
  .app-item { padding: 0 !important; }
  .app-icon { width: 82% !important; aspect-ratio: 1 / 1; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
  .app-label p { font-size: 9px; line-height: 1.2; }
}

@media (max-width: 520px) {
  .games-grid {
    gap: 16px;
    margin-top: 24px;
  }
  
  .game-card {
    padding: 20px 12px;
    border-radius: 16px;
  }
  
  .game-icon {
    width: 50px;
    height: 50px;
    font-size: var(--font-size-2xl);
    border-radius: 12px;
  }
  
  .game-card h3 {
    font-size: var(--font-size-sm);
  }
  
  .game-card p {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .games-grid {
    gap: 12px;
  }
  .app-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  
  .game-card {
    padding: 16px 8px;
  }
  
  .game-icon {
    width: 44px;
    height: 44px;
    font-size: var(--font-size-xl);
  }
}

/* Remove quick-links styles as they're no longer needed */
/* --- Removed legacy banner-image and duplicate mobile grid/icon rules to avoid conflicts --- */

/* Login Prompt Section Styles */
.login-prompt-section {
  margin: 8px 0 16px 0; /* tighter vertical spacing */
}

.login-prompt-card {
  background: var(--c-surface); /* match site card background */
  border-radius: var(--radius-lg);
  padding: 20px 16px; /* reduce padding to avoid oversized card */
  border: 1px solid var(--c-border);
  text-align: center;
  box-shadow: var(--shadow-soft);
  width: 100%;
}

.login-prompt-content h3 {
  margin: 0 0 8px 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--c-text);
}

.login-prompt-content p {
  margin: 0 0 16px 0;
  font-size: var(--font-size-sm);
  color: var(--c-text-muted);
  line-height: var(--line-height-normal);
}

.login-prompt-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.login-btn,
.register-btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 110px;
  justify-content: center;
  text-decoration: none;
  font-family: var(--font-family-primary);
}

.login-btn {
  background: var(--c-primary);
  color: var(--c-white);
  box-shadow: var(--shadow-md);
}

.login-btn:hover {
  background: #1fb5d8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.register-btn {
  background: var(--c-white);
  color: var(--c-primary);
  border: 2px solid var(--c-primary);
  box-shadow: var(--shadow-soft);
}

.register-btn:hover {
  background: var(--c-primary);
  color: var(--c-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Mobile responsive design for login prompt */
@media (max-width: 520px) {
  .login-prompt-section { margin: 6px 0 12px 0; }
  .login-prompt-card { padding: 16px 12px; margin: 0; width: 100%; }
  .login-prompt-content h3 { font-size: var(--font-size-lg); }
  .login-prompt-content p { font-size: var(--font-size-xs); }
  .login-prompt-actions { flex-direction: row; gap: 6px; }
  .login-btn, .register-btn { width: auto; padding: 12px 16px; }
}

/* Consolidated: duplicate games-grid/app-grid rules removed above to avoid conflicts */

/* MLBB Region Checker Section Styles */
.mlbb-checker-section {
  margin: 16px 0 24px 0;
}

.mlbb-checker-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.checker-header h3 {
  margin: 0 0 6px 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  background: linear-gradient(135deg, #ff85a2, #ff6b9d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.checker-subtitle {
  margin: 0 0 12px 0;
  font-size: var(--font-size-sm);
  color: var(--c-text-muted);
}

.checker-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: var(--font-size-xs);
  color: var(--c-text);
  font-weight: var(--font-weight-medium);
}

.input-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-white);
  color: var(--c-text);
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.input-group input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(44, 198, 238, 0.15);
}

.checker-btn {
  align-self: flex-start;
  background: var(--c-primary);
  color: var(--c-white);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.checker-btn:hover {
  background: #1fb5d8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.checker-btn.loading {
  opacity: 0.8;
  cursor: wait;
}

.checker-result {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface-light);
}

.result-success .result-header,
.result-error .result-header,
.result-loading {
  font-weight: var(--font-weight-semibold);
  color: var(--c-text);
  margin-bottom: 8px;
}

.result-success .result-header { color: #10b981; }
.result-error .result-header { color: #ef4444; }

.result-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.detail-row { display: flex; gap: 6px; }
.detail-label { color: var(--c-text-muted); }
.detail-value { color: var(--c-text); font-weight: var(--font-weight-medium); }

/* Responsive */
@media (max-width: 768px) {
  .checker-grid { grid-template-columns: 1fr 1fr; }
  .result-details { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .mlbb-checker-card { padding: 16px; }
  .checker-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (max-width: 420px) {
  .checker-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
