:root {
    --bg-deep: #1e244b;
    --bg-radial: radial-gradient(circle at 50% 30%, #3e4787 0%, #1c224d 100%);
}

html, body {
    height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #1c224d;
    background: var(--bg-radial);
    -webkit-tap-highlight-color: transparent;
    font-family: 'Outfit', sans-serif;
    color: white;
    user-select: none;
}

#game-container {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
}

/* Updated Top Section */
#game-container > .flex.justify-between {
    height: 100px;
    padding-top: 1rem;
    padding-bottom: 0;
}

/* Adjust balance display */
#balance-display {
    font-size: 1.1rem;
}

#refill-btn {
    padding: 4px 12px;
}

.btn-side {
    background: linear-gradient(to bottom, #5d68b2 0%, #3a4178 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #d1d5db;
    cursor: pointer;
}

.btn-side:active {
    transform: translateY(1px);
    border-bottom-width: 1px;
}

.risk-container {
    background: rgba(15, 20, 48, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.btn-risk {
    width: 88px;
    height: 32px;
    border-radius: 6px;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.btn-risk-inactive {
    background: linear-gradient(to bottom, #5d68b2 0%, #3a4178 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.6);
}

.btn-risk-active-gold {
    background: linear-gradient(to bottom, #f7c244 0%, #b48a00 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-bottom: 4px solid rgba(0, 0, 0, 0.5);
    color: #433300;
    box-shadow: 0 0 15px rgba(247, 194, 68, 0.6);
}

.row-selector-container {
    background: rgba(15, 20, 48, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 6px;
    display: flex;
    gap: 4px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    overflow-x: auto;
}

.row-btn {
    min-width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(to bottom, #4a548e 0%, #323a6b 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.row-btn-active {
    background: #00e5ff;
    color: #1a2046;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.8), inset 0 0 6px rgba(255, 255, 255, 0.5);
    border: 1.5px solid #ffffff;
}

.control-pill {
    height: 52px;
    background: #141a3d;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    padding: 0 6px;
    position: relative;
}

.play-btn-outer {
    width: 82px;
    height: 82px;
    background: radial-gradient(circle, #2a3366 0%, #141a3d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.05);
    cursor: pointer;
}

.play-btn-inner {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #4ee42c 0%, #219e11 100%);
    border-top: 3px solid rgba(255,255,255,0.4);
    border-bottom: 5px solid rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
}

.play-btn-inner:active {
    transform: scale(0.95);
    border-bottom-width: 2px;
}

.coin-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #ffb443 0%, #d87600 100%);
    border-top: 2px solid rgba(255,255,255,0.4);
    border-bottom: 3px solid rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
}

.auto-btn-inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #8b5cf6 0%, #5b21b6 100%);
    border-top: 2px solid rgba(255,255,255,0.4);
    border-bottom: 3px solid rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
}

.auto-btn-inner.active {
    background: #00f2ff;
    box-shadow: 0 0 12px #00f2ff;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: #2e366e;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    position: relative;
}

.modal-title {
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #d1d5db;
    margin-bottom: 20px;
}

.modal-input {
    background: #141a3d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    width: 100%;
    color: #00e5ff;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    font-size: 18px;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

.quick-select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-btn {
    background: linear-gradient(to bottom, #4a548e 0%, #323a6b 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 14px;
    color: #d1d5db;
    cursor: pointer;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.quick-btn:active { 
    transform: translateY(1px); 
    border-bottom-width: 1px; 
}

.btn-primary {
    background: linear-gradient(to bottom, #4ee42c 0%, #219e11 100%);
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: #1a2046;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.auto-menu {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #2e366e;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    width: 60px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 110;
}

.auto-menu-btn {
    padding: 12px;
    font-weight: 800;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    text-align: center;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.auto-menu-btn:active { 
    background: rgba(255,255,255,0.1); 
}

.auto-menu-btn.active { 
    background: #00e5ff; 
    color: #1a2046; 
}

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

.no-scrollbar::-webkit-scrollbar { 
    display: none; 
}

.no-scrollbar { 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

.notification {
    position: fixed;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.multiplier-pulse {
    animation: pulse 0.2s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #46518a;
    transition: opacity 0.8s ease-in-out;
}

.game-canvas {
    width: 100%;
    height: 100%;
    max-height: 75vh;
    object-fit: contain;
}
