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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    backdrop-filter: blur(10px);
    min-height: calc(100dvh - 3.5rem);
    color: white;
    overflow: hidden;
}

/* Screens */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #001201;
    z-index: 100;
}

.hidden {
    display: none !important;
}

/* Loader */
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fad900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Login */
.login-box {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

/* Game Container */
#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 420px;
    margin: 0 auto;
    padding: 10px;
}

/* Header */
.game-header {
    display: flex;
    justify-content: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 10px;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
    font-weight: 600;
}

.balance-label {
    color: #888;
}

#balance-value {
    color: #22c55e;
    transition: all 0.3s ease;
}

.currency {
    color: #fbbf24;
    font-weight: 700;
}

/* Game Area */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(180deg, #00420c 0%, #001201 100%);
    border-radius: 16px;
    position: relative;
}

/* Title */
.game-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.title-icon {
    font-size: 28px;
    animation: sparkle 1.5s ease infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.title-text {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Instruction */
.instruction {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 25px;
    text-align: center;
}

.instruction.picking {
    color: #ffd700;
    font-weight: 600;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Chests Container */
.chests-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 350px;
}

/* Chest */
.chest {
    width: 90px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
    border: 3px solid #A0522D;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.chest:hover:not(.disabled):not(.opened) {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
}

.chest.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.chest.opened {
    cursor: default;
}

.chest-body {
    font-size: 50px;
    transition: all 0.3s ease;
}

.chest.opened .chest-body {
    opacity: 0.3;
    transform: scale(0.8);
}

.chest-prize {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 800;
    white-space: nowrap;
    animation: prizeReveal 0.5s ease;
}

@keyframes prizeReveal {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.chest-prize.win {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.chest-prize.selected {
    color: #22c55e;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
    font-size: 28px;
}

.chest.selected {
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    animation: selectedPulse 0.5s ease infinite;
}

@keyframes selectedPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 30px rgba(34, 197, 94, 0.8); }
}

/* Result Display */
.result-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 40px;
    border-radius: 16px;
    animation: resultIn 0.3s ease;
}

@keyframes resultIn {
    from {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.result-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-title.win {
    color: #22c55e;
}

.result-title.lose {
    color: #ef4444;
}

.result-multiplier {
    font-size: 32px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 5px;
}

.result-amount {
    font-size: 20px;
    font-weight: 600;
    color: #4ade80;
}

/* Controls */
.controls {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    margin-top: 10px;
}

.bet-controls {
    margin-bottom: 15px;
}

.bet-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.amount-buttons {
    display: flex;
    gap: 8px;
}

.amount-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.amount-btn.active {
    background: linear-gradient(135deg, #fad900 0%, #b8860b 100%);
    color: #001201;
    box-shadow: 0 0 15px rgba(250, 217, 0, 0.4);
}

.amount-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Action Button */
.action-button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #fad900 0%, #b8860b 100%);
    color: #001201;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(250, 217, 0, 0.4);
}

.action-button:active {
    transform: translateY(0);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Message Display */
.message-display {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-display.visible {
    opacity: 1;
}
