/* ========================================
   KIDSAPP - Styles
   App de suivi comportemental pour enfants
   ======================================== */

:root {
  --ilyes-color: #4FC3F7;
  --ilyes-dark: #0288D1;
  --ilyes-light: #E1F5FE;
  --ilyes-gradient: linear-gradient(135deg, #4FC3F7, #0288D1);

  --yanis-color: #FF8A65;
  --yanis-dark: #E64A19;
  --yanis-light: #FBE9E7;
  --yanis-gradient: linear-gradient(135deg, #FF8A65, #E64A19);

  --bg-primary: #0F1123;
  --bg-secondary: #1A1D35;
  --bg-card: #232740;
  --bg-card-hover: #2A2F50;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A4C0;
  --text-muted: #9295B3;
  --border-color: #2E3354;
  --success: #66BB6A;
  --success-dark: #388E3C;
  --warning: #FFA726;
  --danger: #EF5350;
  --star-color: #FFD700;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);

  --active-child-color: var(--ilyes-color);
  --active-child-gradient: var(--ilyes-gradient);
  --active-child-light: var(--ilyes-light);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* SPLASH SCREEN */
.splash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1A1D35 0%, #0F1123 50%, #1A1035 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, transform 0.5s;
}

.splash.fade-out {
  opacity: 0;
  transform: scale(1.1);
}

.splash-content {
  text-align: center;
}

.splash-stars {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: sparkle 1.5s ease-in-out infinite;
}

.splash-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FFD700, #FFA726, #FF8A65, #4FC3F7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.splash-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.splash-loader {
  margin-top: 2rem;
  width: 200px;
  height: 4px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}

.splash-loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ilyes-color), var(--yanis-color));
  border-radius: 4px;
  animation: splash-load 0.8s ease forwards;
}

@keyframes splash-load {
  0% { width: 0%; }
  100% { width: 100%; }
}

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

/* HIDDEN */
.hidden { display: none !important; }

/* APP CONTAINER */
.app {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* HEADER */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo {
  font-size: 1.5rem;
  animation: spin-star 3s linear infinite;
}

@keyframes spin-star {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.header-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FFD700, #FFA726);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-nav {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.btn-nav:hover {
  background: var(--bg-card-hover);
  border-color: var(--active-child-color);
}

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

.header-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

.header-date.past-date {
  color: var(--warning);
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:active {
  transform: scale(0.95);
  background: var(--bg-card-hover);
}

/* CHILD TABS */
.child-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
}

.child-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.child-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: transparent;
  border-radius: 3px 3px 0 0;
  transition: all 0.3s;
}

.child-tab.active {
  color: var(--text-primary);
}

.child-tab[data-child="ilyes"].active::after {
  background: var(--ilyes-gradient);
}

.child-tab[data-child="yanis"].active::after {
  background: var(--yanis-gradient);
}

.child-tab-avatar {
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.child-tab.active .child-tab-avatar {
  transform: scale(1.2);
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1.2); }
  50% { transform: scale(1.4); }
}

.child-tab-stars {
  font-size: 0.8rem;
  background: var(--bg-card);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  color: var(--star-color);
}

/* MAIN CONTENT */
.main-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* PROGRESS SECTION */
.progress-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

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

.progress-header span:first-child {
  font-weight: 700;
  font-size: 0.95rem;
}

.progress-percent {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  transition: color 0.3s;
}

.progress-bar-container {
  height: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease, background 0.3s;
  background: var(--active-child-gradient);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

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

.progress-stats {
  display: flex;
  justify-content: space-around;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* WEEKLY GAUGES */
.section-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
}

.weekly-gauges {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.gauge-container {
  text-align: center;
}

.gauge {
  width: 100px;
  height: 100px;
  position: relative;
}

.gauge svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-card);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1s ease;
}

.gauge-fill { stroke: var(--active-child-color); }

.gauge-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge-value {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.gauge-name {
  font-size: 1.2rem;
}

.gauge-label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* REWARD SECTION */
.reward-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  transition: all 0.5s;
}

.reward-card.unlocked {
  border-color: var(--star-color);
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,167,38,0.1));
  animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.2); }
  50% { box-shadow: 0 0 25px rgba(255,215,0,0.4); }
}

.reward-icon {
  font-size: 2.5rem;
  transition: transform 0.3s;
}

.reward-card.unlocked .reward-icon {
  animation: reward-bounce 1s ease infinite;
}

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

.reward-info {
  flex: 1;
}

