@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Special+Elite&family=Caveat:wght@600;700&display=swap');

:root {
  --bg-color: #140e0b; /* Deep mahogany dark desk background */
  --panel-bg: #f2e6cf; /* Soft aged parchment paper */
  --panel-border: #d4c5a9; /* Aged brass border */
  --text-color: #2c1a0e; /* Deep charcoal/sepia ink */
  --text-muted: #6e594b; /* Faded brown ink */
  --primary: #c59b27; /* Polished antique brass/gold */
  --primary-glow: rgba(197, 155, 39, 0.25);
  --success: #5f7447; /* Military/field olive green */
  --success-glow: rgba(95, 116, 71, 0.25);
  --error: #962d22; /* Wax seal red */
  --error-glow: rgba(150, 45, 34, 0.25);
  --warning: #af6a28; /* Leather brown/amber */
  --notebook-bg: #fcf8f0; /* Notebook paper warm cream */
  --notebook-line: rgba(175, 140, 100, 0.15); /* Soft sepia rules */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Cormorant Garamond', serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(197, 155, 39, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 10% 20%, rgba(0, 0, 0, 0.5) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 0, 0, 0.5) 0%, transparent 40%);
}

header {
  width: 100%;
  max-width: 1200px;
  padding: 2rem 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px double var(--panel-border);
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #c59b27 0%, #ecd07f 50%, #8a6f27 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.brand span {
  font-family: 'Special Elite', monospace;
  font-size: 0.75rem;
  color: var(--warning);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.current-seq-label {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: var(--success);
  letter-spacing: 0.05em;
  font-weight: 700;
  opacity: 0.9;
  min-height: 1.2em;
  margin-top: 0.3rem;
}

.player-mode-selector {
  display: flex;
  gap: 0.5rem;
  background: #1c110a;
  border: 2px solid #8a6f27;
  padding: 0.3rem;
  border-radius: 4px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: 2px;
  font-family: 'Special Elite', monospace;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mode-btn.active {
  background: var(--primary);
  color: #1c110a;
  box-shadow: 0 2px 6px var(--primary-glow);
  font-weight: bold;
}

.mode-btn:hover:not(.active) {
  color: #ecd07f;
  background: rgba(255, 255, 255, 0.03);
}

main {
  width: 100%;
  max-width: 1200px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex-grow: 1;
}

/* Custom Player Container */
.player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 8px solid #24140a; /* Dark wood outer bezel */
  outline: 2px solid #c59b27; /* Gold metal lining */
  box-shadow: 
    0 20px 45px rgba(0,0,0,0.8),
    inset 0 0 20px rgba(0,0,0,1);
}

.video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
  transform: scale(1.15);
  transform-origin: center;
}

/* User interaction shield */
.video-shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  background: transparent;
  cursor: default;
}

/* Screen overlay notifications */
.player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

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

.overlay-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  max-width: 450px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  margin: 1.5rem auto;
  animation: spin 1s linear infinite;
}

/* Simulator fallback UI */
.fallback-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  z-index: 2;
}

.fallback-visualizer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  pointer-events: none;
}

.fallback-speaker {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.fallback-text {
  font-size: 2rem;
  font-family: 'Playfair Display', serif;
  text-align: center;
  max-width: 800px;
  line-height: 1.4;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  color: #fff;
}

.fallback-narration {
  font-size: 1.1rem;
  color: var(--warning);
  font-family: 'Outfit', sans-serif;
  text-align: center;
  max-width: 600px;
}

.fallback-btn-start {
  margin-top: 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 15px var(--primary-glow);
  z-index: 10;
  transition: transform 0.2s;
}

.fallback-btn-start:hover {
  transform: scale(1.05);
}

/* Custom Controls (Display Only, Not clickable for scrubbing) */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
  padding: 1.5rem 1.5rem 1rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transform: translateY(0);
  transition: transform 0.3s;
}

.progress-container {
  display: none !important;
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--primary), var(--success));
  transition: width 0.1s linear;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.time-display {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: monospace;
}

.status-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.status-badge.playing {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}
.status-badge.playing .dot {
  background: var(--success);
}

.status-badge.paused {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.2);
}
.status-badge.paused .dot {
  background: var(--warning);
}

/* Unmute button for YouTube muted autoplay */
.btn-unmute {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--warning);
  padding: 0.25rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  animation: pulse 1.5s infinite;
}

.btn-unmute:hover {
  background: rgba(245, 158, 11, 0.35);
  transform: scale(1.03);
}

/* Digital Laboratory Notebook Timeline */
.timeline-section {
  background: var(--notebook-bg);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Notebook paper pattern */
.timeline-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(var(--notebook-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--notebook-line) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 16px;
  pointer-events: none;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  border-left: 3px solid var(--primary);
  padding-left: 0.8rem;
  position: relative;
  z-index: 2;
}

.timeline-rows {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  position: relative;
  z-index: 2;
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Connector line */
.timeline-row::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-row-progress {
  position: absolute;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 0%;
  transition: width 0.5s ease;
}

.timeline-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
}

.node-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e293b;
  border: 3px solid #475569;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  cursor: not-allowed;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.timeline-node.unlocked .node-circle {
  cursor: pointer;
  border-color: var(--primary);
  color: var(--primary);
}

