/* =========================================
   LinkInCactus.link — Design System
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* --- Variables dark mode (default) --- */
:root {
    --bg:         #0d0d0d;
    --surface:    #1a1a1a;
    --surface2:   #242424;
    --border:     #2e2e2e;
    --accent:     #00ff87;
    --accent-dim: #00cc6a;
    --danger:     #ff3c6e;
    --warn:       #ffb347;
    --text:       #f0f0f0;
    --text-muted: #888;
    --radius:     8px;
    --font-title: 'Orbitron', monospace;
    --font-body:  'DM Sans', sans-serif;
    --glow:       0 0 12px rgba(0,255,135,0.35);
    --shadow:     0 4px 24px rgba(0,0,0,0.6);
    --transition: 0.2s ease;
}

/* --- Light mode --- */
[data-theme="light"] {
    --bg:         #f2f2f2;
    --surface:    #ffffff;
    --surface2:   #e8e8e8;
    --border:     #d0d0d0;
    --accent:     #008c4a;
    --accent-dim: #006e39;
    --danger:     #d92b55;
    --warn:       #e0850a;
    --text:       #111111;
    --text-muted: #666;
    --glow:       0 0 12px rgba(0,140,74,0.25);
    --shadow:     0 4px 24px rgba(0,0,0,0.12);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-title);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

p { margin-bottom: 1rem; color: var(--text); }

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

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

/* --- Header --- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.logo {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: var(--glow);
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-link { color: var(--accent); }
.logo-in   { color: var(--text); }
.logo-cactus { color: var(--accent); }
.logo-tld  { color: var(--text-muted); font-weight: 600; }

/* --- Desktop nav (las 4 secciones principales) --- */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex: 1;
    justify-content: center;
}

.desktop-nav a {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--accent);
    background: rgba(0,255,135,0.08);
}

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

/* Elementos solo visibles en desktop */
.desktop-only {
    display: flex;
}

/* --- Theme toggle --- */
.theme-toggle {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: var(--glow);
}

/* --- Menú móvil (oculto por defecto) --- */
.mobile-menu {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    overflow-y: auto;
    max-height: calc(100vh - 64px);
}

.mobile-menu.open {
    display: block;
}

.mobile-menu-nav,
.mobile-menu-user {
    display: flex;
    flex-direction: column;
}

.mobile-menu-nav a,
.mobile-menu-user a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.92rem;
    color: var(--text);
    transition: background var(--transition);
}

.mobile-menu-nav a:hover,
.mobile-menu-user a:hover {
    background: var(--surface2);
    opacity: 1;
}

.mobile-menu-nav a.active {
    color: var(--accent);
    background: rgba(0,255,135,0.06);
}

.mobile-menu-sep {
    height: 1px;
    background: var(--border);
    margin: 0.3rem 1rem;
}

.mobile-notif-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 9px;
    margin-left: auto;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--accent-dim);
    box-shadow: var(--glow);
    opacity: 1;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: rgba(0,255,135,0.1);
    box-shadow: var(--glow);
    opacity: 1;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

/* --- Cards --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--accent);
    box-shadow: var(--glow), var(--shadow);
    transform: translateY(-3px);
}

.card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.card-body { padding: 1.25rem; }

.card-title {
    font-family: var(--font-title);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* --- Difficulty badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.diff-easy    { background: rgba(0,255,135,0.15); color: #00ff87; border: 1px solid #00ff87; }
.diff-medium  { background: rgba(255,179,71,0.15); color: #ffb347; border: 1px solid #ffb347; }
.diff-hard    { background: rgba(255,100,50,0.15); color: #ff6432; border: 1px solid #ff6432; }
.diff-hell    { background: rgba(255,60,110,0.15); color: #ff3c6e; border: 1px solid #ff3c6e; }

/* --- Score badge --- */
.score {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: var(--glow);
}

/* --- Progress bar --- */
.progress-bar {
    background: var(--surface2);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    box-shadow: var(--glow);
    transition: width 0.6s ease;
}

/* --- Hero section --- */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0,255,135,0.08), transparent);
    pointer-events: none;
}

.hero-title {
    margin-bottom: 1rem;
}

.hero-title .accent { color: var(--accent); text-shadow: var(--glow); }

.hero-sub {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto 2rem;
}

/* --- Section --- */
.section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.section-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,255,135,0.15);
}

textarea { resize: vertical; min-height: 120px; }

/* --- Alert messages --- */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border-left: 3px solid;
}

