/* ============================================
   Disco Bingo 33 — 70s Disco Style
   Vibrant pink-purple-blue gradient with mirror ball,
   spinning vinyl caller and chrome cell numbers.
   ============================================ */

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

:root {
    /* Disco palette */
    --disco-pink:       #ff006e;
    --disco-purple:     #8338ec;
    --disco-blue:       #3a86ff;
    --disco-orange:     #fb5607;
    --disco-yellow:     #ffbe0b;

    /* Surfaces */
    --bg-deep:          #1a0033;
    --bg-mid:           #2a004f;
    --panel-glass:      rgba(20, 5, 40, 0.55);

    /* Text */
    --text-white:       #fff5fb;
    --text-soft:        #e0c8ff;
    --text-muted:       #a48dc8;

    /* Chrome / gold accents */
    --chrome-1:         #f4f4ff;
    --chrome-2:         #c0c0d0;
    --chrome-3:         #8a8aa8;
    --gold:             #ffd700;

    /* Spacing & radii */
    --radius-sm:        0.5rem;
    --radius-md:        0.875rem;
    --radius-lg:        1.25rem;
}

html { font-size: 16px; }

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

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100dvh - 3.5rem);
    color: var(--text-white);
    background:
        radial-gradient(ellipse at 25% 20%, rgba(255, 0, 110, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 75%, rgba(58, 134, 255, 0.35) 0%, transparent 55%),
        linear-gradient(135deg, #ff006e 0%, #8338ec 50%, #3a86ff 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    overflow-y: auto;
    animation: discoBgShift 16s ease-in-out infinite alternate;
}

@keyframes discoBgShift {
    0%   { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(20deg); }
}

/* ============ DISCO BG SPARKLES ============ */
#disco-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(2px 2px at 12% 18%, rgba(255,255,255,0.95), transparent 60%),
        radial-gradient(1px 1px at 65% 25%, rgba(255,190,11,0.9), transparent 60%),
        radial-gradient(1.5px 1.5px at 80% 60%, rgba(255,255,255,0.85), transparent 60%),
        radial-gradient(1px 1px at 30% 75%, rgba(255,0,110,0.85), transparent 60%),
        radial-gradient(2px 2px at 50% 40%, rgba(255,255,255,0.7), transparent 60%),
        radial-gradient(1px 1px at 88% 88%, rgba(58,134,255,0.9), transparent 60%);
    background-repeat: repeat;
    background-size: 18rem 18rem;
    animation: sparkleTwinkle 3.5s ease-in-out infinite alternate;
    opacity: 0.85;
}

@keyframes sparkleTwinkle {
    0%   { opacity: 0.45; }
    100% { opacity: 0.95; }
}

/* ============ SCREENS ============ */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
    z-index: 1000;
}

.hidden { display: none !important; }

.loading-spinner {
    width: 3.25rem;
    height: 3.25rem;
    border: 0.2rem solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--disco-pink);
    border-right-color: var(--disco-purple);
    border-radius: 50%;
    animation: spinAnim 1s linear infinite;
}

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

#loading-screen p {
    margin-top: 1rem;
    color: var(--disco-yellow);
    font-size: 0.9375rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    font-weight: 700;
}

.login-content { text-align: center; padding: 2rem; }
.login-icon { font-size: 3.5rem; margin-bottom: 1rem; animation: ballSpin 6s linear infinite; }
.login-content h2 { color: var(--disco-pink); margin-bottom: 0.5rem; }
.login-content p { color: var(--text-soft); }

/* ============ GAME CONTAINER ============ */
#game-container {
    width: 100%;
    max-width: 28.75rem;
    min-height: calc(100dvh - 3.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem 1rem;
    position: relative;
    z-index: 1;
}

/* ============ HEADER / BALANCE ============ */
#game-header {
    width: 100%;
    padding: 0.375rem 0 0.5rem;
    display: flex;
    justify-content: center;
}

.balance-display {
    background: linear-gradient(180deg, rgba(255,0,110,0.18) 0%, rgba(131,56,236,0.12) 100%);
    border: 1px solid rgba(255, 190, 11, 0.45);
    border-radius: 1.25rem;
    padding: 0.4375rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    box-shadow:
        0 0 1.125rem rgba(255, 0, 110, 0.25),
        inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
}