.timeline-node.active .node-circle {
  border-color: var(--success);
  color: var(--success);
  transform: scale(1.15);
  box-shadow: 0 0 15px var(--success-glow);
}

.timeline-node.completed .node-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 10px var(--primary-glow);
  cursor: pointer;
}

.node-label {
  position: absolute;
  top: 52px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  background: #1e293b;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
}

.timeline-node.active .node-label {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}

/* Interactivity overlays & Game interfaces */
.game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  background: rgba(11, 15, 25, 0.95);
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.game-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.game-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.game-attempts {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
}

.btn-skip {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: none; /* Only show after 2 attempts */
}

.btn-skip.visible {
  display: block;
}

.btn-skip:hover {
  background: rgba(239, 68, 68, 0.3);
}

.game-body {
  flex-grow: 1;
  position: relative;
  display: flex;
  gap: 1.5rem;
  min-height: 0; /* Important for scroll */
}

/* Game 1: T-Rex Scanner */
.scanner-workspace {
  flex: 2;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.scanner-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.scanner-bg-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 1.5s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
}

.scanner-bg-image.realistic {
  opacity: 0;
}

.scanner-bg-image.realistic.revealed {
  opacity: 1;
}

.scan-hotspot {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid white;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
}

.scan-hotspot::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 1px solid white;
  opacity: 0.5;
  animation: pulse-ring 1.5s infinite;
}

.scan-hotspot:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: var(--primary);
  transform: translate(-50%, -50%) scale(1.2);
}

.scan-hotspot.scanned-error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.2);
}
.scan-hotspot.scanned-error::after {
  border-color: var(--error);
}

.scan-hotspot.scanned-correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.2);
}
.scan-hotspot.scanned-correct::after {
  border-color: var(--success);
}

.scanner-sidebar {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.scanner-sidebar h3 {
  font-size: 1.2rem;
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.scan-detail-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  padding: 1rem;
  border-radius: 8px;
  display: none;
  animation: fadeIn 0.3s;
}

.scan-detail-card.active {
  display: block;
}

.scan-status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.scan-status-pill.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.scan-status-pill.correct {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.scanner-instructions {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.scanner-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.scanner-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--success);
  transition: width 0.3s ease;
}

/* Game 2: Skeleton Quiz — Vrai animal ou Monstre ? */
.quiz-workspace {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.quiz-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 99px;
  transition: width 0.5s ease;
  width: 0%;
}

.quiz-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quiz-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.quiz-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 900px;
}

.quiz-instruction {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

/* Skeleton display */
.quiz-skeleton-display {
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 160px;
  flex-shrink: 0;
}

.quiz-skeleton-img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.quiz-skeleton-placeholder {
  font-size: 3.5rem;
  opacity: 0.4;
}

/* Choices row */
.quiz-choices {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  justify-content: center;
}

.quiz-vs {
  font-size: 1rem;
  font-weight: 900;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.quiz-choice-btn {
  flex: 1;
  max-width: 280px;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.quiz-choice-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(59,130,246,0.08);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.2);
}

.quiz-choice-img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
}

.quiz-choice-placeholder {
  width: 100%;
  height: 140px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem;
  text-align: center;
}

.quiz-choice-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

/* Feedback states */
.quiz-choice-btn.quiz-correct {
  border-color: var(--success, #10b981);
  background: rgba(16,185,129,0.12);
  box-shadow: 0 0 20px rgba(16,185,129,0.25);
  animation: pulseCorrect 0.4s ease;
}

.quiz-choice-btn.quiz-wrong {
  border-color: var(--error, #ef4444);
  background: rgba(239,68,68,0.1);
  animation: shakeWrong 0.4s ease;
}

.quiz-choice-btn.quiz-correct-reveal {
  border-color: var(--success, #10b981);
  background: rgba(16,185,129,0.07);
  opacity: 0.85;
}

@keyframes pulseCorrect {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

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

/* Fact modal — reused from old game */
.match-fact-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.96);
  z-index: 30;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  text-align: center;
}

.match-fact-modal.visible {
  display: flex;
  animation: fadeIn 0.3s;
}

.match-fact-modal h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.fact-animal-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.match-fact-text {
  font-size: 1.1rem;
  max-width: 620px;
  line-height: 1.7;
  margin-bottom: 2rem;
  color: var(--text-color);
}

.btn-next-fact {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  border: none;
  padding: 0.7rem 2.4rem;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-next-fact:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

/* End modal */
.quiz-end-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.97);
  z-index: 31;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  text-align: center;
  gap: 0.8rem;
}

.quiz-end-modal.visible {
  display: flex;
  animation: scaleUp 0.4s ease;
}

.quiz-end-trophy {
  font-size: 4rem;
  line-height: 1;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.quiz-end-modal h3 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-color);
  margin: 0;
}

.quiz-end-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.quiz-end-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

/* Keep btn-validate for legacy/other games */
.match-validation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