.reward-title {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.reward-value {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.reward-status {
  font-size: 1.5rem;
}

.reward-lock {
  opacity: 0.5;
}

.reward-card.unlocked .reward-lock {
  display: none;
}

/* OBJECTIVES */
.objectives-section {
  margin-bottom: 1rem;
}

.objectives-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.objective-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.objective-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--danger);
  transition: background 0.3s;
}

.objective-card.unlocked::before {
  background: var(--success);
}

.objective-card.unlocked {
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(102, 187, 106, 0.25);
}

.obj-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.obj-icon {
  font-size: 1.4rem;
}

.obj-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}

.obj-reward {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  min-height: 2em;
  line-height: 1.3;
}

.obj-progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.obj-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease, background 0.3s;
  background: var(--danger);
}

.obj-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.obj-percent {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.obj-status {
  font-size: 1.2rem;
}

/* BEHAVIOR CATEGORIES */
.category {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.category-header:active {
  background: var(--bg-card-hover);
}

.category-icon {
  font-size: 1.3rem;
}

.category-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.category-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.category-toggle {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s;
}

.category-header.collapsed .category-toggle {
  transform: rotate(-90deg);
}

.category-items {
  padding: 0 0.5rem 0.5rem;
  transition: max-height 0.3s;
  overflow: hidden;
}

.category-items.collapsed {
  max-height: 0 !important;
  padding: 0 0.5rem;
}

/* BEHAVIOR ITEMS */
.behavior-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  margin: 0.3rem 0;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.behavior-item:active {
  transform: scale(0.98);
}

.behavior-item.completed {
  background: rgba(102, 187, 106, 0.15);
  border: 1px solid rgba(102, 187, 106, 0.3);
}

.behavior-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s;
  flex-shrink: 0;
}

.behavior-item.completed .behavior-check {
  background: var(--success);
  border-color: var(--success);
  animation: check-pop 0.4s ease;
}

@keyframes check-pop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.behavior-icon {
  font-size: 1.3rem;
}

.behavior-text {
  flex: 1;
}

.behavior-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.behavior-item.completed .behavior-name {
  text-decoration: line-through;
  opacity: 0.7;
}

.behavior-stars {
  font-size: 0.75rem;
  color: var(--star-color);
}

.behavior-star-badge {
  font-size: 0.85rem;
  color: var(--star-color);
  background: rgba(255, 215, 0, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* WEEK GRID */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.week-day {
  text-align: center;
  padding: 0.5rem 0.2rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  cursor: pointer;
}

.week-day.today {
  border-color: var(--active-child-color);
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
}

.week-day.selected {
  background: var(--active-child-color);
  color: var(--bg-primary);
  border-color: var(--active-child-color);
  transform: scale(1.05);
}

.week-day.selected .week-day-name,
.week-day.selected .week-day-num {
  color: var(--bg-primary);
}

.week-day.future {
  opacity: 0.4;
  cursor: not-allowed;
}

.week-day-name {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.week-day-num {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0.2rem 0;
}

.week-day-score {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
}

.week-day-score.good { color: var(--success); }
.week-day-score.medium { color: var(--warning); }
.week-day-score.low { color: var(--danger); }

/* MODAL */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto;
  animation: slide-up 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.modal-small {
  max-height: 70vh;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.modal-header h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

/* PIN SCREEN */
.pin-screen {
  text-align: center;
}

.pin-screen p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  transition: all 0.2s;
}

.pin-dot.filled {
  background: var(--ilyes-color);
  border-color: var(--ilyes-color);
  transform: scale(1.2);
}

.pin-dot.error {
  background: var(--danger);
  border-color: var(--danger);
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  max-width: 280px;
  margin: 0 auto;
}

.pin-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  margin: 0 auto;
}

.pin-btn:active {
  transform: scale(0.9);
  background: var(--bg-card-hover);
}

.pin-btn-empty {
  border: none;
  background: none;
  cursor: default;
}

.pin-btn-del {
  font-size: 1.2rem;
}

.pin-hint {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* PARENT PANEL */
.parent-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.parent-tab {
  padding: 0.7rem 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.parent-tab.active {
  color: var(--text-primary);
}

.parent-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ilyes-color);
}

.parent-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.parent-section-header h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
}

.btn-add {
  background: var(--ilyes-gradient);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s;
}

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

/* BEHAVIOR LIST (PARENT) */
.behavior-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.behavior-edit-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.behavior-edit-item .be-icon { font-size: 1.2rem; }
.behavior-edit-item .be-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}
.behavior-edit-item .be-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.be-actions {
  display: flex;
  gap: 0.3rem;
}

.be-actions button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.be-actions button:active {
  background: var(--bg-card-hover);
}

/* REWARDS CONFIG */
.rewards-config {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reward-day-config {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  border: 1px solid var(--border-color);
}

.reward-day-label {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.reward-day-input {
  display: flex;
  gap: 0.5rem;
}

.reward-day-input input {
  flex: 1;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
}

.reward-day-input select {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.2rem;
}

/* FORM */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--ilyes-color);
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn.selected {
  border-color: var(--ilyes-color);
  background: rgba(79, 195, 247, 0.15);
}

.stars-picker {
  display: flex;
  gap: 0.5rem;
}

.star-pick {
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.star-pick.selected {
  border-color: var(--star-color);
  background: rgba(255, 215, 0, 0.15);
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-cancel {
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--ilyes-gradient);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.btn-small {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-danger {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger);
  background: rgba(239, 83, 80, 0.15);
  color: var(--danger);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* SETTINGS */
.setting-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.setting-item label {
  flex: 1;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 150px;
}

.setting-item input[type="text"] {
  width: 80px;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 4px;
}

.setting-item input[type="range"] {
  flex: 1;
  min-width: 100px;
  accent-color: var(--ilyes-color);
}

/* HISTORY DETAIL */
.history-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-day-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  border: 1px solid var(--border-color);
}

.history-day-card h4 {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.history-child-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
}

.history-child-row .hc-avatar { font-size: 1rem; }
.history-child-row .hc-name {
  font-weight: 700;
  font-size: 0.85rem;
  width: 60px;
}

.history-child-row .hc-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.history-child-row .hc-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s;
}

.hc-bar-fill.ilyes { background: var(--ilyes-gradient); }
.hc-bar-fill.yanis { background: var(--yanis-gradient); }

.history-child-row .hc-score {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  width: 40px;
  text-align: right;
}

/* CELEBRATION */
.celebration {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.celebration-content {
  text-align: center;
  animation: pop-in 0.5s ease;
}

@keyframes pop-in {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.celebration-emoji {
  font-size: 5rem;
  animation: celebrate-bounce 0.8s ease infinite alternate;
}

@keyframes celebrate-bounce {
  from { transform: translateY(0) rotate(-5deg); }
  to { transform: translateY(-20px) rotate(5deg); }
}

.celebration-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #FFD700, #FFA726, #FF8A65);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0.5rem;
}

.celebration-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* CONFETTI */
.confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2001;
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* TODAY BUTTON */
.btn-today {
  background: var(--warning);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

/* ENCOURAGEMENT */
.encouragement {
  margin-top: 0.8rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 167, 38, 0.12);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warning);
  text-align: center;
  animation: fade-in 0.3s ease;
}

/* STREAK BADGE */
.streak-badge {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,167,38,0.15));
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius-full);
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--star-color);
}

