/* ============================================
   LAYOUT — Grid, Header, Navigation
   ============================================ */

/* ============================================
   HEADER (Global)
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-4);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-area-top);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  min-width: 80px;
}

.header-right {
  justify-content: flex-end;
}

.header-center {
  flex: 1;
  text-align: center;
}

.header-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--font-size-md);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.header-title::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background-image: url('../imgs/logo.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.header-back {
  display: flex;
  align-items: center;
  gap: var(--spacing-1);
  font-size: var(--font-size-base);
  color: var(--accent);
  font-weight: 500;
  padding: var(--spacing-2) var(--spacing-2);
  margin-left: calc(var(--spacing-2) * -1);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.header-back:hover {
  background: var(--bg-tertiary);
  text-decoration: none;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  color: var(--text-secondary);
}

.header-icon-btn > svg {
  width: 20px;
  height: 20px;
}

.header-icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* App Logo (new) */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.header-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background-image: url('../imgs/logo.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(6, 138, 250, 0.35);
  overflow: hidden;
}

.header-logo-icon > svg {
  display: none;
}

/* Large logo icon (index.html hero) */
.header-logo-icon.float {
  border-radius: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Icon Button (new) */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn > svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* ============================================
   ICON UTILITY CLASSES
   ============================================ */

.icon-xs svg {
  width: 12px;
  height: 12px;
}

.icon-sm svg {
  width: 14px;
  height: 14px;
}

.icon-md svg {
  width: 16px;
  height: 16px;
}

.icon-base svg {
  width: 18px;
  height: 18px;
}

.icon-lg svg {
  width: 20px;
  height: 20px;
}

.icon-xl svg {
  width: 22px;
  height: 22px;
}

.icon-2xl svg {
  width: 24px;
  height: 24px;
}

.icon-3xl svg {
  width: 28px;
  height: 28px;
}

.icon-4xl svg {
  width: 32px;
  height: 32px;
}

.icon-5xl svg {
  width: 40px;
  height: 40px;
}

.icon-6xl svg {
  width: 48px;
  height: 48px;
}

.icon-7xl svg {
  width: 56px;
  height: 56px;
}

/* Icon with margin utilities */
.icon-mr-1 svg {
  margin-right: 4px;
}

.icon-mr-2 svg {
  margin-right: 8px;
}

/* ============================================
   BOTTOM NAV (Global)
   ============================================ */

.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: calc(64px + var(--safe-area-bottom));
  display: flex;
  align-items: center;
  padding: 0;
  padding-bottom: var(--safe-area-bottom);
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  width: 100%;
  height: 64px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 6px 0;
  text-decoration: none;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item:hover:not(.active) {
  color: var(--text-secondary);
}

.nav-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-icon > svg {
  width: 22px;
  height: 22px;
}

.nav-item.active .nav-icon {
  background: linear-gradient(135deg, rgba(6, 138, 250, 0.16), rgba(92, 124, 255, 0.12));
}

.nav-item.active .nav-icon svg {
  filter: drop-shadow(0 0 6px rgba(6, 138, 250, 0.45));
}

/* ============================================
   PAGE HERO
   ============================================ */

.hero {
  padding: 16px 0 32px;
  text-align: center;
  animation: fadeInUp 0.6s cubic-bezier(0.2, 0, 0, 1) both;
}

.hero-time-greeting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 10px;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright) 50%, var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 28px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

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

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

/* ============================================
   PAGE SECTIONS
   ============================================ */

.section {
  margin-bottom: var(--spacing-8);
}

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

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-link {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent);
}

.live-section {
  margin-bottom: var(--spacing-8);
  animation: fadeInUp 0.6s 0.1s cubic-bezier(0.2, 0, 0, 1) both;
}

.tournaments-section {
  margin-bottom: var(--spacing-8);
  animation: fadeInUp 0.6s 0.15s cubic-bezier(0.2, 0, 0, 1) both;
}

.stats-section {
  margin-bottom: var(--spacing-8);
  animation: fadeInUp 0.6s 0.2s cubic-bezier(0.2, 0, 0, 1) both;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
  display: grid;
  gap: var(--spacing-3);
}

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

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

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 8px;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(6, 138, 250, 0.12), rgba(92, 124, 255, 0.06));
  border: 1px solid rgba(6, 138, 250, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 28px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 280px;
}

/* ============================================
   BADGE ROW
   ============================================ */

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-4);
}
