:root {
    --saffron: #FF9933;
    --white: #FFFFFF;
    --green: #128807;
    --navy: #000080;
    --pole-color: #4b4b4b;
    --base-color: #808080;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    background: linear-gradient(to bottom, #87CEEB, #b5e2ff);
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
}

.stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

/* 3-Step Base */
.base { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    z-index: 5; 
}

.step { 
    background: var(--base-color); 
    border: 2px solid #555; 
}

.step1 { width: 300px; height: 30px; }
.step2 { width: 200px; height: 30px; }
.step3 { width: 100px; height: 30px; }

/* Pole */
.pole {
    width: 12px;
    height: 550px; 
    background: linear-gradient(90deg, #222, var(--pole-color), #666);
    position: relative;
    border-radius: 10px 10px 0 0;
}

/* Button */
#hoist-btn {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 5px;
    background: #cc0000;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    z-index: 10;
    box-shadow: 0 3px 0 #660000;
}

/* Flag Container */
#flag-container {
    position: absolute;
    bottom: 110px; 
    left: 12px;
    transition: bottom 4s cubic-bezier(0.4, 0, 0.2, 1);
}

.flag-folded {
    width: 30px;
    height: 80px;
    background: linear-gradient(to bottom, var(--saffron) 33%, var(--white) 33%, var(--white) 66%, var(--green) 66%);
    border: 2px dashed #444;
    border-radius: 4px;
}

#flagCanvas {
    display: none;
}

