/* =========================================================================
 * IrisKids — Styles header partagé (servi par la home, chargé par les jeux)
 * Cousins des règles dans style.css : on les duplique ici car les jeux ne
 * chargent pas style.css du domaine principal.
 * ========================================================================= */

#ik-user-zone {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ik-user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.15);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, border-color .15s;
}
.ik-user-avatar-btn:hover { border-color: #fff; transform: scale(1.05); }
.ik-user-avatar-btn img,
.ik-user-avatar-btn svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.ik-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 6px;
  display: none;
  z-index: 1000;
  font-family: 'Baloo 2', system-ui, sans-serif;
}
.ik-user-dropdown.open { display: block; }

.ik-user-pseudo {
  font-weight: 700;
  padding: 8px 12px 4px;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.ik-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #1f2937;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}
.ik-user-dropdown-item:hover { background: #f1f5f9; }
.ik-user-dropdown-item.danger { color: #b91c1c; }
.ik-user-dropdown-item.danger:hover { background: #fee2e2; }

.ik-user-dropdown-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 4px 0;
}

/* ═════════════════════════════════════════════════════════════════════════
   Sprint UX.1 — Logo IrisKids cliquable dans le header
   Le logo remplace l'ancien .ik-back-btn (un seul élément à gauche pour
   l'identité ET la navigation retour).
   ═════════════════════════════════════════════════════════════════════════ */
.ik-logo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.ik-logo-btn:hover { transform: scale(1.05); box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.ik-logo-btn:active { transform: scale(0.92); }
.ik-logo-btn img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* ═════════════════════════════════════════════════════════════════════════
   Sprint UX.4 — Bouton "Jeux" + sheet sélecteur de jeux
   ═════════════════════════════════════════════════════════════════════════ */
.ik-games-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, border-color .15s, background .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  margin-right: 8px;
}
.ik-games-btn:hover { border-color: #fff; background: rgba(255, 255, 255, .25); transform: scale(1.05); }
.ik-games-btn:active { transform: scale(0.92); }

/* Sheet (overlay) — mobile-first bottom-sheet, desktop centered */
.ik-games-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  font-family: 'Baloo 2', system-ui, sans-serif;
}
.ik-games-sheet.is-open { pointer-events: auto; opacity: 1; }

.ik-games-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.ik-games-sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  background: #fffafc;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 16px 20px max(20px, env(safe-area-inset-bottom)) 20px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .25);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.ik-games-sheet.is-open .ik-games-sheet-panel { transform: translateX(-50%) translateY(0); }

.ik-games-sheet-handle {
  width: 48px;
  height: 4px;
  background: #d1c4e9;
  border-radius: 2px;
  margin: 0 auto 14px;
}

.ik-games-sheet-title {
  margin: 0 0 14px;
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  color: #1a1033;
}

.ik-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.ik-games-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: #1a1033;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
  border: 2px solid transparent;
  transition: transform .12s, border-color .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.ik-games-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.ik-games-card:active { transform: translateY(0); }
.ik-games-card--active {
  border-color: var(--ik-accent, #7b3fe4);
  background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
}
.ik-games-card-emoji {
  font-size: 2rem;
  line-height: 1;
}
.ik-games-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
}

.ik-games-sheet-close {
  display: block;
  margin: 8px auto 0;
  padding: 10px 24px;
  background: #f3eafe;
  color: #1a1033;
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  min-height: 44px;
}
.ik-games-sheet-close:hover { background: #e9d5ff; }

@media (min-width: 720px) {
  .ik-games-sheet-panel {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, calc(-50% + 30px));
    border-radius: 20px;
    padding-top: 20px;
    max-height: 80vh;
  }
  .ik-games-sheet.is-open .ik-games-sheet-panel { transform: translate(-50%, -50%); }
  .ik-games-sheet-handle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ik-games-sheet, .ik-games-sheet-panel, .ik-games-card { transition: none; }
}

/* ═════════════════════════════════════════════════════════════════════════
   Sprint UX.5 — Footer minimal (injecté par iriskids-header.js)
   Désactivé si <body data-ik-mode="fullscreen"> (chess, 2048).
   ═════════════════════════════════════════════════════════════════════════ */
.ik-footer-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px max(14px, env(safe-area-inset-bottom)) 16px;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 0.78rem;
  color: #6b5b95;
  background: transparent;
  margin-top: 32px;
}
.ik-footer-mini-brand { font-weight: 700; }
.ik-footer-mini-link {
  color: #6b5b95;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color .15s, border-color .15s;
}
.ik-footer-mini-link:hover {
  color: var(--ik-brand, #7b3fe4);
  border-bottom-color: currentColor;
}
