@font-face {
    font-family: 'TitanOne';
    src: url('../fonts/TitanOne-Regular.ttf') format('truetype');
    font-display: swap;
}

/* gold 3D text treatment - reuse with class .gold-text */
.gold-text {
    font-family: 'TitanOne', Arial Black, sans-serif;
    background: linear-gradient(180deg, #fff7d6 0%, #ffd76a 38%, #f0a818 62%, #ffe27a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 0 #7a4d00)
            drop-shadow(0 4px 3px rgba(0, 0, 0, 0.55))
            drop-shadow(0 0 10px rgba(255, 200, 61, 0.45));
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0b0a1e;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#game {
    width: 100%;
    height: 100%;
}

#game canvas {
    display: block;
}

/* ---------- Loading overlay ---------- */

#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: radial-gradient(ellipse at 50% 35%, #2a2356 0%, #0b0a1e 75%);
    transition: opacity 0.6s ease;
}

#loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#lottie-box {
    width: 55vw;
    max-width: 280px;
    aspect-ratio: 1 / 1;
}

/* ---------- Progress bar ---------- */

#progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 72vw;
    max-width: 340px;
}

#progress-wrap.hidden {
    display: none;
}

#progress-track {
    width: 100%;
    height: 18px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 215, 106, 0.35);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 200, 61, 0.15);
    overflow: hidden;
    padding: 3px;
}

#progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 9px;
    background: linear-gradient(180deg, #fff3c4 0%, #ffd76a 35%, #f0a818 70%, #c87d00 100%);
    box-shadow: 0 0 12px rgba(255, 200, 61, 0.8);
    transition: width 0.25s ease;
    position: relative;
    overflow: hidden;
}

/* moving shine sweep across the gold fill */
#progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.75) 50%, transparent 100%);
    animation: shine 1.1s linear infinite;
}

@keyframes shine {
    0%   { left: -60%; }
    100% { left: 130%; }
}

#loading-percent {
    font-family: 'TitanOne', Arial Black, Arial, Helvetica, sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
    /* gold metal gradient inside the digits */
    background: linear-gradient(180deg, #fff7d6 0%, #ffd76a 38%, #f0a818 62%, #ffe27a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* 3D depth: dark bevel below + warm glow around */
    filter: drop-shadow(0 2px 0 #7a4d00)
            drop-shadow(0 4px 3px rgba(0, 0, 0, 0.55))
            drop-shadow(0 0 10px rgba(255, 200, 61, 0.45));
}

#enter-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    animation: pulse 1.4s ease-in-out infinite;
}

#enter-btn img {
    display: block;
    width: 68vw;
    max-width: 340px;
    height: auto;
    pointer-events: none;
    transition: transform 0.09s ease;
}

/* press effect: shrink like a real button (on the img, so it
   doesn't fight the pulse animation on the button itself) */
#enter-btn:active img,
#enter-btn.pressed img {
    transform: scale(0.86);
    filter: brightness(1.2);
}

#enter-btn.hidden,
#loading-percent.hidden,
#lottie-box.hidden {
    display: none;
}

/* ---------- Account panel ---------- */

#auth-panel {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 4, 20, 0.45);
    transition: opacity 0.5s ease;
}

#auth-panel.hidden {
    display: none;
}

#auth-panel.fade-out {
    opacity: 0;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 360px;
    padding: 28px 24px 26px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(34, 28, 74, 0.96) 0%, rgba(16, 12, 42, 0.96) 100%);
    border: 2px solid rgba(255, 200, 61, 0.55);
    box-shadow: 0 0 35px rgba(255, 200, 61, 0.25), 0 18px 40px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#auth-logo {
    width: 76vw;
    max-width: 330px;
    height: auto;
    align-self: center;
    /* float above the card edge for a premium overlapping look */
    margin-top: -86px;
    margin-bottom: -8px;
    animation: logoFloat 3.4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
        filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55))
                drop-shadow(0 0 16px rgba(255, 200, 61, 0.35));
    }
    50% {
        transform: translateY(-8px);
        filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.45))
                drop-shadow(0 0 30px rgba(255, 200, 61, 0.65));
    }
}

.auth-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 14px;
    padding: 5px;
}

.auth-tab {
    flex: 1;
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 15px;
    letter-spacing: 1px;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 230, 170, 0.55);
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-tab.active {
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    color: #1a1033;
    box-shadow: 0 0 14px rgba(255, 200, 61, 0.5), 0 2px 0 #a36b00;
}

