/* ====== Elif Naz 14 — Stil ====== */
:root {
  --pink-soft: #FFD6E0;
  --pink-deep: #FF8FAB;
  --purple-light: #C8B6FF;
  --purple-deep: #9B72CF;
  --cream: #FFF8F0;
  --berry-black: #1A1A1A;
  --gold: #FFD700;
  --mint: #B8E6D9;
  --sky: #B8DCFF;
  --text: #2A1B2E;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--pink-soft);
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; }

/* ====== Buttons ====== */
.big-btn {
  background: linear-gradient(135deg, var(--pink-deep), var(--purple-deep));
  color: white;
  border: none;
  border-radius: 999px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(155, 114, 207, 0.35);
  margin: 8px 0;
  min-width: 240px;
  min-height: 56px;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.big-btn:active { transform: scale(0.96); }
.big-btn.hidden { display: none; }

.ghost-btn {
  background: rgba(255,255,255,0.6);
  color: var(--purple-deep);
  border: 2px solid var(--purple-light);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.sound-btn {
  position: absolute;
  top: max(env(safe-area-inset-top), 12px);
  right: 12px;
  background: rgba(255,255,255,0.7);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
}

/* ====== Intro ====== */
#screen-intro {
  background: linear-gradient(180deg, var(--pink-soft) 0%, var(--purple-light) 100%);
}
.intro-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.6), transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(200,182,255,0.4), transparent 50%);
  pointer-events: none;
}
.intro-content {
  position: relative;
  text-align: center;
  z-index: 1;
  padding: 24px;
  max-width: 420px;
  width: 100%;
}
.intro-title {
  font-size: clamp(24px, 7vw, 36px);
  line-height: 1.2;
  color: var(--purple-deep);
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(255,255,255,0.6);
}
.intro-sub {
  font-size: 16px;
  margin-bottom: 24px;
  color: var(--text);
  opacity: 0.85;
  font-style: italic;
}
.intro-character {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px;
}
.how-to {
  background: rgba(255,255,255,0.55);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 16px auto 20px;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.55;
  color: #2a1b2e;
  box-shadow: 0 4px 14px rgba(155,114,207,0.18);
  max-width: 340px;
}
.how-to-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--purple-deep);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: center;
}
.how-to-row { margin: 3px 0; }
.how-to-row b { color: var(--pink-deep); }

.intro-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text);
  opacity: 0.7;
}

/* ====== Transition ====== */
#screen-transition {
  background: var(--berry-black);
  color: white;
}
.transition-content {
  text-align: center;
  animation: fadeInUp 0.6s ease;
}
.transition-year {
  font-size: 72px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink-deep), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.transition-title {
  font-size: 28px;
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 1px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== Game ====== */
#screen-game {
  background: #000;
  padding: 0;
}
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hud {
  position: absolute;
  top: max(env(safe-area-inset-top), 12px);
  left: 0;
  right: 0;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  pointer-events: none;
}
.hud-left, .hud-right { display: flex; gap: 8px; align-items: center; }
.hud-score b { color: var(--gold); }

.touch-controls {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 1;
  pointer-events: none;
}
.touch-lane { flex: 1; pointer-events: none; }

.hint {
  position: absolute;
  bottom: max(env(safe-area-inset-bottom), 16px);
  left: 0;
  right: 0;
  padding: 0 12px;
  text-align: center;
  color: rgba(255,255,255,0.9);
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  animation: hintFade 7s ease forwards;
}
@keyframes hintFade { 0% { opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ====== Memory Card ====== */
#screen-memory {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.memory-blur { position: absolute; inset: 0; }
.memory-card {
  position: relative;
  background: linear-gradient(180deg, var(--cream), var(--pink-soft));
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: cardIn 0.5s ease;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.memory-emoji { font-size: 56px; margin-bottom: 8px; }

.memory-photo-frame {
  display: inline-block;
  background: #fff;
  padding: 10px 10px 28px;
  margin: -8px auto 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  transform: rotate(-2.5deg);
  border-radius: 3px;
  position: relative;
}
.memory-photo-frame::after {
  /* Small piece of tape at top */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 40px;
  height: 14px;
  background: rgba(255, 220, 100, 0.55);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.memory-photo {
  display: block;
  width: min(220px, 60vw);
  height: min(220px, 60vw);
  object-fit: cover;
  border-radius: 2px;
}

.berry-secret-photo {
  display: block;
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  object-fit: cover;
  border-radius: 18px;
  margin: 0 auto 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6),
              0 0 80px rgba(200,182,255,0.35);
  border: 3px solid rgba(255,248,240,0.15);
}
.memory-year {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--purple-deep);
  margin-bottom: 4px;
}
.memory-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.memory-text {
  font-size: 16px;
  line-height: 1.6;
  font-style: italic;
  color: var(--text);
  margin-bottom: 16px;
}
.memory-sign {
  font-size: 13px;
  color: var(--pink-deep);
  font-weight: 600;
  margin-bottom: 16px;
}

/* ====== Berry Secret ====== */
#screen-berry {
  background: var(--berry-black);
  color: white;
}
.berry-stage { text-align: center; padding: 24px; }
.berry-text {
  margin: 16px 0 24px;
  font-size: 17px;
  line-height: 1.7;
  color: #f0e6f5;
}

/* ====== Guitar Bridge (Bölge 5 sonu) ====== */
#screen-guitar {
  background: #0a0612;
  padding: 0;
  overflow: hidden;
}
#guitar-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.guitar-question {
  position: absolute;
  top: 11%;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff8f0;
  font-family: "Georgia", serif;
  font-style: italic;
  font-size: clamp(17px, 4.8vw, 22px);
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 2;
  pointer-events: none;
  padding: 0 24px;
}
.guitar-question.visible { opacity: 1; }
.guitar-question.fading { opacity: 0; }
.guitar-text-wrap {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  padding: 0 22px;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  max-height: 36vh;
  overflow: hidden;
}
.guitar-text {
  font-family: "Georgia", "Times New Roman", serif;
  white-space: pre-wrap;
  font-size: clamp(13px, 3.8vw, 16px);
  line-height: 1.7;
  color: #fff8f0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.95);
  margin: 0;
}
.guitar-actions {
  position: absolute;
  bottom: max(env(safe-area-inset-bottom), 14px);
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  z-index: 3;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.4s ease, transform 1.4s ease;
  pointer-events: none;
}
.guitar-actions.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.spotify-btn {
  display: inline-block;
  background: #1ED760;
  color: #0a0612;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 24px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(30,215,96,0.35);
  min-height: 48px;
  line-height: 1.2;
}
.spotify-btn:active { transform: scale(0.97); }
.guitar-actions .ghost-btn {
  background: rgba(255,255,255,0.08);
  color: rgba(255,248,240,0.85);
  border-color: rgba(255,248,240,0.25);
  min-height: 38px;
  padding: 6px 18px;
}
.youtube-link {
  font-size: 12px;
  color: rgba(255,248,240,0.55);
  text-decoration: underline;
  text-decoration-color: rgba(255,248,240,0.3);
  text-underline-offset: 3px;
}

