/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #12121f;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --bg-glass: rgba(255,255,255,0.06);
  --border-glass: rgba(255,255,255,0.08);
  --border-glass-hover: rgba(255,255,255,0.15);
  --text-primary: #e8e8f0;
  --text-secondary: #8a8a9a;
  --text-muted: #55556a;
  --accent-1: #7c5cfc;
  --accent-2: #00d4ff;
  --accent-gradient: linear-gradient(135deg, #7c5cfc, #00d4ff);
  --accent-gradient-soft: linear-gradient(135deg, rgba(124,92,252,0.15), rgba(0,212,255,0.15));
  --danger: #ff4d6a;
  --danger-soft: rgba(255,77,106,0.12);
  --success: #00e676;
  --success-soft: rgba(0,230,118,0.12);
  --warning: #ffab40;
  --warning-soft: rgba(255,171,64,0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(124,92,252,0.15);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg-primary: #f4f5f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(0,0,0,0.03);
  --bg-card-hover: rgba(0,0,0,0.06);
  --bg-glass: rgba(0,0,0,0.03);
  --border-glass: rgba(0,0,0,0.08);
  --border-glass-hover: rgba(0,0,0,0.15);
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #9a9ab0;
  --accent-1: #6a4ce0;
  --accent-2: #0099cc;
  --accent-gradient: linear-gradient(135deg, #6a4ce0, #0099cc);
  --accent-gradient-soft: linear-gradient(135deg, rgba(106,76,224,0.1), rgba(0,153,204,0.1));
  --danger: #e63950;
  --danger-soft: rgba(230,57,80,0.08);
  --success: #00a854;
  --success-soft: rgba(0,168,84,0.08);
  --warning: #e68a00;
  --warning-soft: rgba(230,138,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 30px rgba(106,76,224,0.08);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px;
  transition: background 0.3s ease, color 0.3s ease;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(124,92,252,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(0,212,255,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background: radial-gradient(ellipse at 30% 20%, rgba(106,76,224,0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(0,153,204,0.03) 0%, transparent 50%);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 600; }

/* ===== LAYOUT ===== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.app-header {
  padding: 20px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header h1 {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-indicator {
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.sync-indicator:hover { opacity: 1; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pull-refresh-indicator {
  position: fixed;
  top: -60px;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10000;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
  border-radius: 0 0 16px 16px;
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  border: 2px solid var(--accent-1);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.header-user-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(124,92,252,0.4);
}

.header-points {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-1);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: rotate(15deg);
}

/* ===== NAVIGATION BAR ===== */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,10,20,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
}

[data-theme="light"] .nav-bar {
  background: rgba(255,255,255,0.92);
}

[data-theme="light"] .modal {
  background: #ffffff;
}

[data-theme="light"] .form-select option {
  background: #ffffff;
  color: #1a1a2e;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon { font-size: 1.3rem; line-height: 1; }

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

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  animation: screenFadeIn 0.3s ease;
}

.screen.active { display: block; }

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

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
}

.card-glow {
  box-shadow: var(--shadow-glow);
}

.card.active-user-card {
  border-color: var(--accent-1);
  box-shadow: 0 0 15px rgba(124,92,252,0.15);
}

/* ===== PERSON CARDS ===== */
.person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.person-avatar.child { background: rgba(124,92,252,0.15); }
.person-avatar.young { background: rgba(180,92,252,0.15); }
.person-avatar.adult { background: rgba(0,212,255,0.15); }
.person-avatar img, .detail-avatar img, .sel-avatar img, .pbc-avatar img {
  width: 100% !important; height: 100% !important; object-fit: cover !important; border-radius: 50% !important;
}

.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 600; font-size: 0.95rem; }
.person-role { font-size: 0.75rem; color: var(--text-secondary); }

.person-stats {
  display: flex;
  gap: 14px;
  text-align: right;
}

.stat-block {}
.stat-value { font-weight: 700; font-size: 0.95rem; }
.stat-value.balance { color: var(--success); }
.stat-value.points { color: var(--warning); }
.stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== XP PROGRESS BAR ===== */
.xp-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.xp-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== STREAK ===== */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--warning);
  animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ===== INFO BANNER ===== */
.info-banner {
  background: var(--accent-gradient-soft);
  border: 1px solid rgba(124,92,252,0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-banner .banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.info-banner .banner-text { font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }
.info-banner .banner-label { font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 2px; }

.info-banner.collective {
  background: linear-gradient(135deg, rgba(0,230,118,0.1), rgba(0,212,255,0.1));
  border-color: rgba(0,230,118,0.2);
}

/* ===== MYSTERY TASK BANNER ===== */
.mystery-banner {
  background: linear-gradient(135deg, rgba(255,171,64,0.12), rgba(255,77,106,0.12));
  border: 1px solid rgba(255,171,64,0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.mystery-banner:hover {
  border-color: rgba(255,171,64,0.45);
}

.mystery-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(0deg); }
  100% { transform: translateX(100%) rotate(0deg); }
}

.mystery-banner .banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  animation: sparkle 1.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.15) rotate(5deg); }
  75% { transform: scale(1.15) rotate(-5deg); }
}

.mystery-banner .banner-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.mystery-banner .banner-label {
  font-size: 0.7rem;
  color: var(--warning);
  margin-bottom: 2px;
  font-weight: 600;
}

.mystery-banner .mystery-pts {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--warning-soft);
  color: var(--warning);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ===== ANIMAL ROTATION PREVIEW ===== */
.animal-preview {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.animal-preview-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-select, .form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238a8a9a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124,92,252,0.15);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124,92,252,0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(124,92,252,0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(255,77,106,0.2);
}

.btn-danger:hover { background: rgba(255,77,106,0.2); }

.btn-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(0,230,118,0.2);
}

