/* Color Roulette - Premium Casino Style */

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

:root {
    --bg-dark: #050d05;
    --gold-light: #ffd700;
    --gold-mid: #c8a000;
    --gold-dark: #8a6a00;
    --gold-shine: #fff8dc;
    --color-red: #9e1b1b;
    --color-blue: #0d47a1;
    --color-green: #1b5e20;
    --color-gold: #b8860b;
    --color-white: #c8cdd6;
    --text-white: #ffffff;
    --text-muted: #8a9a8a;
    --surface: #0a180a;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: transparent;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100dvh - 3.5rem);
}

/* ============ SCREENS ============ */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-dark);
    color: var(--text-white);
    z-index: 1000;
}

.screen.hidden { display: none; }

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid rgba(255,215,0,0.15);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spinAnim 1s linear infinite;
}

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

#loading-screen p {
    margin-top: 18px;
    color: var(--gold-mid);
    font-size: 16px;
    letter-spacing: 1px;
}

.login-content { text-align: center; }
.login-icon { font-size: 56px; margin-bottom: 16px; }
.login-content h2 { color: var(--gold-light); margin-bottom: 8px; }
.login-content p { color: var(--text-muted); }

/* ============ GAME CONTAINER ============ */
#game-container {
    width: 100%;
    max-width: 460px;
    height: 100%;
    max-height: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    position: relative;
}

#game-container.hidden { display: none; }

/* ============ HEADER ============ */
#game-header {
    width: 100%;
    padding: 8px 0;
    display: flex;
    justify-content: center;
}

.balance-display {
    background: linear-gradient(180deg, rgba(255,215,0,0.12) 0%, rgba(184,134,11,0.06) 100%);
    border: 1px solid rgba(255,215,0,0.35);
    border-radius: 20px;
    padding: 7px 20px;
    display: flex;
    align-items: center;
    gap: 7px;
    backdrop-filter: blur(4px);
}

.balance-label { color: var(--text-muted); font-size: 12px; letter-spacing: 0.5px; }

#balance-value {
    color: var(--gold-light);
    font-size: 20px;
    font-weight: 700;
    min-width: 70px;
    text-align: right;
}

.balance-currency { color: var(--gold-dark); font-size: 11px; letter-spacing: 0.5px; }

/* ============ WHEEL SECTION ============ */
#wheel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    padding: 10px 20px 0;
}

/* ── Pointer ── */
.wheel-pointer {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pointer-arrow {
    width: 6px;
    height: 38px;
    background: linear-gradient(to bottom,
        #fff8dc 0%, #ffd700 30%, #b8860b 70%, #7a5800 100%);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 12px rgba(255,215,0,0.7), 0 0 4px rgba(255,215,0,0.4);
    position: relative;
}

.pointer-arrow::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 40% 35%, #fff8dc 0%, #ffd700 50%, #a07800 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255,215,0,0.9);
}

.pointer-arrow::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 13px solid #7a5800;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* ── Wheel Container — outer decorative ring ── */
.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        #2c1806 0deg 15deg,
        #4a2a0c 15deg 30deg
    );
    box-shadow:
        0 0 0 2px #1a0e00,
        0 0 0 5px var(--gold-light),
        0 0 0 7px #6b4c00,
        0 0 0 9px var(--gold-mid),
        0 0 0 11px #2c1806,
        0 0 50px rgba(255,215,0,0.35),
        0 0 100px rgba(255,215,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inner metallic ring */
.wheel-container::before {
    content: '';
    position: absolute;
    width: 274px;
    height: 274px;
    border-radius: 50%;
    background: conic-gradient(
        #fff8dc 0deg,
        #b8860b 60deg,
        #ffd700 120deg,
        #7a5800 180deg,
        #ffd700 240deg,
        #b8860b 300deg,
        #fff8dc 360deg
    );
    z-index: 0;
}

/* ── Wheel ── */
.wheel {
    width: 262px;
    height: 262px;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.8),
        inset 0 0 40px rgba(0,0,0,0.55),
        inset 0 0 80px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* ── Wheel center cap ── */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: radial-gradient(circle at 35% 30%,
        #fff8dc 0%, #ffd700 30%, #b8860b 65%, #5a3a00 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 0 0 2px #2c1806,
        0 0 0 4px var(--gold-light),
        0 0 0 6px rgba(0,0,0,0.6),
        0 4px 16px rgba(0,0,0,0.6);
    z-index: 10;
}

.center-star {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 40% 35%, #fff8dc, #c8a000);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    filter: drop-shadow(0 0 3px rgba(255,215,0,0.7));
}

/* ============ WIN DISPLAY ============ */
#win-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(160deg, rgba(20,10,0,0.96) 0%, rgba(40,25,0,0.96) 100%);
    padding: 20px 36px;
    border-radius: 16px;
    border: 1px solid var(--gold-mid);
    box-shadow:
        0 0 0 1px rgba(255,215,0,0.2),
        0 0 40px rgba(255,215,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.1);
    z-index: 100;
    text-align: center;
    animation: winPopup 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#win-display.hidden { display: none; }

@keyframes winPopup {
    0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

.win-label {
    display: block;
    color: var(--gold-light);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 4px;
    opacity: 0.8;
}

#win-amount {
    display: block;
    color: var(--gold-light);
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255,215,0,0.6);
}