.alert-success { background: rgba(0,255,135,0.1); border-color: var(--accent); color: var(--accent); }
.alert-error   { background: rgba(255,60,110,0.1); border-color: var(--danger); color: var(--danger); }
.alert-warn    { background: rgba(255,179,71,0.1); border-color: var(--warn); color: var(--warn); }

/* --- Footer --- */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-logo {
    font-family: var(--font-title);
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
}

.pagination a, .pagination span {
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all var(--transition);
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* --- Hamburger (mobile) --- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Hamburger animación cuando está abierto */
.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Ficha de juego detalle (legacy, mantenido por compatibilidad) --- */
.game-detail {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.game-detail-sidebar {
    position: sticky;
    top: 80px;
}

/* --- Nuevo panel de juego full-width --- */
.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.6rem 1rem;
}

.game-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.game-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

/* --- Admin layout --- */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.admin-sidebar .logo {
    display: block;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 0.25rem;
}

.admin-nav a {
    display: block;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: all var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(0,255,135,0.08);
    color: var(--accent);
}

.admin-main {
    padding: 2rem;
}

/* --- Admin stats --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-num {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --- Admin tables --- */
.admin-main table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-main th,
.admin-main td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-main th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-main tr:hover td {
    background: var(--surface2);
}

/* =========================================
   Responsive
   ========================================= */

/* --- Tablet (≤ 900px): compactar nav desktop --- */
@media (max-width: 900px) {
    .desktop-nav a {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    .user-menu-name {
        display: none;
    }

    .user-menu-btn {
        padding: 0.25rem;
        border-radius: 50%;
    }
}

/* --- Mobile (≤ 768px): desktop nav → hamburger + mobile-menu --- */
@media (max-width: 768px) {
    /* Prevenir scroll horizontal */
    html, body {
        overflow-x: hidden;
    }

    /* Ocultar nav desktop y elementos desktop-only */
    .desktop-nav {
        display: none !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Mostrar hamburger */
    .hamburger {
        display: flex;
    }

    /* Header compacto */
    .header-inner {
        gap: 0.5rem;
        padding: 0 0.75rem;
        height: 56px;
    }

    .logo {
        font-size: 0.95rem;
    }

    .header-actions {
        gap: 0.4rem;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    /* Contenido general */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 3rem 0 2.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .game-detail {
        grid-template-columns: 1fr;
    }

    .game-detail-sidebar {
        position: static;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .container {
        padding: 0 0.75rem;
    }

    /* Game detail panel: portada encima */
    .game-detail-panel > div {
        flex-direction: column;
    }

    .game-detail-panel > div > div:first-child {
        width: 100% !important;
        text-align: center;
    }

    .game-detail-panel > div > div:first-child img {
        width: 180px !important;
        margin: 0 auto;
        display: block;
    }

    .game-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Small mobile (≤ 480px) --- */
@media (max-width: 480px) {
    .header-inner {
        height: 50px;
    }

    .logo {
        font-size: 0.82rem;
    }

    .header-actions {
        gap: 0.2rem;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .hamburger span {
        width: 18px;
    }

    .game-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-menu-nav a,
    .mobile-menu-user a {
        padding: 0.65rem 1rem;
        font-size: 0.88rem;
    }
}

/* =========================================
   Phase 2 — Notifications, User Menu, Votes,
   Profile, Game List
   ========================================= */

/* --- Notification bell & dropdown --- */
.notif-wrapper {
    position: relative;
    z-index: 201;
}

.notif-bell {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all var(--transition);
    position: relative;
    line-height: 1;
}

.notif-bell:hover {
    border-color: var(--accent);
    box-shadow: var(--glow);
    background: rgba(0,255,135,0.06);
}

.notif-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--surface);
    pointer-events: none;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: -60px;
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 300;
    max-height: 420px;
    overflow-y: auto;
    animation: dropdownFadeIn 0.15s ease;
}

.notif-dropdown.open {
    display: block;
}

/* Flechita del dropdown */
.notif-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 72px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    transform: rotate(45deg);
    z-index: 1;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    background: var(--surface);
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 1.1rem;
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--surface2);
    opacity: 1;
}

.notif-item.notif-unread {
    background: rgba(0,255,135,0.04);
    border-left: 3px solid var(--accent);
}

.notif-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 1px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    border-radius: 50%;
}

.notif-text {
    font-size: 0.82rem;
    line-height: 1.45;
    flex: 1;
    color: var(--text);
}

.notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.notif-empty::before {
    content: '🔕';
    display: block;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* --- Full notification list page --- */
.notif-list {
    display: flex;
    flex-direction: column;
}

.notif-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.notif-list-item:hover {
    background: var(--surface2);
    opacity: 1;
}

.notif-list-item.notif-unread {
    background: rgba(0,255,135,0.05);
    border-left: 3px solid var(--accent);
}

/* --- Dropdown animation --- */
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- User menu & dropdown --- */
.user-menu-wrapper {
    position: relative;
    z-index: 200;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    border-radius: 24px;
    cursor: pointer;
    color: var(--text);
    transition: all var(--transition);
}

.user-menu-btn:hover {
    border-color: var(--accent);
    background: rgba(0,255,135,0.06);
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-title);
    flex-shrink: 0;
}
img.user-avatar-sm {
    display: inline-block;
    object-fit: cover;
}

.user-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    font-family: var(--font-title);
    flex-shrink: 0;
    box-shadow: var(--glow);
}
img.user-avatar-lg {
    display: inline-block;
    object-fit: cover;
}

.user-menu-name {
    font-size: 0.82rem;
    font-weight: 500;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 210px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 300;
    padding: 0.4rem 0;
    animation: dropdownFadeIn 0.15s ease;
}

.user-dropdown.open {
    display: block;
}

/* Flechita del dropdown usuario */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    transform: rotate(45deg);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition);
    border-radius: 0;
}