.btn-success:hover { background: rgba(0,230,118,0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-full { width: 100%; }

.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }

/* ===== TASK LIST ITEMS ===== */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.task-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
}

.task-item.selected {
  border-color: var(--accent-1);
  background: rgba(124,92,252,0.08);
}

.task-emoji { font-size: 1.2rem; flex-shrink: 0; }
.task-text { flex: 1; font-size: 0.88rem; }

.task-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.task-badge.points { background: var(--warning-soft); color: var(--warning); }
.task-badge.penalty { background: var(--danger-soft); color: var(--danger); }

/* ===== PENDING APPROVAL ITEMS ===== */
.approval-item {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.approval-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.approval-info { flex: 1; }
.approval-person { font-weight: 600; font-size: 0.9rem; }
.approval-task { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.approval-date { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.approval-actions {
  display: flex;
  gap: 8px;
}

/* ===== REWARD CARDS ===== */
.reward-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.reward-item:hover {
  background: var(--bg-card-hover);
}

.reward-emoji { font-size: 1.3rem; flex-shrink: 0; }
.reward-info { flex: 1; }
.reward-name { font-size: 0.88rem; font-weight: 500; }
.reward-cost { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

.reward-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all var(--transition-fast);
  background: var(--accent-gradient);
  color: #fff;
}

.reward-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn { flex: 1; }

/* ===== PERSON DETAIL MODAL ===== */
.detail-header {
  text-align: center;
  margin-bottom: 20px;
}

.detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 10px;
  position: relative;
  overflow: hidden;
}

.detail-avatar.child { background: rgba(124,92,252,0.15); }
.detail-avatar.adult { background: rgba(0,212,255,0.15); }

.detail-avatar .avatar-edit-hint {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.55rem;
  text-align: center;
  padding: 2px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.detail-avatar:hover .avatar-edit-hint { opacity: 1; }

.avatar-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.avatar-upload-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.detail-name { font-size: 1.2rem; font-weight: 700; }
.detail-role { font-size: 0.8rem; color: var(--text-secondary); }

.detail-stats {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.detail-stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
}

.detail-stat-value { font-size: 1.3rem; font-weight: 800; }
.detail-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.detail-penalties-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 8px;
}

.detail-penalty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.85rem;
}

.detail-penalty-row:last-child { border-bottom: none; }

.detail-penalty-value {
  color: var(--danger);
  font-weight: 600;
}

.detail-points-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.85rem;
}

