:root {
    --bg: #FDFBF7;
    --primary: #2E3B32;
}

body {
    background-color: var(--bg);
    color: var(--primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.noise-bg-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0.04;
    z-index: 1;
    pointer-events: none;
}

#viewport { position: relative; }

#camera {
    position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center;
    transform-origin: center center; will-change: transform;
}

#cup-group { 
    position: relative; 
    width: 75vmin; 
    max-width: 450px;
    z-index: 10; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.editorial-container { max-width: 680px; margin: 0 auto; position: relative; }
.editorial-text p {
    font-family: 'Newsreader', serif; font-size: 1.25rem; line-height: 1.8;
    margin-bottom: 1.75rem; color: var(--primary); font-weight: 300;
}

.subhead {
    font-family: 'Anton', sans-serif; font-weight: 400; font-size: 2.2rem;
    text-transform: uppercase; letter-spacing: 0.04em; color: #2f3b34;
    margin-top: 4rem; margin-bottom: 1.5rem; line-height: 1.2;
}

.sapo-wrapper { padding: 0 1.5rem; margin: 2rem auto 4rem auto; position: relative; z-index: 10; }
.sapo-box {
    background: #f5f1e8; padding: 3rem 2.5rem; border-radius: 12px;
    border: 1px solid #e0d8cc; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02), 0 10px 30px rgba(46,59,50,0.05);
    max-width: 800px; margin: 0 auto; text-align: justify;
}
.sapo-box p {
    font-family: 'Newsreader', serif; font-style: italic; font-size: 1.4rem; line-height: 1.8;
    color: #2f3b34; margin-bottom: 0 !important;
}

