/* Joao's Birthday Portal v2 - Quest Edition */

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

:root {
  --purple: #7c3aed;
  --cyan: #00d4ff;
  --green: #00ff9d;
  --brasil-green: #009c3b;
  --brasil-yellow: #ffdf00;
  --brasil-blue: #002776;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --border: #30363d;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }

/* ---- HERO ---- */
.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(124,58,237,0.15) 0%, transparent 60%), radial-gradient(ellipse at 50% 70%, rgba(0,212,255,0.08) 0%, transparent 50%); pointer-events: none; }
.sigil-container { width: 120px; height: 120px; margin-bottom: 2rem; animation: sigil-pulse 3s ease-in-out infinite, sigil-enter 1.5s ease-out; }
@keyframes sigil-pulse { 0%, 100% { filter: drop-shadow(0 0 20px rgba(124,58,237,0.5)); transform: scale(1); } 50% { filter: drop-shadow(0 0 40px rgba(0,212,255,0.6)); transform: scale(1.05); } }
@keyframes sigil-enter { 0% { opacity: 0; transform: scale(0.3) rotate(-180deg); } 100% { opacity: 1; transform: scale(1) rotate(0deg); } }
.sigil-svg { width: 100%; height: 100%; }
.hero h1 { font-family: var(--font-mono); font-size: clamp(2rem, 6vw, 4rem); font-weight: 700; background: linear-gradient(135deg, var(--purple), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 0.5rem; animation: fade-up 1s ease-out 0.5s both; }
.hero .subtitle { font-size: clamp(1rem, 2.5vw, 1.3rem); color: var(--text-secondary); font-weight: 400; animation: fade-up 1s ease-out 0.8s both; }
.hero .date-badge { display: inline-block; margin-top: 1.5rem; padding: 0.5rem 1.5rem; border: 1px solid var(--border); border-radius: 9999px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--cyan); animation: fade-up 1s ease-out 1.1s both; }
.origin-badge { display: inline-block; margin-top: 0.75rem; padding: 0.4rem 1rem; border: 1px solid rgba(0,156,59,0.3); border-radius: 9999px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--brasil-yellow); background: rgba(0,156,59,0.08); animation: fade-up 1s ease-out 1.3s both; }
.scroll-indicator { position: absolute; bottom: 2rem; animation: bounce 2s infinite, fade-up 1s ease-out 1.5s both; color: var(--text-secondary); font-size: 0.8rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.scroll-indicator svg { width: 20px; height: 20px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---- SECTIONS ---- */
section { padding: 5rem 1.5rem; max-width: 800px; margin: 0 auto; }
.section-title { font-family: var(--font-mono); font-size: 0.85rem; color: var(--purple); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1rem; }

/* ---- WAKE UP SECTION ---- */
.wake-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; text-align: center; }
.wake-emoji { font-size: 3rem; margin-bottom: 1rem; }
.wake-title { font-family: var(--font-mono); font-size: 1.5rem; background: linear-gradient(135deg, var(--brasil-yellow), var(--brasil-green)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 0.5rem; }
.wake-text { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; }
.selfie-zone { width: 200px; height: 200px; margin: 0 auto; border: 2px dashed var(--purple); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; transition: border-color 0.3s, box-shadow 0.3s; position: relative; }
.selfie-zone:hover { border-color: var(--cyan); box-shadow: 0 0 30px rgba(124,58,237,0.3); }
.selfie-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1rem; }
.selfie-placeholder span { font-size: 0.8rem; color: var(--text-secondary); text-align: center; }
.selfie-timestamp { position: absolute; bottom: -2rem; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.7rem; color: var(--green); white-space: nowrap; }

/* ---- SONG SECTION ---- */
.song-section { text-align: center; position: relative; }
.waveform { display: flex; align-items: center; justify-content: center; gap: 3px; height: 40px; margin-bottom: 1.5rem; }
.waveform span { width: 3px; background: linear-gradient(to top, var(--purple), var(--cyan)); border-radius: 3px; animation: wave 1.2s ease-in-out infinite; }
.waveform span:nth-child(1) { height: 15px; animation-delay: 0s; }
.waveform span:nth-child(2) { height: 25px; animation-delay: 0.1s; }
.waveform span:nth-child(3) { height: 35px; animation-delay: 0.2s; }
.waveform span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.waveform span:nth-child(5) { height: 30px; animation-delay: 0.4s; }
.waveform span:nth-child(6) { height: 15px; animation-delay: 0.5s; }
.waveform span:nth-child(7) { height: 25px; animation-delay: 0.6s; }
.waveform span:nth-child(8) { height: 35px; animation-delay: 0.7s; }
.waveform span:nth-child(9) { height: 20px; animation-delay: 0.8s; }
.waveform span:nth-child(10) { height: 28px; animation-delay: 0.9s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1.2); } }
.spotify-embed { border-radius: 12px; margin: 1.5rem auto; max-width: 400px; }
.song-dedication { color: var(--text-secondary); font-style: italic; margin-top: 1rem; font-size: 0.95rem; }