.detail-points-row:last-child { border-bottom: none; }

.detail-points-value {
  color: var(--success);
  font-weight: 600;
}

.detail-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 12px 0;
}

/* ===== XP IN DETAIL ===== */
.detail-xp-section {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  text-align: center;
}

.detail-xp-level {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-2);
}

.detail-xp-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  margin: 8px 0 4px;
  overflow: hidden;
}

.detail-xp-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.detail-xp-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== ACHIEVEMENTS ===== */
.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.achievement-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid var(--border-glass);
  background: var(--bg-card);
  transition: all var(--transition-normal);
  position: relative;
}

.achievement-badge.unlocked {
  border-color: var(--warning);
  background: var(--warning-soft);
  animation: achieveGlow 2s ease-in-out infinite;
}

.achievement-badge.locked {
  opacity: 0.3;
  filter: grayscale(1);
}

@keyframes achieveGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255,171,64,0); }
  50% { box-shadow: 0 0 10px rgba(255,171,64,0.3); }
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.achievement-item.locked { opacity: 0.4; }

.achievement-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: var(--warning-soft);
  border: 2px solid var(--warning);
}

.achievement-item.locked .achievement-icon {
  filter: grayscale(1);
  border-color: var(--border-glass);
  background: var(--bg-card);
}

.achievement-info { flex: 1; }
.achievement-name { font-size: 0.88rem; font-weight: 600; }
.achievement-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== MONTHLY SUMMARY ===== */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-name { font-weight: 600; font-size: 0.95rem; }
.summary-values { text-align: right; }
.summary-balance { font-weight: 700; font-size: 1rem; color: var(--success); }
.summary-points { font-size: 0.8rem; color: var(--warning); }

/* ===== HISTORY SCREEN ===== */
.history-month {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-month:hover { background: var(--bg-card-hover); }
.history-month-title { font-weight: 600; font-size: 0.95rem; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 300;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90%;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(0,230,118,0.3); }
.toast.error { border-color: rgba(255,77,106,0.3); }

.toast .undo-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-left: 8px;
  white-space: nowrap;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 0.9rem; line-height: 1.5; }

/* ===== CLOSE MONTH BUTTON ===== */
.close-month-btn {
  margin: 20px 0;
}

/* ===== UTILITY ===== */
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ===== RESET BUTTON ===== */
.reset-link {
  display: block;
  text-align: center;
  margin: 30px 0 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.reset-link:hover { color: var(--danger); }

/* ===== HISTORY DETAIL ===== */
.history-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--accent-2);
  cursor: pointer;
  margin-bottom: 14px;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

.history-person-section {
  margin-bottom: 16px;
}

.history-person-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-glass);
}

.history-person-name { font-weight: 600; }

.history-entry {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 4px 0;
  color: var(--text-secondary);
}

/* ===== PERSON SELECTOR MODAL ===== */
.person-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.person-selector-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.person-selector-item:hover {
  border-color: var(--accent-1);
  background: rgba(124,92,252,0.08);
  transform: translateY(-2px);
}

.person-selector-item .sel-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  position: relative;
  overflow: hidden;
}

.person-selector-item .sel-avatar.child { background: rgba(124,92,252,0.15); }
.person-selector-item .sel-avatar.young { background: rgba(180,92,252,0.15); }
.person-selector-item .sel-avatar.adult { background: rgba(0,212,255,0.15); }

.sel-avatar-edit {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 22px; height: 22px;
  background: var(--accent-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  border: 2px solid var(--bg-primary);
  z-index: 2;
  cursor: pointer;
}

.person-selector-item .sel-name {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== MAIS (MORE) SUB-MENU ===== */
.mais-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  border-bottom: none;
  padding: 24px 20px env(safe-area-inset-bottom, 16px);
  z-index: 150;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.mais-panel.open {
  transform: translateY(0);
}

.mais-panel-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 0 auto 16px;
  opacity: 0.5;
}

.mais-panel-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.mais-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.mais-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 500;
}

