:root {
    --felt-900: #050914;
    --felt-800: #0c1638;
    --felt-700: #101c47;
    --gold-500: #f5a623;
    --gold-400: #ffd966;
    --gold-200: #ffe9b3;
    --cream: #eef1ff;
    --ink: #0a0e1f;
    --ruby: #e0405f;
    --ruby-bright: #ff5c7c;
    --emerald-bright: #35d68f;
    --line: #1c2850;
    --line-strong: #2c3d78;
    --blue-400: #3d9bff;
    --blue-700: #0a3d91;
    --purple-400: #b57bff;
    --purple-600: #8b2fe0;

    --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
    --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); }
input, textarea, select { user-select: text; }
[hidden] { display: none !important; }

html, body {
    margin: 0; min-height: 100%;
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%, var(--felt-700) 0%, transparent 60%),
        radial-gradient(ellipse 700px 500px at 110% 20%, #1a1050 0%, transparent 55%),
        linear-gradient(180deg, var(--felt-800) 0%, var(--felt-900) 100%);
    background-attachment: fixed;
    color: var(--cream); font-family: var(--font-body); -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; }

.btn {
    border: 1px solid var(--line-strong); background: transparent; color: var(--cream);
    padding: 0.7rem 1.2rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
    cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--gold-500); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); border-color: transparent; color: var(--ink); }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); border: none; color: var(--ink); font-weight: 700; }
.btn-withdraw { background: linear-gradient(135deg, var(--blue-400), var(--blue-700)); border: none; color: #fff; font-weight: 700; }
.btn-ghost { background: var(--felt-800); }
.btn-small { padding: 0.5rem 0.9rem; font-size: 0.82rem; }
.link-btn { background: none; border: none; color: var(--gold-400); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }

.brand-logo {
    display: inline-flex; align-items: baseline; font-family: var(--font-display);
    letter-spacing: 0.02em; font-size: 1.5rem; line-height: 1;
}
.brand-logo .brand-juegos { color: var(--cream); }
.brand-logo .brand-k {
    background: linear-gradient(135deg, var(--purple-400), var(--purple-600));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-logo .brand-one { color: var(--cream); }

.preloader {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%, var(--felt-700) 0%, transparent 60%),
        radial-gradient(ellipse 700px 500px at 110% 20%, #1a1050 0%, transparent 55%),
        linear-gradient(180deg, var(--felt-800) 0%, var(--felt-900) 100%);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}
.preloader.preloader-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-badge {
    position: relative; width: 104px; height: 104px;
    display: flex; align-items: center; justify-content: center;
}
.preloader-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid var(--line-strong);
    border-top-color: var(--gold-400);
    border-right-color: var(--gold-500);
    animation: preloader-spin 0.85s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
.preloader-logo { position: relative; font-size: 1.7rem; }
.game-launch-overlay {
    position: fixed; inset: 0; z-index: 9999; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--felt-900);
}
.game-launch-bg {
    position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px);
    object-fit: cover; filter: blur(30px) brightness(0.35) saturate(1.2); transform: scale(1.1);
}
.game-launch-card { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: 1.5rem; }
.game-launch-poster {
    width: 240px; max-width: 72vw; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px;
    border: 2px solid var(--gold-500);
    animation: game-launch-pulse 1.4s ease-in-out infinite;
}
@keyframes game-launch-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,166,35,0.45); }
    50% { box-shadow: 0 0 0 14px rgba(245,166,35,0); }
}
.game-launch-text { margin: 0; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.02em; color: var(--gold-200); text-align: center; padding: 0 1rem; }
.game-launch-progress { width: 200px; max-width: 60vw; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.14); overflow: hidden; }
.game-launch-progress-bar {
    width: 40%; height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--gold-400), var(--gold-500));
    animation: game-launch-slide 1.1s ease-in-out infinite;
}
@keyframes game-launch-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(300%); }
}
@keyframes preloader-spin { to { transform: rotate(360deg); } }

.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.25rem 0.85rem; }
.auth-card {
    width: 100%; max-width: 380px; background: var(--felt-800);
    border: 1px solid var(--line-strong); border-radius: 12px; padding: 2rem 1.75rem;
}
.auth-brand { margin-bottom: 1.5rem; }
.auth-brand-img { display: block; width: 100%; height: auto; border-radius: 8px; }

.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.auth-tab { flex: 1; background: none; border: none; color: var(--cream); opacity: 0.5; padding: 0.6rem 0; font-weight: 600; font-size: 0.88rem; border-bottom: 2px solid transparent; cursor: pointer; }
.auth-tab.active { opacity: 1; border-bottom-color: var(--gold-500); color: var(--gold-400); }

