/* ============================================================
   JAKOMI TCG CAFÉ – Portal Cautivo
   Tipografía: Nunito (servida localmente)
   Paleta: café dorado / warm brown brand
   ============================================================ */

/* ---------- FUENTES LOCALES (sin internet requerido) ---------- */
@font-face {
    font-family: 'Nunito';
    src: url('/static/fonts/Nunito-Light.woff2') format('woff2');
    font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Nunito';
    src: url('/static/fonts/Nunito-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Nunito';
    src: url('/static/fonts/Nunito-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Nunito';
    src: url('/static/fonts/Nunito-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Nunito';
    src: url('/static/fonts/Nunito-ExtraBold.woff2') format('woff2');
    font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Nunito';
    src: url('/static/fonts/Nunito-Black.woff2') format('woff2');
    font-weight: 900; font-style: normal; font-display: swap;
}

/* ---------- VARIABLES ---------- */
:root {
    --brown-primary:  #C4956A;
    --brown-dark:     #8B5E3C;
    --brown-deep:     #5C3A1E;
    --brown-light:    #E8C99A;
    --bg-dark:        #16100A;
    --bg-card:        rgba(34, 20, 8, 0.88);
    --bg-input:       rgba(0, 0, 0, 0.28);
    --text-light:     #F5EFE6;
    --text-muted:     #9A7E63;
    --accent:         #E0BA88;
    --error:          #E07878;
    --success:        #72C472;
    --border-glass:   rgba(196, 149, 106, 0.18);
    --border-input:   rgba(196, 149, 106, 0.28);
    --radius-card:    24px;
    --radius-input:   13px;
    --radius-btn:     13px;
}

/* ---------- RESET ---------- */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 16px 48px;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- FONDO DECORATIVO ---------- */
.bg-blobs {
    position: fixed; inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0;
    animation: blobIn 1.2s ease forwards;
}
.blob-1 {
    width: 480px; height: 480px;
    background: radial-gradient(circle, #C4956A, transparent 70%);
    top: -160px; left: -140px;
    animation-delay: 0s;
}
.blob-2 {
    width: 360px; height: 360px;
    background: radial-gradient(circle, #7D4E2A, transparent 70%);
    bottom: -80px; right: -80px;
    animation-delay: .2s;
}
.blob-3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, #E8C99A, transparent 70%);
    top: 45%; left: 55%;
    opacity: 0;
    animation-delay: .4s;
}
@keyframes blobIn {
    to { opacity: 0.28; }
}

/* ---------- LAYOUT ---------- */
.portal-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fadeUp .65s cubic-bezier(.16,1,.3,1);
}

/* ---------- HEADER ---------- */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 8px;
    text-align: center;
}

.mascot-wrap {
    width: 130px; height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 24px rgba(196,149,106,0.35));
    animation: floatMascot 4s ease-in-out infinite;
    margin-bottom: 6px;
}

.mascot-img {
    width: 118px; height: 118px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.brand-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 2.8rem;
    letter-spacing: 5px;
    color: var(--brown-primary);
    line-height: 1;
    text-shadow: 0 2px 20px rgba(196,149,106,0.45);
}

.brand-sub {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 6px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 400;
}

/* ---------- CARD ---------- */
.portal-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow:
        0 24px 64px rgba(0,0,0,0.55),
        0 0 0 1px rgba(196,149,106,0.06) inset,
        0 1px 0 rgba(255,255,255,0.04) inset;
}

/* ---------- TABS ---------- */
.tabs-nav {
    display: flex;
    background: rgba(0,0,0,0.35);
    border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
    flex: 1;
    padding: 16px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: color .2s, background .2s;
    position: relative;
    letter-spacing: 0.2px;
}

.tab-btn:hover {
    color: var(--text-light);
    background: rgba(196,149,106,0.06);
}

.tab-btn.active { color: var(--brown-light); }

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 12%; width: 76%;
    height: 2.5px;
    background: linear-gradient(90deg, var(--brown-deep), var(--brown-primary), var(--brown-light));
    border-radius: 2px 2px 0 0;
}

/* ---------- TAB PANES ---------- */
.tab-pane {
    display: none;
    padding: 26px 24px 30px;
    animation: fadeIn .3s ease;
}
.tab-pane.active { display: block; }

.tab-hint {
    font-size: 0.83rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 22px;
    line-height: 1.5;
    font-weight: 400;
}

/* ---------- FORMS ---------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding-left: 4px;
}

.field input {
    background: var(--bg-input);
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-input);
    padding: 14px 16px;
    color: var(--text-light);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: border-color .2s, box-shadow .2s, background .2s;
    width: 100%;
    outline: none;
}

.field input::placeholder {
    color: rgba(154, 126, 99, 0.45);
    font-weight: 400;
}

.field input:focus {
    border-color: var(--brown-primary);
    background: rgba(0,0,0,0.42);
    box-shadow: 0 0 0 3px rgba(196,149,106,0.14);
}

/* ---------- CHECKBOX ---------- */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
}

