:root {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;

    color: #1f2937;
    background: #f5f7fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
}


/* ============================================================
   HEADER
   ============================================================ */

header {
    background: #111827;
    color: white;
    padding: 14px 4%;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.brand {
    font-weight: 800;
    font-size: 20px;
}

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

nav a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
}

nav a:hover {
    background: #374151;
}


/* ============================================================
   CONTENIDO
   ============================================================ */

.container {
    width: min(1400px, 94%);
    margin: 24px auto;
}

h1 {
    color: #172033;
}

h2 {
    color: #202a3b;
}

.section-title {
    margin-top: 28px;
    margin-bottom: 14px;
}


/* ============================================================
   TARJETAS / PANELES
   ============================================================ */

.cards {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(210px, 1fr)
        );
    gap: 14px;
}

.card,
.panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow:
        0 2px 10px
        rgba(0, 0, 0, .06);
}

.card {
    transition:
        transform .15s ease,
        box-shadow .15s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow:
        0 5px 18px
        rgba(0, 0, 0, .08);
}

.metric {
    font-size: 27px;
    font-weight: 800;
    margin-top: 5px;
}

.value-card .metric {
    font-size: 24px;
}

.muted {
    color: #6b7280;
}


/* ============================================================
   TOOLBAR
   ============================================================ */

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 15px 0;
}


/* ============================================================
   BOTONES
   ============================================================ */

.btn,
button {
    display: inline-block;
    border: 0;
    background: #2563eb;
    color: white;
    padding: 9px 13px;
    border-radius: 9px;
    text-decoration: none;
    cursor: pointer;
    transition:
        opacity .15s ease,
        transform .15s ease;
}

.btn:hover,
button:hover {
    opacity: .90;
}

.btn.secondary {
    background: #4b5563;
}

.btn.danger {
    background: #dc2626;
}

.btn.light {
    background: #e5e7eb;
    color: #111827;
}


/* ============================================================
   FORMULARIOS
   ============================================================ */

input,
select,
textarea {
    width: 100%;
    padding: 9px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, .10);
}

label {
    font-weight: 650;
    font-size: 14px;
}


/* ============================================================
   GRID FORMULARIOS
   ============================================================ */

.grid {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 14px;
}

.full {
    grid-column: 1 / -1;
}


/* ============================================================
   TABLAS
   ============================================================ */

.tablewrap {
    overflow-x: auto;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    padding: 10px;
    border-bottom:
        1px solid
        #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #eef2ff;
    font-size: 13px;
    white-space: nowrap;
}

tbody tr {
    transition:
        background .12s ease;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.nowrap {
    white-space: nowrap;
}


/* ============================================================
   SORTING
   ============================================================ */

.sort-link {
    color: #1f2937;
    text-decoration: none;
    display: inline-block;
}

.sort-link:hover {
    color: #2563eb;
}


/* ============================================================
   FOTOS
   ============================================================ */

.thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #eee;
}

.gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
}


/* ============================================================
   FLASH
   ============================================================ */

.flash {
    padding: 12px;
    background: #dcfce7;
    border:
        1px solid
        #86efac;
    border-radius: 10px;
    margin-bottom: 15px;
}

.flash.error {
    background: #fee2e2;
    border-color: #fca5a5;
}


/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 12px;
}

.badge.repro {
    background: #fee2e2;
    color: #991b1b;
}


/* ============================================================
   LINKS
   ============================================================ */

.title-link {
    color: #1d4ed8;
    text-decoration: none;
}

.title-link:hover {
    text-decoration: underline;
}


/* ============================================================
   SESIÓN
   ============================================================ */

.session-nav {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.session-nav a {
    color: #fff;
}


/* ============================================================
   DETALLE JUEGO
   ============================================================ */

.detail-grid {
    display: grid;
    grid-template-columns:
        minmax(280px, 430px)
        1fr;
    gap: 28px;
    align-items: start;
}

.detail-photo-column {
    min-width: 0;
}

.hero-photo {
    width: 100%;
    max-height: 470px;
    object-fit: contain;
    background: #f3f4f6;
    border-radius: 14px;
    padding: 8px;
}

.main-photo-caption {
    color: #6b7280;
    text-align: center;
    font-size: 13px;
    margin-top: 7px;
}

.no-photo-large {
    min-height: 300px;
    border-radius: 14px;
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-subtitle {
    margin-top: 0;
}

.detail-list {
    display: grid;
    grid-template-columns:
        180px
        1fr;
    gap: 10px 16px;
    margin-bottom: 0;
}

.detail-list dt {
    font-weight: 700;
    color: #374151;
}

.detail-list dd {
    margin: 0;
    min-width: 0;
}

.value-highlight {
    font-weight: 700;
}

.external-link {
    font-weight: 650;
}

.source-url {
    margin-top: 5px;
    color: #6b7280;
    font-size: 12px;
    overflow-wrap: anywhere;
}


/* ============================================================
   GALERÍA GRANDE
   ============================================================ */

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

.gallery-large img {
    width: 100%;
    height: 190px;
    object-fit: contain;
    background: #f3f4f6;
    border-radius: 10px;
}

.photo-card {
    position: relative;
    border:
        1px solid
        #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    background: #fff;
}

.photo-card.main {
    border:
        2px solid
        #2563eb;
}

.photo-card .main-label {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #2563eb;
    color: #fff;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
}

.photo-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.photo-actions form {
    margin: 0;
}


/* ============================================================
   PAGINACIÓN
   ============================================================ */

.list-summary {
    color: #6b7280;
    margin: 13px 2px;
    font-size: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 22px 0;
}

.pagination a,
.pagination span {
    min-width: 36px;
    height: 36px;
    padding: 7px 10px;
    border-radius: 8px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    background: white;
    color: #374151;
    border:
        1px solid
        #e5e7eb;
}

.pagination a:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.pagination .active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    font-weight: 700;
}

.empty-table {
    padding: 30px;
    text-align: center;
}


/* ============================================================
   LOGIN
   ============================================================ */

.login-box {
    max-width: 430px;
    margin: 50px auto;
}


/* ============================================================
   FOOTER
   ============================================================ */

footer {
    text-align: center;
    color: #6b7280;
    padding: 30px;
}


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

@media (
    max-width: 900px
) {

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


@media (
    max-width: 760px
) {

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

    .detail-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-list dd {
        margin-bottom: 10px;
    }

    .session-nav {
        width: 100%;
        margin-left: 0;
    }

    .metric {
        font-size: 23px;
    }
}