.mais-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

.mais-item .mais-icon {
  font-size: 1.4rem;
}

.mais-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 140;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mais-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ===== CALENDAR ===== */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.calendar-nav-btn:hover { background: var(--bg-card-hover); }

.calendar-month-label {
  font-weight: 600;
  font-size: 0.95rem;
}

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

.calendar-day-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 6px 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  border: 1px solid transparent;
  position: relative;
  gap: 2px;
  min-height: 44px;
}

.calendar-day:hover {
  border-color: var(--border-glass-hover);
  background: var(--bg-card-hover);
}

.calendar-day.today {
  border-color: var(--accent-1);
  background: rgba(124,92,252,0.08);
}

.calendar-day.other-month {
  opacity: 0.3;
}

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

.calendar-day .day-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.calendar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.calendar-dot.green { background: var(--success); }
.calendar-dot.red { background: var(--danger); }
.calendar-dot.blue { background: var(--accent-2); }
.calendar-dot.paw { width: auto; height: auto; font-size: 0.5rem; }

/* ===== RANKING ===== */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.ranking-position {
  font-size: 1.3rem;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.ranking-info { flex: 1; }
.ranking-name { font-weight: 600; font-size: 0.95rem; }
.ranking-details { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

.ranking-points {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--warning);
}

/* ===== CUSTOM TASK/PENALTY SECTION ===== */
.custom-section {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.custom-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.custom-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.custom-row .form-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.custom-row .form-select {
  width: 90px;
  padding: 10px 12px;
  font-size: 0.85rem;
}

/* ===== ABSENCE MODAL ===== */
.absence-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.absence-reason-item {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.absence-reason-item:hover, .absence-reason-item.selected {
  border-color: var(--accent-1);
  background: rgba(124,92,252,0.08);
}

/* ===== NOTIFICATION SETTINGS ===== */
.notif-settings {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.notif-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.notif-label {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.notif-time {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
}

/* ===== AVATAR PICKER ===== */
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}
.avatar-picker-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  border: 2px solid var(--border-glass);
  background: var(--bg-card);
  transition: var(--transition-fast);
}
.avatar-picker-item:hover {
  border-color: var(--accent-1);
  background: var(--bg-card-hover);
  transform: scale(1.12);
}
.avatar-picker-item.selected {
  border-color: var(--accent-1);
  box-shadow: 0 0 12px rgba(124,92,252,0.35);
}

/* ===== ACTIVITY LOG ===== */
.log-entry {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.82rem;
  align-items: flex-start;
}
.log-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 45px;
  flex-shrink: 0;
  line-height: 1.4;
}
.log-actor {
  font-weight: 600;
}
.log-action {
  color: var(--text-primary);
}
.log-detail {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* ===== PRIVATE AREA ===== */
.private-accent { --accent-private: #f5a623; --accent-private-soft: rgba(245,166,35,0.12); }

#screenAdmin {
  --accent-1: #f5a623;
  --accent-2: #ffcc02;
  --accent-gradient: linear-gradient(135deg, #f5a623, #ffcc02);
  --accent-gradient-soft: linear-gradient(135deg, rgba(245,166,35,0.15), rgba(255,204,2,0.15));
}

#screenAdmin .btn-primary {
  background: linear-gradient(135deg, #f5a623, #ffcc02);
  box-shadow: 0 4px 15px rgba(245,166,35,0.3);
}

#screenAdmin .btn-primary:hover {
  box-shadow: 0 6px 25px rgba(245,166,35,0.4);
}

#screenAdmin .btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(255,77,106,0.2);
}

.private-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.private-balance-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.private-balance-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.private-balance-card .pbc-avatar { font-size: 1.8rem; margin-bottom: 6px; }
.private-balance-card .pbc-name { font-size: 0.88rem; font-weight: 600; margin-bottom: 4px; }
.private-balance-card .pbc-balance { font-size: 1.2rem; font-weight: 800; color: var(--success); }
.private-balance-card .pbc-penalties { font-size: 0.75rem; color: var(--danger); margin-top: 2px; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
  transition: all var(--transition-fast);
}

.pin-dot.filled {
  background: var(--accent-1);
  border-color: var(--accent-1);
}

/* ===== SELECTION TOTAL ===== */
.selection-total {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 0;
  font-weight: 500;
}

.selection-total strong {
  color: var(--warning);
}

.selection-total.penalty strong {
  color: var(--danger);
}

/* ===== BOARD ITEMS ===== */
.board-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}
.board-item.done {
  opacity: 0.5;
  text-decoration: line-through;
}
.board-item-text { flex: 1; font-size: 0.88rem; }
.board-item-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.board-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.board-item-actions button {
  background: none; border: none; cursor: pointer; font-size: 1rem; padding: 2px;
  transition: var(--transition-fast);
}
.board-item-actions button:hover { transform: scale(1.2); }

/* ===== HALL OF FAME ===== */
.hof-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}
.hof-card:hover { border-color: var(--border-glass-hover); }
.hof-emoji { font-size: 1.6rem; flex-shrink: 0; }
.hof-info { flex: 1; }
.hof-title { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 2px; }
.hof-holder { font-weight: 600; font-size: 0.95rem; }
.hof-value { font-size: 0.78rem; color: var(--accent-1); margin-top: 2px; }

