:root {
    --ikoth-surface: #171c22;
    --ikoth-surface-soft: #1d242c;
    --ikoth-line: #3f2b2b;
    --ikoth-red: #e63946;
    --ikoth-red-strong: #c1121f;
    --ikoth-red-glow: rgba(230, 57, 70, 0.15);
    --ikoth-blue: #71c7ff;
}

/* OPTIMIZACIÓN GLOBAL Y PREVENCIÓN DE OVERFLOW */
html, body {
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%; /* Evita que iOS cambie el tamaño del texto al girar la pantalla */
}

body {
    background:
        radial-gradient(circle at 10% 0%, rgba(230, 57, 70, 0.12), transparent 32rem),
        linear-gradient(145deg, #140e0e 0%, #1c1112 52%, #181011 100%);
}

.navbar {
    background: rgba(23, 20, 20, 0.92);
    border-bottom-color: var(--ikoth-line);
    backdrop-filter: blur(12px);
}

.navbar-brand { letter-spacing: 0.04em; }

.navbar-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.navbar-link:hover {
    color: var(--text-main);
    background: var(--ikoth-surface-soft);
    border-color: var(--ikoth-line);
}

.container {
    width: min(1120px, calc(100% - 40px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 28px;
    margin: 0 auto;
    padding: 52px 0 64px;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    padding: 28px;
    background: linear-gradient(135deg, rgba(36, 25, 26, 0.96), rgba(28, 20, 21, 0.82));
    border: 1px solid var(--ikoth-line);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.project-icon {
    display: block;
    flex: 0 0 112px;
    width: 112px;
    height: 112px;
    padding: 8px;
    object-fit: contain;
    background: #1a1011;
    border: 1px solid #503436;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.project-details { min-width: 0; }

.project-details h1 {
    color: var(--text-main);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.project-tagline {
    max-width: 680px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.badge {
    background: rgba(230, 57, 70, 0.1);
    border-color: rgba(230, 57, 70, 0.3);
    color: #ff6b7a;
}

.description-section {
    padding: 32px;
    background: rgba(25, 19, 20, 0.78);
    border: 1px solid var(--ikoth-line);
    border-radius: 14px;
}

.description-section h2 {
    color: var(--text-main);
    font-size: 20px;
    line-height: 1.3;
    margin: 26px 0 12px;
}

.description-section h2:first-child { margin-top: 0; }

.description-section p,
.description-section li {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.75;
}

.description-section strong { color: #f5e9e9; }
.description-section ul { display: grid; gap: 9px; padding-left: 20px; }
.description-section li::marker { color: var(--ikoth-red); }

/* MEJORA EN BLOQUES DE CÓDIGO (SCROLL TÁCTIL SUAVE) */
.code-block {
    overflow-x: auto;
    padding: 17px 19px;
    background: #140b0c;
    border: 1px solid #3a2224;
    border-left: 3px solid var(--ikoth-red);
    border-radius: 8px;
    color: #f8c0c4;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.9;
    white-space: pre;
    -webkit-overflow-scrolling: touch; /* Scroll por inercia en Safari iOS */
}

footer { border-top-color: var(--ikoth-line); background: rgba(23, 18, 19, 0.9); }

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: rgba(25, 19, 20, 0.9);
    border: 1px solid var(--ikoth-line);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

.sidebar-title {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.version-box label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

/* AJUSTE PARA EVITAR ZOOM AUTOMÁTICO EN SAFARI (MIN 16PX) */
#version-select {
    width: 100%;
    padding: 11px 12px;
    background-color: #1a1011;
    border: 1px solid var(--ikoth-line);
    color: var(--text-main);
    border-radius: 8px;
    outline: none;
    font-size: 16px; /* Evita zoom invasivo en iOS */
    cursor: pointer;
    margin-bottom: 14px;
    touch-action: manipulation;
}

#version-select:focus {
    border-color: var(--ikoth-red);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* BOTONES OPTIMIZADOS PARA ELEMENTOS TÁCTILES */
.btn-download,
.btn-discord,
.navbar-link {
    touch-action: manipulation; /* Elimina retraso de 300ms al pulsar */
}

.btn-download,
.btn-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 9px;
    box-sizing: border-box;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-download {
    background: linear-gradient(135deg, var(--ikoth-red), var(--ikoth-red-strong));
    color: #ffffff;
    border: 1px solid rgba(255, 178, 184, 0.3);
    box-shadow: 0 8px 18px rgba(193, 18, 31, 0.28);
}

.btn-download:hover {
    background: linear-gradient(135deg, #ff4d5a, var(--ikoth-red));
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 11px 24px rgba(230, 57, 70, 0.4);
}

.btn-discord {
    background: rgba(113, 199, 255, 0.1);
    color: var(--ikoth-blue);
    border: 1px solid rgba(113, 199, 255, 0.25);
}

.btn-discord:hover {
    background: rgba(113, 199, 255, 0.18);
    color: #b9e5ff;
    border-color: rgba(113, 199, 255, 0.45);
    transform: translateY(-2px);
}

.btn-download i,
.btn-discord i,
.btn-download svg,
.btn-discord svg { flex-shrink: 0; }

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
}

.meta-item span:last-child {
    color: var(--text-main);
    font-weight: 500;
    text-align: right;
}

.btn-download:focus-visible,
.btn-discord:focus-visible,
.navbar-link:focus-visible,
#version-select:focus-visible {
    outline: 3px solid rgba(230, 57, 70, 0.45);
    outline-offset: 3px;
}

/* MEDIA QUERIES RESPONSIVAS */
@media (max-width: 850px) {
    .container {
        width: min(100% - 28px, 680px);
        grid-template-columns: 1fr;
        padding: 32px 0 44px;
    }

    .project-header {
        align-items: flex-start;
        padding: 22px;
    }

    .code-block {
        font-size: 12px;
        padding: 14px;
    }
}

@media (max-width: 520px) {
    .navbar { padding: 12px 14px; }
    .navbar-brand { font-size: 14px; }
    .navbar-link { padding: 0 8px; font-size: 12px; }

    .project-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .project-icon {
        flex-basis: 96px;
        width: 96px;
        height: 96px;
    }

    .badges { justify-content: center; }
    .description-section { padding: 22px; }
}