/* Animations */
@keyframes fadeUpStagger {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  opacity: 0;
  animation: fadeUpStagger 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* Top Navigation (Ultra Minimal) */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 250, 250, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.top-pills {
  display: flex;
  gap: 0.5rem;
}

.score-pill {
  background: rgba(0, 0, 0, 0.03);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 50;
}

.top-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: right center;
  transform: scaleX(0);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  background: #0066cc;
}

/* Buttons */
button {
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ghost-btn {
  color: #86868b;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

.ghost-btn:hover {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.04);
}

.primary-btn {
  background: #1d1d1f;
  color: #fff;
  padding: 1.2rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.primary-btn:hover:not(:disabled) {
  transform: scale(0.97);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  background: #000;
}

.primary-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Structural: Scene Container */
.scene-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 75vh;
  gap: 1.5rem;
  padding: 2rem 0;
}

.scene-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  margin: 0;
  color: #1d1d1f;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.scene-text {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: #86868b;
  margin: 0;
  max-width: 600px;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

.typing {
  white-space: pre-line;
  min-height: 4rem;
}

/* Choices / Options Layout (iOS Settings style) */
.choice-list,
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-width: 500px;
  margin-top: 1rem;
}

.choice-btn,
.option-btn {
  width: 100%;
  text-align: right;
  padding: 1.3rem 1.6rem;
  background: #fff;
  border-radius: 20px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.choice-btn::after,
.option-btn::after {
  content: "→";
  font-family: -apple-system, sans-serif;
  color: #86868b;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.choice-btn:hover,
.option-btn:hover {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  transform: scale(0.98);
}

.choice-btn:hover::after,
.option-btn:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.option-btn.selected,
.choice-btn.selected {
  background: #fbfbfd;
  border-color: #0066cc;
  box-shadow: 0 0 0 1px #0066cc;
}

input.choice-btn {
  text-align: right;
  cursor: text;
}
input.choice-btn::after { display: none; }
input.choice-btn:focus {
  outline: none;
  border-color: #1d1d1f;
}

.feedback {
  padding: 1.2rem;
  border-radius: 16px;
  background: #fff;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  margin-top: 1rem;
}

.feedback.ok { color: #34c759; }
.feedback.fun { color: #ff9500; }

.puzzle-note {
  font-size: 1rem;
  color: #86868b;
  margin: 0;
}

/* Mini grids */
.memory-grid,
.frame-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 500px;
}

.memory-card {
  aspect-ratio: 1;
  background: #fff;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0,0,0,0.03);
}

.memory-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.memory-emoji { font-size: 2.5rem; }
.memory-label { font-weight: 600; color: #1d1d1f; }
.memory-card.concealed .memory-label { opacity: 0; transition: opacity 0.3s; }
.memory-card.concealed .memory-emoji {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s, transform 0.3s;
}

.frame-btn {
  padding: 1rem 0;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  text-align: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 1rem;
}
.frame-btn::after { display: none; }
.frame-btn.selected {
  background: #1d1d1f;
  color: #fff;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Timeline */
.timeline-box {
  text-align: right;
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255,255,255,0.4);
}
.timeline-title {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.timeline-list {
  color: #86868b;
  line-height: 2;
  font-size: 1.1rem;
  list-style: none;
  padding: 0;
}
.timeline-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.timeline-list li:last-child { border-bottom: none; }

/* Games */
.puzzle-board {
  width: min(90vw, 380px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  margin: 0 auto;
}

.tile {
  border-radius: 16px;
  background-size: 300% 300%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: transparent; 
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s;
}
.tile.selected {
  transform: scale(0.9);
  filter: brightness(1.2);
  box-shadow: 0 0 0 3px #0066cc, 0 8px 20px rgba(0,0,0,0.15);
}

.catcher-canvas {
  width: 100%;
  max-width: 500px;
  height: 340px;
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 15px 50px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.02);
}

.hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
  color: #86868b;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

/* Premium Puzzle Layout */
.puzzle-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 800px;
  align-items: center;
  margin-top: 1rem;
}

@media (min-width: 760px) {
  .puzzle-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  }
  .puzzle-sidebar {
    width: 200px;
    flex-shrink: 0;
  }
  .puzzle-main {
    flex: 1;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.puzzle-preview-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 1.2rem;
  box-shadow: 0 15px 40px rgba(0,0,0,0.04);
  border: 1px solid rgba(255,255,255,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.puzzle-mini-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.premium-shadow {
  box-shadow: 0 20px 50px rgba(0,0,0,0.06), 0 2px 5px rgba(0,0,0,0.02);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px;
  border-radius: 24px;
}
