@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Roboto+Mono:wght@500&display=swap');

/* --- Reset & Base Settings --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    overflow: hidden;
    background-color: #0f172a; /* Matches the 3D fog */
    font-family: 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* --- Canvas & UI Layers --- */
#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none; /* Allows clicks to pass through to the game */
}

.hidden { 
    display: none !important; 
}

/* --- Typography & Colors (UPDATED TO YELLOW) --- */
.glow-text {
    color: #facc15; /* Bright Yellow */
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(234, 179, 8, 0.8);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-align: center;
}
.error-text { 
    color: #ef4444 !important; 
    text-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444 !important; 
}
.highlight { 
    color: #10b981; 
    font-family: 'Roboto Mono', monospace; 
    font-weight: bold; 
}

/* --- Banners (Menu, Win, Lose) --- */
.banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.banner-content {
    background: #1e293b;
    padding: 40px;
    border-radius: 16px;
    border: 2px solid #334155;
    text-align: center;
    color: #f8fafc;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Make specific banner instructions yellow and highly visible */
#menu-start .banner-content p,
#banner-win .banner-content p {
    color: #facc15; /* Bright Yellow */
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
}

/* Winning amount text */
.reward-box {
    margin-bottom: 20px;
    font-size: 1.5rem;
}
#banner-win .reward-box span {
    color: #facc15;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 15px rgba(234, 179, 8, 0.5);
}

/* --- HUD (Heads Up Display) --- */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 15px;
    pointer-events: auto;
    flex-wrap: wrap;
}

.hud-box {
    background: rgba(30, 41, 59, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
}

.hud-box.highlight-box {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.hud-box .label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-box .value {
    font-size: 1.5rem;
    font-family: 'Roboto Mono', monospace;
    color: #f8fafc;
}

/* --- Forms & Inputs --- */
.bet-input-area {
    background: #0f172a;
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-input-area label { color: #cbd5e1; }
.bet-input-area input {
    background: #0f172a;
    border: 2px solid #3b82f6;
    color: white;
    padding: 12px;
    font-size: 1.5rem;
    text-align: center;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    outline: none;
}
.bet-input-area input:focus { border-color: #60a5fa; }

/* --- Bottom Controls (Mute, Restart, Cashout) --- */
#controls {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row; /* Forces side-by-side */
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    z-index: 30;
    width: 95%; /* Adapts to mobile width */
    max-width: 450px;
}

/* Uniform button styling for side-by-side controls */
#controls button {
    flex: 1; /* Makes them equal width */
    width: 100%;
    margin-top: 0;
    padding: 14px 10px; /* Thicker touch area for mobile */
    font-size: 0.95rem; /* Fits text cleanly on small screens */
    white-space: nowrap; /* Prevents text from stacking inside the button */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Buttons Base Styles --- */
button {
    padding: 15px 30px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: none !important;
}

.btn-primary {
    background: #3b82f6;
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 100%;
}
.btn-primary:hover:not(:disabled) { background: #2563eb; }

/* Ghost button styling for Mute */
.btn-mute-menu, #btn-mute {
    background: transparent;
    border: 2px solid #475569;
    color: #cbd5e1;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-mute-menu:hover, #btn-mute:hover:not(:disabled) {
    border-color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

.btn-cashout {
    background: #10b981;
    border: none;
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}
.btn-cashout:hover:not(:disabled) {
    background: #059669;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

#btn-restart {
    background: #334155;
    border: 1px solid #475569;
    color: #f8fafc;
}
#btn-restart:hover:not(:disabled) {
    background: #475569;
}

/* --- Mobile D-Pad Controls --- */
#mobile-controls {
    position: absolute;
    bottom: 100px; /* Safely above the bottom controls */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
    z-index: 20;
}

.middle-row {
    display: flex;
    gap: 25px;
}

.arrow-btn {
    width: 60px;
    height: 60px;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid #475569;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.arrow-btn:active {
    background: rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
    color: white;
}

/* Hide on Desktop ALWAYS */
@media (min-width: 1024px) {
    #mobile-controls {
        display: none !important;
    }
}

/* Extra safety for very small screens (iPhone SE, etc.) */
@media (max-width: 400px) {
    .glow-text { font-size: 2rem; }
    #controls button { font-size: 0.8rem; padding: 12px 5px; }
}