.checkbox-row input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--brown-primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-row label {
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.45;
    font-weight: 500;
}

.checkbox-row a {
    color: var(--brown-primary);
    text-decoration: none;
    font-weight: 700;
}
.checkbox-row a:hover { text-decoration: underline; }

/* ---------- BUTTONS ---------- */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #D4A574, var(--brown-dark));
    border: 1px solid rgba(196,149,106,0.35);
    border-radius: var(--radius-btn);
    color: #1A0E05;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s, filter .18s;
    box-shadow: 0 4px 22px rgba(196,149,106,0.28), 0 1px 0 rgba(255,255,255,0.12) inset;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    border-radius: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(196,149,106,0.38);
    filter: brightness(1.07);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.btn-secondary {
    padding: 11px 24px;
    background: rgba(196,149,106,0.1);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--text-light);
    font-family: 'Nunito', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.btn-secondary:hover { background: rgba(196,149,106,0.2); }

/* ---------- ALERT ---------- */
.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    margin: 0 24px 4px;
    border-radius: 11px;
    background: rgba(224,120,120,0.1);
    border: 1px solid rgba(224,120,120,0.22);
    color: #E8A0A0;
    font-size: 0.84rem;
    line-height: 1.45;
    font-weight: 600;
}

/* ---------- DIVIDER ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 18px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-glass);
}

/* ---------- FOOTER ---------- */
.portal-footer {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(154,126,99,0.35);
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ---------- MODAL ---------- */
.modal {
    display: none;
    position: fixed; inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-box {
    background: #1c1008;
    border: 1px solid var(--border-glass);
    border-radius: 22px;
    padding: 30px 26px 26px;
    width: 100%;
    max-width: 460px;
    max-height: 82vh;
    overflow-y: auto;
    position: relative;
    animation: fadeUp .3s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 24px 64px rgba(0,0,0,0.75);
}

.modal-close {
    position: absolute;
    top: 18px; right: 20px;
    background: rgba(196,149,106,0.1);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    width: 30px; height: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color .2s, background .2s;
    font-weight: 700;
}
.modal-close:hover {
    color: var(--text-light);
    background: rgba(196,149,106,0.2);
}

.modal-box h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: var(--brown-light);
    font-size: 1.25rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-glass);
    letter-spacing: 0.3px;
}

.modal-body {
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 400;
}

.modal-body strong { color: var(--text-light); font-weight: 700; }
.modal-body ul { padding-left: 20px; }
.modal-body li { margin-bottom: 5px; }

/* ---------- SUCCESS STYLES ---------- */
.success-container { text-align: center; padding: 6px 0 2px; }

.success-ring {
    width: 78px; height: 78px;
    border-radius: 50%;
    background: rgba(114,196,114,0.09);
    border: 2px solid var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    margin: 0 auto 20px;
    font-size: 1.9rem;
    box-shadow: 0 0 30px rgba(114,196,114,0.18);
    animation: pulseGreen 2.8s ease-in-out infinite;
}

.success-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.75rem;
    color: var(--brown-light);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.success-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 500;
}

.stats-grid {
    background: rgba(0,0,0,0.22);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stat-row:first-child { padding-top: 0; }
.stat-row:last-child { border-bottom: none; padding-bottom: 0; }

.stat-lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-val {
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--text-light);
}

.stat-val.gold {
    color: var(--brown-primary);
    font-size: 1.15rem;
}

.loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 6px 0 2px;
}

.spinner {
    width: 24px; height: 24px;
    border: 2.5px solid rgba(196,149,106,0.15);
    border-top-color: var(--brown-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.redirect-note {
    font-size: 0.79rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

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

@keyframes pulseGreen {
    0%   { box-shadow: 0 0 0 0 rgba(114,196,114,0.4); }
    70%  { box-shadow: 0 0 0 16px rgba(114,196,114,0); }
    100% { box-shadow: 0 0 0 0 rgba(114,196,114,0); }
}

/* ---------- SCROLLBAR ---------- */
.modal-box::-webkit-scrollbar { width: 5px; }
.modal-box::-webkit-scrollbar-track { background: transparent; }
.modal-box::-webkit-scrollbar-thumb { background: rgba(196,149,106,0.2); border-radius: 4px; }
.modal-box::-webkit-scrollbar-thumb:hover { background: rgba(196,149,106,0.35); }

/* ---------- RESPONSIVE ---------- */
@media (max-height: 640px) {
    .mascot-wrap { width: 90px; height: 90px; }
    .mascot-img  { width: 82px; height: 82px; }
    .brand-name  { font-size: 2.2rem; }
    body { padding-top: 14px; }
}