/* ---- BRAZILIAN TRADITIONS ---- */
.tradition-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
.tradition-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; transition: transform 0.3s, border-color 0.3s; }
.tradition-card:hover { transform: translateY(-4px); border-color: var(--brasil-green); }
.tradition-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.tradition-card h3 { font-family: var(--font-mono); font-size: 0.95rem; color: var(--brasil-yellow); margin-bottom: 0.5rem; }
.tradition-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 1rem; }
.tradition-btn { background: transparent; border: 1px solid var(--brasil-green); color: var(--brasil-green); padding: 0.4rem 1rem; border-radius: 9999px; font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; transition: all 0.3s; width: 100%; }
.tradition-btn:hover:not(:disabled) { background: rgba(0,156,59,0.15); }
.tradition-btn.completed { background: rgba(0,156,59,0.2); border-color: var(--green); color: var(--green); }
.tradition-progress { text-align: center; margin-top: 1rem; }
.progress-label { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.progress-bar { height: 6px; background: var(--bg-card); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brasil-green), var(--brasil-yellow)); border-radius: 3px; transition: width 0.5s ease; }

/* ---- TERMINAL ---- */
.terminal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 2rem 0; }
.terminal-header { display: flex; align-items: center; gap: 6px; padding: 0.75rem 1rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }
.terminal-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); margin-left: 8px; }
.terminal-body { padding: 1.25rem; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.8; overflow-x: auto; }
.terminal-body .prompt { color: var(--green); }
.terminal-body .cmd { color: var(--text-primary); }
.terminal-body .output { color: var(--text-secondary); }
.terminal-body .highlight { color: var(--cyan); }
.terminal-body .success { color: var(--green); }
.terminal-body .purple { color: var(--purple); }

/* ---- STATS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.stat-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem 1rem; text-align: center; transition: border-color 0.3s, transform 0.3s; }
.stat-card:hover { border-color: var(--purple); transform: translateY(-4px); }
.stat-number { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--cyan); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ---- JOURNEY ---- */
.journey { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin: 2rem 0; flex-wrap: wrap; }
.journey-stop { padding: 0.4rem 1rem; border-radius: 9999px; font-family: var(--font-mono); font-size: 0.8rem; border: 1px solid var(--border); color: var(--text-secondary); transition: all 0.3s; }
.journey-stop.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0,212,255,0.1); }
.journey-arrow { color: var(--text-secondary); font-size: 0.7rem; }

