/* ==========================================================================
   Match Maker V1 MVP - Premium Tactical Dark Mode Stylesheet
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-display: 'Outfit', var(--font-family-sans);

  /* Color Palette - HSL Curated Tactical Palette */
  --bg-obsidian: hsl(222, 47%, 5%);       /* #040815 */
  --bg-deep-slate: hsl(222, 35%, 10%);    /* #0A0F20 */
  --card-slate: hsl(222, 28%, 15%);       /* #131A30 */
  --card-hover: hsl(222, 25%, 20%);       /* #1B2440 */
  
  --text-pure: hsl(0, 0%, 100%);
  --text-white: hsl(210, 40%, 96%);       /* #F1F5F9 */
  --text-muted: hsl(215, 20%, 65%);       /* #8EA1B4 */
  --text-dark: hsl(215, 25%, 30%);
  
  /* Tactical Action Accents */
  --accent-tactical: hsl(150, 84%, 43%);   /* #10B981 - Tactical Emerald (Active, Success) */
  --accent-tactical-glow: hsla(150, 84%, 43%, 0.15);
  
  --accent-amber: hsl(38, 92%, 50%);      /* #F59E0B - Amber Warning (No-show, Pending) */
  --accent-amber-glow: hsla(38, 92%, 50%, 0.15);
  
  --accent-crimson: hsl(350, 89%, 60%);    /* #EF4444 - Cancellation Red */
  --accent-crimson-glow: hsla(350, 89%, 60%, 0.15);

  --accent-indigo: hsl(245, 80%, 65%);     /* #6366F1 - Info, Admin */
  --accent-indigo-glow: hsla(245, 80%, 65%, 0.15);

  /* Borders & Shadows */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(255, 255, 255, 0.15);
  --shadow-tactical: 0 12px 40px -10px rgba(0, 0, 0, 0.7);
  --shadow-neon-green: 0 0 15px -3px hsla(150, 84%, 43%, 0.4);
  --shadow-neon-amber: 0 0 15px -3px hsla(38, 92%, 50%, 0.4);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-round: 9999px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

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

body {
  background-color: var(--bg-obsidian);
  color: var(--text-white);
  font-family: var(--font-family-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-obsidian);
}
::-webkit-scrollbar-thumb {
  background: var(--card-slate);
  border-radius: var(--radius-round);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--card-hover);
}

/* Glassmorphism Panel Template */
.glass-panel {
  background: rgba(19, 26, 48, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-tactical);
}

.glass-panel-interactive {
  background: rgba(19, 26, 48, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-tactical);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.glass-panel-interactive:hover {
  background: rgba(27, 36, 64, 0.85);
  border-color: var(--border-glass-bright);
  transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px hsla(150, 84%, 43%, 0.2); }
  50% { box-shadow: 0 0 15px hsla(150, 84%, 43%, 0.5); }
  100% { box-shadow: 0 0 5px hsla(150, 84%, 43%, 0.2); }
}

@keyframes vibration {
  0%, 100% { transform: translate(0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-3px, 1px); }
  20%, 40%, 60%, 80% { transform: translate(3px, -1px); }
}

.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.vibrate {
  animation: vibration 0.4s linear infinite;
}

/* App Core Layout */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0px;
}

/* Header UI */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  border-bottom: 1px solid var(--border-glass);
  padding: 0 16px;
}

.header-inner {
  max-width: 1200px;
  height: 64px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  color: var(--text-pure);
}

.logo-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px var(--accent-tactical));
}

.accent-text {
  color: var(--accent-tactical);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

#header-nav {
  display: flex;
  gap: 24px;
}

#header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
}

#header-nav a:hover, #header-nav a.active {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

#header-nav a.active {
  border-bottom: 2px solid var(--accent-tactical);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: var(--radius-round);
  border: 1px solid var(--border-glass);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.08);
}

.role-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-round);
}

.role-tag.player {
  background: var(--accent-indigo-glow);
  color: var(--accent-indigo);
  border: 1px solid var(--accent-indigo);
}