.auth-form { display: none; flex-direction: column; gap: 0.9rem; }
.auth-form.active { display: flex; }
.auth-form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; color: var(--gold-200); }
.auth-form input { background: var(--felt-900); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0.65rem 0.8rem; color: var(--cream); font-size: 0.92rem; }
.auth-form input:focus { outline: none; border-color: var(--gold-500); }
.auth-error { color: var(--ruby-bright); font-size: 0.8rem; margin: -0.3rem 0 0; min-height: 1.1em; }

.lobby-screen { display: none; min-height: 100vh; flex-direction: column; }

.lobby-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.65rem 1.1rem; border-bottom: 1px solid var(--line);
    background: var(--felt-800); position: sticky; top: 0; z-index: 10;
}
.brand-mini { display: flex; align-items: center; gap: 0.55rem; }
.header-actions { display: flex; align-items: center; gap: 0.65rem; }
.header-balance {
    font-family: var(--font-mono); font-weight: 700; color: var(--gold-400); font-size: 0.95rem;
    background: var(--felt-900); border: 1px solid var(--line-strong); border-radius: 20px;
    padding: 0.4rem 0.85rem;
}

.lobby-main { flex: 1; max-width: 960px; margin: 0 auto; width: 100%; padding: 1rem; display: flex; flex-direction: column; gap: 1.25rem; }

.welcome-banner {
    position: relative; border-radius: 10px; border: 1px solid var(--line-strong);
    border-top: 3px solid var(--gold-500); background:
        radial-gradient(ellipse 480px 160px at 50% -20%, rgba(245,166,35,0.14) 0%, transparent 70%),
        var(--felt-800);
    padding: 1.6rem 1.5rem; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.3rem;
}
.welcome-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-500); }
.welcome-name { font-family: var(--font-display); font-size: 2rem; margin: 0; letter-spacing: 0.02em; color: var(--gold-200); line-height: 1.15; }
.welcome-username { margin: 0; font-family: var(--font-mono); font-size: 0.82rem; color: var(--cream); opacity: 0.55; }

.account-actions-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.account-actions-row .btn { flex: 1; min-width: 150px; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }

.games-floor h2 { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.03em; color: var(--gold-400); margin: 0 0 0.85rem; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.9rem; }
.games-empty { color: var(--gold-200); opacity: 0.6; grid-column: 1 / -1; text-align: center; padding: 2rem 0; }
.game-card {
    position: relative; background: var(--felt-800); border: 1px solid var(--line-strong); border-radius: 10px;
    padding: 1.25rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.6rem;
    overflow: hidden;
}
.game-card:hover { border-color: var(--gold-500); }

.live-badge {
    position: absolute; top: 0.6rem; left: 0.6rem; z-index: 2;
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: rgba(5,9,20,0.7); border: 1px solid rgba(255,92,124,0.5); border-radius: 20px;
    padding: 0.25rem 0.6rem 0.25rem 0.5rem; font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.03em; text-transform: uppercase; color: #fff;
}
.live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--ruby-bright); flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(255,92,124,0.65);
    animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,92,124,0.65); }
    70% { box-shadow: 0 0 0 8px rgba(255,92,124,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,92,124,0); }
}

.game-card-icon { font-size: 2.2rem; }
.game-card h3 { font-family: var(--font-display); font-size: 1.35rem; margin: 0; letter-spacing: 0.02em; }
.game-card p { margin: 0; color: var(--gold-200); opacity: 0.7; font-size: 0.85rem; flex: 1; }

/* Tarjeta con imagen: la imagen es un póster arriba, y el nombre +
   botón van debajo, en un panel con degradado azul. */
.game-card.has-image { padding: 0; align-items: stretch; gap: 0; }
.game-card-bg { position: static; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.game-card.has-image .game-card-content {
    width: 100%; padding: 0.9rem 1rem 1.1rem;
    background: linear-gradient(135deg, var(--blue-700), var(--felt-900));
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.game-card.has-image h3 { color: #fff; font-size: 1.15rem; }
.game-card.has-image p { display: none; }

.lobby-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.lobby-modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 20, 0.85); }
.lobby-modal-box {
    position: relative; z-index: 1; width: 100%; max-width: 400px; background: var(--felt-800);
    border: 1px solid var(--line-strong); border-radius: 12px; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.wallet-modal-box { max-width: 440px; }
.lobby-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.lobby-modal-header h3 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; letter-spacing: 0.02em; }
.lobby-modal-close { background: none; border: none; color: var(--cream); font-size: 1.5rem; cursor: pointer; line-height: 1; opacity: 0.7; }
.lobby-modal-body { padding: 1.25rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.9rem; }
.lobby-modal-body label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; color: var(--gold-200); }
.lobby-modal-body input, .lobby-modal-body select {
    background: var(--felt-900); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0.6rem 0.75rem; color: var(--cream); font-size: 0.9rem;
}
.lobby-modal-body input:disabled { opacity: 0.4; cursor: not-allowed; }
.lobby-modal-note { font-size: 0.78rem; color: var(--gold-200); opacity: 0.7; margin: 0; }
.lobby-modal-error { color: var(--ruby-bright); font-size: 0.82rem; margin: 0; min-height: 1.1em; }