.password-wrap {
    position: relative;
    display: flex;
}

.password-wrap #auth-password {
    flex: 1;
    width: 100%;
    padding-right: 52px;
}

#toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 230, 170, 0.5);
    transition: color 0.15s ease, transform 0.09s ease;
}

#toggle-password svg {
    width: 24px;
    height: 24px;
}

#toggle-password svg.hidden {
    display: none;
}

#toggle-password:active {
    transform: translateY(-50%) scale(0.85);
    color: #ffd76a;
}

#toggle-password.revealed {
    color: #ffd76a;
    filter: drop-shadow(0 0 6px rgba(255, 200, 61, 0.6));
}

#auth-username,
#auth-password {
    font-family: 'TitanOne', Arial, sans-serif;
    font-size: 17px;
    letter-spacing: 1px;
    color: #ffe9a0;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 200, 61, 0.3);
    border-radius: 14px;
    padding: 13px 16px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#auth-username:focus,
#auth-password:focus {
    border-color: rgba(255, 200, 61, 0.85);
    box-shadow: 0 0 14px rgba(255, 200, 61, 0.35);
}

#auth-username::placeholder,
#auth-password::placeholder {
    color: rgba(255, 230, 170, 0.35);
}

#loading-status {
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    color: rgba(255, 230, 170, 0.6);
    min-height: 15px;
    animation: statusBlink 1.2s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

#auth-hint {
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-align: center;
    color: rgba(255, 230, 170, 0.45);
}

#auth-error {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    color: #ff7d7d;
    text-shadow: 0 0 8px rgba(255, 80, 80, 0.5);
    min-height: 18px;
}

#auth-error.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-7px); }
    50%      { transform: translateX(7px); }
    75%      { transform: translateX(-4px); }
}

#auth-submit {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    color: #1a1033;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    border: none;
    border-radius: 16px;
    padding: 15px 0;
    box-shadow: 0 0 22px rgba(255, 200, 61, 0.45), 0 4px 0 #a36b00;
    cursor: pointer;
    transition: transform 0.09s ease, filter 0.09s ease;
}

#auth-submit:active {
    transform: scale(0.94);
    filter: brightness(1.15);
}

#auth-submit {
    position: relative;
}

#auth-submit.busy #submit-label {
    visibility: hidden;
}

#submit-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#submit-spinner.hidden {
    display: none;
}

#submit-spinner > div {
    width: 40px;
    height: 40px;
}

/* ---------- Main menu (glass) ---------- */

#main-menu {
    position: fixed;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
    pointer-events: none;
}

#main-menu.hidden {
    display: none;
}

#menu-angel {
    position: absolute;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    height: 52vh;
    max-height: 56%;
    filter: drop-shadow(0 14px 24px rgba(40, 20, 80, 0.45))
            drop-shadow(0 0 26px rgba(255, 220, 130, 0.35));
    animation: angelFloat 4.2s ease-in-out infinite;
}

@keyframes angelFloat {
    0%, 100% { transform: translateX(-50%) translateY(0)     rotate(-1deg); }
    50%      { transform: translateX(-50%) translateY(-14px) rotate(1deg); }
}