.intro-copy { max-width: 820px; }
.intro-copy p {
    font-family: 'Newsreader', serif;
    font-size: clamp(1.8rem, 3.4vw, 3.6rem);
    line-height: 1.25;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--primary);
}
.intro-copy strong { color: #355e3b; font-weight: 700; }
.title-stack {
    font-family: 'Anton', sans-serif;
    font-size: clamp(3.2rem, 7vw, 7rem);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.96;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(0.75rem, 1.5vw, 1.45rem);
    margin: 0;
}
.title-line {
    display: block;
    white-space: nowrap;
    padding-block: 0.04em;
}
@media (max-width: 767px) {
    .intro-copy p { font-size: clamp(1.65rem, 7vw, 2.35rem); line-height: 1.3; }
    .title-stack {
        font-size: clamp(2.7rem, 13vw, 4.4rem);
        gap: clamp(0.55rem, 2vw, 0.9rem);
        line-height: 0.98;
    }
    .title-line { white-space: normal; padding-block: 0.03em; }
}

.photo-grid-wrapper {
    width: min(960px, calc(100% - 2rem));
    max-width: calc(100vw - 2rem);
    margin: 4rem auto;
    padding: 1.5rem;
    box-sizing: border-box;
    background: #fdfbf7;
    border: 1px solid #e0d8cc;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(46,59,50,0.05);
    position: relative;
    left: auto;
    transform: none;
    z-index: 10;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.ending-title {
    font-family: 'Newsreader', serif;
    font-size: clamp(2.85rem, 5.4vw, 4.8rem);
    font-style: italic;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.55rem, 1vw, 0.9rem);
    text-align: center;
}
.ending-line {
    display: block;
    line-height: 1.12;
    padding-block: 0.02em;
    white-space: nowrap;
    text-shadow: 0 8px 20px rgba(0,0,0,0.04);
}
.ending-line-top { color: #111111; }
.ending-line-bottom { color: #355e3b; }
@media (max-width: 768px) {
    .photo-grid { gap: 0.5rem; }
    .photo-grid-wrapper { width: calc(100% - 1.25rem); padding: 1rem; }
    .ending-title {
        font-size: clamp(2.1rem, 8.3vw, 3.2rem);
        gap: 0.45rem;
        letter-spacing: -0.015em;
    }
    .ending-line {
        line-height: 1.14;
        padding-block: 0.02em;
        white-space: normal;
    }
}

#tracker-container {
    position: absolute; left: -12px; top: 0; width: 24px; height: 24px;
    z-index: 30; display: flex; align-items: center; justify-content: center;
}

.shape-cup {
    width: 18px; height: 14px; background: linear-gradient(to bottom, #ffffff 0%, #e0d8cc 100%);
    border-radius: 2px 2px 8px 8px; position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15); border: 1px solid #d8d0c5;
    display: flex; justify-content: center;
}
.shape-cup::before { 
    content: ''; position: absolute; top: 0; left: 1px; right: 1px; height: 3px;
    background-color: #3B2417; border-radius: 50%;
}
.shape-cup::after { 
    content: ''; position: absolute; top: 2px; right: -5px; width: 5px; height: 7px;
    border: 2px solid #e0d8cc; border-left: none; border-radius: 0 4px 4px 0;
}

.shape-coin {
    width: 26px; height: 26px; background: linear-gradient(135deg, #FFD700 0%, #FDB931 50%, #B8860B 100%);
    border-radius: 50%; border: 2px solid #DAA520;
    box-shadow: inset 0 0 4px rgba(255,255,255,0.8), 0 4px 8px rgba(0,0,0,0.25);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; justify-content: center;
}
.shape-coin::before { display: none; }
.shape-coin::after {
    content: '₫'; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700;
    color: #8B6508; position: static; border: none; width: auto; height: auto;
}

.lottery-path { stroke-dasharray: 1000; stroke-dashoffset: 1000; }

#city-viewport {
    width: 100%; height: 100vh; position: relative; overflow: hidden;
    background-color: var(--bg);
}
#city-world {
    position: absolute; bottom: 0; left: 0; width: 5000px; height: 1200px;
    transform-origin: left bottom; will-change: transform;
}
#ground {
    position: absolute; bottom: 100px; left: 0; width: 100%; height: 1px;
    background-color: #7EBB8C; transform: scaleX(0); transform-origin: center; z-index: 10;
}
.value-text { font-family: 'Anton', sans-serif; color: #0F5132; letter-spacing: 0.05em; }
.name-text { font-family: 'Inter', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); }
.building-wrapper { position: absolute; bottom: 101px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.building-structure {
    position: relative; width: 100%; border-left: 1px solid #7EBB8C; border-right: 1px solid #7EBB8C; border-top: 1px solid #7EBB8C;
    overflow: hidden; transform-origin: bottom; transform: scaleY(0); background-color: rgba(253, 251, 247, 0.9);
}
.building-pattern {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; opacity: 0.4;
    background-image: linear-gradient(to right, transparent 48%, #7EBB8C 48%, #7EBB8C 52%, transparent 52%), linear-gradient(to bottom, transparent 90%, #7EBB8C 90%);
    background-size: 20px 10px;
}
.accent-beam { position: absolute; width: 100%; height: 2px; background-color: #2E8B57; opacity: 0.6; }
.building-info { position: absolute; bottom: -80px; text-align: center; width: 200px; opacity: 0; transform: translateY(10px); }
.unit { font-size: 0.75rem; color: var(--primary); opacity: 0.7; font-weight: 300; }

.city-layer { position: absolute; bottom: 101px; left: 0; width: 100%; height: 100%; pointer-events: none; }
.city-layer svg { position: absolute; bottom: 0; left: 0; width: 100%; overflow: visible; }
.path-draw { fill: none; stroke: #7EBB8C; stroke-width: 1; stroke-dasharray: 6000; stroke-dashoffset: 6000; }

@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes continuous-right { from { transform: translateX(-500px); } to { transform: translateX(5500px); } }
@keyframes continuous-left { from { transform: translateX(5500px); } to { transform: translateX(-500px); } }
@keyframes rustle { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(3deg); } }
.anim-continuous-right { animation: continuous-right linear infinite; }
.anim-continuous-left { animation: continuous-left linear infinite; }
.anim-spin { animation: rotate linear infinite; transform-origin: center; }
.anim-rustle { animation: rustle 4s ease-in-out infinite; transform-origin: bottom center; }

#overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background-color: var(--bg); z-index: 100; transition: opacity 0.5s ease;
}
@keyframes pulse-soft { 0% { box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.6); } 70% { box-shadow: 0 0 0 25px rgba(218, 165, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(218, 165, 32, 0); } }
#start-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.95rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 1.2rem 1.5rem;
}
#start-btn-container:hover { transform: scale(1.05); }
.gold-coin-large {
    border-radius: 50%; background: radial-gradient(circle, #FFDF00 0%, #D4AF37 80%, #996515 100%);
    width: clamp(112px, 11vw, 142px); height: clamp(112px, 11vw, 142px); display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 14px rgba(255,255,255,0.5), 0 8px 18px rgba(0,0,0,0.18);
    animation: pulse-soft 2.5s infinite; border: 5px solid #DAA520;
}
.gold-coin-large::before {
    content: "₫";
    font-family: 'Anton', sans-serif;
    font-size: clamp(3.1rem, 4vw, 4.2rem);
    color: #8B6508;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
}
.start-text {
    margin-top: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 1.7vw, 1.4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#final-title-container {
    position: absolute; top: 8vh; left: 0; width: 100%; display: flex; flex-direction: column;
    align-items: center; opacity: 0; transition: opacity 2s ease; z-index: 50; pointer-events: none;
}
#final-title {
    font-family: 'Anton', sans-serif; font-size: clamp(2.2rem, 4.6vw, 4rem); color: var(--primary);
    text-transform: uppercase; letter-spacing: 0.03em; margin-top: 20px; text-align: center; line-height: 1.2;
}