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

:root {
    --bg: #14142a;
    --bg-2: rgba(255, 255, 255, 0.055);
    --bg-3: rgba(255, 255, 255, 0.11);
    --border: rgba(255, 255, 255, 0.14);
    --text: #e9eaf5;
    --text-muted: #9b9fc2;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --danger: #ff6161;
    --warning: #ffb020;
    --success: #3ddc97;
    --tier-s: linear-gradient(135deg, #ffd700, #ffaa00);
    --tier-a: linear-gradient(135deg, #c0c0c0, #8a8d94);
    --tier-b: linear-gradient(135deg, #cd7f32, #8b4513);
    --tier-c: linear-gradient(135deg, #4a90e2, #357abd);
    --tier-d: linear-gradient(135deg, #27ae60, #1e8449);
    --tier-e: linear-gradient(135deg, #95a5a6, #7f8c8d);
    --accent-rate: linear-gradient(135deg, #ffd166, #ff8a3d);
    --accent-ranking: linear-gradient(135deg, #7c5cff, #00d4ff);
    --accent-upload: linear-gradient(135deg, #00e5a0, #00b8d9);
    --accent-create: linear-gradient(135deg, #ff5ca8, #a855f7);
    --brand-gradient: linear-gradient(135deg, #7c5cff, #00d4ff);
}

.glass-surface,
.top-bar, .main-btn, .modal-content, .curis-card, .curis-creator, .rate-controls,
.creator-badge, .counter-pill, .ranking-table-wrap, .dev-container, .rate-finished,
.upload-zone, .upload-preview, .upload-limit, .profile-header, .profile-section,
.ad-square, .user-menu, .rate-feedback, .prize-banner, .prize-card, .incentive-box,
.update-note, .stat-card, .ad-player, .admin-card, .admin-tabs, .upload-notice {
    /* Bajado de 16px a 8px: el desenfoque de vidrio es de los efectos más
       caros de repintar para el GPU, sobre todo detrás del fondo animado
       (ver animated-bg.js) -- a menor radio, menos costo por frame, y de
       paso el "vidrio" se ve menos lavado/brillante. */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

html, body {
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    min-height: 100vh;
    background-color: var(--bg);
}

canvas#bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: -1;
}

#bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.top-bar, .site-nav, .main-content, .page-content, .rate-finished {
    position: relative;
    z-index: 1;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }


.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}

.logo-mini {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: inline-flex;
    align-items: baseline;
    gap: 0.05em;
    color: var(--text);
}

.logo-c {
    color: var(--text);
    font-size: 1.4rem;
    margin-right: 1px;
}

.logo-fandom {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-left: 0.3em;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.user-name.authenticated {
    color: var(--text);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid var(--border);
    color: var(--text);
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-google {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-google:hover { background: var(--border); }

.google-icon {
    width: 16px;
    height: 16px;
}

/* Botón oficial de Google (invisible) superpuesto sobre .btn-google, ver
   renderRealGoogleButton() en app.js -- el usuario ve nuestro diseño pero
   el clic cae sobre el botón real de Google. */
.google-btn-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    min-width: 170px;
    z-index: 50;
}

.menu-btn {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    background: transparent;
    border: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}

.menu-btn:hover { background: var(--bg-3); }


.main-content {
    flex: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hero {
    text-align: center;
    padding: 1rem 0;
}

.brand-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -1.5px;
}

.brand-c {
    color: var(--text);
}

.brand-fandom {
    display: block;
    font-size: 0.4em;
    font-weight: 700;
    letter-spacing: 3px;
    margin-top: 0.4rem;
    text-transform: uppercase;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}


.buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 380px;
    margin: 0 auto;
}

.main-btn {
    padding: 0.85rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    background: var(--bg-2);
    text-align: left;
    width: 100%;
    text-decoration: none;
}

.main-btn:hover {
    background: var(--bg-3);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.btn-icon {
    font-size: 1.15rem;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.btn-label {
    flex: 1;
}

.btn-rate .btn-icon { background: var(--accent-rate); }
.btn-ranking .btn-icon { background: var(--accent-ranking); }
.btn-upload .btn-icon { background: var(--accent-upload); }
.btn-create .btn-icon { background: var(--accent-create); }

.btn-rate:hover { border-color: #ff8a3d; box-shadow: 0 10px 26px rgba(255, 138, 61, 0.25); }
.btn-ranking:hover { border-color: #7c5cff; box-shadow: 0 10px 26px rgba(124, 92, 255, 0.28); }
.btn-upload:hover { border-color: #00c9a7; box-shadow: 0 10px 26px rgba(0, 201, 167, 0.25); }
.btn-create:hover { border-color: #ff5ca8; box-shadow: 0 10px 26px rgba(255, 92, 168, 0.25); }


.ad-square {
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner-center .ad-large {
    aspect-ratio: 16 / 5;
    max-width: 728px;
    margin: 0 auto;
}


.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    display: none;
}

.modal-overlay.active { display: block; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 101;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-wide { max-width: 900px; }

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 30px;
    height: 30px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover { background: var(--border); }

.modal h2 {
    margin-bottom: 0.6rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.modal p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.muted { color: var(--text-muted); }
.hint { font-size: 0.8rem; color: var(--text-muted); }

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}

.btn-big { padding: 1rem; font-size: 1rem; }
.btn-ad { background: var(--primary); }

.btn-google-big {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.9rem;
}

.other-methods {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}


.rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.creator-badge {
    padding: 0.4rem 0.85rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text);
}

.counter-pill {
    padding: 0.4rem 0.85rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rate-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
}

.curis-card.swap-in { animation: swapIn 0.5s ease; }
.curis-card.swap-out { animation: swapOut 0.45s ease forwards; }

/* Deslizan verticalmente en vez de solo escalar -- da la sensación de
   "scrollear" al siguiente Curis, como un feed tipo TikTok, en vez de que
   la tarjeta simplemente aparezca/desaparezca en el lugar. */
@keyframes swapIn {
    from { opacity: 0; transform: translateY(45px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes swapOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-45px) scale(0.97); }
}

/* La tarjeta se adapta a la imagen: la altura la manda el Curi, no un
   formato fijo tipo TikTok. Así los memes con varias viñetas se ven
   completos y con su tamaño/calidad real, sin recortes. */
.curis-card {
    /* ancho fijo y cómodo para ver el Curi, sin importar su resolución:
       los chicos se agrandan hasta acá, los grandes se achican. */
    width: min(480px, 100%);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-2);
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    flex-direction: column;
}

.curis-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-3);
    min-height: 160px;
}

img.curis-image {
    display: block;
    margin: 0 auto;
    /* ocupa el ancho de la tarjeta, pero los Curis chicos NO se agrandan
       más de ~1.8x (lo fija app.js con img.style.width en el onload): así
       una imagen de baja resolución no queda toda borrosa. Queda centrada
       con franjas var(--bg-3) a los lados. El alto sale de la proporción
       real, con un tope para los muy verticales; nunca se recorta ni se
       deforma (object-fit: contain cubre el caso raro del Curi altísimo). */
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 72vh;
    object-fit: contain;
}

.curis-image-wrap .music-toggle-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
}

.curis-card > .curis-creator { padding: 0.9rem 1rem 0; text-align: center; border-top: none; background: none; }
.curis-card > .rate-controls { margin-top: 0.7rem; background: none; border: none; padding-bottom: 0; }
.curis-card > .rate-value { margin-top: 0.4rem; }
.curis-card > .rate-actions { margin: 0.8rem 0 1rem; }
.curis-card > .rate-feedback { margin: 0 1rem 1rem; }

.curis-creator {
    padding: 0.7rem 1rem;
    background: var(--bg-2);
    color: var(--text);
    font-weight: 500;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.rate-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.85rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.star-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-family: inherit;
    flex-shrink: 0;
}

.star-btn:hover { background: var(--border); }
.star-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.stars-display {
    display: flex;
    gap: 0.15rem;
    flex: 1;
    justify-content: center;
}

.star-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

.star-icon.active {
    color: var(--warning);
}

.star-icon.half {
    background: linear-gradient(90deg, var(--warning) 0%, var(--warning) 50%, var(--text-muted) 50%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rate-value {
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    min-height: 1.5rem;
}

.rate-actions {
    display: flex;
    justify-content: center;
}

.btn-confirm {
    max-width: 320px;
    padding: 0.85rem 1.5rem;
}

.rate-feedback {
    text-align: center;
    padding: 0.85rem;
    background: var(--bg-2);
    border: 1px solid var(--success);
    border-radius: 6px;
    color: var(--success);
    font-weight: 500;
}


.ranking-table-wrap {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead th {
    background: var(--bg-3);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.ranking-table tbody tr {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.ranking-table tbody tr:last-child { border-bottom: none; }
.ranking-table tbody tr:hover { background: var(--bg-3); }

.ranking-table td {
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text);
    vertical-align: middle;
}

.ranking-table .col-pos {
    width: 60px;
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
}

.ranking-table .col-name {
    font-weight: 500;
}

.ranking-table .col-avg {
    width: 110px;
    text-align: right;
    color: var(--warning);
    font-weight: 600;
}

.ranking-table .col-count {
    width: 110px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.rank-position-badge {
    display: inline-block;
    width: 32px;
    height: 24px;
    line-height: 24px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.rank-position-badge.top1 { background: var(--warning); color: #fff; border-color: var(--warning); }
.rank-position-badge.top2 { background: var(--text-muted); color: #fff; border-color: var(--text-muted); }
.rank-position-badge.top3 { background: var(--danger); color: #fff; border-color: var(--danger); }


.image-viewer { text-align: center; }

.image-viewer img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
}


.upload-zone {
    text-align: center;
    padding: 2rem;
    border: 1px dashed var(--border);
    border-radius: 6px;
    background: var(--bg-2);
}

.upload-container {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.upload-as {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.btn-upload-big {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-upload-big:hover { background: var(--primary-hover); }

.upload-icon { font-size: 1.1rem; }

.upload-preview {
    text-align: center;
    margin: 1rem 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.25rem;
}

.upload-preview img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 6px;
    margin: 0.75rem 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.upload-preview h3 { margin-bottom: 0.5rem; color: var(--text); }

.upload-limit {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-2);
    border: 1px solid var(--warning);
    border-radius: 6px;
    margin-top: 1rem;
}

.upload-limit h3 { color: var(--warning); margin-bottom: 0.6rem; }

.limit-icon { font-size: 2rem; margin-bottom: 0.5rem; }

.upload-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: left;
}

.upload-notice-icon { font-size: 1.1rem; line-height: 1; }
.upload-notice strong { color: var(--text); }


.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-tab {
    padding: 0.5rem 0.9rem;
    background: var(--bg-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
}

.admin-tab:hover { background: var(--bg-3); }
.admin-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.admin-danger-zone {
    margin-top: 2.5rem;
    padding: 1.25rem;
    border: 1px solid var(--danger);
    border-radius: 10px;
    background: rgba(255, 97, 97, 0.06);
}
.admin-danger-zone h3 { margin: 0 0 0.35rem; color: var(--danger); font-size: 1rem; }
.admin-danger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.admin-queue {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.admin-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.admin-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
}

.admin-card-body { padding: 0.75rem; }

.admin-card-creator { font-weight: 600; margin-bottom: 0.15rem; }

.admin-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.admin-card-actions .btn-primary,
.admin-card-actions .btn-secondary {
    flex: 1;
    margin-top: 0;
    width: auto;
    padding: 0.55rem 0.4rem;
    font-size: 0.78rem;
}

.ad-player {
    background: #252540;
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    margin: 1rem 0;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-countdown {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin: 0.5rem 0;
}

.modal-success { text-align: center; }

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.dev-container {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.dev-icon-big { font-size: 3.5rem; margin-bottom: 1rem; }

.dev-container h2 {
    color: var(--warning);
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.dev-message {
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.dev-container .btn-secondary { margin-top: 1.5rem; }





.rate-finished {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-2);
    border: 1px solid var(--success);
    border-radius: 8px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

.rate-finished-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.rate-finished h2 {
    color: var(--success);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.rate-finished p {
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.rate-finished .btn-primary {
    max-width: 260px;
    margin: 0.25rem auto;
    display: block;
    text-align: center;
    text-decoration: none;
}


.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #fff;
    text-transform: uppercase;
}

.tier-badge.tier-S { background: var(--tier-s); color: #4a3500; }
.tier-badge.tier-A { background: var(--tier-a); color: #2c2f33; }
.tier-badge.tier-B { background: var(--tier-b); }
.tier-badge.tier-C { background: var(--tier-c); }
.tier-badge.tier-D { background: var(--tier-d); }
.tier-badge.tier-E { background: var(--tier-e); }
.tier-badge.tier-UN { background: var(--bg-3); color: var(--text-muted); }

.ranking-table .col-tier {
    width: 80px;
}


::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0d0d1a; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }


@media (max-width: 768px) {
    .top-bar { padding: 0.75rem 1rem; }
    .logo-mini { font-size: 1.1rem; }
    .btn-google { padding: 0.45rem 0.75rem; font-size: 0.8rem; }
    .user-name { display: none; }
    .main-content { padding: 1rem; }
    .buttons-grid { max-width: 100%; }
    .main-btn { padding: 0.75rem 1rem; }
    .modal-content { padding: 1.25rem; }
    .rate-controls { gap: 0.75rem; padding: 0.75rem; }
    .star-btn { width: 36px; height: 36px; font-size: 1.2rem; }
    .star-icon { font-size: 1.4rem; }
    .ranking-table thead th,
    .ranking-table td { padding: 0.55rem 0.6rem; }
    .ranking-table .col-count { display: none; }
    .ad-banner-center .ad-large { aspect-ratio: 16 / 6; }
    .ad-banner-top, .ad-banner-bottom { min-height: 60px; }
    .ad-square-label .ad-square-tag { display: none; }
}

@media (max-width: 380px) {
    .top-bar { padding: 0.6rem 0.75rem; }
    .logo-mini { font-size: 1rem; }
    .main-content { padding: 0.75rem; }
    .page-content { padding: 1rem 0.85rem; }
    .buttons-grid { gap: 0.75rem; }
    .main-btn { padding: 0.65rem 0.85rem; gap: 0.6rem; }
    .rate-controls { gap: 0.5rem; padding: 0.6rem; }
    .ad-banner-top, .ad-banner-bottom { min-height: 50px; font-size: 0.65rem; }
}


.page-content {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.95rem;
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-back-home:hover {
    background: var(--bg-3);
    border-color: var(--primary);
    color: #fff;
}

.page-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.ad-banner-top, .ad-banner-bottom {
    width: 100%;
    min-height: 80px;
    margin: 0 auto;
}

.ad-square.ad-wide {
    aspect-ratio: 16 / 5;
    max-width: 728px;
}

.ad-square-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.ad-square-label .ad-square-tag {
    font-size: 0.65rem;
    opacity: 0.7;
}


.profile-header {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-wrap: wrap;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    border: 1px solid var(--border);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-edit:hover { background: var(--border); }

.profile-id { flex: 1; min-width: 200px; }

.profile-username-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.profile-username {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.profile-edit-btn {
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-edit-btn:hover {
    background: var(--border);
    color: var(--text);
}

.profile-joined {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

.profile-bio-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.profile-bio {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    word-break: break-word;
}

.profile-bio.is-empty { color: var(--text-muted); font-style: italic; }


.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.stat-card {
    padding: 1.25rem 0.75rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
}

.stat-icon { font-size: 1.4rem; margin-bottom: 0.3rem; color: var(--text-muted); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.2rem;
}


.profile-section {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.profile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}


.profile-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.6rem;
}

.profile-gallery-item {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
}

.profile-gallery-item:hover { border-color: var(--primary); }

.profile-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: flex-end;
    padding: 0.4rem;
    font-size: 0.7rem;
    color: white;
}

.profile-gallery-item:hover .profile-gallery-overlay { opacity: 1; }


.profile-empty { text-align: center; padding: 2rem 1rem; }
.profile-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; color: var(--text-muted); }
.profile-empty p { color: var(--text-muted); margin-bottom: 1rem; }
.profile-empty .btn-confirm { display: inline-block; max-width: 240px; text-decoration: none; }


.legal-content .legal-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.legal-quicknav {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.legal-quicknav a {
    padding: 0.4rem 0.9rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
}

.legal-quicknav a:hover { border-color: var(--primary); }

.legal-content h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.75rem 0 0.75rem;
    scroll-margin-top: 1rem;
}

.legal-content h2:first-of-type { margin-top: 0; }

.legal-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.85rem;
    font-size: 0.92rem;
}

.legal-content ul {
    margin: 0 0 0.85rem 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.92rem;
}

.legal-content li { margin-bottom: 0.35rem; }
.legal-content strong { color: var(--text); }


.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1.25rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: underline;
}

.site-footer a:hover { color: var(--text); }


.profile-settings { display: flex; flex-direction: column; gap: 0.75rem; }

.profile-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: #252540;
    border: 1px solid var(--border);
    border-radius: 6px;
    flex-wrap: wrap;
}

.profile-setting-row strong { font-weight: 600; color: var(--text); }
.profile-setting-row p { margin: 0.15rem 0 0; font-size: 0.8rem; }


.btn-small { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

.btn-secondary {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover { background: var(--border); }

.btn-danger { border-color: var(--warning); color: var(--warning); }
.btn-danger:hover { background: rgba(214,137,16,0.12); }

.btn-danger-strong { border-color: var(--danger); color: var(--danger); }
.btn-danger-strong:hover { background: rgba(192,57,43,0.12); }


.modal-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    flex: 1;
    margin-top: 0;
}


@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-header { padding: 1rem; gap: 1rem; }
    .profile-avatar { width: 70px; height: 70px; font-size: 1.8rem; }
    .profile-username { font-size: 1.2rem; }
    .stat-value { font-size: 1.3rem; }
    .ranking-table .col-avg { width: 80px; }
    .rank-position-badge { width: 28px; height: 22px; line-height: 22px; font-size: 0.7rem; }
}


.prize-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(255, 138, 61, 0.06)), var(--bg-2);
    border: 1px solid rgba(255, 176, 32, 0.35);
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.08), 0 12px 30px rgba(255, 138, 61, 0.1);
    text-align: left;
}

.prize-banner-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(255, 176, 32, 0.5));
}

.prize-banner-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.prize-banner-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.prize-banner-text strong {
    color: var(--warning);
    font-weight: 700;
}

.prize-banner-text.hint {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    opacity: 0.85;
}


.incentive-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 3px solid #7c5cff;
    border-radius: 10px;
    text-align: left;
}

.incentive-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.incentive-text strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.incentive-text p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.incentive-text p:last-child { margin-bottom: 0; }

.incentive-highlight {
    color: var(--success) !important;
    font-weight: 600;
}


.update-note {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.update-note strong { color: var(--text); }

.update-note-icon { font-size: 1.1rem; flex-shrink: 0; }


.prize-card {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.1), rgba(255, 138, 61, 0.04)), var(--bg-2);
    border: 1px solid rgba(255, 176, 32, 0.35);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(255, 138, 61, 0.1);
}

.prize-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.prize-card-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px rgba(255, 176, 32, 0.5));
}

.prize-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.prize-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.prize-card-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--warning);
    text-align: center;
    margin: 0.5rem 0 1.25rem;
    letter-spacing: -1px;
}

.prize-card-currency {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.prize-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.prize-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.prize-meta-row strong { color: var(--text); }

.prize-card-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
}

.prize-card-hint strong { color: var(--warning); }


@media (max-width: 640px) {
    .prize-banner, .incentive-box { flex-direction: column; }
    .prize-card-amount { font-size: 2rem; }
}

/* ---------- selector de música (subir.html) ---------- */

select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

.music-picker,
.country-picker {
    width: 100%;
    max-width: 420px;
    margin: 1rem auto;
    text-align: left;
}

.music-picker label,
.country-picker label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* mini reproductor para elegir desde qué parte suena la canción */
.music-trim {
    margin-top: 0.7rem;
    padding: 0.7rem;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 0.6rem;
    background: var(--bg-3, rgba(255, 255, 255, 0.04));
}

.music-trim-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.music-trim-row input[type="range"]:disabled {
    opacity: 0.4;
}

.music-trim-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.music-trim-play {
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-trim-row input[type="range"] {
    flex: 1 1 auto;
    accent-color: var(--primary);
    min-width: 0;
}

.music-trim-time {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 2.4rem;
    text-align: right;
}

.music-trim .hint {
    margin-top: 0.4rem;
}

/* ---------- botón de música en la barra lateral de calificar.html ---------- */

.music-toggle-btn {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: none;
    background: rgba(20, 20, 42, 0.65);
    color: var(--text);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s, transform 0.15s;
}

.music-toggle-btn:hover { background: rgba(20, 20, 42, 0.85); }
.music-toggle-btn.playing { background: var(--primary); animation: musicPulse 1.2s ease-in-out infinite; }

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

/* ---------- rango de calificador (perfil.html) ---------- */

.rank-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.rank-progress-wrap { flex: 1; min-width: 200px; }

.rank-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: var(--bg-3);
    overflow: hidden;
}

.rank-progress-fill {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.rank-section .hint { margin-top: 0.6rem; }

/* ---------- toast de +XP estilo moneda al calificar ---------- */

.xp-toast {
    position: fixed;
    top: 5.5rem;
    right: 1.25rem;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #4a3500;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    animation: xpToastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               xpToastOut 0.4s ease forwards 1.6s;
    pointer-events: none;
}

.xp-toast-coin {
    display: inline-block;
    animation: xpCoinSpin 0.6s linear infinite;
}

@keyframes xpCoinSpin {
    0% { transform: scaleX(1) rotate(0deg); }
    50% { transform: scaleX(-1) rotate(0deg); }
    100% { transform: scaleX(1) rotate(0deg); }
}

@keyframes xpToastIn {
    from { opacity: 0; transform: translateY(10px) scale(0.7); }
    to { opacity: 1; transform: translateY(-6px) scale(1); }
}

@keyframes xpToastOut {
    from { opacity: 1; transform: translateY(-6px) scale(1); }
    to { opacity: 0; transform: translateY(-24px) scale(0.85); }
}

/* ---------- easter egg: nombre del Curis hecho polvo (calificar.html) ---------- */

.curis-creator {
    position: relative;
    cursor: default;
}

.curis-creator.dust-active {
    color: transparent;
    transition: color 0.4s ease;
}

.dust-particle {
    position: absolute;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.9;
    pointer-events: none;
    animation: dustDrift 0.9s ease-out forwards;
}

@keyframes dustDrift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.9; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

/* ---------- botón flotante de Patreon (index.html) ---------- */

.patreon-float-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem 0.7rem 0.9rem;
    background: #f96854;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: padding-right 0.2s, background 0.15s;
}

.patreon-float-btn:hover { background: #e5573f; }
.patreon-icon { font-size: 1.1rem; }

@media (max-width: 640px) {
    .patreon-float-btn span:last-child { display: none; }
    .patreon-float-btn { padding: 0.7rem; border-radius: 999px 0 0 999px; }
    .xp-toast { top: auto; bottom: 1.25rem; right: 1rem; }
}

/* ---------- calificar.html: tarjeta que se adapta a la imagen ---------- */

@media (max-width: 640px) {
    .curis-card { border-radius: 10px; }
    img.curis-image { max-height: 68vh; }
}

/* ---------- páginas de contenido (cómo funciona, guía, FAQ, novedades) ---------- */

.content-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.content-nav a {
    padding: 0.4rem 0.85rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: border-color 0.15s, color 0.15s;
}

.content-nav a:hover { border-color: var(--primary); color: var(--text); }
.content-nav a[aria-current="page"] { border-color: var(--primary); color: var(--text); background: var(--bg-2); }

.legal-content .content-lead {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.legal-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.25rem 0 0.5rem;
}

.legal-content ol {
    margin: 0 0 0.85rem 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.92rem;
}

.legal-content ol li { margin-bottom: 0.4rem; }

.faq-item { border-bottom: 1px solid var(--border); padding: 0.9rem 0; }
.faq-item:last-child { border-bottom: 0; }
.faq-item h3 { margin: 0 0 0.4rem; }
.faq-item p { margin-bottom: 0; }

.changelog-entry { margin-bottom: 1.5rem; }
.changelog-date {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.3px;
}
.changelog-entry h3 { margin: 0.2rem 0 0.5rem; }

/* ---------- galeria.html ---------- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-item {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-item-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bg-3);
    display: block;
}

.gallery-item-body { padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.2rem; }
.gallery-item-creator { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.gallery-item-meta { font-size: 0.8rem; color: var(--text-muted); }

.gallery-empty, .gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* bloque de texto introductorio en la home */
.home-about {
    max-width: 640px;
    margin: 0 auto;
    text-align: left;
    color: var(--text-muted);
    line-height: 1.65;
    font-size: 0.92rem;
}
.home-about h2 {
    text-align: center;
    color: var(--text);
    font-size: 1.15rem;
    margin-bottom: 0.85rem;
}
.home-about p { margin-bottom: 0.8rem; }
.home-about-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.25rem;
}
.home-about-links a {
    padding: 0.45rem 0.95rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.83rem;
    text-decoration: none;
    color: var(--text-muted);
}
.home-about-links a:hover { border-color: var(--primary); color: var(--text); }

/* ---------- bloque de sugerencias (home) ---------- */

.suggest-box {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem 1.25rem;
}

.suggest-box h2 {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.suggest-box p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 1.1rem;
}

.btn-suggest {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.35rem;
    background: var(--brand-gradient, linear-gradient(135deg, #8b5cf6, #00d4ff));
    color: #fff;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 999px;
    border: 0;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-suggest:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.35);
}

/* ---------- botón nuevo del calcador en la home ---------- */

.btn-calcador .btn-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.btn-calcador:hover { border-color: #f59e0b; box-shadow: 0 10px 26px rgba(245, 158, 11, 0.25); }

/* ---------- cursor personalizado (bolita blanca, solo pantallas con mouse) ---------- */

@media (pointer: fine) {
    html.cf-cursor-on, html.cf-cursor-on * { cursor: none !important; }
}

.cf-cursor {
    position: fixed;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 2px 12px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 2147483647;
    transition: width 0.13s ease, height 0.13s ease, margin 0.13s ease,
                background 0.13s ease, opacity 0.2s ease;
    will-change: transform;
}

.cf-cursor.is-down { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; }

.cf-cursor.is-link {
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.cf-cursor.is-hidden { opacity: 0; }

/* ---------- botón flotante discreto de la ruleta (home) ---------- */

.ruleta-float-btn {
    position: fixed;
    left: 0;
    bottom: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 999px 999px 0;
    font-size: 1.35rem;
    line-height: 1;
    opacity: 0.42;
    z-index: 40;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.ruleta-float-btn:hover {
    opacity: 1;
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.12);
}

/* ---------- ruleta.html ---------- */

.ruleta-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    text-align: center;
}

.ruleta-stage {
    position: relative;
    width: min(340px, 82vw);
    height: min(340px, 82vw);
}

.ruleta-stage canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    transition: transform 4.6s cubic-bezier(0.12, 0.62, 0.06, 1);
}

.ruleta-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 26px solid var(--warning);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
    z-index: 3;
}

.ruleta-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--warning);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.ruleta-balance {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 700;
    font-size: 1.05rem;
}

.ruleta-btn {
    padding: 0.85rem 2rem;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
    background: var(--brand-gradient);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.ruleta-btn:hover { transform: translateY(-2px); }
.ruleta-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.ruleta-result {
    min-height: 1.6rem;
    font-weight: 600;
    color: var(--warning);
}

.ruleta-note { color: var(--text-muted); font-size: 0.85rem; max-width: 460px; line-height: 1.6; }

.ruleta-odds {
    width: 100%;
    max-width: 460px;
    margin: 0.5rem auto 0;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ruleta-odds th, .ruleta-odds td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.ruleta-odds td:last-child, .ruleta-odds th:last-child { text-align: right; color: var(--text-muted); }

/* cuenta regresiva de anuncio (ruleta.html, independiente de app.js) */
.ruleta-ad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 22, 0.86);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.ruleta-ad-overlay.show { display: flex; }

.ruleta-ad-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.6rem;
    text-align: center;
    max-width: 340px;
}

.ruleta-ad-box .count {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.6rem 0;
}

/* ---------- menú de navegación principal (todas las páginas públicas) ---------- */

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.15rem 0.3rem;
    padding: 0.45rem 1rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.site-nav a {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover { background: var(--bg-3); color: var(--text); }
.site-nav a[aria-current="page"] { background: var(--bg-3); color: var(--text); }

@media (max-width: 560px) {
    .site-nav {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .site-nav a { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
}

/* ---------- blog.html ---------- */

.blog-card {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--border);
}

.blog-card:last-child { border-bottom: 0; }

.blog-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
}

.blog-card h2 a { color: var(--text); }
.blog-card h2 a:hover { color: var(--primary); }

.blog-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.blog-card p { margin-bottom: 0.6rem; }

.blog-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.blog-next {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.blog-next h2 { font-size: 1rem; margin-bottom: 0.6rem; }

.blog-next ul { list-style: none; margin: 0; padding: 0; }
.blog-next li { margin-bottom: 0.4rem; }
.blog-next a { color: var(--primary); font-weight: 600; }