.streak-badge.streak-fire {
  background: linear-gradient(135deg, rgba(255,82,82,0.15), rgba(255,167,38,0.15));
  border-color: rgba(255,82,82,0.3);
  color: var(--danger);
  animation: pulse-fire 1.5s ease-in-out infinite;
}

@keyframes pulse-fire {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* GAUGE TREND */
.gauge-trend {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 0.3rem;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-equal { color: var(--text-muted); }

/* WEEK NAV HEADER */
.week-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.week-nav-header .section-title {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* FOCUS STYLES (a11y) */
.btn-nav:focus-visible,
.btn-icon:focus-visible,
.btn-today:focus-visible,
.child-tab:focus-visible,
.behavior-item:focus-visible,
.week-day:focus-visible,
.pin-btn:focus-visible {
  outline: 2px solid var(--active-child-color);
  outline-offset: 2px;
}

/* RESPONSIVE */
@media (max-width: 400px) {
  .header-title { font-size: 1.1rem; }
  .child-tab-name { font-size: 0.85rem; }
  .progress-percent { font-size: 1.2rem; }
  .weekly-gauges { gap: 1rem; }
  .gauge { width: 80px; height: 80px; }
  .gauge-value { font-size: 0.9rem; }
  .pin-btn { width: 60px; height: 60px; font-size: 1.3rem; }
  .week-day { padding: 0.6rem 0.3rem; }
  .week-day-name { font-size: 0.7rem; }
  .week-day-num { font-size: 1.1rem; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .header { padding: 0.5rem 1rem; }
  .main-content { gap: 0.8rem; }
  .weekly-gauges { gap: 1rem; }
  .gauge { width: 70px; height: 70px; }
  .splash-title { font-size: 2.5rem; }
}
