/* undo.quest — Holographic 3D Product / Time-Manipulation Puzzle Game */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* === Base === */
body {
    background: #0C0C1D;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* === Section Headings === */
.section-heading {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* === Holographic Border === */
.holo-border {
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #E0C3FC, #8EC5FC, #A0FFE6) 1;
}

/* === HERO ZONE === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: radial-gradient(ellipse at center, rgba(142,197,252,0.06) 0%, transparent 60%);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(224,195,252,0.04) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner {
    position: relative;
    z-index: 1;
}

/* Prism */
.prism {
    margin-bottom: 1.5rem;
    animation: prismFloat 6s ease-in-out infinite;
}
.prism svg {
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 20px rgba(142,197,252,0.35));
    animation: prismRotate 12s linear infinite;
}
@keyframes prismFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes prismRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spectrum-ray {
    opacity: 0.5;
    animation: rayPulse 3s ease-in-out infinite;
}
.ray-1 { animation-delay: 0s; }
.ray-2 { animation-delay: 1s; }
.ray-3 { animation-delay: 2s; }
@keyframes rayPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}
.prism-flare {
    animation: flarePulse 2s ease-in-out infinite;
}
@keyframes flarePulse {
    0%, 100% { opacity: 0.1; r: 3; }
    50% { opacity: 0.4; r: 5; }
}

/* Countdown */
.countdown {
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    font-size: 1.1rem;
    color: #8888AA;
    margin-bottom: 0.5rem;
    letter-spacing: 0.08em;
}
.cd-num { color: #E0C3FC; }
.cd-sep { color: #8888AA; }

/* Hero Title */
.hero-title {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 4.5rem;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #E0C3FC, #8EC5FC, #A0FFE6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holoShift 4s ease infinite;
    letter-spacing: 0.08em;
}
.hero-title.reversed {
    transform: scaleX(-1);
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.hero-title.corrected {
    transform: scaleX(1);
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes holoShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hero Subtitle */
.hero-sub {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #8888AA;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* Rewind Button */
.rewind-btn {
    display: inline-block;
    background: linear-gradient(135deg, #E0C3FC, #8EC5FC, #A0FFE6);
    color: #0C0C1D;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.7rem 2.2rem;
    text-decoration: none;
    background-size: 200% 200%;
    animation: holoShift 4s ease infinite, btnPulse 2s ease-in-out infinite;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rewind-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(142,197,252,0.3);
}
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(160,255,230,0.3); }
    50% { box-shadow: 0 0 15px 3px rgba(160,255,230,0.15); }
}

/* === PUZZLE LEVELS === */
.levels {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.level-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.level-card {
    background: #1A1A3E;
    padding: 1.5rem;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateY(0deg) rotateX(0deg);
    transition: transform 0.15s ease, box-shadow 0.3s ease;
    will-change: transform;
}
.level-card:hover {
    box-shadow: 0 8px 30px rgba(142,197,252,0.12);
}
.level-cat {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
    padding: 3px 10px;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.level-cat.rewind { color: #E0C3FC; background: rgba(224,195,252,0.1); }
.level-cat.reverse { color: #8EC5FC; background: rgba(142,197,252,0.1); }
.level-cat.paradox { color: #FF6EC7; background: rgba(255,110,199,0.1); }
.level-name {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #FFFFFF;
    margin-bottom: 0.35rem;
}
.level-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #8888AA;
    margin-bottom: 0.85rem;
    line-height: 1.5;
}
.progress-rev {
    height: 6px;
    background: #0C0C1D;
    direction: rtl;
    margin-bottom: 0.35rem;
}
.progress-fill-rev {
    height: 100%;
    background: linear-gradient(90deg, #A0FFE6, #8EC5FC, #E0C3FC);
    transition: width 0.6s ease;
}
.progress-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #8888AA;
}

/* === REWIND SCRUBBER DEMO === */
.scrubber-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 2rem 3rem;
}
.scrubber-panel {
    background: #1A1A3E;
    padding: 2rem;
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #E0C3FC, #8EC5FC, #A0FFE6) 1;
}
.scrubber-stage {
    height: 120px;
    position: relative;
    margin-bottom: 1.5rem;
    background: rgba(12,12,29,0.6);
    overflow: hidden;
}
.scrubber-object {
    position: absolute;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #E0C3FC, #8EC5FC, #A0FFE6);
    top: 50%;
    transform: translateY(-50%);
    left: 90%;
    transition: left 0.15s ease;
}
.scrubber-trail {
    position: absolute;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8EC5FC);
    transform: translateY(-50%);
    left: 0;
    width: 90%;
    opacity: 0.4;
    transition: width 0.15s ease, opacity 0.15s ease;
}
.scrubber-track {
    margin-bottom: 0.75rem;
}
.scrubber-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #E0C3FC, #8EC5FC, #A0FFE6);
    outline: none;
    opacity: 0.8;
    direction: rtl;
}
.scrubber-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #FFFFFF;
    cursor: grab;
    border: 2px solid #8EC5FC;
}
.scrubber-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #FFFFFF;
    cursor: grab;
    border: 2px solid #8EC5FC;
}
.scrubber-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}
.scrub-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #8888AA;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.scrubber-hint {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #8888AA;
    text-align: center;
    font-style: italic;
}

/* === ACHIEVEMENTS === */
.achievements {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 2rem 3rem;
}
.trophy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.trophy {
    background: #1A1A3E;
    padding: 1.25rem 1rem;
    text-align: center;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateY(0deg) rotateX(0deg);
    transition: transform 0.15s ease, box-shadow 0.3s ease;
    will-change: transform;
}
.trophy:hover {
    box-shadow: 0 6px 20px rgba(160,255,230,0.1);
}
.trophy.locked {
    opacity: 0.3;
}
.trophy-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.35rem;
    color: #A0FFE6;
}
.trophy-name {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: #FFFFFF;
    display: block;
    margin-bottom: 0.2rem;
}
.trophy-status {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: #8888AA;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.trophy-status.unlocked {
    color: #A0FFE6;
}

/* === LEADERBOARD === */
.leaderboard {
    max-width: 550px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}
.leaderboard-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #8888AA;
    text-align: center;
    margin-bottom: 1rem;
}
.leader-panel {
    background: #1A1A3E;
    padding: 1.25rem;
}
.leader-row {
    display: flex;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.leader-row:last-child {
    border-bottom: none;
}
.leader-rank {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #E0C3FC;
    width: 2.5rem;
    flex-shrink: 0;
}
.leader-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #FFFFFF;
    flex: 1;
}
.leader-time {
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    color: #A0FFE6;
    letter-spacing: 0.03em;
}

/* === FOOTER === */
.footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, rgba(26,26,62,0.3) 100%);
}
.footer-inner {}
.rev-clock {
    font-size: 2.5rem;
    color: #E0C3FC;
    animation: spinRev 4s linear infinite reverse;
    display: inline-block;
    margin-bottom: 0.5rem;
}
@keyframes spinRev {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.footer-text {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #8888AA;
    margin-bottom: 0.85rem;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}
.flink {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #8888AA;
    text-decoration: none;
    transition: color 0.2s ease;
}
.flink:hover {
    color: #A0FFE6;
}
.footer-copy {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #8888AA;
}

/* === FADE-IN ANIMATION === */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero-title { font-size: 3rem; }
    .level-cards { grid-template-columns: 1fr; }
    .trophy-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 2.4rem; }
    .trophy-grid { grid-template-columns: 1fr; }
    .countdown { font-size: 0.9rem; }
}
