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

body {
    font-family: 'Inter', sans-serif;
    background: #FFFFFF;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    cursor: default;
}

/* Landing Animation */
#landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: auto;
    overflow: hidden;
}

#landing.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.tree-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 957px;
    height: 923px;
    max-width: 100vw;
    max-height: 80vh;
    z-index: 10;
    pointer-events: auto;
    transition: transform 1.5s ease-out;
}

.tree-container.slide-up {
    transform: translateX(-50%) translateY(-100vh);
}

@media (max-width: 1000px) {
    .tree-container {
        width: 80vw;
        height: auto;
        aspect-ratio: 957 / 923;
    }
}

.tree-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: rotate(180deg);
    transform-origin: center center;
    cursor: pointer;
    transition: transform 0.2s ease;
    pointer-events: auto;
}

.tree-image.shaking {
    animation: treeShake 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes treeShake {
    0% { transform: rotate(180deg) translateX(0); }
    5% { transform: rotate(180deg) translateX(-6px); }
    10% { transform: rotate(180deg) translateX(6px); }
    15% { transform: rotate(180deg) translateX(-5px); }
    20% { transform: rotate(180deg) translateX(5px); }
    25% { transform: rotate(180deg) translateX(-4px); }
    30% { transform: rotate(180deg) translateX(4px); }
    35% { transform: rotate(180deg) translateX(-3px); }
    40% { transform: rotate(180deg) translateX(3px); }
    45% { transform: rotate(180deg) translateX(-2px); }
    50% { transform: rotate(180deg) translateX(2px); }
    55% { transform: rotate(180deg) translateX(-2px); }
    60% { transform: rotate(180deg) translateX(2px); }
    65% { transform: rotate(180deg) translateX(-1px); }
    70% { transform: rotate(180deg) translateX(1px); }
    75% { transform: rotate(180deg) translateX(-1px); }
    80% { transform: rotate(180deg) translateX(1px); }
    85% { transform: rotate(180deg) translateX(-0.5px); }
    90% { transform: rotate(180deg) translateX(0.5px); }
    95% { transform: rotate(180deg) translateX(-0.5px); }
    100% { transform: rotate(180deg) translateX(0); }
}

.landing-stick {
    position: absolute;
    width: 20px;
    height: auto;
    opacity: 0;
    z-index: 20;
    transform-origin: center center;
    object-fit: contain;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.landing-stick.falling {
    animation: stickFallFade 2s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes stickFallFade {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

.landing-stick.floating {
    animation: gentleFloat 3s ease-in-out infinite !important;
    left: 50% !important;
    top: 50% !important;
    width: 172px !important; /* Desktop size */
    transform: translate(-50%, -50%) !important;
}

/* Mobile: landing stick 70% larger */
@media (max-width: 768px) {
    .landing-stick.floating {
        width: 292px !important; /* Mobile: 70% larger (172px * 1.7) */
    }
}

@keyframes gentleFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0px) rotate(0deg) !important;
    }
    50% {
        transform: translate(-50%, -50%) translateY(-8px) rotate(1deg) !important;
    }
}

/* Main Page */
#main {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#main.visible {
    display: flex;
}

.stick-container {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease;
    z-index: 100; /* Above stick pile - ensure main stick is always on top */
}

.stick-image {
    width: 172px; /* Desktop size */
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    animation: stickFloat 3s ease-in-out infinite;
}


@keyframes stickFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

.stick-container.clicked .stick-image {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-5px) rotate(-3deg); }
    20% { transform: translateX(5px) rotate(3deg); }
    30% { transform: translateX(-5px) rotate(-3deg); }
    40% { transform: translateX(5px) rotate(3deg); }
    50% { transform: translateX(-3px) rotate(-2deg); }
    60% { transform: translateX(3px) rotate(2deg); }
    70% { transform: translateX(-2px) rotate(-1deg); }
    80% { transform: translateX(2px) rotate(1deg); }
}