.role-tag.master {
  background: var(--accent-amber-glow);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber);
}

.role-tag.admin {
  background: var(--accent-crimson-glow);
  color: var(--accent-crimson);
  border: 1px solid var(--accent-crimson);
}



/* Base Layout Configs */
#main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Button & Interactive Element Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-tactical);
  color: var(--bg-obsidian);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: hsl(150, 84%, 48%);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: var(--text-dark);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-glass-bright);
}

.btn-danger {
  background: var(--accent-crimson);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: hsl(350, 89%, 65%);
  transform: translateY(-1px);
}

.btn-danger:disabled {
  background: var(--text-dark);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-warning {
  background: var(--accent-amber);
  color: var(--bg-obsidian);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: hsl(38, 92%, 55%);
  transform: translateY(-1px);
}

/* Badge Classes */
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-recruiting { background: var(--accent-tactical-glow); color: var(--accent-tactical); border: 1px solid var(--accent-tactical); }
.badge-closed { background: var(--accent-amber-glow); color: var(--accent-amber); border: 1px solid var(--accent-amber); }
.badge-playing { background: var(--accent-indigo-glow); color: var(--accent-indigo); border: 1px solid var(--accent-indigo); }
.badge-ended { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--border-glass); }
.badge-cancelled { background: var(--accent-crimson-glow); color: var(--accent-crimson); border: 1px solid var(--accent-crimson); }
.badge-settled { background: rgba(16, 185, 129, 0.1); color: var(--accent-tactical); border: 1px solid rgba(16, 185, 129, 0.4); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: rgba(10, 15, 32, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  padding: 12px 16px;
  font-family: var(--font-family-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-tactical);
  box-shadow: var(--shadow-neon-green);
  background: rgba(10, 15, 32, 0.95);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row > * {
  flex: 1;
}

/* Modals & Dialog System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 8, 21, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: var(--bg-deep-slate);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-md);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-tactical);
  animation: fadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

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

.modal-header h3 {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-pure);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-white);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Auth View Styles */
.auth-container {
  max-width: 420px;
  margin: 40px auto;
  padding: 32px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-family: var(--font-family-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-pure);
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.role-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.role-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.role-btn input {
  display: none;
}

.role-btn .role-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.role-btn .role-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-white);
  display: block;
  margin-bottom: 4px;
}

.role-btn .role-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.role-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glass-bright);
}

.role-btn.active {
  background: var(--accent-indigo-glow);
  border-color: var(--accent-indigo);
  box-shadow: 0 0 15px -3px rgba(99, 102, 241, 0.4);
}

.role-btn.active.master {
  background: var(--accent-amber-glow);
  border-color: var(--accent-amber);
  box-shadow: var(--shadow-neon-amber);
}

/* Home / Discovery View Styles */
.discovery-container {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
}

.search-filter-panel {
  padding: 24px;
  border-radius: var(--radius-md);
  height: fit-content;
  position: sticky;
  top: 88px;
}

.section-title {
  font-family: var(--font-family-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-pure);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Player Grid Calendar */
.player-calendar-wrapper {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.player-calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.player-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.player-calendar-day-cell {
  aspect-ratio: 1.1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.player-calendar-day-cell:hover {
  background: rgba(255, 255, 255, 0.06);
}

.player-calendar-day-cell.empty {
  opacity: 0.1;
  cursor: default;
  background: transparent;
  border: none;
  pointer-events: none;
}

.player-calendar-day-cell.active {
  border-color: var(--accent-tactical);
  background: var(--accent-tactical-glow);
  box-shadow: var(--shadow-neon-green);
}

.player-calendar-day-cell .day-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-white);
}

.player-calendar-day-cell.active .day-num {
  color: var(--accent-tactical);
}

.player-calendar-day-cell .game-count-badge {
  font-size: 0.58rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-tactical);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 3px;
  border-radius: var(--radius-xs);
  margin-top: auto;
  line-height: 1;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  box-sizing: border-box;
}