/* ===== THEME PICKER ===== */
.theme-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  justify-content: center;
}
.theme-color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition-fast);
  position: relative;
}
.theme-color-circle:hover { transform: scale(1.15); }
.theme-color-circle.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* ===== WEEKLY GOAL ===== */
.weekly-goal-section {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}
.weekly-goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.weekly-goal-title { font-size: 0.85rem; font-weight: 600; }
.weekly-goal-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.weekly-goal-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.weekly-goal-text { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }
.weekly-goal-mini {
  font-size: 0.7rem;
  color: var(--accent-2);
  margin-top: 2px;
}

/* ===== MONTHLY COMPARISON ===== */
.monthly-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.monthly-compare-item {
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
}
.monthly-compare-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; }
.monthly-compare-value { font-size: 1rem; font-weight: 700; }
.monthly-compare-arrow { font-size: 0.85rem; margin-left: 4px; }

/* ===== CHALLENGE CARD ===== */
.challenge-card {
  background: linear-gradient(135deg, rgba(255,200,0,0.08), rgba(255,100,0,0.08));
  border-color: rgba(255,180,0,0.2);
}
.challenge-card:hover {
  border-color: rgba(255,180,0,0.35);
}
.challenge-vs {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
  text-shadow: 0 0 10px rgba(255,200,0,0.2);
}

/* ===== REACTION PICKER ===== */
.reaction-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  cursor: default;
}
.reaction-badge .reaction-count {
  font-weight: 600;
  color: var(--text-secondary);
}
.reaction-add-btn {
  background: none;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.reaction-add-btn:hover {
  border-color: var(--accent-1);
  color: var(--text-primary);
  background: var(--bg-card);
}
.reaction-picker-popup {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  position: absolute;
  z-index: 10;
}
.reaction-picker-popup span {
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}
.reaction-picker-popup span:hover {
  background: var(--bg-card-hover);
  transform: scale(1.2);
}

/* ===== PROOF PHOTO ===== */
.proof-photo-preview {
  max-width: 120px;
  max-height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  margin-top: 6px;
  cursor: pointer;
}
.proof-photo-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.proof-photo-thumb:hover {
  transform: scale(1.08);
  border-color: var(--accent-1);
}

/* ===== VACATION BANNER ===== */
.vacation-banner {
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(0,230,118,0.1));
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-2);
}