.btn-validate {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  border: none;
  padding: 0.6rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--success-glow);
  transition: transform 0.2s;
}

.btn-validate:hover {
  transform: translateY(-2px);
}

/* Game 3: Spinosaurus Timeline */
.timeline-game-workspace {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.spino-dock {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.5rem;
}

.spino-card {
  width: 115px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: grab;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}

.spino-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.spino-image-placeholder {
  width: 100%;
  height: 50px;
  background: #334155;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  font-weight: bold;
  color: #fff;
  text-align: center;
  padding: 0.2rem;
}

.spino-card h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-color);
}

.spino-timeline-track {
  display: flex;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 1.8rem 0.6rem 0.6rem;
  position: relative;
  margin-top: 0.4rem;
  gap: 0.6rem;
}

.spino-timeline-track::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 5%;
  right: 5%;
  height: 4px;
  background: #475569;
  z-index: 1;
}

.spino-slot {
  width: 125px;
  min-height: 95px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.3s;
  padding: 0.3rem;
}

.spino-slot.drag-over {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.spino-slot.correct {
  border-color: var(--success);
  border-style: solid;
  background: rgba(16, 185, 129, 0.05);
}

.spino-slot.error {
  border-color: var(--error);
  border-style: solid;
  background: rgba(239, 68, 68, 0.05);
}

.spino-slot-year {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 2px solid #475569;
  padding: 0.2rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
}

.spino-slot.highlight .spino-slot-year {
  background: var(--warning);
  color: #000;
  border-color: var(--warning);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive elements */
@media (max-width: 1024px) {
  .match-board {
    grid-template-columns: repeat(2, 1fr);
  }
  .spino-timeline-track {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
  }
}
/* =========================================================================
   WELCOME SCREEN / LANDING PAGE (ANTIQUE JOURNAL CLOSED)
   ========================================================================= */

.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: opacity 1s cubic-bezier(0.77, 0, 0.175, 1), visibility 1s;
}

body.book-closed header,
body.book-closed main,
body.book-closed footer {
  display: none !important;
}

body.book-opened .welcome-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Wood Desk Background */
.wood-desk {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #1a0f0a;
  background-image: 
    repeating-linear-gradient(90deg, rgba(0,0,0,0.15), rgba(0,0,0,0.15) 30px, transparent 30px, transparent 60px),
    radial-gradient(circle at 50% 50%, rgba(197, 155, 39, 0.08) 0%, #080403 100%);
  z-index: 1;
  pointer-events: none;
  opacity: 0.95;
}

/* Leather Binder Cover */
.journal-binder {
  position: relative;
  width: 90%;
  max-width: 850px;
  background: #3b2314; /* Deep rich leather brown */
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(0,0,0,0.4) 0%, transparent 50%),
    repeating-linear-gradient(135deg, rgba(0,0,0,0.15), rgba(0,0,0,0.15) 2px, transparent 2px, transparent 4px);
  border-radius: 8px;
  box-shadow: 
    0 30px 70px rgba(0,0,0,0.85), 
    inset 0 0 45px rgba(0,0,0,0.7), 
    0 0 0 10px #22120a;
  padding: 20px;
  z-index: 2;
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s ease;
  border: 3px solid #5a381e;
  transform-origin: left center;
}

/* Leather strap with brass latch */
.journal-strap {
  position: absolute;
  right: -35px;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 48px;
  background: #4a2812;
  border: 2px solid #22120a;
  border-radius: 0 6px 6px 0;
  box-shadow: 3px 5px 12px rgba(0,0,0,0.6);
  z-index: 5;
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.4s;
  cursor: pointer;
}

.journal-strap .latch {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: radial-gradient(circle, #f3d47d, #c59b27);
  border-radius: 50%;
  border: 2px solid #564010;
  box-shadow: inset 1px 1px 3px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.3);
}

/* Sangle animation when book opens */
body.book-opening .journal-strap {
  transform: translateY(-50%) rotate(100deg);
  transform-origin: left center;
  opacity: 0;
}

body.book-opening .journal-binder {
  transform: rotateY(-30deg) translateZ(100px) scale(1.05);
  opacity: 0;
}

/* Parchment Cover Inner Card */
.journal-cover {
  background-color: #f3edd8;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.45) 0%, transparent 100%),
    repeating-linear-gradient(rgba(175, 140, 100, 0.05) 1px, transparent 1px, transparent 24px);
  background-size: 100% 100%, 100% 24px;
  border: 1px solid #d4c4a8;
  border-radius: 6px;
  padding: 2.5rem 2rem;
  color: #2c1a0e;
  box-shadow: inset 0 0 25px rgba(44, 26, 14, 0.2);
  position: relative;
  overflow: hidden;
}

/* Brass corners */
.brass-corners .corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid #c59b27;
  z-index: 3;
}
.brass-corners .top-left { top: 10px; left: 10px; border-right: none; border-bottom: none; border-radius: 3px 0 0 0; }
.brass-corners .top-right { top: 10px; right: 10px; border-left: none; border-bottom: none; border-radius: 0 3px 0 0; }
.brass-corners .bottom-left { bottom: 10px; left: 10px; border-right: none; border-top: none; border-radius: 0 0 0 3px; }
.brass-corners .bottom-right { bottom: 10px; right: 10px; border-left: none; border-top: none; border-radius: 0 0 3px 0; }

