body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    padding: 0px;
    margin: 0px;
    color: black;
    background-color: black;
    overflow: hidden;
}

.title {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: gold;
}

p {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: white;
}

#intro,
#game {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.btn-main {
    color: black;
    background-color: gold;
    border: 0;
    border-radius: 2px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    cursor: pointer;
    padding: 8px 16px;
}

.btn-gamble {
    color: black;
    background-color: gold;
    border: 0;
    border-radius: 2px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    cursor: pointer;
    width: 142px;
    height: 32px;
    font-size: 20px;
}

.btn-gamble:disabled {
    background-color: #7a6b1f;
    color: #333;
    cursor: not-allowed;
}

.btn-pill {
    color: gold;
    background-color: black;
    border: 2px solid gold;
    border-radius: 15px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    cursor: pointer;
    width: 142px;
    height: 32px;
    font-size: 20px;
    margin-top: 20px;
}

.number {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    padding: 0;
    margin: 0;
    font-size: 15vh;
    position: relative;
    z-index: 2;
}

/* Wobble effect on a loss. --wobble-amp is set inline per-spin by script.js
   so the amplitude can scale with how fast the player is clicking. */
.wobble {
    --wobble-amp: 6px;
    animation: wobble 0.4s ease-in-out;
}

@keyframes wobble {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(calc(var(--wobble-amp) * -1)); }
    40%  { transform: translateX(var(--wobble-amp)); }
    60%  { transform: translateX(calc(var(--wobble-amp) * -0.6)); }
    80%  { transform: translateX(calc(var(--wobble-amp) * 0.6)); }
    100% { transform: translateX(0); }
}

/* Glow pulse on the number while it reads "WIN!" */
.win-glow {
    animation: winGlow 0.6s ease-in-out infinite alternate;
}

@keyframes winGlow {
    from { text-shadow: 0 0 10px #2ecc71, 0 0 20px #2ecc71; }
    to   { text-shadow: 0 0 25px #2ecc71, 0 0 50px #2ecc71; }
}

/* Sunburst rays fanning out from behind the number */
.sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60vh;
    height: 60vh;
    transform: translate(-50%, -50%) scale(0);
    z-index: 1;
    pointer-events: none;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 215, 0, 0.55) 0deg 8deg,
        transparent 8deg 20deg
    );
    border-radius: 50%;
    animation: sunburstAnim 1.4s ease-out forwards;
}

@keyframes sunburstAnim {
    0%   { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4) rotate(60deg); opacity: 0; }
}

/* Coins raining down from the top of the screen on a win */
.falling-coin {
    position: fixed;
    top: -5vh;
    z-index: 3;
    pointer-events: none;
    animation-name: coinFall;
    animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
    animation-fill-mode: forwards;
}

@keyframes coinFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(115vh) rotate(360deg); opacity: 0.9; }
}

/* Account button + login/register modal */
#account-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    width: auto;
    padding: 0 14px;
    height: 32px;
    margin-top: 0;
}

#account-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.modal-content {
    position: relative;
    background-color: #0a0a0a;
    border: 1px solid gold;
    border-radius: 4px;
    padding: 24px 28px;
    width: 90vw;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: gold;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

#account-status {
    font-size: 14px;
    text-align: center;
    margin: 4px 0 12px;
}

.form-label {
    align-self: flex-start;
    color: gold;
    margin: 10px 0 4px;
    font-size: 14px;
}

#login-form,
#register-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#account-modal input[type="text"],
#account-modal input[type="password"] {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    padding: 7px 10px;
    border-radius: 2px;
    border: 1px solid gold;
    background-color: black;
    color: white;
}

#account-modal .btn-main {
    padding: 7px 0;
    margin-top: 2px;
}

#logout-btn {
    margin-top: 14px;
}

.error-text {
    color: #e74c3c;
    font-size: 13px;
    min-height: 1.2em;
    text-align: center;
    margin: 6px 0 0;
}

/* Game over overlay */
#gameOver {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10;
}

.game-over-title {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: #e74c3c;
    font-size: 48px;
    margin: 0;
}