/* Album Panini interactif — Mr Brian */

.album-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.album-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.album-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.album-stat {
  background: var(--surface);
  border: 2px solid #fde68a;
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
}

.album-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.album-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.album-btn--primary {
  background: linear-gradient(180deg, #fbbf24, var(--math-main));
  color: #fff;
  box-shadow: 0 4px 0 var(--math-dark);
}

.album-btn--secondary {
  background: #fff;
  color: var(--ink);
  border: 2px solid #e2e8f0;
  box-shadow: 0 3px 0 #cbd5e1;
}

.album-btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 2px dashed #cbd5e1;
  box-shadow: none;
}

.album-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--math-dark);
}

.album-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Appel élève */
.album-turn {
  text-align: center;
  padding: 1.25rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 3px solid var(--math-main);
  box-shadow: var(--shadow-lift);
  animation: album-turn-pulse 1.8s ease-in-out infinite;
}

.album-turn[hidden] { display: none !important; }

.album-turn-label {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--math-dark);
}

.album-turn-name {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.album-turn-hint {
  margin: 0.5rem 0 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  color: var(--math-dark);
}

@keyframes album-turn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

/* Zone distribution */
.album-stage {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.album-stage[hidden] { display: none !important; }

.album-stage-card-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 14rem;
}

.album-stage-card {
  position: relative;
  width: min(11rem, 42vw);
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 0.75rem;
  transition: transform 0.2s ease;
}

.album-stage-card:disabled {
  cursor: wait;
  opacity: 0.7;
}

.album-stage-card:not(:disabled):hover {
  transform: scale(1.04) rotate(-1deg);
}

.album-stage-card.is-ready {
  animation: album-card-wiggle 1.2s ease-in-out infinite;
}

.album-stage-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.album-stage-meta {
  text-align: center;
  font-family: var(--font-body);
  font-weight: 800;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.album-stage-actions {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

@keyframes album-card-wiggle {
  0%, 100% { transform: rotate(-1deg) scale(1); }
  50% { transform: rotate(1deg) scale(1.03); }
}

/* Album virtuel élève */
.album-viewer {
  background: var(--surface);
  border: 3px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.album-viewer-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.album-viewer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}

.album-viewer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.album-btn.is-active {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.album-slot.is-removable {
  cursor: pointer;
}

.album-slot.is-removable:hover {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.album-slot-remove {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

.album-viewer-select {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 2px solid #e2e8f0;
  background: #fff;
  max-width: 100%;
}

.album-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 0.35rem;
  max-height: 11rem;
  overflow-y: auto;
  padding: 0.25rem;
}

.album-slot {
  aspect-ratio: 65 / 90;
  border-radius: 0.35rem;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}

.album-slot.is-filled {
  border-style: solid;
  border-color: #fde68a;
  background: #fff;
}

.album-slot.is-filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-slot.is-target {
  border-color: var(--math-main);
  border-width: 3px;
  box-shadow: 0 0 0 3px var(--math-glow);
  animation: album-slot-glow 0.8s ease-in-out infinite alternate;
}

.album-slot.is-new {
  animation: album-slot-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes album-slot-glow {
  from { box-shadow: 0 0 0 3px var(--math-glow); }
  to { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.35); }
}

@keyframes album-slot-pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Grille sélection cartes */
.album-picker-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.album-picker-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.album-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.album-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr));
  gap: 0.65rem;
}

.album-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 3px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
  font-family: var(--font-body);
}

.album-pick--muted img,
.album-pick--muted .album-pick-placeholder {
  filter: grayscale(0.9) opacity(0.45);
}

.album-pick.is-partial img,
.album-pick.is-partial .album-pick-placeholder {
  filter: grayscale(0.55) opacity(0.65);
}

.album-pick.is-complete img,
.album-pick.is-complete .album-pick-placeholder {
  filter: grayscale(0.75) opacity(0.5);
}

.album-pick:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--math-main);
}

.album-pick:hover img,
.album-pick:hover .album-pick-placeholder {
  filter: grayscale(0.1) opacity(1);
}

.album-pick:disabled {
  cursor: wait;
}

.album-pick-placeholder {
  aspect-ratio: 65 / 90;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  border-radius: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #64748b;
}

.album-loading {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink-soft);
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
}

#pickerSection.is-dimmed {
  opacity: 0.45;
  pointer-events: none;
}

.album-pick--fr { border-top: 4px solid var(--fr-main); }
.album-pick--math { border-top: 4px solid var(--math-main); }
.album-pick--sci { border-top: 4px solid var(--sci-main); }

.album-pick.is-complete {
  border-color: #86efac;
  background: #f0fdf4;
}

.album-pick.is-partial {
  border-color: #fde68a;
  background: #fffbeb;
}

.album-pick.is-active {
  outline: 3px solid var(--math-main);
  outline-offset: 2px;
}

.album-pick img {
  width: 100%;
  height: auto;
  border-radius: 0.45rem;
  display: block;
}

.album-pick-num {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.album-pick-title {
  margin: 0.3rem 0 0;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.album-pick-badge {
  margin-top: 0.2rem;
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--math-dark);
}

/* Vol carte */
.album-fly-card {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  border-radius: 0.65rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
}

/* Célébration */
.album-celebrate {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 1rem;
}

.album-celebrate[hidden] { display: none !important; }

.album-celebrate-panel {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 4px solid var(--math-main);
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 22rem;
  animation: album-slot-pop 0.45s ease;
}

.album-celebrate-panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.album-celebrate-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Modale élèves */
.album-student-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 14rem;
  overflow-y: auto;
  margin: 0.75rem 0;
}

.album-student-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.album-student-row input {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.65rem;
}

.album-student-row input:focus {
  outline: none;
  border-color: var(--math-main);
}

.album-student-row button {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.5rem;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  cursor: pointer;
}

.album-import-area {
  width: 100%;
  min-height: 5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.65rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.65rem;
  resize: vertical;
  margin-top: 0.5rem;
}

.album-empty {
  text-align: center;
  padding: 2rem 1rem;
  background: #fffbeb;
  border: 3px dashed #fde68a;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.album-empty p {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .album-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .album-toolbar-actions {
    justify-content: stretch;
  }

  .album-toolbar-actions .album-btn {
    flex: 1;
    text-align: center;
  }
}