.glass-menu {
    pointer-events: auto;
    width: 82vw;
    max-width: 340px;
    padding: 18px 16px;
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    /* dark glass: still translucent and blurred, but deep navy so the
       gold lettering stays readable over the bright sky */
    background: linear-gradient(180deg, rgba(30, 22, 70, 0.55) 0%, rgba(14, 10, 40, 0.62) 100%);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1.5px solid rgba(255, 255, 255, 0.30);
    box-shadow: 0 14px 38px rgba(20, 10, 50, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

#main-menu.show .glass-menu {
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.menu-btn {
    border: 1.5px solid rgba(255, 215, 106, 0.40);
    border-radius: 18px;
    padding: 15px 0;
    background: linear-gradient(180deg, rgba(50, 38, 105, 0.65) 0%, rgba(22, 16, 58, 0.70) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(20, 10, 50, 0.35);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    opacity: 0;
}

#main-menu.show .menu-btn {
    animation: menuItemIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#main-menu.show .menu-btn:nth-child(1) { animation-delay: 0.10s; }
#main-menu.show .menu-btn:nth-child(2) { animation-delay: 0.20s; }
#main-menu.show .menu-btn:nth-child(3) { animation-delay: 0.30s; }

@keyframes menuItemIn {
    from { opacity: 0; transform: translateY(22px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.menu-btn:active {
    transform: scale(0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 18px rgba(255, 200, 61, 0.45);
}

.menu-btn span {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 21px;
    letter-spacing: 2px;
    background: linear-gradient(180deg, #fff7d6 0%, #ffd76a 38%, #f0a818 62%, #ffe27a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 0 #5c3a00)
            drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6))
            drop-shadow(0 0 10px rgba(255, 200, 61, 0.4));
}

/* ---------- Top bar: real balance + deposit ---------- */

#top-bar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
    z-index: 6;
    display: flex;
    justify-content: flex-end;
}

#top-bar.hidden {
    display: none;
}

#balance-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 6px 5px 10px;
    border-radius: 30px;
    white-space: nowrap;
    background: linear-gradient(180deg, rgba(30, 22, 70, 0.80) 0%, rgba(14, 10, 40, 0.85) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 200, 61, 0.45);
    box-shadow: 0 0 16px rgba(255, 200, 61, 0.20), 0 6px 14px rgba(0, 0, 0, 0.4);
}

#balance-pill .coin-dot {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* demo mode: grey coin so the player always knows it's practice money */
#balance-pill .coin-dot.demo {
    background: radial-gradient(circle at 35% 30%, #f2f2f8 0%, #a2a2bc 45%, #5e5e78 100%);
    box-shadow: 0 0 8px rgba(170, 170, 200, 0.55);
}

#balance-pill .currency-label {
    font-size: 9px;
    align-self: center;
    margin-bottom: 0;
    flex-shrink: 0;
}

#topbar-balance {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 13px;
    background: linear-gradient(180deg, #fff7d6 0%, #ffd76a 50%, #f0a818 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 #5c3a00);
}

#deposit-open {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    font-family: Arial Black, sans-serif;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    color: #1a1033;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    box-shadow: 0 0 12px rgba(255, 200, 61, 0.6), 0 2px 0 #a36b00;
    cursor: pointer;
    transition: transform 0.1s ease;
    animation: depositGlow 2s ease-in-out infinite;
}

#deposit-open:active {
    transform: scale(0.85);
}

@keyframes depositGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 200, 61, 0.4),  0 2px 0 #a36b00; }
    50%      { box-shadow: 0 0 20px rgba(255, 200, 61, 0.9), 0 2px 0 #a36b00; }
}

/* ---------- Deposit modal ---------- */

#deposit-modal {
    position: fixed;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 4, 20, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#deposit-modal.hidden { display: none; }
#deposit-modal.open { opacity: 1; }

#deposit-modal.open .deposit-card {
    animation: modalPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#deposit-modal.closing .deposit-card {
    animation: modalOut 0.22s ease both;
}

.deposit-card {
    position: relative;
    width: 100%;
    max-width: 340px;
    padding: 26px 22px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(180deg, rgba(34, 28, 74, 0.97) 0%, rgba(16, 12, 42, 0.97) 100%);
    border: 2px solid rgba(255, 200, 61, 0.55);
    box-shadow: 0 0 35px rgba(255, 200, 61, 0.25), 0 18px 40px rgba(0, 0, 0, 0.6);
}

#deposit-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 230, 170, 0.7);
    font-size: 17px;
    cursor: pointer;
}

#deposit-close:active { transform: scale(0.85); }

#deposit-step-amount,
#deposit-step-wait,
#deposit-step-done {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}

#deposit-step-wait.hidden,
#deposit-step-done.hidden,
#deposit-step-amount.hidden { display: none; }

.amount-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.amount-btn {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 16px;
    color: #ffe9a0;
    padding: 12px 0;
    border-radius: 13px;
    border: 1.5px solid rgba(255, 200, 61, 0.35);
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: all 0.12s ease;
}

.amount-btn:active { transform: scale(0.93); }

.amount-btn.selected {
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    color: #1a1033;
    box-shadow: 0 0 14px rgba(255, 200, 61, 0.5);
}

#deposit-amount {
    font-family: 'TitanOne', Arial, sans-serif;
    font-size: 18px;
    text-align: center;
    letter-spacing: 1px;
    color: #ffe9a0;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 200, 61, 0.3);
    border-radius: 14px;
    padding: 13px 16px;
    outline: none;
    -moz-appearance: textfield;
}

#deposit-amount::-webkit-outer-spin-button,
#deposit-amount::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

#deposit-amount:focus {
    border-color: rgba(255, 200, 61, 0.85);
    box-shadow: 0 0 14px rgba(255, 200, 61, 0.35);
}