.balance-label {
    color: var(--text-soft);
    font-size: 0.75rem;
    letter-spacing: 0.03rem;
}

#balance-value {
    color: var(--disco-yellow);
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 4.375rem;
    text-align: right;
    text-shadow: 0 0 0.625rem rgba(255, 190, 11, 0.6);
}

.balance-currency {
    color: var(--disco-pink);
    font-size: 0.6875rem;
    font-weight: 700;
}

/* ============ GAME TITLE ============ */
.game-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.25rem 0 0.5rem;
}

.mirror-ball {
    font-size: 1.75rem;
    display: inline-block;
    animation: ballSpin 6s linear infinite;
    filter: drop-shadow(0 0 0.625rem rgba(255,255,255,0.7));
}

@keyframes ballSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.title-disco {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: 0.1875rem;
    background: linear-gradient(135deg, var(--chrome-1) 0%, var(--chrome-2) 45%, var(--chrome-3) 70%, var(--chrome-1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 0.625rem rgba(255,255,255,0.25);
    text-transform: uppercase;
}

.title-33 {
    color: var(--disco-yellow);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.125rem;
    text-shadow: 0 0 0.875rem rgba(255, 190, 11, 0.7);
}

/* ============ PAYOUT STRIP ============ */
.payout-strip {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.4375rem 0.75rem;
    background:
        linear-gradient(180deg, rgba(20,5,40,0.7) 0%, rgba(40,10,80,0.7) 100%) padding-box,
        linear-gradient(135deg, var(--disco-pink), var(--disco-purple) 50%, var(--disco-blue)) border-box;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    margin-bottom: 0.625rem;
    backdrop-filter: blur(6px);
}

.pay-item {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0 0.5rem;
}

.pay-label {
    color: var(--text-soft);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.0625rem;
}

.pay-mult {
    color: var(--disco-yellow);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.0625rem;
    white-space: nowrap;
    text-shadow: 0 0 0.5rem rgba(255, 190, 11, 0.5);
}

.pay-sep {
    width: 1px;
    height: 1.125rem;
    background: linear-gradient(to bottom, transparent, rgba(255,0,110,0.5), transparent);
}

/* ============ VINYL CALLER ============ */
.vinyl-caller {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.625rem;
}

.vinyl-disc {
    position: relative;
    width: 6.25rem;
    height: 6.25rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #1a1a1a 0%, #000 70%);
    box-shadow:
        0 0 0 0.125rem #2a2a2a,
        0 0 1.5rem rgba(255, 0, 110, 0.55),
        0 0 3rem rgba(58, 134, 255, 0.35),
        inset 0 0 1.5rem rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.vinyl-grooves {
    position: absolute;
    inset: 0.5rem;
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle at center,
            transparent 0,
            transparent 0.1875rem,
            rgba(255, 255, 255, 0.04) 0.1875rem,
            rgba(255, 255, 255, 0.04) 0.21875rem);
    pointer-events: none;
}

.vinyl-label {
    position: relative;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--disco-pink) 0%, var(--disco-purple) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 0 0 0.125rem rgba(255,255,255,0.15),
        inset 0 0.0625rem 0 rgba(255,255,255,0.25);
}

#current-call {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 0.5rem rgba(0,0,0,0.6);
    letter-spacing: -0.03125rem;
}

.vinyl-disc.spinning {
    animation: vinylSpin 0.6s linear, vinylPulse 0.6s ease;
}

@keyframes vinylSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* ============ BINGO CARD ============ */
.bingo-card {
    width: 100%;
    max-width: 22rem;
    padding: 0.625rem;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(15,2,35,0.85) 0%, rgba(40,8,90,0.85) 100%) padding-box,
        linear-gradient(135deg, var(--disco-pink) 0%, var(--disco-purple) 45%, var(--disco-blue) 70%, var(--disco-pink) 100%) border-box;
    border: 0.1875rem solid transparent;
    box-shadow:
        0 0 1.75rem rgba(255, 0, 110, 0.35),
        0 0 3.5rem rgba(131, 56, 236, 0.25),
        0 1.25rem 2.5rem rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3125rem;
}