/* Elements styling */
.journal-badge {
  font-family: 'Special Elite', monospace;
  font-size: 0.8rem;
  background: #c59b27;
  color: #140e0b;
  padding: 0.2rem 0.7rem;
  border-radius: 2px;
  display: inline-block;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.15);
}

.journal-title {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #2c1a0e;
  text-shadow: 1px 1px 0px #fff, 2px 2px 0px #d4c4a8;
  line-height: 1.1;
  text-align: center;
}

.journal-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: #6e594b;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  text-align: center;
}

.vintage-divider {
  height: 4px;
  width: 140px;
  margin: 1.2rem auto;
  border-top: 1px solid #c59b27;
  border-bottom: 1px solid #c59b27;
  position: relative;
}
.vintage-divider::after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f3edd8;
  padding: 0 0.5rem;
  color: #c59b27;
  font-size: 0.8rem;
}

.journal-credits {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.written-by {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  font-style: italic;
  color: #6e594b;
}

.author-name {
  font-family: 'Caveat', cursive;
  font-size: 2.2rem;
  color: #962d22;
  margin-top: -0.2rem;
  transform: rotate(-3deg);
  font-weight: 700;
}

/* Vintage modes cards */
.setup-section {
  width: 100%;
  margin-bottom: 2rem;
}

.setup-instruction {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #2c1a0e;
  margin-bottom: 0.8rem;
  text-align: center;
}

.vintage-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.vintage-mode-card {
  background: rgba(255, 255, 255, 0.35);
  border: 1px dashed #d4c4a8;
  border-radius: 4px;
  padding: 1rem 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.vintage-mode-card:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: #c59b27;
  transform: translateY(-2px);
}

.vintage-mode-card.active {
  background: #fff;
  border: 2px solid #c59b27;
  box-shadow: 0 6px 15px rgba(44, 26, 14, 0.12);
}

.vintage-mode-card .card-icon {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.vintage-mode-card h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: #2c1a0e;
  margin-bottom: 0.3rem;
}

.vintage-mode-card p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: #6e594b;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.vintage-mode-card .badge-status {
  font-family: 'Special Elite', monospace;
  font-size: 0.65rem;
  color: #6e594b;
  border: 1px solid #d4c4a8;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  background: rgba(44, 26, 14, 0.03);
}

.vintage-mode-card.active .badge-status {
  background: #c59b27;
  color: #140e0b;
  border-color: #c59b27;
}

/* Red Wax Seal Button */
.action-section {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.wax-seal-button {
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
  outline: none;
}

.wax-seal-button:hover {
  transform: scale(1.06);
}

.wax-seal-button:active {
  transform: scale(0.94);
}

.wax-seal-button::before {
  content: '';
  position: absolute;
  width: 130px;
  height: 130px;
  background: #962d22;
  border-radius: 52% 48% 51% 49% / 48% 52% 48% 52%;
  box-shadow: 
    0 8px 16px rgba(0,0,0,0.5), 
    inset 0 -5px 12px rgba(0,0,0,0.6), 
    inset 0 5px 12px rgba(255,255,255,0.25);
  z-index: 1;
}

.wax-seal-button .seal-inner {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px double #b93c30;
  background: #812118;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 
    inset 0 4px 8px rgba(0,0,0,0.5);
}

.wax-seal-button .seal-inner::after {
  content: '🦖';
  font-size: 2.2rem;
  opacity: 0.55;
  filter: contrast(1.5) brightness(0.6);
}

.wax-seal-button .seal-text {
  position: absolute;
  font-family: 'Special Elite', monospace;
  font-size: 0.5rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  width: 90px;
  text-align: center;
  line-height: 1.1;
  z-index: 3;
  transform: translateY(20px);
}

.handwritten-note {
  position: absolute;
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: #5c4a39;
  opacity: 0.7;
  pointer-events: none;
  font-weight: 700;
}

.handwritten-note.note-1 {
  top: 12%;
  left: 3%;
  transform: rotate(-10deg);
}

.handwritten-note.note-2 {
  bottom: 8%;
  right: 3%;
  transform: rotate(8deg);
}

/* =========================================================================
   APPLICATION ANTIQUE VISUAL OVERRIDES
   ========================================================================= */

/* Timeline Section open notebook design */
.timeline-section {
  background-color: var(--notebook-bg);
  border: 2px solid #8a6f27;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: var(--text-color);
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.timeline-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(var(--notebook-line) 1px, transparent 1px);
  background-size: 100% 24px;
  border-radius: 6px;
  pointer-events: none;
}

.timeline-title {
  font-family: 'Cinzel', serif;
  color: var(--text-color);
  border-left: 4px solid var(--primary);
  font-weight: bold;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
}

.node-circle {
  background: #ecd07f;
  border: 3px solid #8a6f27;
  color: #2c1a0e;
  font-family: 'Special Elite', monospace;
}

.timeline-node.unlocked .node-circle {
  border-color: var(--primary);
  color: var(--primary);
  background: #fbf6ec;
}

.timeline-node.active .node-circle {
  border-color: var(--success);
  color: var(--success);
  background: #fcf8f0;
  box-shadow: 0 0 12px var(--success-glow);
}

.timeline-node.completed .node-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #140e0b;
  box-shadow: 0 0 10px var(--primary-glow);
}

