:root {
    --neon-red: #ff003c;
    --neon-green: #00ff66;
    --neon-blue: #00d4ff;
    --day-sky: #87ceeb;
    --glass-bg: rgba(15, 15, 15, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #2d5a27;
    --panel-bg: #0f0f0f;
    --input-bg: #1a1a1a;
    --text-main: #ffffff;
    --text-dim: #888888;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-content {
    width: 200px;
    text-align: center;
}

.loader-bar-bg {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

#loader-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--neon-green);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--neon-green);
}

.loader-status {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 4px;
    height: 12px;
}

.loader-percentage {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--day-sky);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    user-select: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

/* Header Styles */
header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -1px;
    color: var(--accent-color);
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

#reset-balance-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#reset-balance-btn:hover {
    opacity: 1;
}

.wallet-amount {
    color: white;
    font-variant-numeric: tabular-nums;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.icon-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Betting Panel */
#betting-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 600px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

@media (min-width: 600px) {
    .bet-controls {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        align-items: flex-end;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.bet-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s;
}

.bet-input-wrapper:focus-within {
    border-color: var(--neon-green);
}

.bet-input-wrapper span {
    padding-left: 12px;
    font-weight: 700;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.bet-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 10px;
    font-size: 1rem;
    font-weight: 700;
    outline: none;
}

.bet-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.quick-btn {
    padding: 5px;
    border-radius: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

#place-bet-btn {
    padding: 15px 40px;
    border-radius: 12px;
    border: none;
    background: var(--neon-green);
    color: #052a14;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.2);
}

@media (min-width: 600px) {
    #place-bet-btn {
        height: 50px;
    }
}

#place-bet-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.4);
}

#place-bet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* In-Game UI */
#multiplier-display {
    position: absolute;
    top: 120px;
    left: 20px;
    text-align: left;
    pointer-events: none;
    z-index: 50;
    display: none;
    background: rgba(15, 15, 15, 0.8);
    padding: 10px 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

@media (max-width: 600px) {
    #multiplier-display {
        top: 110px;
        left: 10px;
        padding: 8px 12px;
    }
    #multiplier-value {
        font-size: 1.8rem;
    }
}

#multiplier-value {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

#multiplier-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
    margin-top: 2px;
}

#cashout-panel {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 110;
    display: none;
}

#cashout-btn {
    padding: 15px 40px;
    border-radius: 100px;
    border: none;
    background: var(--neon-green);
    color: #052a14;
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 255, 102, 0.3);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

#cashout-btn span {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 5px;
    text-transform: uppercase;
}

#cashout-btn:hover {
    transform: scale(1.05);
    background: #00e65c;
}

#cashout-btn:active {
    transform: scale(0.95);
}

/* Overlays */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: none;
}

.result-card {
    background: #1a1a1a;
    color: white;
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 350px;
    width: 85%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
    .result-card {
        padding: 20px;
    }
    .result-multiplier {
        font-size: 3rem;
    }
}

.result-title {
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.result-multiplier {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 20px;
}

.win-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--neon-green);
    margin-bottom: 30px;
}

.lose-text {
    color: var(--neon-red);
}

#next-round-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border-radius: 12px;
    border: none;
    background: var(--neon-green);
    color: #052a14;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 255, 102, 0.2);
}

#next-round-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 102, 0.3);
    background: #00e65c;
}

#fair-modal, #how-to-play-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 24px;
    z-index: 300;
    width: 90%;
    max-width: 400px;
    display: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
}

.seed-box {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    word-break: break-all;
    margin-top: 10px;
    font-size: 0.8rem;
}