.bingo-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #1a0033 0%, #2a004f 100%);
    border: 1px solid rgba(255, 0, 110, 0.55);
    border-radius: 0.5rem;
    font-weight: 800;
    box-shadow:
        inset 0 0 0.5rem rgba(255, 0, 110, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 0 0.375rem rgba(131, 56, 236, 0.35);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cell-num {
    font-size: 1.125rem;
    font-weight: 800;
    background: linear-gradient(180deg, var(--chrome-1) 0%, var(--chrome-2) 45%, var(--chrome-3) 70%, var(--chrome-1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    letter-spacing: 0.03125rem;
}

.bingo-cell.free {
    background: linear-gradient(135deg, var(--disco-orange) 0%, var(--disco-yellow) 100%);
    border-color: var(--disco-yellow);
    color: #2a004f;
    font-size: 0.6875rem;
    letter-spacing: 0.0625rem;
    box-shadow:
        0 0 0.75rem rgba(255, 190, 11, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.bingo-cell.marked {
    background: linear-gradient(135deg, var(--disco-pink) 0%, var(--disco-purple) 100%);
    border-color: var(--gold);
    box-shadow:
        0 0 0.875rem rgba(255, 215, 0, 0.65),
        0 0 1.5rem rgba(255, 0, 110, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.18);
    animation: markPop 0.3s ease;
}

.bingo-cell.marked .cell-num {
    background: linear-gradient(180deg, #fff 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 0.5rem rgba(255,215,0,0.4);
}

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

.cell-sparkle {
    position: absolute;
    top: 0.125rem;
    right: 0.125rem;
    font-size: 0.75rem;
    pointer-events: none;
    animation: sparkleBurst 0.7s ease-out forwards;
}

@keyframes sparkleBurst {
    0%   { opacity: 1; transform: scale(0.4) rotate(0deg); }
    50%  { opacity: 1; transform: scale(1.3) rotate(180deg); }
    100% { opacity: 0; transform: scale(0.8) rotate(360deg); }
}

.bingo-cell.winning {
    background: linear-gradient(135deg, var(--gold) 0%, var(--disco-orange) 100%);
    border-color: #fff;
    animation: winningPulse 0.6s ease-in-out infinite;
}

.bingo-cell.winning .cell-num {
    background: linear-gradient(180deg, #fff 0%, #fff8dc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes winningPulse {
    0%, 100% {
        box-shadow:
            0 0 0.625rem rgba(255, 215, 0, 0.9),
            0 0 1.25rem rgba(255, 190, 11, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 1.5rem rgba(255, 215, 0, 1),
            0 0 2.5rem rgba(255, 0, 110, 0.7);
        transform: scale(1.04);
    }
}

/* ============ BALLS DRAWN ============ */
.balls-drawn {
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-soft);
    letter-spacing: 0.0625rem;
}

.balls-label { margin-right: 0.3125rem; text-transform: uppercase; font-weight: 700; }

#balls-count {
    color: var(--disco-yellow);
    font-weight: 800;
    text-shadow: 0 0 0.5rem rgba(255, 190, 11, 0.5);
}

/* ============ RESULT DISPLAY ============ */
.result-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 200;
    background: linear-gradient(160deg, rgba(15,2,35,0.97) 0%, rgba(40,5,90,0.97) 100%);
    padding: 1.5rem 2.25rem;
    border-radius: var(--radius-lg);
    border: 0.125rem solid var(--gold);
    box-shadow:
        0 0 0 1px rgba(255, 215, 0, 0.3),
        0 0 3rem rgba(255, 0, 110, 0.55),
        0 0 5rem rgba(58, 134, 255, 0.35),
        inset 0 1px 0 rgba(255,255,255,0.1);
    animation: resultIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes resultIn {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: ballSpin 4s linear infinite;
    display: inline-block;
}

.result-title {
    font-size: 1.625rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
    letter-spacing: 0.125rem;
}

.result-title.win {
    background: linear-gradient(135deg, var(--gold) 0%, #fff 50%, var(--disco-pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 0.875rem rgba(255, 215, 0, 0.5);
}

.result-title.lose {
    color: var(--text-muted);
}

.result-pattern {
    font-size: 0.8125rem;
    color: var(--text-soft);
    margin-bottom: 0.5rem;
    letter-spacing: 0.125rem;
    text-transform: uppercase;
}

.result-multiplier {
    font-size: 2rem;
    font-weight: 800;
    color: var(--disco-yellow);
    margin-bottom: 0.25rem;
    text-shadow: 0 0 0.875rem rgba(255, 190, 11, 0.7);
}

.result-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--disco-pink);
    text-shadow: 0 0 0.625rem rgba(255, 0, 110, 0.55);
}

/* ============ CONTROLS ============ */
.controls {
    width: 100%;
    margin-top: 0.875rem;
    padding: 0.75rem;
    background: var(--panel-glass);
    border: 1px solid rgba(255, 0, 110, 0.35);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 1.25rem rgba(131, 56, 236, 0.25);
}

.bet-controls {
    margin-bottom: 0.75rem;
}

.bet-controls.hidden { display: none; }

.bet-label {
    font-size: 0.6875rem;
    color: var(--text-soft);
    margin-bottom: 0.4375rem;
    text-transform: uppercase;
    letter-spacing: 0.125rem;
    text-align: center;
    font-weight: 700;
}

.bet-buttons {
    display: flex;
    gap: 0.5rem;
}

.bet-btn {
    flex: 1;
    height: 2.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 190, 11, 0.35);
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bet-btn:hover:not(:disabled) {
    border-color: var(--disco-yellow);
    color: var(--text-white);
    background: rgba(255, 190, 11, 0.12);
}

.bet-btn.active {
    background: linear-gradient(135deg, var(--disco-orange) 0%, var(--disco-yellow) 100%);
    color: #2a004f;
    border-color: #fff;
    box-shadow:
        0 0.125rem 0.75rem rgba(255, 190, 11, 0.55),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

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

/* ============ ACTION BUTTON ============ */
.action-button {
    width: 100%;
    height: 3.25rem;
    background: linear-gradient(135deg, var(--disco-pink) 0%, var(--disco-purple) 50%, var(--disco-blue) 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1.125rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1875rem;
    transition: all 0.2s ease;
    box-shadow:
        0 0.25rem 1.25rem rgba(255, 0, 110, 0.5),
        0 0 2.5rem rgba(131, 56, 236, 0.35),
        inset 0 1px 0 rgba(255,255,255,0.25);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.action-button:hover:not(:disabled) {
    transform: translateY(-0.125rem);
    box-shadow:
        0 0.5rem 1.75rem rgba(255, 0, 110, 0.7),
        0 0 3rem rgba(58, 134, 255, 0.5);
}

.action-button:active:not(:disabled) {
    transform: translateY(0);
}

.action-button:disabled {
    background: linear-gradient(135deg, #3a2050 0%, #20153a 100%);
    border-color: rgba(255,255,255,0.1);
    box-shadow: none;
    cursor: not-allowed;
    color: var(--text-muted);
}

/* ============ MESSAGE ============ */
.message-display {
    position: fixed;
    bottom: 6.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 2, 35, 0.95);
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--disco-pink);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 1.25rem rgba(255, 0, 110, 0.45);
    white-space: nowrap;
}

.message-display.visible { opacity: 1; }

#message-text {
    color: var(--text-white);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.0625rem;
}

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

.particle {
    position: absolute;
    font-size: 1.375rem;
    animation: particleFall 2s ease-out forwards;
    filter: drop-shadow(0 0 0.375rem rgba(255, 215, 0, 0.6));
}

@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: 25rem) {
    .bingo-card { max-width: 100%; }
    .cell-num { font-size: 1rem; }
    .bingo-cell.free { font-size: 0.625rem; }
    .vinyl-disc { width: 5.5rem; height: 5.5rem; }
    .vinyl-label { width: 2.625rem; height: 2.625rem; }
    #current-call { font-size: 1.25rem; }
    .title-disco { font-size: 1rem; letter-spacing: 0.125rem; }
    .title-33 { font-size: 1.375rem; }
    .pay-item { padding: 0 0.375rem; }
    .pay-mult { font-size: 0.75rem; }
}

@media (max-height: 44rem) {
    .vinyl-disc { width: 5rem; height: 5rem; }
    .vinyl-label { width: 2.5rem; height: 2.5rem; }
    #current-call { font-size: 1.125rem; }
    .bingo-card { padding: 0.5rem; }
    .bingo-grid { gap: 0.25rem; }
    .cell-num { font-size: 1rem; }
    .action-button { height: 2.875rem; font-size: 1rem; }
}
