/* ==========================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ========================================== */
:root {
  --bg-primary: #06050e;
  --bg-secondary: #0b0a19;
  --bg-glass: rgba(13, 10, 26, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-active: rgba(168, 85, 247, 0.35);
  
  --color-primary: #a855f7;       /* Neon Purple */
  --color-primary-glow: rgba(168, 85, 247, 0.35);
  --color-secondary: #ec4899;     /* Hot Pink */
  --color-secondary-glow: rgba(236, 72, 153, 0.35);
  --color-accent: #06b6d4;        /* Cyan */
  --color-danger: #ef4444;        /* Crimson Red */
  --color-danger-glow: rgba(239, 68, 68, 0.35);
  --color-success: #10b981;       /* Emerald Green */
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================
   RESET & INITIAL SETUPS
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ==========================================
   DYNAMIC BACKGROUND GLOWS
   ========================================== */
.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.bg-glow-1 {
  background: radial-gradient(circle, var(--color-primary) 0%, rgba(0,0,0,0) 70%);
  top: -150px;
  right: -150px;
  animation: floatGlow1 25s infinite alternate ease-in-out;
}

.bg-glow-2 {
  background: radial-gradient(circle, var(--color-secondary) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px;
  left: -150px;
  animation: floatGlow2 22s infinite alternate ease-in-out;
}

@keyframes floatGlow1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-100px, 120px) scale(1.15); }
}

@keyframes floatGlow2 {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(100px, -120px) scale(0.9); }
}

/* ==========================================
   CORE UTILITIES & UI COMPONENTS
   ========================================== */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transition: var(--transition-smooth);
}

.btn {
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-bounce);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--color-primary-glow), 0 0 15px rgba(236, 72, 153, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  color: #fff;
  box-shadow: 0 4px 15px var(--color-danger-glow);
}
.btn-danger:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--color-danger-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.glowing-btn {
  position: relative;
  overflow: hidden;
}
.glowing-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -50%; width: 200%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-25deg);
  transition: 0.75s;
}
.glowing-btn:hover::after {
  left: 125%;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}
.text-center { text-align: center; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* ==========================================
   LAYOUT CONTAINER & WRAPPER
   ========================================== */
.login-wrapper {
  position: relative;
  width: 100%;
  max-width: 580px;
  padding: 1.5rem;
  z-index: 10;
  margin: 12vh auto 2rem auto;
  transition: max-width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.login-wrapper.dashboard-active {
  max-width: 900px;
}

.auth-card {
  display: none;
  padding: 2.5rem;
  width: 100%;
  border-color: rgba(255, 255, 255, 0.07);
}

.auth-card.active {
  display: block;
}

/* Brand header */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}

.brand-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: rotateLogo 10s linear infinite;
}

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

.brand h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* Forms layout */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition-smooth);
  outline: none;
}

select option {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.form-group input:disabled {
  background: rgba(255, 255, 255, 0.01);
  border-color: rgba(255, 255, 255, 0.03);
  color: #6b7280;
  cursor: not-allowed;
}

.input-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Avatar selectors grid */
.avatar-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.avatar-selector input[type="radio"] {
  display: none;
}

.avatar-selector label {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.avatar-selector input[type="radio"]:checked + label {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
  transform: scale(1.1);
}

.avatar-selector label:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Auth Card Footer */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.auth-footer a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

/* ==========================================
   DASHBOARD TABS CARD
   ========================================== */
.dashboard-wrapper {
  display: none;
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  z-index: 10;
  position: relative;
}

.dashboard-wrapper.active {
  display: block;
}

#pane-settings {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2.2rem;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.records-header-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.dashboard-header {
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  height: 64px;
  box-sizing: border-box;
}

.header-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.profile-avatar {
  font-size: 2.5rem;
  width: 58px;
  height: 58px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-text h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.user-id-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
  display: inline-block;
}

/* Tab buttons bar */
.tabs-bar {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.18);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.05);
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-pane.active {
  display: block;
}

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

/* ==========================================
   TAB: STATISTICS (GLOBAL WAR ROOM)
   ========================================== */
.global-war-room-container {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(168, 85, 247, 0.04));
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: 20px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.05);
}