/* ===== TEAM TASK ===== */
.team-member-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.team-member-check:hover {
  border-color: var(--border-glass-hover);
}
.team-member-check.checked {
  border-color: var(--accent-1);
  background: rgba(124,92,252,0.08);
}

/* ===== FULLSCREEN PHOTO OVERLAY ===== */
.photo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: pointer;
}
.photo-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
}
/* ===== CHAT STYLES ===== */
.chat-msg { display:flex; gap:8px; margin-bottom:12px; align-items:flex-start; }
.chat-msg-avatar { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.2rem; flex-shrink:0; background:var(--bg-card); }
.chat-msg-body { flex:1; }
.chat-msg-header { display:flex; gap:8px; align-items:baseline; margin-bottom:2px; }
.chat-msg-name { font-weight:600; font-size:0.85rem; }
.chat-msg-time { font-size:0.7rem; color:var(--text-secondary); }
.chat-msg-text { font-size:0.9rem; line-height:1.4; word-wrap:break-word; }
.chat-msg-text .mention { color:var(--accent-1); font-weight:600; }
.chat-msg-own .chat-msg-body { background:linear-gradient(135deg, rgba(124,92,252,0.15), rgba(0,212,255,0.1)); padding:8px 12px; border-radius:12px; }
/* ===== CONFESSION STYLES ===== */
.confession-btn {
  background: linear-gradient(135deg, rgba(255,171,64,0.15), rgba(255,77,106,0.12));
  border: 1px solid rgba(255,171,64,0.3);
  color: var(--warning);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.confession-btn:hover { background: linear-gradient(135deg, rgba(255,171,64,0.25), rgba(255,77,106,0.2)); }
.confession-badge { color: var(--warning); font-size: 0.75rem; opacity: 0.7; }
/* ===== POWER-UP STYLES ===== */
.powerup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.powerup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
}
.powerup-card:hover { border-color: var(--accent-1); background: var(--bg-card-hover); }
.powerup-card.owned { border-color: var(--success); }
.powerup-emoji { font-size: 2rem; display: block; margin-bottom: 6px; }
.powerup-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.powerup-desc { font-size: 0.7rem; color: var(--text-secondary); margin-top: 4px; }
.powerup-cost { font-size: 0.8rem; color: var(--accent-2); font-weight: 700; margin-top: 6px; }
.powerup-owned-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--success); color: #000; font-size: 0.6rem;
  padding: 2px 6px; border-radius: 10px; font-weight: 700;
}
.active-powerups { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.active-powerup-tag {
  background: var(--accent-gradient-soft);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.7rem;
  color: var(--accent-2);
  animation: pulse 2s ease-in-out infinite;
}
/* ===== WHEEL OF FORTUNE STYLES ===== */
.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}
.wheel-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
}
.wheel {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 4px solid var(--accent-1);
  position: relative;
  overflow: hidden;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  box-shadow: 0 0 30px rgba(124,92,252,0.3);
}
.wheel-segment {
  position: absolute;
  width: 50%;
  height: 50%;
  transform-origin: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--accent-2);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 5;
  box-shadow: var(--shadow-md);
}
.spin-btn {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 14px 40px;
  border-radius: var(--radius-xl);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-glow);
}
.spin-btn:hover { transform: scale(1.05); }
.spin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.wheel-result {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
/* ===== LOGIN MODAL & ADMIN FAMILY CONFIG ===== */
.login-modal-box {
  max-width: 400px;
}
.login-logo {
  font-size: 2.6rem;
  text-align: center;
  margin-bottom: 6px;
}
.login-error {
  background: rgba(255, 77, 106, 0.14);
  border: 1px solid rgba(255, 77, 106, 0.35);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  margin-bottom: 12px;
  display: none;
}
.login-advanced-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 8px;
  text-decoration: underline;
}
.family-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
}
.family-member-row:last-child {
  border-bottom: none;
}
.proof-photo-loading {
  opacity: 0.55;
  background: var(--bg-glass);
  min-width: 72px;
  min-height: 54px;
}