.identity-divider { width: 100%; border: none; border-top: 1px solid var(--line); margin: 0.25rem 0; }
.identity-logout-btn { color: var(--ruby-bright); border-color: var(--line-strong); }
.identity-logout-btn:hover { border-color: var(--ruby-bright); }

.payment-instructions {
    background: var(--felt-900); border: 1px solid var(--line-strong); border-left: 3px solid var(--emerald-bright);
    border-radius: 6px; padding: 0.75rem 0.9rem; font-size: 0.82rem; white-space: pre-line; color: var(--cream);
}
.payout-account {
    background: var(--felt-900); border: 1px solid var(--line-strong); border-left: 3px solid var(--gold-500);
    border-radius: 6px; padding: 0.7rem 0.9rem; font-size: 0.82rem; line-height: 1.5;
}
.payout-account strong { color: var(--gold-400); }

.withdraw-fields { position: relative; overflow: hidden; border-radius: 10px; display: flex; flex-direction: column; gap: 0.75rem; }
.withdraw-locked-overlay {
    position: absolute; inset: 0; z-index: 5; box-sizing: border-box;
    background: rgba(5,9,20,0.94); border: 1px solid var(--ruby-bright); border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    gap: 0.7rem; padding: 1.5rem 1.25rem;
}
.withdraw-locked-overlay i { font-size: 1.5rem; color: var(--ruby-bright); }
.withdraw-locked-overlay p { margin: 0; font-size: 0.85rem; color: var(--cream); opacity: 0.85; line-height: 1.45; }

/* ---------------------------------------------------------
   Billetera: pestañas y paneles
   --------------------------------------------------------- */
