/* mujun.quest — Memphis Bold Paradox Quest */

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

:root {
    --pink: #FF69B4;
    --orange: #FF6B35;
    --gold: #FFD700;
    --green: #00C853;
    --blue: #4169E1;
    --cream: #f0ece4;
    --light: #f0f0f0;
    --dark: #1a1a1a;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--cream);
    color: var(--dark);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Geometric Shapes */
.shapes-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    width: var(--size);
    height: var(--size);
    top: var(--top);
    left: var(--left);
    transform: rotate(var(--rotation));
    opacity: 0.2;
    transition: opacity 0.3s;
}

.shape.circle {
    background: var(--color);
    border-radius: 50%;
}

.shape.triangle {
    background: transparent;
    width: 0;
    height: 0;
    border-left: calc(var(--size) / 2) solid transparent;
    border-right: calc(var(--size) / 2) solid transparent;
    border-bottom: var(--size) solid var(--color);
    opacity: 0.25;
}

.shape.square {
    background: var(--color);
}

.shape.zigzag {
    background: transparent;
    border-top: 4px solid var(--color);
    border-radius: 0;
    height: 4px;
    opacity: 0.3;
    background-image: repeating-linear-gradient(
        90deg,
        var(--color) 0px,
        var(--color) 20px,
        transparent 20px,
        transparent 40px
    );
    background-size: 40px 4px;
}

/* Game HUD */
#game-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 4px solid var(--pink);
}

.hud-score, .hud-inventory {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.hud-value {
    font-family: 'Bungee', cursive;
    font-size: 1.5rem;
    color: var(--light);
}

.inventory-slots {
    display: flex;
    gap: 6px;
}

.inv-slot {
    width: 28px;
    height: 28px;
    border: 2px solid var(--gold);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgba(255, 215, 0, 0.1);
    transition: background 0.3s, border-color 0.3s;
}

.inv-slot.empty {
    opacity: 0.4;
}

.inv-slot.filled {
    opacity: 1;
    background: rgba(255, 215, 0, 0.2);
    animation: slot-pop 0.4s ease-out;
}

@keyframes slot-pop {
    0% { transform: scale(0.5); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Quest Sections */
.quest-section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}

/* Section 1: Starting Village */
#starting-village {
    min-height: 100vh;
}

.title-container {
    text-align: center;
}

.main-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 1.1;
    margin-bottom: 16px;
    animation: title-wobble 3s ease-in-out infinite;
}

@keyframes title-wobble {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

.subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.subtitle-jp {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--blue);
    margin-bottom: 40px;
}

.start-prompt {
    margin-top: 32px;
}

.quest-btn {
    font-family: 'Bungee', cursive;
    font-size: clamp(1rem, 2vw, 1.3rem);
    padding: 16px 40px;
    background: var(--dark);
    color: var(--gold);
    border: 4px solid var(--gold);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
}

.quest-btn:hover {
    transform: translateY(-4px) rotate(1deg);
    box-shadow: 8px 8px 0 var(--pink);
    background: var(--blue);
}

.quest-btn:active {
    transform: translateY(0) rotate(0deg);
    box-shadow: 2px 2px 0 var(--pink);
}

/* Section Titles */
.section-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
    margin-bottom: 12px;
    color: var(--dark);
}

.section-desc {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    text-align: center;
    max-width: 600px;
    color: var(--dark);
    opacity: 0.8;
    margin-bottom: 40px;
    font-weight: 600;
}

/* Quest Cards */
.quest-cards {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1000px;
}

.quest-card {
    width: 280px;
    background: var(--light);
    border: 4px solid var(--card-color, var(--dark));
    padding: 28px 24px;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: default;
}

.quest-card:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 10px 10px 0 var(--card-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    line-height: 1;
}

.card-title {
    font-family: 'Bungee', cursive;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.card-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--dark);
    opacity: 0.8;
    margin-bottom: 16px;
    font-weight: 600;
}

.card-btn {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 8px 20px;
    background: var(--dark);
    color: var(--gold);
    border: 3px solid var(--dark);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: transform 0.2s, background 0.2s, color 0.2s;
}

.card-btn:hover {
    background: var(--gold);
    color: var(--dark);
    transform: translateY(-2px);
}

.card-btn.collected {
    background: var(--green);
    color: var(--dark);
    border-color: var(--green);
    cursor: default;
}

/* Final Gate */
.final-choice {
    text-align: center;
}

.gate-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 24px;
}

.gate-btn {
    font-family: 'Bungee', cursive;
    font-size: 0.9rem;
    padding: 14px 28px;
    background: transparent;
    color: var(--dark);
    border: 4px solid var(--gate-color, var(--dark));
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s, color 0.2s;
}

.gate-btn:hover {
    background: var(--gate-color);
    color: var(--light);
    transform: translateY(-4px);
    box-shadow: 6px 6px 0 var(--dark);
}

.gate-message {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    min-height: 2em;
    transition: opacity 0.4s;
}

/* Credits */
#credits {
    background: var(--dark);
    color: var(--light);
    min-height: 60vh;
}

.credits-content {
    text-align: center;
}

.credits-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--gold);
    margin-bottom: 24px;
}

.credits-line {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--light);
    margin-bottom: 8px;
    opacity: 0.8;
}

.credits-attribution {
    margin-top: 40px;
}

.credits-attribution p {
    font-family: 'Bungee', cursive;
    font-size: 1.2rem;
    color: var(--pink);
    margin-bottom: 4px;
}

.credits-jp {
    font-size: 2rem;
    color: var(--gold);
}

/* Scroll reveal */
.quest-card, .section-title, .section-desc {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s, transform 0.6s;
}

.quest-card.visible, .section-title.visible, .section-desc.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Keep original card rotation on visible */
.quest-card.visible {
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .quest-cards {
        flex-direction: column;
        align-items: center;
    }

    .quest-card {
        width: 90%;
        max-width: 320px;
        transform: none;
    }

    .gate-options {
        flex-direction: column;
        align-items: center;
    }

    #game-hud {
        flex-direction: column;
        gap: 8px;
        padding: 8px 16px;
    }
}