.user-dropdown a:hover {
    background: var(--surface2);
    opacity: 1;
}

/* Separador en el dropdown */
.user-dropdown-sep {
    border-top: 1px solid var(--border);
    margin: 0.3rem 0;
}

/* --- Vote buttons --- */
.vote-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 40px;
    flex-shrink: 0;
}

.vote-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all var(--transition);
    padding: 0;
}

.vote-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.vote-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.vote-up.vote-active {
    background: rgba(0,255,135,0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.vote-down.vote-active {
    background: rgba(255,60,110,0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.vote-count {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    min-width: 24px;
}

/* --- Game list select --- */
.lista-juego-wrapper {
    flex-shrink: 0;
}

.lista-juego-select,
select.lista-juego-select {
    width: auto;
    min-width: 180px;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
}

.lista-juego-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,255,135,0.15);
}

/* --- Profile header --- */
.profile-header {
    position: relative;
}

.profile-header:hover {
    transform: none;
}

/* --- Profile color themes --- */
[data-profile-theme="purple"] {
    --accent: #a855f7;
    --glow: 0 0 12px rgba(168, 85, 247, 0.4);
}

[data-profile-theme="purple"] .user-avatar-lg,
[data-profile-theme="purple"] .user-avatar-sm {
    background: #a855f7;
}

[data-profile-theme="red"] {
    --accent: #ef4444;
    --glow: 0 0 12px rgba(239, 68, 68, 0.4);
}

[data-profile-theme="red"] .user-avatar-lg,
[data-profile-theme="red"] .user-avatar-sm {
    background: #ef4444;
}

[data-profile-theme="blue"] {
    --accent: #0b49f5;
    --glow: 0 0 12px rgba(11, 54, 245, 0.4);
}

[data-profile-theme="blue"] .user-avatar-lg,
[data-profile-theme="blue"] .user-avatar-sm {
    background: #0b49f5;
}

[data-profile-theme="gold"] {
    --accent: #f59e0b;
    --glow: 0 0 12px rgba(245, 158, 11, 0.4);
}

[data-profile-theme="gold"] .user-avatar-lg,
[data-profile-theme="gold"] .user-avatar-sm {
    background: #f59e0b;
}

/* --- Header login/register buttons --- */
.header-login-btn,
.header-register-btn {
    font-size: 0.8rem !important;
}

/* --- Auth pages (login/registro) --- */
.auth-card {
    max-width: 420px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Guide submission badge --- */
.badge-official {
    background: rgba(0,255,135,0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.badge-community {
    background: rgba(136,136,136,0.15);
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}

/* --- Admin: Estado badges for guides/users --- */
.estado-pendiente {
    background: rgba(255,179,71,0.15);
    color: var(--warn);
    border: 1px solid var(--warn);
}

.estado-aprobada {
    background: rgba(0,255,135,0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.estado-rechazada {
    background: rgba(255,60,110,0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* --- Responsive Phase 2 extras --- */
@media (max-width: 768px) {
    .vote-buttons {
        min-width: 32px;
    }

    .vote-btn {
        width: 28px;
        height: 24px;
        font-size: 0.7rem;
    }

    .profile-header .user-avatar-lg {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }

    /* Profile page: una sola columna */
    .profile-content-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- Utility --- */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
