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

@keyframes bgDrift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background-color: #000;
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #7bc855;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* UI Elements */
#top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: auto;
    z-index: 10;
}

.stat-box {
    background: linear-gradient(180deg, #ffffff 0%, #fff0f5 100%);
    border: 4px solid #fff;
    border-radius: 30px;
    padding: 10px 25px;
    display: flex;
    align-items: center;
    font-size: 28px;
    color: #333;
    font-weight: 900;
    box-shadow: 0 8px 0 #ccc, 0 15px 25px rgba(0,0,0,0.3);
    position: relative;
}

.stat-box::after {
    content: '';
    position: absolute;
    top: 2px; left: 10%; width: 80%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    border-radius: 20px;
}

.icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    margin-right: 12px;
    border-radius: 50%;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.3);
}

.coin-icon { background: radial-gradient(circle at 30% 30%, #fff, #ffd700, #ffaa00); }
.season-icon { background: radial-gradient(circle at 30% 30%, #fff, #7bc855, #3d9a3d); }
.market-icon { background: radial-gradient(circle at 30% 30%, #fff, #ff66aa, #cc2266); }

.ui-button {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    border: none;
    cursor: pointer;
    outline: none;
    transition: all 0.1s;
}

@keyframes pulseBtn {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.main-btn {
    background: linear-gradient(180deg, #ffaa00 0%, #ff6600 100%);
    color: white;
    padding: 20px 60px;
    font-size: 36px;
    border-radius: 50px;
    border: 4px solid #ffeeaa;
    box-shadow: 
        0 12px 0 #cc4400,
        0 20px 30px rgba(0,0,0,0.5),
        inset 0 5px 0 rgba(255,255,255,0.5);
    animation: pulseBtn 2s infinite;
}

.main-btn:active {
    transform: translateY(12px) !important;
    box-shadow: 
        0 0px 0 #cc4400,
        0 5px 10px rgba(0,0,0,0.5),
        inset 0 5px 0 rgba(255,255,255,0.5);
    animation: none;
}

.round-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
    border: 4px solid #fff;
    box-shadow: 0 8px 0 #aaa, 0 10px 20px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.round-btn::after {
    content: '';
    position: absolute;
    top: 2px; left: 15%; width: 70%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    border-radius: 20px;
}

.round-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0px 0 #aaa, 0 5px 10px rgba(0,0,0,0.3);
}

/* Screens */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(50px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(135, 206, 235, 0.6);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 100;
}

.screen:not(.hidden) {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hidden {
    display: none !important;
}

.logo-thumb {
    width: 350px;
    height: 210px;
    border-radius: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 8px rgba(255,255,255,0.3);
    border: 6px solid #ffcc00;
    object-fit: cover;
    animation: floatTitle 4s ease-in-out infinite;
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

h1 {
    font-size: 64px;
    background: linear-gradient(180deg, #ffffff 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 0 #cc6600) drop-shadow(0 15px 20px rgba(0,0,0,0.5));
    margin-bottom: 15px;
    text-align: center;
    animation: floatTitle 3s ease-in-out infinite reverse;
}

p {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 40px;
    text-shadow: 0 4px 0 rgba(0,0,0,0.4);
    background: rgba(0,0,0,0.3);
    padding: 10px 30px;
    border-radius: 20px;
}

/* Toolbar */
.toolbar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 30px;
    pointer-events: auto;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3), inset 0 2px 20px rgba(255,255,255,0.5);
    border: 2px solid rgba(255,255,255,0.6);
}

.tool-btn {
    background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
    border: 4px solid #fff;
    border-radius: 20px;
    width: 80px;
    height: 80px;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 0 #aaa, 0 10px 15px rgba(0,0,0,0.3);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #555;
    position: relative;
}

.tool-btn::after {
    content: '';
    position: absolute;
    top: 2px; left: 10%; width: 80%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    border-radius: 10px;
}

.tool-btn.active {
    background: linear-gradient(180deg, #fff9c4 0%, #ffeb3b 100%);
    border-color: #ffcc00;
    box-shadow: 0 0 20px #ffcc00, 0 4px 0 #cc9900;
    transform: translateY(4px) scale(1.1);
    color: #d84315;
    z-index: 2;
}

/* Seed Selector */
#seed-selector {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 25px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    pointer-events: auto;
    border: 4px solid #00bcd4;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seed-option {
    padding: 10px 20px;
    background: linear-gradient(180deg, #e0f7fa 0%, #b2ebf2 100%);
    border: 3px solid #00acc1;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 900;
    color: #006064;
    box-shadow: 0 4px 0 #00838f;
    transition: all 0.1s;
}

.seed-option:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #00838f;
}

.seed-option.active {
    background: linear-gradient(180deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    border-color: #fff;
    box-shadow: 0 4px 0 #006064, 0 0 15px #00bcd4;
}

/* Popups */
.popup {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.popup-content {
    background: linear-gradient(180deg, #ffffff 0%, #fff8e1 100%);
    width: 90%;
    max-width: 700px;
    height: 80%;
    border-radius: 40px;
    padding: 40px;
    position: relative;
    border: 8px solid #ffcc00;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), inset 0 10px 0 rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
}

.popup-content h2 {
    color: #ff8800;
    font-size: 48px;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 0 #fff, 4px 4px 0 #ccc;
}

.close-btn {
    position: absolute;
    top: -25px;
    right: -25px;
    background: linear-gradient(180deg, #ff6666 0%, #cc0000 100%);
    color: white;
    width: 70px;
    height: 70px;
    font-size: 32px;
    border-radius: 50%;
    box-shadow: 0 8px 0 #880000, 0 10px 20px rgba(0,0,0,0.5), inset 0 4px 0 rgba(255,255,255,0.4);
    border: 4px solid #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.1s;
}

.close-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0px 0 #880000, 0 5px 10px rgba(0,0,0,0.5);
}

#orders-container {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-right: 10px;
}

#orders-container::-webkit-scrollbar {
    width: 15px;
}
#orders-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
#orders-container::-webkit-scrollbar-thumb {
    background: #ffcc00;
    border-radius: 10px;
    border: 3px solid #f1f1f1;
}

.order-card {
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
    border: 4px dashed #ffb300;
    border-radius: 25px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.order-card:hover {
    transform: scale(1.02);
}

.order-btn {
    margin-top: 15px;
    background: linear-gradient(180deg, #66ff66 0%, #00cc00 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    box-shadow: 0 6px 0 #008800, 0 10px 15px rgba(0,0,0,0.2);
    border: 3px solid #ccffcc;
    font-size: 20px;
}

.order-btn:not([disabled]):active {
    transform: translateY(6px);
    box-shadow: 0 0px 0 #008800;
}

/* Responsive */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    h1 { font-size: 48px; }
    .tool-btn { width: 60px; height: 60px; font-size: 12px; }
    #orders-container { grid-template-columns: 1fr; }
    .stat-box { font-size: 20px; padding: 5px 15px; }
    .icon { width: 24px; height: 24px; }
}