.node-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  font-weight: bold;
  background: #eaddc3;
  color: #2c1a0e;
  border: 1px solid #c59b27;
}

.timeline-node.active .node-label {
  color: var(--success);
  border-color: var(--success);
}

.timeline-row::before {
  background: rgba(44, 26, 14, 0.18);
  height: 3px;
}

.timeline-row-progress {
  background: linear-gradient(90deg, #8a6f27, #c59b27);
  height: 3px;
}

/* Fallback player and Subtitles */
.fallback-player {
  background: linear-gradient(135deg, #18110b 0%, #2a1b12 100%) !important;
}

.fallback-speaker {
  font-family: 'Special Elite', monospace;
  color: var(--primary);
  letter-spacing: 0.15em;
  font-size: 0.95rem;
}

.fallback-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 600;
  color: #fdfaf2;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

.fallback-narration {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: var(--warning);
  font-weight: 700;
}

.fallback-btn-start {
  font-family: 'Special Elite', monospace;
  background: #962d22;
  box-shadow: 0 4px 10px var(--error-glow);
  border: 1px solid #7d1c12;
  border-radius: 4px;
}
.fallback-btn-start:hover {
  background: #b93c30;
}

/* Progress bar & Custom Controls styling */
.progress-container {
  height: 8px;
  background: rgba(44, 26, 14, 0.5);
  border: 1px solid #8a6f27;
  border-radius: 4px;
}

.progress-bar {
  background: linear-gradient(to right, #8a6f27, #c59b27);
}

.time-display {
  font-family: 'Special Elite', monospace;
  color: #ecd07f;
}

.status-badge {
  font-family: 'Special Elite', monospace;
  background: #1c110a;
  border: 1px solid #8a6f27;
  color: #c59b27;
  border-radius: 2px;
}

.status-badge.playing {
  color: #5f7447;
  border-color: #5f7447;
}

.status-badge.playing .dot {
  background: #5f7447;
}

.status-badge.paused {
  color: var(--warning);
  border-color: var(--warning);
}

.status-badge.paused .dot {
  background: var(--warning);
}

.btn-unmute {
  font-family: 'Special Elite', monospace;
  border-radius: 2px;
  background: rgba(175, 106, 40, 0.2);
  border-color: #af6a28;
  color: #ecd07f;
}

/* Overlay Cards */
.player-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.overlay-card {
  background: #f2e6cf;
  border: 3px double #d4c5a9;
  border-radius: 8px;
  color: #2c1a0e;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), inset 0 0 15px rgba(44,26,14,0.1);
}

.overlay-card h2 {
  font-family: 'Cinzel', serif;
  color: #962d22;
  font-weight: bold;
}

.overlay-card p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
}

.spinner {
  border-color: rgba(197, 155, 39, 0.15);
  border-left-color: #c59b27;
}

/* =========================================================================
   SANDBOX (BANC D'ESSAI) — Admin Preview Overrides
   ========================================================================= */

/* Sandbox tab: prevent any content from overflowing the tab bounds */
#tab-preview {
  overflow: hidden;
}

/* Sandbox player wrapper: fixed 450px height, clips ALL children including iframes */
.sandbox-player-shell {
  width: 100%;
  max-width: 800px;
  height: 450px;
  margin: 0 auto;
  position: relative;
  background: #000;
  border-radius: 8px;
  /* overflow: hidden alone doesn't clip iframes in some browsers — use contain */
  overflow: hidden;
  contain: layout paint; /* Prevents children from painting outside this box */
  isolation: isolate;    /* Creates a new stacking context */
  flex-shrink: 0;
}

/* Override the global .player-container so it fills the shell exactly */
#tab-preview .player-container {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: unset !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  overflow: hidden;
}

/* Swipe deck — compact card size to fit inside the sandbox player */
#tab-preview .swipe-deck-container {
  width: 220px;
  height: 290px;
}

#tab-preview .swipe-game-workspace {
  overflow: hidden;
}

/* =========================================================================
   GAME OVERLAYS ANTIQUE OVERRIDES
   ========================================================================= */

.game-container {
  background: #f2e6cf;
  color: #2c1a0e;
  border: 8px solid #24140a; /* Wood framing */
  outline: 2px solid #c59b27;
  box-shadow: inset 0 0 30px rgba(44,26,14,0.25);
  border-radius: 8px;
}

.game-header {
  border-bottom: 2px dashed #d4c5a9;
}

.game-header h2 {
  font-family: 'Cinzel', serif;
  color: #962d22;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.game-attempts {
  font-family: 'Special Elite', monospace;
  background: rgba(44, 26, 14, 0.04);
  border: 1px solid #d4c4a8;
  color: #6e594b;
  border-radius: 2px;
}

