@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Gamja+Flower&family=Special+Elite&display=swap');

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0e0e0e;
    --bg-tertiary: #111111;
    --bg-hover: #1a1a1a;
    --accent: #f700ff;
    --accent-bright: #f9ec34;
    --accent-dim: #00fbff;
    --border: #1e1e1e;
    --border-mid: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #bbbbbb;
    --text-dim: #676767;
    --text-accent: #00ff0d;
    --font-mono: 'Gamja Flower', sans-serif;
    --font-display: 'Special Elite', system-ui;
}

body {
    background-color: #0a0a0a;
    background-image: repeating-linear-gradient(
        45deg,
        #111 0px,
        #111 1px,
        transparent 1px,
        transparent 50%
    );
    background-size: 8px 8px;
    /* background-color: var(--bg-primary); */
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--text-primary);
}

h4 {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent-dim);
    margin-bottom: 8px;
}

/* ===== HEADER ===== */
header {
    background-color: #000000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23766f00' fill-opacity='0.4' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    /* background: var(--bg-tertiary); */
    border-bottom: 2px solid var(--accent);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 a {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--accent-bright);
    letter-spacing: 3px;
    text-decoration: none;
}

header h1 a:hover {
    color: var(--text-primary);
}

nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-secondary);
    font-size: 11px;
    border: 1px solid var(--border-mid);
    padding: 3px 8px;
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.15s;
}

nav a:hover {
    color: var(--accent-bright);
    border-color: var(--accent);
}

nav a.active {
    color: var(--accent-bright);
    border-color: var(--accent);
}

