:root {
    --bg-deep: #0c0b0e;
    --gold: #bba27a;
    --gold-light: #dac59b;
    --text-primary: #f5f2ea;
    --text-muted: #c9c1ac;
    --card-bg: rgba(18, 16, 22, 0.7);
    --card-border: rgba(220, 200, 160, 0.25);
    --button-bg: linear-gradient(135deg, #b4966a 0%, #dfc28a 100%);
    --button-hover: linear-gradient(135deg, #cfaf7a 0%, #edd39c 100%);
    --shadow-lg: 0 25px 60px rgba(0,0,0,0.6);
    --transition: 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

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

body {
    background: var(--bg-deep);
    font-family: 'Inter', system-ui, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    cursor: default;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ─── OVERLAY ─── */
#overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: opacity var(--transition), visibility var(--transition);
    opacity: 1;
    visibility: visible;
}

#overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#overlay-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 40px 32px 36px;
    max-width: 500px;
    width: 92%;
    text-align: center;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
    animation: fadeInUp 0.9s ease forwards;
}

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

.icon-memory {
    font-size: 48px;
    color: var(--gold-light);
    filter: drop-shadow(0 4px 10px rgba(200,160,100,0.5));
    display: block;
    margin-bottom: 8px;
}

#overlay-card h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: #ede7d5;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.description {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

/* ─── UPLOAD BUTTON ─── */
.upload-wrapper {
    display: inline-block;
    margin-bottom: 16px;
}

.upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold-light);
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.4s ease;
    text-transform: uppercase;
    overflow: hidden;
    min-height: 52px;
}

.upload-label:hover,
.upload-label:active {
    background: rgba(220, 190, 130, 0.12);
    border-color: var(--gold-light);
    box-shadow: 0 0 40px rgba(190,150,90,0.3);
}

/* Input transparan menutupi tombol */
.upload-label input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

#photo-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-height: 20px;
    margin-top: 4px;
    transition: 0.3s;
}

#photo-count.has-photos {
    color: var(--gold-light);
    font-weight: 500;
}

/* ─── START BUTTON ─── */
#start-btn {
    display: none;
    cursor: pointer;
    background: var(--button-bg);
    border: none;
    color: #1c1a14;
    padding: 16px 40px;
    border-radius: 50px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: 0 12px 35px rgba(150, 110, 60, 0.45);
    transition: all 0.4s ease;
    min-height: 52px;
    width: auto;
}

#start-btn.visible {
    display: inline-block;
    animation: fadeUp 0.6s ease forwards;
}

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

#start-btn:hover,
#start-btn:active {
    background: var(--button-hover);
    box-shadow: 0 18px 45px rgba(180,130,70,0.55);
    transform: translateY(-2px);
}

/* ─── CONTROLS HINT ─── */
#controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    font-size: 0.65rem;
    color: rgba(240,230,210,0.5);
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 1.5s;
    text-align: center;
    pointer-events: none;
}

#controls-hint.visible {
    opacity: 1;
}

#controls-hint span {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 2px 6px;
    margin: 0 2px;
    font-weight: 500;
    color: rgba(235,225,200,0.85);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
    #overlay-card {
        padding: 28px 18px 24px;
        border-radius: 22px;
    }
    #overlay-card h1 {
        font-size: 1.7rem;
    }
    .subtitle {
        font-size: 0.8rem;
    }
    .description {
        font-size: 0.72rem;
    }
    .upload-label {
        padding: 14px 24px;
        font-size: 0.8rem;
        min-height: 46px;
    }
    #start-btn {
        padding: 14px 30px;
        font-size: 1rem;
        min-height: 46px;
    }
    #controls-hint {
        bottom: 12px;
        font-size: 0.55rem;
    }
}