@import './variables.css';

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-darkest);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  background-image:
    radial-gradient(circle at 10% 15%, rgba(0, 240, 255, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(217, 70, 239, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 50% 40%, rgba(255, 159, 67, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #090e1a 0%, #050810 100%);
  background-attachment: fixed;
}

/* Subtle 3D Ambient Mesh Background Glow */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 120vw;
  height: 140vh;
  background:
    radial-gradient(400px circle at 30% 20%, rgba(0, 240, 255, 0.08), transparent 80%),
    radial-gradient(500px circle at 75% 70%, rgba(217, 70, 239, 0.08), transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* App Wrapper */
.app-container {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* App Header - 3D Glassmorphism */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.2rem;
  background: linear-gradient(135deg, rgba(16, 26, 48, 0.75), rgba(9, 15, 29, 0.85));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}

.app-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 240, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: var(--transition-fast);
}

.brand-icon:hover {
  transform: translateY(-2px) scale(1.05) rotate(3deg);
  box-shadow: 0 12px 28px rgba(0, 240, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 240, 255, 0.25));
}

.auth-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-status .badge {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.08));
  color: var(--accent-cyan);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid var(--accent-cyan-glow);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Main Split Content Area */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 1.5rem;
  flex: 1;
}

/* Left Panel: Calendar 3D Glass Container */
.calendar-panel {
  background: linear-gradient(145deg, rgba(16, 27, 51, 0.72), rgba(9, 16, 31, 0.82));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  box-shadow: var(--shadow-lg);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.current-month {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.calendar-nav-btn {
  background: linear-gradient(145deg, rgba(28, 44, 80, 0.8), rgba(16, 27, 51, 0.9));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-white);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.calendar-nav-btn:hover {
  background: linear-gradient(135deg, var(--accent-cyan), #0080ff);
  color: var(--bg-darkest);
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 8px 20px rgba(0, 240, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.calendar-nav-btn:active {
  transform: translateY(1px) scale(0.96);
}

/* Weekday Grid */
.weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.weekday-head {
  padding: 0.5rem 0;
}

.weekday-head.sun {
  color: var(--accent-league);
  text-shadow: 0 0 10px rgba(255, 159, 67, 0.3);
}

/* Days Grid - 3D Tactile Buttons */
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  flex: 1;
}

.day-cell {
  aspect-ratio: 1;
  background: linear-gradient(145deg, rgba(22, 36, 68, 0.75), rgba(12, 20, 38, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.day-cell.other-month {
  opacity: 0.25;
  cursor: default;
  box-shadow: none;
}

.day-cell:not(.other-month):hover {
  background: linear-gradient(145deg, rgba(32, 54, 98, 0.9), rgba(18, 30, 56, 0.95));
  border-color: var(--accent-cyan);
  border-top-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 240, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Distinct Magenta-Azulado 3D Gradient for Days with Tournaments */
.day-cell.has-events {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.28) 0%, rgba(139, 92, 246, 0.28) 45%, rgba(0, 240, 255, 0.22) 100%);
  border: 1px solid rgba(217, 70, 239, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 20px rgba(217, 70, 239, 0.3), 0 0 16px rgba(0, 240, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.day-cell.has-events:not(.other-month):hover {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.45) 0%, rgba(139, 92, 246, 0.45) 50%, rgba(0, 240, 255, 0.35) 100%);
  border-color: var(--accent-cyan);
  border-top-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 32px rgba(217, 70, 239, 0.45), 0 0 25px rgba(0, 240, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.day-cell.today {
  border-color: var(--accent-cyan);
  background: linear-gradient(145deg, rgba(0, 240, 255, 0.2), rgba(9, 15, 28, 0.7));
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.day-cell.selected {
  background: linear-gradient(145deg, rgba(32, 52, 96, 0.95), rgba(14, 24, 46, 0.98));
  border: 2px solid var(--accent-league);
  box-shadow: 0 0 26px var(--accent-league-glow), inset 0 0 14px rgba(255, 159, 67, 0.3);
  transform: translateY(-2px) scale(1.01);
}

.day-num {
  font-size: 1.05rem;
  font-weight: 900;
  align-self: flex-start;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.day-cell.has-events .day-num {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(217, 70, 239, 0.7), 0 1px 4px rgba(0, 0, 0, 0.8);
}

.day-cell.today .day-num {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

/* Day Event Indicators & 3D League Badges */
.day-events-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.day-league-badge {
  background: linear-gradient(135deg, #ff9f43, #ee5253);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(255, 159, 67, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  align-self: flex-start;
}

.day-events-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.event-icon-badge {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan-glow);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-magenta);
  box-shadow: 0 0 10px var(--accent-magenta);
}

/* Right Panel: Events Sidebar 3D Glass */
.events-panel {
  background: linear-gradient(145deg, rgba(16, 27, 51, 0.72), rgba(9, 16, 31, 0.82));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--accent-cyan);
}

.events-panel-header {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Search input 3D tactile box */
.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.7rem;
  background: rgba(6, 10, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.selected-date-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-bright);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.clear-filter-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.08));
  border: 1px solid var(--accent-cyan-glow);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 10px rgba(0, 240, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.clear-filter-btn:hover {
  background: var(--accent-cyan);
  color: var(--bg-darkest);
  box-shadow: 0 6px 16px rgba(0, 240, 255, 0.35);
}

/* Events List Container */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.events-list::-webkit-scrollbar {
  width: 6px;
}

.events-list::-webkit-scrollbar-track {
  background: rgba(6, 10, 18, 0.6);
  border-radius: 10px;
}

.events-list::-webkit-scrollbar-thumb {
  background: var(--bg-accent);
  border-radius: 10px;
}

/* Single Event Card Item with 3D Depth & Lift */
.event-card {
  background: linear-gradient(145deg, rgba(14, 23, 42, 0.8), rgba(7, 12, 23, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  transition: var(--transition-fast);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.event-card:hover {
  background: linear-gradient(145deg, rgba(22, 36, 66, 0.9), rgba(12, 20, 38, 0.95));
  border-color: var(--accent-cyan);
  border-top-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px) translateX(4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 240, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Poster Thumbnail 3D Frame */
.event-poster-thumb {
  width: 58px;
  height: 74px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: var(--transition-fast);
}

.event-card:hover .event-poster-thumb {
  transform: scale(1.04);
  border-color: var(--accent-cyan);
  box-shadow: 0 6px 16px rgba(0, 240, 255, 0.3);
}

.event-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

.event-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-badge {
  background: linear-gradient(135deg, #ff9f43, #ee5253);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(255, 159, 67, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.league-badge.league-badge-metal {
  background: linear-gradient(135deg, #a55eea, #45aaf2);
  box-shadow: 0 3px 8px rgba(165, 94, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.event-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.event-meta-item {
  display: flex;
  align-items: self-start;
  gap: 0.35rem;
}

.event-meta-item svg {
  margin-top: 3px;
}

/* Pagination Controls 3D */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-btn {
  background: linear-gradient(145deg, rgba(20, 32, 60, 0.7), rgba(9, 15, 28, 0.8));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-bright);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.pagination-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-cyan), #0080ff);
  color: var(--bg-darkest);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 240, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

/* Card Admin Action Buttons */
.event-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  transform: translateY(-2px);
}

.btn-icon.edit-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan-glow);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.3);
}

.btn-icon.delete-btn:hover {
  color: var(--danger);
  background: rgba(255, 71, 87, 0.2);
  border-color: rgba(255, 71, 87, 0.4);
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

/* General Tactile Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #0080ff 100%);
  color: var(--bg-darkest);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.015);
  filter: brightness(1.12);
  box-shadow: 0 14px 32px rgba(0, 240, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.3);
}

.btn-secondary {
  background: linear-gradient(145deg, rgba(28, 44, 80, 0.8), rgba(16, 27, 51, 0.9));
  color: var(--text-white);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: linear-gradient(145deg, rgba(38, 58, 102, 0.9), rgba(22, 36, 68, 0.95));
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary:active {
  transform: translateY(1px);
}

.btn-full {
  width: 100%;
}

/* Empty State */
.empty-events-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.empty-events-icon {
  opacity: 0.5;
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* Visibility Control for Admin Buttons */
.admin-only {
  display: none !important;
}

body.logged-in .admin-only {
  display: inline-flex !important;
}

body.logged-in div.admin-only,
body.logged-in button.admin-only {
  display: flex !important;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .main-layout {
    display: flex;
    flex-direction: column;
  }

  .events-panel {
    order: 1;
  }

  .calendar-panel {
    order: 2;
  }
}

@media (max-width: 640px) {
  .app-container {
    padding: 0.6rem;
  }

  .app-header {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }

  .calendar-panel,
  .events-panel {
    padding: 1rem 0.8rem;
    border-radius: var(--radius-md);
  }

  .calendar-header {
    padding-bottom: 0.8rem;
  }

  .current-month {
    font-size: 1.25rem;
  }

  .weekdays-grid {
    gap: 6px;
    font-size: 0.72rem;
    letter-spacing: 0;
  }

  .weekday-head {
    padding: 0.25rem 0;
  }

  .days-grid {
    gap: 6px;
  }

  .day-cell {
    padding: 5px 4px;
    border-radius: 8px;
    min-height: 48px;
    aspect-ratio: 1 / 1.15;
  }

  .day-num {
    font-size: 0.82rem;
  }

  .day-events-container {
    gap: 2px;
  }

  .day-league-badge {
    font-size: 0.52rem;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0;
  }

  .day-events-indicator {
    gap: 2px;
  }

  .event-icon-badge {
    font-size: 0.58rem;
    padding: 1px 4px;
    border-radius: 6px;
    gap: 2px;
  }

  .event-icon-badge svg {
    width: 8px;
    height: 8px;
  }

  .event-dot {
    width: 5px;
    height: 5px;
  }
}

@media (max-width: 400px) {
  .app-container {
    padding: 0.4rem;
  }

  .calendar-panel,
  .events-panel {
    padding: 0.75rem 0.5rem;
  }

  .weekdays-grid,
  .days-grid {
    gap: 4px;
  }

  .day-cell {
    padding: 4px 2px;
    min-height: 44px;
    border-radius: 6px;
  }

  .day-num {
    font-size: 0.75rem;
  }

  .day-league-badge {
    font-size: 0.46rem;
    padding: 1px 3px;
  }

  .event-icon-badge {
    font-size: 0.52rem;
    padding: 1px 3px;
  }
}

/* ==========================================
   App Loader Screen (3D Glassmorphism Theme)
   ========================================== */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 18, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
  opacity: 1;
  visibility: visible;
}

.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
}

.loader-spinner-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-spinner-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-cyan);
  border-bottom-color: var(--accent-magenta);
  animation: spinOuter 1s linear infinite;
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.loader-spinner-inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-left-color: var(--accent-league);
  border-right-color: var(--accent-cyan);
  animation: spinInner 1.4s linear infinite reverse;
}

.loader-icon {
  position: relative;
  z-index: 2;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseGlow 2s ease-in-out infinite alternate;
}

.loader-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.loader-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 2.5px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.loader-subtext {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  animation: subtextFade 1.5s ease-in-out infinite alternate;
}

@keyframes spinOuter {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinInner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0% { transform: scale(0.92); opacity: 0.75; filter: drop-shadow(0 0 4px var(--accent-cyan-glow)); }
  100% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 14px var(--accent-cyan-glow)); }
}

@keyframes subtextFade {
  0% { opacity: 0.45; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-spinner-outer,
  .loader-spinner-inner,
  .loader-icon,
  .loader-subtext {
    animation: none;
  }
}