#deposit-error {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    color: #ff7d7d;
    min-height: 17px;
}

#deposit-error.shake { animation: shake 0.4s ease; }

#deposit-pay {
    position: relative;
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 19px;
    letter-spacing: 2px;
    color: #1a1033;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    border: none;
    border-radius: 16px;
    padding: 15px 0;
    box-shadow: 0 0 22px rgba(255, 200, 61, 0.45), 0 4px 0 #a36b00;
    cursor: pointer;
    transition: transform 0.09s ease;
}

#deposit-pay:active { transform: scale(0.94); }

#deposit-pay.busy #deposit-pay-label { visibility: hidden; }

#deposit-pay-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#deposit-pay-spinner.hidden { display: none; }

#deposit-pay-spinner > div { width: 38px; height: 38px; }

.deposit-note {
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-align: center;
    color: rgba(255, 230, 170, 0.45);
}

#deposit-wait-anim {
    width: 90px;
    height: 90px;
    align-self: center;
}

#deposit-wait-text {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    text-align: center;
    color: #ffe9a0;
    animation: statusBlink 1.2s ease-in-out infinite;
}

#deposit-cancel {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 15px;
    letter-spacing: 2px;
    color: rgba(255, 230, 170, 0.8);
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid rgba(255, 230, 170, 0.3);
    border-radius: 13px;
    padding: 11px 0;
    cursor: pointer;
}

.deposit-success {
    width: 74px;
    height: 74px;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 900;
    color: #1a1033;
    border-radius: 50%;
    background: linear-gradient(180deg, #c8ffd0 0%, #5ee27a 60%, #2eaf4a 100%);
    box-shadow: 0 0 30px rgba(94, 226, 122, 0.7);
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#deposit-done-text {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 17px;
    letter-spacing: 1px;
    text-align: center;
    color: #a4ffb0;
    text-shadow: 0 0 12px rgba(94, 226, 122, 0.5);
}

/* ---------- Under development modal ---------- */

#dev-modal {
    position: fixed;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 4, 20, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#dev-modal.hidden { display: none; }
#dev-modal.open { opacity: 1; }

#dev-modal.open .dev-card {
    animation: modalPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#dev-modal.closing .dev-card {
    animation: modalOut 0.22s ease both;
}

.dev-card {
    width: 100%;
    max-width: 310px;
    padding: 28px 24px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.07) 100%);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dev-icon {
    font-size: 46px;
    animation: devBounce 1.6s ease-in-out infinite;
}

@keyframes devBounce {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-9px) rotate(4deg); }
}

.dev-text {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
}

#dev-ok {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 17px;
    letter-spacing: 2px;
    color: #1a1033;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    border: none;
    border-radius: 15px;
    padding: 13px 34px;
    box-shadow: 0 0 22px rgba(255, 200, 61, 0.45), 0 4px 0 #a36b00;
    cursor: pointer;
    transition: transform 0.09s ease;
}

#dev-ok:active { transform: scale(0.93); }

/* ---------- Credits modal ---------- */

#credit-modal {
    position: fixed;
    inset: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 4, 20, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#credit-modal.hidden {
    display: none;
}

#credit-modal.open {
    opacity: 1;
}

#credit-modal.open .credit-card {
    animation: modalPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#credit-modal.closing .credit-card {
    animation: modalOut 0.22s ease both;
}

.credit-card {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 26px 22px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.07) 100%);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

#credit-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.75);
    font-size: 17px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

#credit-close:active {
    transform: scale(0.85);
}

.credit-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.credit-role {
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 10px;
}

.credit-name {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 19px;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #fff7d6 0%, #ffd76a 50%, #f0a818 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 0 rgba(122, 77, 0, 0.7));
}

/* ---------- Settings gear & modal ---------- */

#settings-btn {
    position: fixed;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 6;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(34, 28, 74, 0.95) 0%, rgba(16, 12, 42, 0.95) 100%);
    border: 2px solid rgba(255, 200, 61, 0.55);
    box-shadow: 0 0 18px rgba(255, 200, 61, 0.25), 0 6px 14px rgba(0, 0, 0, 0.5);
    color: #ffd76a;
    cursor: pointer;
    transition: transform 0.12s ease;
}

#settings-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.4s ease;
}

#settings-btn:active {
    transform: scale(0.88);
}

#settings-btn:active svg {
    transform: rotate(60deg);
}

#settings-btn.hidden {
    display: none;
}