/* ====== Result whisper (Future Days fısıltı) ====== */
.result-whisper {
  position: absolute;
  bottom: max(env(safe-area-inset-bottom), 8px);
  right: 12px;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(42,27,46,0.42);
  text-align: right;
  text-decoration: none;
  font-style: italic;
  z-index: 5;
  letter-spacing: 0.2px;
  max-width: 60vw;
}
.result-whisper:hover, .result-whisper:active {
  color: rgba(42,27,46,0.75);
  text-decoration: underline;
}

/* memory text now supports multi-line */
.memory-text { white-space: pre-line; }

/* ====== Cake ====== */
#screen-cake {
  background: linear-gradient(180deg, #2a1b2e, #4a2a4a);
  padding: 0;
}
#cake-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cake-prompt {
  position: absolute;
  top: 12%;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  z-index: 2;
  pointer-events: none;
  animation: pulseHint 2s ease-in-out infinite;
}
.cake-prompt small { font-size: 13px; opacity: 0.8; font-weight: 400; }
@keyframes pulseHint {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ====== Final Message ====== */
#screen-message {
  background: linear-gradient(180deg, #2a1b2e 0%, #4a2a4a 100%);
  color: #fff8f0;
  padding: 32px 24px;
  overflow-y: auto;
}
.message-wrap {
  max-width: 540px;
  width: 100%;
  text-align: center;
}
.message-text {
  font-family: "Georgia", "Times New Roman", serif;
  white-space: pre-wrap;
  font-size: clamp(15px, 4.2vw, 19px);
  line-height: 1.9;
  color: #fff8f0;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
  min-height: 60vh;
  text-align: center;
}

/* ====== Result ====== */
#screen-result {
  background: linear-gradient(180deg, var(--pink-soft) 0%, var(--purple-light) 100%);
  overflow-y: auto;
  padding: 32px 16px;
}
.result-content { text-align: center; max-width: 420px; width: 100%; }
.result-title {
  font-size: 22px;
  color: var(--purple-deep);
  margin-bottom: 12px;
  line-height: 1.4;
}
.result-score {
  font-size: 24px;
  margin-bottom: 24px;
}
.result-score b { color: var(--pink-deep); }
.result-buttons { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* ====== Gallery ====== */
#screen-gallery {
  background: linear-gradient(180deg, var(--cream), var(--pink-soft));
  overflow-y: auto;
  padding: 24px 16px;
  justify-content: flex-start;
}
.gallery-wrap { width: 100%; max-width: 480px; text-align: center; }
.gallery-wrap h2 {
  color: var(--purple-deep);
  margin-bottom: 16px;
}
.gallery-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.gallery-item {
  background: white;
  border-radius: 16px;
  padding: 16px;
  text-align: left;
  box-shadow: 0 4px 16px rgba(155,114,207,0.15);
}
.gallery-item .gi-emoji { font-size: 32px; }
.gallery-item .gi-title { font-weight: 700; color: var(--purple-deep); }
.gallery-item .gi-text { font-style: italic; font-size: 14px; margin-top: 8px; }
.gallery-item.locked { opacity: 0.4; text-align: center; padding: 24px; }

/* ====== Share ====== */
#screen-share {
  background: linear-gradient(180deg, var(--cream), var(--purple-light));
  overflow-y: auto;
  padding: 24px 16px;
  justify-content: flex-start;
}
.share-wrap { width: 100%; max-width: 480px; text-align: center; }
.share-wrap h2 { color: var(--purple-deep); margin-bottom: 12px; }
#share-canvas {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 16px;
}
.share-hint { font-size: 13px; opacity: 0.8; margin-bottom: 12px; }
.share-buttons { display: flex; flex-direction: column; gap: 4px; }