.btn-skip {
  font-family: 'Special Elite', monospace;
  background: #962d22;
  color: #fff;
  border: 1px solid #7d1c12;
  border-radius: 2px;
}

.btn-skip:hover {
  background: #b93c30;
}

/* Game 1: T-Rex Scanner */
.scanner-sidebar {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid #d4c4a8;
  color: #2c1a0e;
}

.scanner-sidebar h3 {
  font-family: 'Cinzel', serif;
  color: #2c1a0e;
  border-bottom: 2px dashed #d4c4a8;
  font-weight: bold;
}

.scanner-instructions {
  font-family: 'Cormorant Garamond', serif;
  color: #6e594b;
  font-size: 1rem;
}

.scan-detail-card {
  background: #fff;
  border: 1px solid #c59b27;
  box-shadow: 0 4px 10px rgba(44,26,14,0.06);
}

.scan-detail-card h4 {
  font-family: 'Cinzel', serif;
  color: #2c1a0e !important;
}

.scan-detail-card p {
  color: #4b3d30 !important;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
}

.scan-status-pill.correct {
  background: rgba(95, 116, 71, 0.15);
  color: #5f7447;
  border: 1px solid rgba(95, 116, 71, 0.3);
}

.scan-status-pill.error {
  background: rgba(150, 45, 34, 0.12);
  color: #962d22;
  border: 1px solid rgba(150, 45, 34, 0.25);
}

.scanner-progress-bar {
  background: rgba(44, 26, 14, 0.08);
  border: 1px solid #d4c4a8;
}

.scanner-progress-fill {
  background: #5f7447;
}

/* Game 2: Skeleton Match */
.match-column {
  background: rgba(255, 255, 255, 0.35);
  border: 1px dashed #d4c4a8;
}

.animal-target {
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed #d4c4a8;
}

.animal-target.drag-over {
  border-color: var(--primary);
  background: rgba(197, 155, 39, 0.08);
}

.animal-target.correct {
  border-color: var(--success);
  background: rgba(95, 116, 71, 0.08);
}

.animal-target.error {
  border-color: var(--error);
  background: rgba(150, 45, 34, 0.08);
}

.animal-image-placeholder {
  background: #eaddc3;
  color: #6e594b;
  border: 1px solid #d4c4a8;
  font-family: 'Cormorant Garamond', serif;
}

.animal-target h4 {
  font-family: 'Cinzel', serif;
  color: #2c1a0e;
  font-weight: bold;
}

.skeleton-dock {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid #d4c4a8;
}

.skeleton-card {
  background: #fff;
  border: 1px solid #d4c4a8;
  box-shadow: 0 4px 8px rgba(44,26,14,0.06);
}

.skeleton-card:hover {
  border-color: #c59b27;
  box-shadow: 0 6px 14px rgba(44,26,14,0.15);
}

.skeleton-image-placeholder {
  background: #eaddc3;
  color: #6e594b;
  border: 1px solid #d4c4a8;
  font-family: 'Cormorant Garamond', serif;
}

.skeleton-card span {
  font-family: 'Special Elite', monospace;
  color: #6e594b;
}

.btn-validate {
  font-family: 'Special Elite', monospace;
  background: #5f7447;
  box-shadow: 0 4px 10px var(--success-glow);
  border: 1px solid #4a5c36;
}

.btn-validate:hover {
  background: #738c57;
}

.match-fact-modal {
  background: #f2e6cf;
}

.match-fact-modal h3 {
  font-family: 'Cinzel', serif;
  color: #5f7447;
  font-weight: bold;
}

.match-fact-text {
  font-family: 'Cormorant Garamond', serif;
  color: #2c1a0e;
}

.btn-next-fact {
  font-family: 'Special Elite', monospace;
  background: #c59b27;
  color: #140e0b;
  border: 1px solid #a37f1e;
  border-radius: 4px;
}
.btn-next-fact:hover {
  background: #dfb236;
}

/* Game 3: Spinosaurus Timeline */
.spino-dock {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid #d4c4a8;
}

.spino-card {
  background: #fff;
  border: 1px solid #d4c4a8;
  box-shadow: 0 4px 8px rgba(44,26,14,0.05);
}

.spino-card:hover {
  box-shadow: 0 8px 18px rgba(44,26,14,0.15);
  border-color: #c59b27;
}

.spino-image-placeholder {
  background: #eaddc3;
  color: #6e594b;
  border: 1px solid #d4c4a8;
  font-family: 'Cormorant Garamond', serif;
}

.spino-card h4 {
  font-family: 'Cinzel', serif;
  color: #2c1a0e;
  font-weight: bold;
}

.spino-timeline-track {
  background: rgba(255, 255, 255, 0.35);
  border: 1px dashed #d4c4a8;
}

.spino-timeline-track::before {
  background: #d4c4a8;
}

.spino-slot {
  border: 2px dashed #d4c4a8;
  background: rgba(255, 255, 255, 0.5);
}