/* ===== MARQUEE ===== */
.marquee-bar {
    background: #0a141a;
    border-bottom: 1px solid var(--accent-dim);
    padding: 4px 0;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-bar p {
    display: inline-block;
    animation: marquee 30s linear infinite;
    font-size: 11px;
    color: var(--text-dim);
}

@keyframes marquee {
    from { transform: translateX(100vw); }
    to { transform: translateX(-100%); }
}

/* ===== LAYOUT ===== */
.wrapper {
    display: grid;
    grid-template-columns: 180px 1fr;
    flex: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
    background-color: #000000;
    background-image: url("data:image/svg+xml,%3Csvg width='42' height='44' viewBox='0 0 42 44' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Page-1' fill='none' fill-rule='evenodd'%3E%3Cg id='brick-wall' fill='%235b0070' fill-opacity='0.4'%3E%3Cpath d='M0 0h42v44H0V0zm1 1h40v20H1V1zM0 23h20v20H0V23zm22 0h20v20H22V23z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    /* background: var(--bg-secondary);   -  Version anterior del background de la sidebar */
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {}

.sidebar-label {
    font-size: 20px;
    color: var(--accent-bright);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--accent-dim);
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.sidebar-item {
    font-size: 18px;
    color: var(--text-secondary);
    padding: 3px 0 3px 8px;
    border-left: 2px solid transparent;
    margin-bottom: 2px;
    display: block;
    text-decoration: none;
    transition: all 0.15s;
}

.sidebar-item:hover,
.sidebar-item.active {
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.disc-box {
    background: var(--bg-hover);
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    padding: 8px;
    text-align: center;
}

.disc-box .disc-label {
    font-size: 9px;
    color: var(--text-dim);
    display: block;
}

.disc-box .disc-count {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--accent-bright);
    display: block;
    line-height: 1;
}

.disc-box .disc-sub {
    font-size: 9px;
    color: var(--text-dim);
    display: block;
}

.sidebar-gif {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    display: block;
}

/* ===== MAIN CONTENT ===== */
main {
    padding: 20px 24px;
    background: var(--bg-primary);
}

.section-header {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ===== POST CARDS ===== */
.post-card {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    padding: 8px 20px;
    margin-bottom: 8px;
    border-radius: 0 2px 2px 0;
    transition: border-color 0.15s;
}

.post-card:hover {
    border-color: var(--accent-bright);
    border-left-color: var(--accent-bright);
}

.post-card h2,
.post-card h3 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: normal;
}

.post-card h2 a,
.post-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.post-card h2 a:hover,
.post-card h3 a:hover {
    color: var(--accent-bright);
}

.post-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.post-excerpt {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.post-tag {
    display: inline-block;
    font-size: 9px;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    padding: 1px 6px;
    border-radius: 1px;
    margin-top: 8px;
    margin-right: 4px;
}

/* ===== FOOTER ===== */
footer {
    background: #080808;
    border-top: 1px solid var(--border);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    font-size: 10px;
    color: var(--text-dim);
}

.footer-gifs {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ===== FORMS ===== */
form p {
    margin-bottom: 10px;
}

form label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

form input,
form textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-mid);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 2px;
    width: 100%;
    transition: border-color 0.15s;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

form button,
.btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
}

form button:hover,
.btn:hover {
    background: var(--accent);
    color: var(--text-primary);
}

/* ===== UTILIDADES ===== */
.text-accent { color: var(--accent-bright); }
.text-dim { color: var(--text-dim); }
.text-display { font-family: var(--font-display); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ===== WELCOME BOX ===== */
.welcome-box {
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: 0 2px 2px 0;
    margin-bottom: 8px;
}

.welcome-title {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--accent-bright);
    margin-bottom: 10px;
}

.welcome-text {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 14px;
}

.welcome-links {
    display: flex;
    gap: 10px;
}

/* ===== GAMES GRID ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.game-card {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 12px 14px;
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.15s;
    display: block;
}

.game-card:hover {
    border-color: var(--accent);
}

.game-title {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.game-desc {
    font-size: 11px;
    color: var(--text-dim);
}

/* ===== POST DETAIL ===== */
.post-full {
    margin-bottom: 24px;
}

.post-full-title {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--text-primary);
    font-weight: normal;
    margin-bottom: 6px;
}

.post-image {
    margin: 16px 0;
}

.post-image img {
    max-width: 100%;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
}

.post-content {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.2;
    margin-top: 16px;
}

/* ===== COMMENTS ===== */
.comment-card {
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-mid);
    background: var(--bg-secondary);
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 0 2px 2px 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 20px;
    color: var(--accent-bright);
    margin-right: 8px;
}

.comment-date {
    font-size: 16px;
    color: var(--text-dim);
}

.comment-content {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.comment-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vote-btn {
    font-size: 11px;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 2px;
    transition: all 0.15s;
}

.vote-btn:hover { color: var(--accent-bright); border-color: var(--accent); }
.vote-btn.active { color: var(--accent-bright); border-color: var(--accent); }
.vote-btn.dislike:hover { color: #4a9eff; border-color: #4a9eff; }
.vote-btn.active-dislike { color: #4a9eff; border-color: #4a9eff; }

.vote-display {
    font-size: 11px;
    color: var(--text-dim);
}

.delete-btn {
    font-size: 11px;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 2px;
    transition: all 0.15s;
}

.delete-btn:hover { color: #e74c3c; border-color: #e74c3c; }

.comment-avatar {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    display: block;
}

.comment-avatar-placeholder {
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--accent-bright);
}

/* ===== PROFILE ===== */
.profile-box {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: 0 2px 2px 0;
    margin-bottom: 8px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    display: block;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: var(--bg-hover);
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--accent-bright);
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-username {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--text-primary);
    line-height: 1;
}

.profile-bio {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.profile-discs {
    margin-left: auto;
    flex-shrink: 0;
    text-align: center;
}

/* ===== ABOUT ===== */
.about-box {
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    padding: 20px 24px;
    border-radius: 0 2px 2px 0;
}

.about-title {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--accent-bright);
    margin-bottom: 16px;
}

.about-content {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* ===== POST LIST ===== */
.post-card-image {
    margin-bottom: 10px;
}

.post-card-image img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    display: block;
}

.post-read-more {
    display: inline-block;
    font-size: 14px;
    color: var(--accent-bright);
    text-decoration: none;
    margin-top: 8px;
    transition: color 0.15s;
}

.post-read-more:hover {
    color: var(--text-primary);
}

/* ===== FORM BOX ===== */
.form-box {
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    padding: 20px 24px;
    border-radius: 0 2px 2px 0;
    max-width: 480px;
}

.form-title {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--accent-bright);
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 14px;
}

.form-field label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-help {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
    line-height: 1.5;
}

.form-error {
    font-size: 11px;
    color: var(--accent-bright);
    margin-top: 4px;
}

.form-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ===== ENTRIES ===== */
.entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.entry-card {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 12px 14px;
    border-radius: 2px;
    text-decoration: none;
    display: block;
    transition: all 0.15s;
}

.entry-card:hover {
    border-color: var(--accent);
}

.entry-title {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.entry-date {
    font-size: 10px;
    color: var(--text-dim);
}

/* ===== EMOJI PICKER ===== */
.comment-input-wrapper {
    position: relative;
}

.emoji-toggle-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
}

.emoji-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
}

.emoji-picker {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.emoji-picker.hidden { display: none; }

.emoji-picker-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.emoji-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.emoji-tab:hover { color: var(--text-secondary); }
.emoji-tab.active {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
}

.emoji-picker-body {
    padding: 8px;
    min-height: 80px;
    max-height: 160px;
    overflow-y: auto;
}

.emoji-pack { display: none; flex-wrap: wrap; gap: 4px; }
.emoji-pack.active { display: flex; }

.emoji-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    padding: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.emoji-item:hover { border-color: var(--border-mid); background: var(--bg-hover); }
.emoji-item img, .custom-emoji {
    width: 1.5em;
    height: 1.5em;
    object-fit: contain;
    vertical-align: middle;
}

/* ===== RESPONSIVE ===== */

/* Botón de menú — solo visible en móvil */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
}

.menu-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
}

@media (max-width: 768px) {

    /* Header */
    header {
        padding: 8px 14px;
    }

    header h1 a {
        font-size: 22px;
        letter-spacing: 1px;
    }

    .header-user {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .header-user a {
        font-size: 10px;
        padding: 2px 6px;
    }

    .menu-toggle {
        display: block;
        font-size: 18px;
        padding: 2px 8px;
    }

    /* Layout */
    .wrapper {
        grid-template-columns: 1fr;
    }

    /* Sidebar como drawer desde la derecha */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 200;
        border-right: none;
        border-left: 2px solid var(--accent);
        padding: 20px 16px;
        overflow-y: auto;
        transition: right 0.3s ease;
        display: flex;
    }

    .sidebar.open {
        left: 0;
    }

    /* Overlay oscuro detrás del sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 199;
    }

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

    /* Main ocupa todo */
    main {
        padding: 14px 14px;
    }

    /* Profile */
    .profile-box {
        flex-direction: column;
        gap: 12px;
    }

    .profile-discs {
        margin-left: 0;
    }

    /* Grids */
    .games-grid { grid-template-columns: 1fr 1fr; }
    .achievements-grid { grid-template-columns: 1fr 1fr; }
    .entries-grid { grid-template-columns: 1fr; }

    /* Form */
    .form-box { max-width: 100%; }

    /* Footer */
    footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 a {
        font-size: 18px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }
}