/* ---- QUEST SYSTEM ---- */
.quest-timeline { position: relative; padding-left: 2rem; }
.quest-timeline::before { content: ''; position: absolute; left: 0.6rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--purple), var(--cyan), var(--brasil-green), var(--brasil-yellow)); }
.quest-block { position: relative; margin-bottom: 2rem; }
.quest-block::before { content: ''; position: absolute; left: -1.65rem; top: 1rem; width: 12px; height: 12px; border-radius: 50%; background: var(--purple); border: 2px solid var(--bg-primary); z-index: 1; }
.quest-time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.quest-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; transition: border-color 0.3s; }
.quest-card:hover { border-color: var(--purple); }
.quest-card.brasil-glow { border-color: rgba(0,156,59,0.4); box-shadow: 0 0 30px rgba(0,156,59,0.1); }
.quest-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.quest-badge { font-family: var(--font-mono); font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 4px; background: rgba(124,58,237,0.2); color: var(--purple); border: 1px solid rgba(124,58,237,0.3); }
.quest-badge.brasil-badge { background: rgba(0,156,59,0.2); color: var(--brasil-green); border-color: rgba(0,156,59,0.3); }
.quest-xp { font-family: var(--font-mono); font-size: 0.75rem; color: var(--brasil-yellow); }
.quest-card h3 { font-family: var(--font-mono); font-size: 1.05rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.quest-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.5; }
.quest-tasks { list-style: none; margin-bottom: 1rem; }
.quest-tasks li { padding: 0.3rem 0; font-size: 0.85rem; color: var(--text-secondary); }
.quest-tasks label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.quest-tasks input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }
.quest-tasks input[type="checkbox"]:checked + span, .quest-tasks input:checked ~ * { }
.quest-tasks li:has(input:checked) { color: var(--green); text-decoration: line-through; opacity: 0.7; }

/* ---- MINI LOG SLOTS ---- */
.quest-log-slots { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.mini-log { width: 80px; height: 80px; border: 1px dashed var(--border); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; cursor: pointer; transition: all 0.3s; overflow: hidden; position: relative; }
.mini-log:hover { border-color: var(--purple); background: rgba(124,58,237,0.05); }
.mini-log.captured { border-style: solid; border-color: var(--green); }
.mini-log-icon { font-size: 1.2rem; }
.mini-log span { font-size: 0.55rem; color: var(--text-secondary); text-align: center; line-height: 1.2; padding: 0 0.2rem; }
.mini-log-done { position: absolute; bottom: 2px; right: 4px; font-size: 0.5rem !important; color: var(--green) !important; font-family: var(--font-mono); background: rgba(13,17,23,0.8); padding: 1px 3px; border-radius: 3px; }

/* ---- XP BOARD ---- */
.xp-board { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; margin-top: 2rem; }
.xp-label { font-family: var(--font-mono); font-size: 1.1rem; color: var(--cyan); margin-bottom: 0.75rem; }
.xp-fill { background: linear-gradient(90deg, var(--purple), var(--cyan), var(--green)) !important; }
.xp-rank { font-family: var(--font-mono); font-size: 0.8rem; color: var(--brasil-yellow); margin-top: 0.75rem; }

/* ---- MESSAGE WALL ---- */
.message-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; margin: 1.5rem 0; }
.message-card .from { font-family: var(--font-mono); font-size: 0.75rem; color: var(--purple); margin-bottom: 0.75rem; }
.message-card p { color: var(--text-secondary); line-height: 1.8; }

/* ---- FOOTER ---- */
.portal-footer { text-align: center; padding: 3rem 1.5rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.portal-footer p { color: var(--text-secondary); font-size: 0.85rem; }
.portal-footer a { color: var(--purple); text-decoration: none; }
.portal-footer a:hover { text-decoration: underline; }

/* ---- SCROLL REVEAL ---- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ---- BRASIL TOUCHES ---- */
.brasil-flag { display: inline-flex; gap: 3px; margin-left: 0.5rem; vertical-align: middle; }
.brasil-flag span { width: 8px; height: 8px; border-radius: 50%; }
.brasil-flag .bg { background: var(--brasil-green); }
.brasil-flag .by { background: var(--brasil-yellow); }
.brasil-flag .bb { background: var(--brasil-blue); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  section { padding: 3rem 1rem; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .stat-card { padding: 1rem 0.5rem; }
  .stat-number { font-size: 1.4rem; }
  .tradition-grid { grid-template-columns: 1fr; }
  .journey { gap: 0.3rem; }
  .journey-stop { padding: 0.3rem 0.6rem; font-size: 0.7rem; }
  .terminal-body { font-size: 0.7rem; }
  .quest-timeline { padding-left: 1.5rem; }
  .mini-log { width: 65px; height: 65px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .selfie-zone { width: 160px; height: 160px; }
}
