:root {
    --sky-color: #87CEEB;
    --sky-gradient: linear-gradient(180deg, #5AB9E8 0%, #AEE2FF 100%);
    --ground-color: #556B2F;
    --ground-gradient: linear-gradient(180deg, #749642 0%, #465924 100%);
    --ui-bg: rgba(255, 255, 255, 0.85);
    --ui-text: #333;
    --ui-border: rgba(255, 255, 255, 0.5);
    --danger: #e74c3c;
    --info: #3498db;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: var(--font-body);
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background: var(--sky-gradient);
    border: 4px solid #333;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 20px rgba(255,255,255,0.2);
    overflow: hidden;
}

/* Scenery */
#sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: var(--ground-gradient);
    border-top: 4px solid #3e511f;
    z-index: 2;
}

/* UI Overlay */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    padding: 20px;
    display: flex;
    justify-content: space-between;
}

.stats-left, .stats-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-right {
    align-items: flex-end;
}

.stat-box {
    background: var(--ui-bg);
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-box.danger {
    color: var(--danger);
}

.stat-box.info {
    color: var(--info);
}

.stats-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    pointer-events: auto; /* Allow clicks on button */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border: 2px solid #ddd;
}

#game-title {
    font-family: var(--font-heading);
    font-size: 42px;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

#game-subtitle {
    color: #666;
    font-size: 16px;
    max-width: 300px;
    line-height: 1.4;
}

#start-button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    font-family: var(--font-heading);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    margin-top: 10px;
    box-shadow: 0 4px 0 #219653;
}

#start-button:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #219653;
}

#start-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #219653;
}

/* Entities */
#player {
    position: absolute;
    bottom: 120px; /* Sits exactly on ground */
    left: 350px;
    width: 60px;
    height: 60px;
    z-index: 5;
    transition: transform 0.1s ease-out; /* Smooth flipping if needed */
    display: flex;
    align-items: center;
    justify-content: center;
}

#player-emoji {
    font-size: 60px; /* Size of the emoji */
    line-height: 60px;
    text-align: center;
}

#carry-indicator {
    position: absolute;
    left: -15px;
    bottom: 0;
    display: flex;
    flex-direction: column-reverse; /* Stack from bottom up */
    gap: 5px;
}

.carry-dot {
    width: 12px;
    height: 12px;
    background-color: #2ecc71; /* Green dot */
    border-radius: 50%;
    border: 2px solid #27ae60;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

#cart {
    position: absolute;
    bottom: 120px; /* Sits exactly on ground */
    right: 30px;  /* Placed on the right side */
    font-size: 70px;
    width: 70px;
    height: 70px;
    line-height: 70px;
    text-align: center;
    z-index: 4;
}

.cabbage {
    position: absolute;
    font-size: 40px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    z-index: 3;
    /* Optional: add a slight rotation animation for falling */
    animation: spin 3s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Warning Message */
#warning-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: #e74c3c;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px #fff, -2px -2px 0px #fff, 2px -2px 0px #fff, -2px 2px 0px #fff, 0 4px 10px rgba(0,0,0,0.5);
    z-index: 15;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: translateX(-50%) scale(1); }
    to { transform: translateX(-50%) scale(1.1); }
}

/* Strikes */
.strike {
    opacity: 0.3;
    filter: grayscale(100%);
    transition: all 0.3s ease;
    margin-left: 5px;
}
.strike.active {
    opacity: 1;
    filter: grayscale(0%);
}

/* Utility classes */
.hidden {
    display: none !important;
}