.spino-slot.drag-over {
  border-color: var(--primary);
  background: rgba(197, 155, 39, 0.08);
}

.spino-slot.correct {
  border-color: var(--success);
  background: rgba(95, 116, 71, 0.08);
}

.spino-slot.error {
  border-color: var(--error);
  background: rgba(150, 45, 34, 0.08);
}

.spino-slot-year {
  font-family: 'Special Elite', monospace;
  background: #eaddc3;
  border: 2px solid #8a6f27;
  color: #2c1a0e;
}

.spino-slot.highlight .spino-slot-year {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
  box-shadow: 0 0 12px rgba(175, 106, 40, 0.3);
}

/* Footer & other global overrides */
footer {
  font-family: 'Special Elite', monospace;
  color: #6e594b !important;
}

.fallback-player h2 {
  font-family: 'Cinzel', serif;
}

/* =========================================================================
   SCORE, FULLSCREEN, AND POINTS FLOATING ANIMATION STYLES
   ========================================================================= */

.score-display {
  font-family: 'Special Elite', monospace;
  background: #1c110a;
  border: 2px solid #8a6f27;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.score-label {
  color: #6e594b;
}

.score-value {
  color: #c59b27;
  font-weight: bold;
  font-size: 1.15rem;
  text-shadow: 0 0 5px rgba(197, 155, 39, 0.4);
}

.score-pts {
  color: #8a6f27;
  font-size: 0.75rem;
}

.btn-fullscreen {
  font-family: 'Special Elite', monospace;
  background: transparent;
  border: 2px solid #8a6f27;
  color: #c59b27;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-fullscreen:hover {
  background: #c59b27;
  color: #140e0b;
  border-color: #c59b27;
  box-shadow: 0 4px 10px rgba(197, 155, 39, 0.3);
  transform: translateY(-1px);
}

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

/* Fullscreen browser native styling overrides */
#player-container:fullscreen {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: auto !important;
  border: none !important;
  outline: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #000 !important;
}

#player-container:fullscreen .custom-controls {
  bottom: 0 !important;
  padding: 2rem 2rem 1.5rem !important;
}

/* Floating Points popup */
.points-popup {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-family: 'Special Elite', monospace;
  font-size: 2.8rem;
  font-weight: bold;
  color: #c59b27;
  text-shadow: 0 0 12px rgba(197, 155, 39, 0.7), 2px 2px 4px rgba(0,0,0,0.85);
  z-index: 1000;
  pointer-events: none;
  animation: floatUpFade 1.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.points-popup.negative {
  color: #962d22;
  text-shadow: 0 0 12px rgba(150, 45, 34, 0.7), 2px 2px 4px rgba(0,0,0,0.85);
}

@keyframes floatUpFade {
  0% {
    transform: translate(-50%, -30%) scale(0.7);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -85%) scale(1);
    opacity: 0;
  }
}

/* =========================================================================
   END SCREEN SUCCESS SCALE & GRADES
   ========================================================================= */
