/* Mini Spin 777 — Premium Casino Style */

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

:root {
    --gold-light:  #ffd700;
    --gold-mid:    #c8a000;
    --gold-dark:   #8a6a00;
    --gold-shine:  #fff8dc;
    --text-white:  #ffffff;
    --text-muted:  #7a8a7a;
    --red-seven:   #cc2200;
}

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

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

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

.screen.hidden { display: none; }

.loading-spinner {
    width: 52px;
    height: 52px;
    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: 16px;
    color: var(--gold-mid);
    font-size: 15px;
    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: 820px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    position: relative;
}

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

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

.balance-display {
    background: linear-gradient(180deg, rgba(255,215,0,0.1) 0%, rgba(184,134,11,0.05) 100%);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 20px;
    padding: 7px 20px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.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; }

/* ============ PAYTABLE STRIP ============ */
.paytable-strip {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 7px 12px;
    background:
        linear-gradient(180deg, #0f0800 0%, #1a1205 100%) padding-box,
        linear-gradient(180deg, var(--gold-mid), var(--gold-dark) 50%, var(--gold-mid)) border-box;
    border: 1px solid transparent;
    border-radius: 10px;
    margin-bottom: 2px;
}

.pay-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
}

.pay-symbols { font-size: 13px; letter-spacing: -2px; }

.pay-mult {
    color: var(--gold-light);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pay-sep {
    width: 1px;
    height: 18px;
    background: linear-gradient(to bottom, transparent, rgba(255,215,0,0.3), transparent);
}

/* ============ SPIN MACHINE ============ */
#slot-machine {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
}

/* Machine body — CSS gradient border (respects border-radius) */
.machine-frame {
    position: relative;
    background:
        linear-gradient(180deg, #12100a 0%, #0a0800 100%) padding-box,
        linear-gradient(180deg, #ffd700 0%, #8a6a00 40%, #ffd700 70%, #8a6a00 100%) border-box;
    border: 3px solid transparent;
    border-radius: 22px;
    padding: 18px;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.8),
        0 0 40px rgba(255,215,0,0.2),
        0 0 80px rgba(255,215,0,0.08),
        0 20px 60px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Top highlight strip on machine */
.machine-frame::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.4), transparent);
    border-radius: 50%;
}

/* ── Reels container ── */
.reels-container {
    display: flex;
    gap: 8px;
    padding: 14px 12px;
    background: linear-gradient(180deg, #060504 0%, #0a0800 100%);
    border-radius: 14px;
    border: 1px solid rgba(255,215,0,0.15);
    box-shadow:
        inset 0 4px 20px rgba(0,0,0,0.8),
        inset 0 1px 0 rgba(255,255,255,0.03);
    position: relative;
}

/* Inner glow line across all reels */
.reels-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 1px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.15), transparent);
    pointer-events: none;
}

/* ── Individual reel ── */
.reel {
    width: 88px;
    height: 96px;
    background: linear-gradient(180deg, #0a0800 0%, #120f08 50%, #0a0800 100%);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,215,0,0.2);
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.7),
        inset 0 2px 6px rgba(0,0,0,0.5),
        0 0 0 1px rgba(0,0,0,0.5);
}

/* top/bottom fade masks on reel */
.reel::before,
.reel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 28px;
    z-index: 10;
    pointer-events: none;
}

.reel::before {
    top: 0;
    background: linear-gradient(180deg, rgba(8,6,4,0.85) 0%, transparent 100%);
}

.reel::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(8,6,4,0.85) 0%, transparent 100%);
}

.reel-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.reel.spinning .reel-inner {
    animation: reelSpin 0.08s linear infinite;
}

@keyframes reelSpin {
    0%   { transform: translateY(-60%); }
    100% { transform: translateY(60%); }
}

/* ── Symbol ── */
.symbol {
    font-size: 48px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
    transition: transform 0.25s ease;
    line-height: 1;
}

.reel.highlight .symbol {
    animation: symbolPulse 0.5s ease;
    filter: drop-shadow(0 0 12px rgba(255,215,0,0.9));
}

@keyframes symbolPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

/* ── Win line ── */
.win-line {
    position: absolute;
    top: 50%;
    left: 8px;
    right: 8px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-light) 20%, var(--gold-light) 80%, transparent);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 12px var(--gold-light), 0 0 4px var(--gold-light);
    border-radius: 1px;
    pointer-events: none;
}

.win-line.active {
    opacity: 1;
    animation: winLinePulse 0.6s ease-in-out infinite;
}

@keyframes winLinePulse {
    0%, 100% { opacity: 1;   box-shadow: 0 0 12px var(--gold-light); }
    50%       { opacity: 0.6; box-shadow: 0 0 24px var(--gold-light); }
}

/* ============ WIN DISPLAY ============ */
#win-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(160deg, rgba(15,10,2,0.97) 0%, rgba(28,20,5,0.97) 100%);
    padding: 18px 40px;
    border-radius: 16px;
    border: 1px solid var(--gold-mid);
    box-shadow:
        0 0 0 1px rgba(255,215,0,0.15),
        0 0 50px rgba(255,215,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.08);
    z-index: 100;
    text-align: center;
    animation: winPopup 0.4s 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-mid);
    font-size: 12px;
    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: 42px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
}

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

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

/* ============ 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.04);
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 6px;
    color: rgba(255,255,255,0.65);
    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.07);
}

.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; }

.current-bet {
    background: rgba(0,0,0,0.35);
    padding: 4px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,215,0,0.15);
}

#current-bet-value {
    color: var(--gold-light);
    font-size: 16px;
    font-weight: 700;
}

/* ============ SPIN BUTTON ============ */
#spin-button {
    width: 180px;
    height: 52px;
    background: linear-gradient(160deg, #ffd700 0%, #b8860b 100%);
    border: 1px solid rgba(255,248,220,0.45);
    border-radius: 26px;
    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: 8px 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 10px rgba(255,215,0,0.3);
}

#spin-button:disabled {
    background: linear-gradient(160deg, #2e2e2e 0%, #1a1a1a 100%);
    border-color: rgba(255,255,255,0.08);
    box-shadow: none;
    cursor: not-allowed;
}

#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); }
}

.spin-text {
    color: #1a0e00;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 3px;
}

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

/* ============ GAME TITLE ============ */
.game-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 0 6px;
}

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

.title-777 {
    color: var(--red-seven);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(204,34,0,0.4);
}

/* ============ 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) {
    .reel { width: 72px; height: 80px; }
    .symbol { font-size: 40px; }
    .bet-btn { width: 42px; height: 30px; font-size: 12px; }
    #spin-button { width: 155px; height: 46px; }
    .spin-text { font-size: 17px; }
    .pay-symbols { font-size: 11px; }
}

@media (max-height: 700px) {
    .paytable-strip { padding: 5px 10px; margin-bottom: 0; }
    #slot-machine { padding: 8px 16px; }
    .machine-frame { padding: 12px; }
    .reels-container { padding: 10px; gap: 7px; }
    .reel { height: 80px; }
    .symbol { font-size: 42px; }
}