#settings-modal {
    position: fixed;
    inset: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 4, 20, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#settings-modal.hidden {
    display: none;
}

#settings-modal.open {
    opacity: 1;
}

/* card pops in with a bouncy overshoot, leaves with a quick shrink */
#settings-modal.open .settings-card {
    animation: modalPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#settings-modal.closing .settings-card {
    animation: modalOut 0.22s ease both;
}

@keyframes modalPop {
    0% {
        transform: scale(0.6) translateY(46px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes modalOut {
    to {
        transform: scale(0.82) translateY(14px);
        opacity: 0;
    }
}

.settings-card {
    position: relative;
    width: 100%;
    max-width: 340px;
    padding: 24px 22px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(34, 28, 74, 0.97) 0%, rgba(16, 12, 42, 0.97) 100%);
    border: 2px solid rgba(255, 200, 61, 0.55);
    box-shadow: 0 0 35px rgba(255, 200, 61, 0.25), 0 18px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#settings-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 230, 170, 0.7);
    font-size: 17px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

#settings-close:active {
    transform: scale(0.85);
    color: #ffd76a;
}

.settings-title {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 22px;
    text-align: center;
    letter-spacing: 2px;
    background: linear-gradient(180deg, #fff7d6 0%, #ffd76a 38%, #f0a818 62%, #ffe27a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 0 #7a4d00) drop-shadow(0 0 10px rgba(255, 200, 61, 0.4));
}

.profile-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 200, 61, 0.25);
}

#profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 24px;
    color: #1a1033;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    box-shadow: 0 0 14px rgba(255, 200, 61, 0.5);
}

#profile-name {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 19px;
    color: #ffe9a0;
    letter-spacing: 1px;
}

.profile-balance-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 3px;
}

.coin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3c4 0%, #ffc83d 45%, #c87d00 100%);
    box-shadow: 0 0 8px rgba(255, 200, 61, 0.7);
}

#profile-balance {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 17px;
    background: linear-gradient(180deg, #fff7d6 0%, #ffd76a 50%, #f0a818 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.currency-label {
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: rgba(255, 230, 170, 0.5);
    align-self: flex-end;
    margin-bottom: 2px;
}

#profile-mode-badge {
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #8ee8ff;
    border: 1px solid rgba(142, 232, 255, 0.55);
    border-radius: 8px;
    padding: 2px 7px;
    margin-left: 4px;
}

#profile-mode-badge.real {
    color: #a4ffb0;
    border-color: rgba(164, 255, 176, 0.55);
}

/* REAL / DEMO account switch */
.mode-switch {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 14px;
    padding: 5px;
}

.mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-btn .mode-name {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    color: rgba(255, 230, 170, 0.55);
}

.mode-btn .mode-balance {
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: rgba(255, 230, 170, 0.4);
}

.mode-btn.active {
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 55%, #e8a317 100%);
    box-shadow: 0 0 14px rgba(255, 200, 61, 0.5), 0 2px 0 #a36b00;
}

.mode-btn.active .mode-name,
.mode-btn.active .mode-balance {
    color: #1a1033;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-label {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 15px;
    letter-spacing: 1px;
    color: rgba(255, 230, 170, 0.85);
}

/* toggle switch */
.switch {
    width: 56px;
    height: 30px;
    border: none;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 230, 170, 0.25);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.switch::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6a6390;
    transition: left 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.switch.on {
    background: rgba(232, 163, 23, 0.35);
    border-color: rgba(255, 200, 61, 0.7);
}

.switch.on::after {
    left: 27px;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc83d 60%, #e8a317 100%);
    box-shadow: 0 0 10px rgba(255, 200, 61, 0.8);
}

/* volume slider */
#music-volume {
    width: 100%;
    accent-color: #ffc83d;
    cursor: pointer;
}

#logout-btn {
    font-family: 'TitanOne', Arial Black, sans-serif;
    font-size: 16px;
    letter-spacing: 2px;
    color: #ffb3b3;
    background: rgba(120, 20, 30, 0.35);
    border: 2px solid rgba(255, 100, 110, 0.45);
    border-radius: 14px;
    padding: 12px 0;
    cursor: pointer;
    transition: transform 0.1s ease;
}

#logout-btn:active {
    transform: scale(0.95);
}

@keyframes pulse {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 10px rgba(255, 200, 61, 0.4)); }
    50%      { transform: scale(1.06); filter: drop-shadow(0 0 28px rgba(255, 200, 61, 0.85)); }
}