.end-screen-scale-container {
  width: 100%;
  max-width: 500px;
  margin: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-scale-title {
  font-family: 'Special Elite', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.success-scale-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin: 1rem 0 1.5rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.success-scale-progress {
  position: absolute;
  height: 100%;
  left: 0;
  top: 0;
  border-radius: 4px;
  background: linear-gradient(to right, #962d22, #c59b27, #5f7447);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-scale-nodes {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.scale-node {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #18110b;
  border: 3px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
}

.scale-node.active {
  transform: scale(1.3);
  box-shadow: 0 0 12px currentColor;
}

.scale-node-label {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Special Elite', monospace;
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.scale-node.active .scale-node-label {
  color: #fff;
  font-weight: bold;
}

.scale-node.debutant {
  color: #af6a28;
}
.scale-node.debutant.active {
  border-color: #af6a28;
  background: #af6a28;
}

.scale-node.confirme {
  color: #c59b27;
}
.scale-node.confirme.active {
  border-color: #c59b27;
  background: #c59b27;
}

.scale-node.expert {
  color: #5f7447;
}
.scale-node.expert.active {
  border-color: #5f7447;
  background: #5f7447;
}

/* =========================================================================
   LIVE NOTEBOOK & PLAYER LAYOUT
   ========================================================================= */
.player-layout-wrapper {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  width: 100%;
  align-items: stretch;
}

/* Notebook Cover & Spine styling */
.live-notebook {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  background: #fdfaf2;
  border-radius: 8px 12px 12px 8px;
  border: 1px solid #c5b497;
  box-shadow: 
    5px 10px 30px rgba(0, 0, 0, 0.4),
    inset -5px 0 10px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  height: auto;
  min-height: 400px;
  font-family: 'Cormorant Garamond', serif;
}

.notebook-spine {
  width: 18px;
  background: linear-gradient(to right, #3c2312, #5a3e2b 30%, #3c2312 80%, #1e1108);
  border-right: 1px solid #1e1108;
  height: 100%;
  flex-shrink: 0;
  box-shadow: inset 1px 0 5px rgba(0,0,0,0.5);
  position: relative;
}

/* Binding rings effect */
.notebook-spine::after {
  content: '';
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  background-image: radial-gradient(circle, #ecd07f 20%, transparent 25%);
  background-size: 100% 30px;
}

.notebook-page-content {
  flex-grow: 1;
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  background: #fdfcf7;
  overflow-y: auto;
  max-height: 520px;
}

/* Custom scrollbar for vintage feel */
.notebook-page-content::-webkit-scrollbar {
  width: 6px;
}
.notebook-page-content::-webkit-scrollbar-track {
  background: #f5f0e1;
}
.notebook-page-content::-webkit-scrollbar-thumb {
  background: #c5b497;
  border-radius: 3px;
}

.notebook-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #3e2715;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.notebook-divider {
  height: 2px;
  background: repeating-linear-gradient(to right, #ecd07f, #ecd07f 4px, transparent 4px, transparent 8px);
  margin-bottom: 1.2rem;
  opacity: 0.7;
}

.notebook-notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.05rem;
}

.notebook-entry {
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed rgba(62, 39, 21, 0.15);
  animation: inkSpread 1s ease-out forwards;
  line-height: 1.45;
  color: #2c190b;
  position: relative;
  padding-left: 1.2rem;
}

.notebook-entry::before {
  content: '✒️';
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 0.8rem;
  opacity: 0.8;
}

.notebook-entry-title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #8c5a3c;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.notebook-entry-text {
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a0f07;
}

.empty-notebook {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #8c7e6c;
  text-align: center;
  margin-top: 2rem;
  line-height: 1.5;
}

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

/* Responsiveness: on smaller screens, stack them */
@media (max-width: 992px) {
  .player-layout-wrapper {
    flex-direction: column;
  }
  .live-notebook {
    width: 100%;
    min-height: auto;
  }
  .notebook-page-content {
    max-height: 250px;
  }
}

/* =========================================================================
   JEU 4 : DINOSAURE OU PAS ? (SWIPE)
   ========================================================================= */
.swipe-game-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.swipe-deck-container {
  width: 290px;
  height: 380px;
  position: relative;
  margin: 0.5rem auto 1.5rem;
}

.swipe-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.1s ease;
}

.swipe-card:active {
  cursor: grabbing;
}

.swipe-card.card-hidden {
  display: none !important;
}

.swipe-card-inner {
  width: 100%;
  height: 100%;
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(12px);
  border: 2px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.swipe-card-media-wrapper {
  position: relative;
  flex-grow: 1;
  background: #0b0f19;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.swipe-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.swipe-card-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #18233c 0%, #0c1220 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

.swipe-card-info {
  padding: 1rem;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid var(--panel-border);
}

.swipe-card-info h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
}

.swipe-card-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Stamps: YES and NO overlays */
.card-stamp {
  position: absolute;
  top: 25px;
  padding: 0.4rem 1rem;
  font-size: 1.5rem;
  font-weight: 900;
  border-radius: 6px;
  text-transform: uppercase;
  font-family: 'Special Elite', monospace;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  letter-spacing: 0.1em;
}

.stamp-yes {
  right: 20px;
  color: #10b981;
  border: 3px solid #10b981;
  transform: rotate(15deg);
}

.stamp-no {
  left: 20px;
  color: #ef4444;
  border: 3px solid #ef4444;
  transform: rotate(-15deg);
}

/* Cue Labels left/right */
.swipe-cue {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Special Elite', monospace;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-muted);
  opacity: 0.25;
  transition: all 0.2s ease;
  pointer-events: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 2;
}

.cue-left {
  left: 1rem;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
}

.cue-right {
  right: 1rem;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
}

.swipe-cue.active {
  opacity: 0.95;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(240, 221, 176, 0.4);
}

/* Buttons row */
.swipe-btn-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-swipe-action {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.action-no {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #f87171;
}

.action-no:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.1);
}

.action-yes {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #34d399;
}

.action-yes:hover {
  background: #10b981;
  color: #fff;
  transform: scale(1.1);
}

/* Instant flash feedback */
.swipe-flash-feedback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  animation: flashFade 0.7s forwards;
}

.flash-success {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(0,0,0,0) 70%);
}

.flash-error {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, rgba(0,0,0,0) 70%);
}

@keyframes flashFade {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

/* Bilan Card */
.swipe-bilan-card {
  width: 100%;
  max-width: 550px;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  border: 2px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  padding: 1.5rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.swipe-bilan-score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0.8rem 0;
}

.score-stat {
  padding: 0.8rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.score-stat .val {
  font-family: 'Special Elite', monospace;
  font-size: 1.6rem;
  font-weight: bold;
}

.score-stat .lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-success .val { color: var(--success); }
.stat-error .val { color: var(--error); }
.stat-pts .val { color: var(--primary); }

.swipe-bilan-item {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.8rem;
  transition: border-color 0.25s;
  text-align: left;
}

.swipe-bilan-item.item-correct {
  border-left: 4px solid var(--success);
}

.swipe-bilan-item.item-incorrect {
  border-left: 4px solid var(--error);
}

.bilan-badge {
  font-family: 'Special Elite', monospace;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-ko {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