.market-cap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 36px;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    transition: background-color 0.1s ease-out, border-color 0.1s ease-out !important;
    z-index: 1000;
}

.market-cap-label {
    font-weight: 400;
    color: #333;
}

.market-cap-value {
    font-weight: 400;
    color: #333;
    transition: opacity 0.3s ease;
}

.market-cap-value.updating {
    opacity: 0;
}

.market-cap.increasing {
    background: rgba(76, 175, 80, 0.95);
    border-color: rgba(76, 175, 80, 0.8);
}

.market-cap.decreasing {
    background: rgba(244, 67, 54, 0.95);
    border-color: rgba(244, 67, 54, 0.8);
}

.stick-pile {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Behind main stick (z-index: 100) but above background */
    overflow: hidden; /* Ensure sticks don't go off-screen */
}

.falling-stick {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transform-origin: center center;
    /* No CSS animation - using JavaScript physics instead */
}

.stick-glow-green {
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.6)) drop-shadow(0 0 4px rgba(76, 175, 80, 0.4));
    transition: filter 0.2s ease;
}

.stick-glow-red {
    filter: drop-shadow(0 0 8px rgba(244, 67, 54, 0.6)) drop-shadow(0 0 4px rgba(244, 67, 54, 0.4));
    transition: filter 0.2s ease;
}

.piled-stick {
    position: absolute;
    opacity: 1;
    pointer-events: none;
    transform-origin: center center;
}

/* Animation now handled by JavaScript physics - no CSS keyframes needed */

.bottom-left-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.bottom-left-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.twitter-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 36px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.twitter-button:hover {
    background: #000000;
    color: #FFFFFF;
}

.twitter-button:active {
    background: #000000;
    color: #FFFFFF;
}

.twitter-button svg {
    width: 20px;
    height: 20px;
}

.ca-address {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #333;
    padding: 8px 12px;
    height: 36px;
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ca-address:hover {
    background: #F5F5F5;
    border-color: #CCC;
}

.ca-address:active {
    background: #EEEEEE;
}

.ca-address.copied {
    background: #E8F5E9;
    border-color: #4CAF50;
    color: #2E7D32;
}

.message {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    font-weight: 400;
}

.message.show {
    animation: fadeUp 2s ease-out forwards;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #8B4513;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes particleFloat {
    0% {
        opacity: 0.8;
        transform: translateY(0) translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) translateX(var(--tx)) scale(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .stick-image {
        width: 292px; /* Mobile: 70% larger than desktop (172px * 1.7 = 292px) */
    }

    .tree-container {
        width: 80vw;
        height: auto;
    }
    
    .market-cap {
        font-size: 10px;
        padding: 0 10px;
        height: 32px;
        bottom: 15px;
        right: 15px;
    }
    
    .bottom-left-container {
        bottom: 15px;
        left: 15px;
        gap: 8px;
    }
    
    .twitter-button {
        height: 32px;
        padding: 0 10px;
    }
    
    .twitter-button svg {
        width: 18px;
        height: 18px;
    }
    
    .ca-address {
        font-size: 10px;
        padding: 6px 10px;
        height: 32px;
    }
    
    .falling-stick,
    .piled-stick {
        max-width: 15px; /* Smaller sticks on mobile */
    }
}

@media (max-width: 480px) {
    .stick-image {
        width: 292px; /* Small mobile: same 70% larger size */
    }
    
    .market-cap {
        font-size: 9px;
        padding: 0 8px;
        height: 28px;
        bottom: 12px;
        right: 12px;
    }
    
    .bottom-left-container {
        bottom: 12px;
        left: 12px;
        gap: 6px;
    }
    
    .twitter-button {
        height: 28px;
        padding: 0 8px;
    }
    
    .twitter-button svg {
        width: 16px;
        height: 16px;
    }
    
    .ca-address {
        font-size: 9px;
        padding: 5px 8px;
        height: 28px;
    }
    
    .falling-stick,
    .piled-stick {
        max-width: 12px; /* Even smaller sticks on very small screens */
    }
}