.war-room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.war-room-badge {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-secondary);
  background: rgba(236, 72, 153, 0.12);
  padding: 0.4rem 1.1rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.war-room-pulse {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(236, 72, 153, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--color-secondary);
  border-radius: 50%;
  animation: pulseAnimation 1.5s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.war-room-main {
  display: flex;
  justify-content: center;
  margin: 1rem 0 1.5rem;
}

.global-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.global-val {
  font-size: 4.2rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(to bottom, #fff 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(236, 72, 153, 0.45));
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.global-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.latest-activity-banner {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--color-accent);
  text-align: center;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.quick-stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quick-stat-box:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.stat-icon.purple { background: rgba(168, 85, 247, 0.12); color: var(--color-primary); }
.stat-icon.pink { background: rgba(236, 72, 153, 0.12); color: var(--color-secondary); }
.stat-icon.blue { background: rgba(6, 182, 212, 0.12); color: var(--color-accent); }

.stat-info h4 {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.stat-info p {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

/* Analytics Row (Chart & Country Tally) */
.analytics-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chart-box, .feedback-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.5rem;
  min-width: 0;
}

.chart-box h3, .feedback-box h3, .history-section h3, .leaderboard-info h3, #pane-settings h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.chart-wrapper {
  position: relative;
  height: 220px;
  width: 100%;
}

.media-ratio-card .chart-wrapper {
  height: 160px;
}

/* Country firepower list rankings */
.country-rankings-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.country-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.country-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 110px;
}

.country-flag {
  font-size: 1.25rem;
}

.country-name {
  font-weight: 500;
  color: var(--text-main);
}

.country-bar-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  margin: 0 0.85rem;
  overflow: hidden;
  position: relative;
}

.country-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.country-count {
  font-weight: 700;
  color: var(--color-accent);
  min-width: 42px;
  text-align: right;
  font-size: 0.88rem;
}

/* Recovery status alert card */
.recovery-status-card {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 14px;
}

.recovery-status-card.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.recovery-status-card.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.status-emoji {
  font-size: 2rem;
  display: flex;
  align-items: center;
}

.status-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.status-details p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Session History list styling */
.history-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.5rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  transition: var(--transition-smooth);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
}

.history-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  width: 100%;
}

.history-drawer {
  margin-top: 1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.drawer-content label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.drawer-content textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  resize: vertical;
  transition: var(--transition-smooth);
}

.drawer-content textarea:focus {
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.35);
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.drawer-actions button {
  padding: 0.45rem 1.15rem;
  font-size: 0.82rem;
}

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

.history-icon-box {
  width: 38px;
  height: 38px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.history-details h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.history-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

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

.meta-item.intensity-high { color: var(--color-danger); }
.meta-item.intensity-med { color: #f59e0b; }
.meta-item.intensity-low { color: var(--color-accent); }

.history-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.history-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

/* ==========================================
   TAB: LEADERBOARD COMPONENTS
   ========================================== */
.leaderboard-info {
  margin-bottom: 1.5rem;
}

.leaderboard-table-container {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
}

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

.leaderboard-table th {
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  text-transform: uppercase;
}

.leaderboard-table td {
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.leaderboard-table tbody tr {
  transition: var(--transition-smooth);
}
.leaderboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Leaderboard custom columns formatting */
.rank-badge {
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); color: #fff; }
.rank-other { color: var(--text-muted); }

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
}

.user-cell.me::after {
  content: 'YOU';
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--color-primary);
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 0.4rem;
}

.table-avatar {
  font-size: 1.3rem;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-cell-glow {
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  display: inline-flex;
}

.status-badge.clean { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.status-badge.warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.status-badge.relapsed { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }

/* Records Action Area (Goon! Button) */
.records-action-area {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
}

#pane-records #action-log-btn {
  padding: 0.95rem 2.5rem;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ==========================================
   TAB: SETTINGS COMPONENTS
   ========================================== */
#pane-settings form {
  max-width: 100%;
}

.mypage-actions {
  margin-top: 2rem;
}

/* ==========================================
   MODAL DIALOG (LOG DIALOG OVERLAY)
   ========================================== */
.overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(5, 3, 10, 0.85);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  padding: 2.2rem;
  border-color: rgba(239, 68, 68, 0.2);
  box-shadow: 0 25px 50px rgba(239, 68, 68, 0.12);
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-danger);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  line-height: 1;
}
.close-btn:hover { color: #fff; }

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.form-row {
  display: flex;
  gap: 1rem;
}
.form-row .col { flex: 1; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(13, 12, 27, 0.95);
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-left: 4px solid var(--color-primary);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================== */
@media (max-width: 820px) {
  body {
    padding: 1rem;
  }
  
  .login-wrapper.dashboard-active {
    max-width: 100%;
  }

  .dashboard-card {
    padding: 1.5rem;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    height: auto;
  }
  .dashboard-header button {
    width: 100%;
  }

  .global-val {
    font-size: 3rem;
  }

  .quick-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .analytics-row {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Rankings Tab Headers */
.rankings-tab-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.rankings-tab-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.45;
  transition: var(--transition-smooth);
  margin-bottom: 0 !important;
}

.rankings-tab-header h3:hover {
  opacity: 0.85;
}

.rankings-tab-header h3.active-rank-title {
  opacity: 1;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

.rankings-tab-header .divider {
  color: var(--text-muted);
  opacity: 0.3;
  font-size: 1.1rem;
}

/* Custom additions for authentication features */
.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button input {
  flex: 1;
}

.input-with-button .btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 1rem;
  font-size: 0.85rem;
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.form-checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.form-checkbox-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.input-tip {
  font-size: 0.78rem;
  margin-top: 4px;
  display: block;
}

.input-tip.success {
  color: var(--color-success);
}

.input-tip.error {
  color: var(--color-danger);
}