.player-calendar-day-cell.active .game-count-badge {
  background: var(--accent-tactical);
  color: var(--bg-obsidian);
  border-color: var(--accent-tactical);
}

/* Game Card Grid & Items */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.game-card {
  padding: 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.game-card-title {
  font-family: var(--font-family-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-pure);
  margin-bottom: 4px;
}

.game-card-field {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.game-card-body {
  margin-bottom: 16px;
}

.game-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-white);
  margin-bottom: 12px;
}

.game-card-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-card-pricing {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-card-pricing .price-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.game-card-pricing .price-val {
  font-family: var(--font-family-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-tactical);
}

/* Detail View Styles */
.game-detail-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-card {
  padding: 24px;
  border-radius: var(--radius-md);
}

.game-detail-header {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.game-detail-header h1 {
  font-family: var(--font-family-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-pure);
  margin: 12px 0 8px 0;
}

.detail-section-title {
  font-family: var(--font-family-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-pure);
  margin-bottom: 16px;
  border-left: 3px solid var(--accent-tactical);
  padding-left: 10px;
}

/* Dynamic Tier Accordion */
.pricing-accordion {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.pricing-accordion-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pricing-accordion-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pricing-accordion-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.pricing-accordion-body {
  padding: 20px;
  border-top: 1px solid var(--border-glass);
  display: none;
}

.pricing-accordion-body.open {
  display: block;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
}

.pricing-table th, .pricing-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.9rem;
}

.pricing-table th {
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-table tr.active-tier td {
  background: var(--accent-tactical-glow);
  color: var(--accent-tactical);
  font-weight: 700;
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

/* Participant List UI */
.participant-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.participant-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
}

/* Field Master / Admin Dashboard UI Elements */
.dashboard-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
  background: var(--accent-amber-glow);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.sidebar-link.admin-active {
  background: var(--accent-indigo-glow);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.stats-card-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stats-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.stats-card .stats-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.stats-card .stats-value {
  font-family: var(--font-family-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-pure);
}

/* Master Booking Calendar */
.calendar-view-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Standard Calendar Grid */
.calendar-grid-wrapper {
  padding: 20px;
  border-radius: var(--radius-md);
}

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

.calendar-month-header h3 {
  font-family: var(--font-family-display);
  font-size: 1.1rem;
}

.calendar-month-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day-cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.calendar-day-cell:hover {
  background: rgba(255, 255, 255, 0.06);
}

.calendar-day-cell.other-month {
  opacity: 0.2;
  cursor: default;
}

.calendar-day-cell.selected {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.05);
}

.calendar-day-cell .day-num {
  font-size: 0.85rem;
  font-weight: 600;
}

.day-badge-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
}

.day-badge-indicator.red { background: var(--accent-crimson); }
.day-badge-indicator.green { background: var(--accent-tactical); }
.day-badge-indicator.grey { background: var(--text-muted); }

/* Master Roster List Table */
.roster-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.roster-table th, .roster-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.85rem;
}

.roster-table th {
  color: var(--text-muted);
}

.noshow-badge {
  background: var(--accent-crimson-glow);
  color: var(--accent-crimson);
  border: 1px solid var(--accent-crimson);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Virtual SMS Smartphone Simulator Panel */
#sms-simulator-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 320px;
  height: 520px;
  z-index: 999;
  pointer-events: none; /* Allows click-through when closed */
}

.phone-shell {
  width: 100%;
  height: 100%;
  background: #000;
  border: 8px solid #222;
  border-radius: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  pointer-events: auto; /* Catch clicks */
  transform: translateY(450px); /* Partially hidden by default */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-shell.expanded {
  transform: translateY(0);
}

.phone-notch {
  width: 110px;
  height: 20px;
  background: #222;
  border-radius: 0 0 12px 12px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-notch::before {
  content: '';
  width: 40px;
  height: 4px;
  background: #333;
  border-radius: var(--radius-round);
}

.phone-header-toggle {
  background: #111;
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 0 20px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phone-body {
  flex: 1;
  background: #141416;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.phone-app-title {
  padding: 10px 16px;
  background: #1C1C1E;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phone-avatar {
  width: 28px;
  height: 28px;
  background: var(--accent-indigo);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 700;
}

.phone-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.phone-msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phone-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
  align-self: flex-start;
  background: #2C2C2E;
  color: #fff;
  white-space: pre-line;
}

.phone-bubble.sent {
  align-self: flex-end;
  background: #007AFF; /* Apple Blue for sent messages */
  color: #fff;
}

.phone-timestamp {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
  display: block;
}

/* Phone unread count trigger badge */
.phone-trigger-badge {
  position: absolute;
  top: -12px;
  right: 12px;
  background: var(--accent-crimson);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  animation: pulseGlow 2s infinite;
}

/* Master Income Tracking Table */
.income-table {
  width: 100%;
  border-collapse: collapse;
}

.income-table th, .income-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.9rem;
}

.income-table th {
  color: var(--text-muted);
}

/* Responsive Configs */
@media (max-width: 900px) {
  .discovery-container {
    grid-template-columns: 1fr;
  }
  .search-filter-panel {
    position: static;
  }
  .game-detail-container {
    grid-template-columns: 1fr;
  }
  .calendar-view-container {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  #app-header {
    padding: 0 8px;
  }
  .header-inner {
    height: auto;
    min-height: 64px;
    padding: 8px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }
  .logo {
    font-size: 1.15rem !important;
  }
  #header-nav {
    width: 100%;
    justify-content: center;
    gap: 6px;
    order: 3;
    display: flex;
    margin-top: 4px;
  }
  #header-nav a {
    font-size: 0.8rem;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .user-profile-badge {
    padding: 4px 8px;
    font-size: 0.75rem;
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
  }
  .user-profile-badge:empty {
    display: none !important;
  }
  .user-profile-badge .role-tag {
    display: none !important;
  }
  .user-profile-badge #logout-trigger {
    margin-left: 6px !important;
    font-size: 0.75rem !important;
  }
  
  #main-content {
    padding: 16px 12px 24px 12px;
  }
  
  /* Font size scale upgrades for optimal mobile readability */
  body {
    font-size: 15px;
  }
  .btn {
    font-size: 0.95rem;
    padding: 12px 20px;
  }
  .game-card-title {
    font-size: 1.2rem;
  }
  .game-card-field {
    font-size: 0.9rem;
  }
  .game-card-meta {
    font-size: 0.9rem;
  }
  .game-card-pricing .price-val {
    font-size: 1.15rem;
  }
  .section-title {
    font-size: 1.3rem;
  }
  .detail-section-title {
    font-size: 1.15rem;
  }
  .player-calendar-day-cell {
    aspect-ratio: auto;
    min-height: 48px;
    padding: 6px 2px 8px 2px;
    overflow: visible;
  }
  .player-calendar-day-cell .day-num {
    font-size: 0.95rem;
    font-weight: 700;
  }
  .player-calendar-day-cell .game-count-badge {
    font-size: 0.6rem;
    padding: 1px 2px;
    min-width: 13px;
    height: 13px;
    box-sizing: border-box;
  }
  .form-control {
    font-size: 1rem;
    padding: 12px 14px;
  }
  .form-group label {
    font-size: 0.9rem;
  }
  .phone-bubble {
    font-size: 0.9rem;
  }
  .phone-name {
    font-size: 0.95rem;
  }
  .roster-table th, .roster-table td {
    font-size: 0.9rem;
    padding: 10px 8px;
  }
  .income-table th, .income-table td {
    font-size: 0.95rem;
    padding: 12px 10px;
  }
  .badge {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
  #sms-simulator-container {
    bottom: 20px;
    right: 12px;
    width: calc(100% - 24px);
    max-width: 320px;
  }
}