.wallet-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 0.6rem; }
.wallet-tab {
    flex: 1; background: none; border: none; color: var(--cream); opacity: 0.55;
    padding: 0.65rem 0.3rem; font-weight: 700; font-size: 0.78rem; border-bottom: 2px solid transparent;
    cursor: pointer; white-space: nowrap;
}
.wallet-tab.active { opacity: 1; border-bottom-color: var(--gold-500); color: var(--gold-400); }
.wallet-modal-body { gap: 1rem; }
.wallet-panels-viewport { width: 100%; overflow-x: hidden; overflow-y: visible; transition: height 0.3s ease; }
.wallet-panels-track { display: flex; align-items: flex-start; width: 100%; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.wallet-panels-track .wallet-panel { flex: 0 0 100%; width: 100%; min-width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.wallet-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.wallet-panel-sub { margin: 0; font-size: 0.8rem; color: var(--cream); opacity: 0.7; }

.official-pm-card {
    background: var(--felt-900); border: 1px solid var(--emerald-bright); border-radius: 10px; padding: 0.8rem 0.9rem;
    display: flex; flex-direction: column; gap: 0.55rem;
}
.official-pm-loading { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.6rem 0; font-size: 0.82rem; color: var(--gold-200); opacity: 0.85; }
.pm-spinner {
    width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid var(--line-strong); border-top-color: var(--emerald-bright);
    animation: preloader-spin 0.7s linear infinite;
}
.official-pm-details { display: flex; flex-direction: column; gap: 0.55rem; }
.official-pm-header { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; font-weight: 700; color: var(--emerald-bright); }
.official-pm-badge { background: rgba(53,214,143,0.15); border: 1px solid var(--emerald-bright); border-radius: 20px; padding: 0.1rem 0.55rem; font-size: 0.68rem; }
.official-pm-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.official-pm-label { font-size: 0.68rem; color: var(--gold-200); opacity: 0.75; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; }
.official-pm-value-row { display: flex; align-items: center; gap: 0.5rem; }
.official-pm-value-row strong { font-size: 0.88rem; }
.copy-btn { background: var(--felt-800); border: 1px solid var(--line-strong); color: var(--cream); font-size: 0.68rem; padding: 0.22rem 0.5rem; border-radius: 20px; cursor: pointer; white-space: nowrap; }
.copy-btn:hover { border-color: var(--gold-500); }

.wallet-ref-label { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; color: var(--gold-200); font-weight: 700; letter-spacing: 0.03em; }
.wallet-ref-input {
    width: 100%; text-align: center; font-family: var(--font-mono); font-size: 1.6rem; letter-spacing: 0.4em;
    background: var(--felt-900); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0.7rem; color: var(--cream);
}
.wallet-ref-input:focus { outline: none; border-color: var(--gold-500); }

.wallet-minmax { margin: -0.4rem 0 0; font-size: 0.76rem; color: var(--gold-200); opacity: 0.75; text-align: center; }

.wallet-history { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.2rem; }
.wallet-history h4 { margin: 0 0 0.6rem; font-size: 0.76rem; color: var(--gold-200); opacity: 0.8; letter-spacing: 0.05em; }

.requests-list { display: flex; flex-direction: column; gap: 0.55rem; }
.requests-empty { color: var(--gold-200); opacity: 0.6; text-align: center; padding: 1.5rem 0; margin: 0; }
.request-row { display: flex; align-items: center; gap: 0.6rem; background: var(--felt-900); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.85rem; font-size: 0.85rem; }
.request-row .rq-type { font-size: 1.1rem; }
.request-row .rq-detail { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.request-row .rq-meta { font-size: 0.72rem; opacity: 0.6; }
.request-row .rq-amount { font-family: var(--font-mono); font-weight: 700; }
.request-row.status-pending .rq-amount { color: var(--gold-400); }
.request-row.status-approved .rq-amount { color: var(--emerald-bright); }
.request-row.status-rejected .rq-amount { color: var(--ruby-bright); text-decoration: line-through; opacity: 0.7; }
.rq-badge { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.12rem 0.45rem; border-radius: 4px; }
.rq-badge.status-pending { background: var(--felt-800); color: var(--gold-400); border: 1px solid var(--gold-500); animation: rq-pending-pulse 1.6s ease-in-out infinite; }
@keyframes rq-pending-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.rq-badge.status-approved { background: var(--felt-800); color: var(--emerald-bright); border: 1px solid var(--emerald-bright); }
.rq-badge.status-rejected { background: var(--felt-800); color: var(--ruby-bright); border: 1px solid var(--ruby-bright); }

.toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    background: var(--felt-800); border: 1px solid var(--gold-500); color: var(--cream);
    padding: 0.85rem 1.5rem; border-radius: 8px; font-size: 0.9rem; z-index: 300;
}
.toast.error { border-color: var(--ruby-bright); }

/* ---------------------------------------------------------
   Espaciado de iconos Font Awesome junto a texto
   --------------------------------------------------------- */
.btn i,
.wallet-tab i,
.lobby-modal-header h3 i,
.official-pm-header i,
.official-pm-badge i,
.official-pm-label i,
.lobby-modal-body label i,
.wallet-ref-label i,
.wallet-history h4 i,
.copy-btn i {
    margin-right: 0.45rem;
}
.game-card-icon i { font-size: inherit; }

@media (max-width: 640px) {
    .account-actions-row .btn { min-width: 0; }
    .welcome-name { font-size: 1.6rem; }
    .header-actions { gap: 0.5rem; }

    .games-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .game-card.has-image h3 { font-size: 0.95rem; }
    .game-card.has-image .game-card-content { padding: 0.65rem 0.55rem 0.85rem; gap: 0.4rem; }
    .game-card.has-image .play-btn { font-size: 0.78rem; padding: 0.5rem 0.6rem; width: 100%; }
}


/* ---------------------------------------------------------
   Aviso tipo push (recarga/retiro aprobado o rechazado)
   --------------------------------------------------------- */
.push-alert {
    position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
    z-index: 400; display: flex; align-items: center; gap: 0.6rem;
    background: var(--felt-800); border: 1px solid var(--emerald-bright);
    border-radius: 10px; padding: 0.8rem 1.1rem; max-width: 92vw;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    animation: push-alert-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.push-alert.push-error { border-color: var(--ruby-bright); }
.push-icon { font-size: 1.3rem; flex-shrink: 0; }
.push-text { font-size: 0.88rem; color: var(--cream); }
.push-close { background: none; border: none; color: var(--cream); opacity: 0.6; font-size: 1.2rem; cursor: pointer; margin-left: 0.3rem; flex-shrink: 0; }

@keyframes push-alert-in {
    from { opacity: 0; transform: translate(-50%, -14px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