#win-multiplier {
    display: block;
    color: var(--gold-mid);
    font-size: 15px;
    font-weight: 600;
    margin-top: 4px;
}

/* ============ MESSAGE DISPLAY ============ */
#message-display {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 4, 0, 0.92);
    padding: 9px 22px;
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.3);
    z-index: 100;
    white-space: nowrap;
}

#message-display.hidden { display: none; }
#message-text { color: var(--text-white); font-size: 13px; }

/* ============ COLOR SELECTION ============ */
#color-selection {
    width: 100%;
    padding: 8px 4px 0;
}

.color-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    min-width: 58px;
}

.color-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,215,0,0.3);
}

.color-btn.selected {
    border-color: var(--gold-light);
    background: rgba(255,215,0,0.1);
    box-shadow: 0 0 14px rgba(255,215,0,0.3), inset 0 0 8px rgba(255,215,0,0.05);
}

.color-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.color-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
}

.color-circle.red   { background: radial-gradient(circle at 35% 30%, #d63030, var(--color-red)); }
.color-circle.blue  { background: radial-gradient(circle at 35% 30%, #2266cc, var(--color-blue)); }
.color-circle.green { background: radial-gradient(circle at 35% 30%, #2e8832, var(--color-green)); }
.color-circle.gold  { background: radial-gradient(circle at 35% 30%, #e8b500, var(--color-gold)); }
.color-circle.white { background: radial-gradient(circle at 35% 30%, #ffffff, var(--color-white)); }

.color-name {
    color: rgba(255,255,255,0.85);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.color-mult {
    color: var(--gold-mid);
    font-size: 10px;
    font-weight: 700;
}

.selection-info {
    text-align: center;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.3px;
}

.selection-info strong { color: var(--gold-light); }

/* ============ BET CONTROLS ============ */
#bet-controls {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 4px;
    flex-wrap: wrap;
}

.bet-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.bet-buttons { display: flex; gap: 6px; }

.bet-btn {
    width: 48px;
    height: 32px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bet-btn:hover {
    border-color: var(--gold-mid);
    color: var(--text-white);
    background: rgba(255,215,0,0.08);
}

.bet-btn.active {
    background: linear-gradient(160deg, var(--gold-light) 0%, var(--gold-dark) 100%);
    color: #1a0e00;
    border-color: var(--gold-shine);
    box-shadow: 0 2px 10px rgba(255,215,0,0.3);
}

.bet-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.total-bet {
    background: rgba(0,0,0,0.3);
    padding: 4px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,215,0,0.15);
    color: var(--text-muted);
    font-size: 12px;
}

.total-bet strong { color: var(--gold-light); font-size: 15px; }

/* ============ SPIN BUTTON ============ */
#spin-button {
    width: 190px;
    height: 50px;
    background: linear-gradient(160deg, #ffd700 0%, #b8860b 100%);
    border: 1px solid rgba(255,248,220,0.5);
    border-radius: 25px;
    cursor: pointer;
    box-shadow:
        0 4px 20px rgba(255,215,0,0.4),
        0 1px 0 rgba(255,255,255,0.2) inset;
    transition: all 0.18s ease;
    margin: 6px 0;
}

#spin-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255,215,0,0.55);
}

#spin-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(255,215,0,0.3);
}

#spin-button:disabled {
    background: linear-gradient(160deg, #3a3a3a 0%, #222 100%);
    border-color: rgba(255,255,255,0.1);
    box-shadow: none;
    cursor: not-allowed;
}

.spin-text {
    color: #1a0e00;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

#spin-button:disabled .spin-text { color: #666; }

#spin-button.pulse {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(255,215,0,0.4); }
    50%       { box-shadow: 0 4px 36px rgba(255,215,0,0.75); }
}

/* ============ GAME TITLE ============ */
.game-title {
    padding: 4px 0 6px;
}

.title-text {
    color: rgba(255,255,255,0.35);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============ PARTICLES ============ */
#particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
}

.particle {
    position: absolute;
    font-size: 20px;
    animation: particleFall 2s ease-out forwards;
}

@keyframes particleFall {
    0%   { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(80vh) rotate(540deg) scale(0.3); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 400px) {
    .wheel-container { width: 260px; height: 260px; }
    .wheel-container::before { width: 236px; height: 236px; }
    .wheel { width: 226px; height: 226px; }
    .color-btn { padding: 6px 8px; min-width: 50px; }
    .color-circle { width: 22px; height: 22px; }
    .color-name { font-size: 9px; }
    .bet-btn { width: 42px; height: 30px; font-size: 12px; }
    #spin-button { width: 160px; height: 44px; }
    .spin-text { font-size: 15px; }
}

@media (max-height: 700px) {
    #wheel-section { padding: 6px 16px 0; }
    .wheel-container { width: 240px; height: 240px; }
    .wheel-container::before { width: 218px; height: 218px; }
    .wheel { width: 208px; height: 208px; }
    #color-selection { padding: 4px 4px 0; }
    .color-btn { padding: 5px 8px; }
}
