/* Fuentes personalizadas */
@font-face {
    font-family: 'TevaSans';
    src: url('../fonts/TevaSans-Regular (1).otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'TevaSans';
    src: url('../fonts/TevaSans-Bold (2).otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'TevaSans';
    src: url('../fonts/TevaSans-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'TevaSans';
    src: url('../fonts/TevaSans-BoldItalic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
}

@font-face {
    font-family: 'AvenirNextCondensed';
    src: url('../fonts/avenir-next-condensed-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'TevaSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    overscroll-behavior: none;
}

body {
    font-family: 'TevaSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #bde2f0;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

button,
input,
textarea,
select {
    font-family: 'TevaSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.juegos-neurok-container.colgado-container {
    max-width: 900px;
    margin: 0 auto;
    background: #bde2f0;
    min-height: 100vh;
    padding: 20px;
}

header {
    background: transparent;
    color: #00528C;
    padding: 30px 20px;
    text-align: center;
    position: relative;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 82, 140, 0.15);
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.neurok-logo {
    max-height: 100px;
    width: auto;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #00528C;
    font-weight: 700;
}

.subtitle {
    font-size: 1em;
    opacity: 0.8;
    color: #00528C;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.screen {
    display: none;
    padding: 50px 40px;
    min-height: 500px;
    background: white;
}

.screen.active {
    display: block;
}

/* Welcome Screen */
.welcome-content {
    max-width: 700px;
    margin: 0 auto;
}

.welcome-hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 30px;
}

.welcome-text-section {
    flex: 1;
    text-align: left;
}

.welcome-title {
    color: #0069a8;
    font-size: 2.6em;
    font-weight: 900;
    margin-bottom: 15px;
    line-height: 1.3;
    font-family: 'AvenirNextCondensed', 'TevaSans', sans-serif;
}

.welcome-mission {
    color: #eb6415;
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
}

.welcome-mission em {
    font-style: italic;
    font-weight: 700;
}

.welcome-image-section {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.doctor-image {
    max-width: 180px;
    height: auto;
}

.welcome-instructions {
    background: #e8f4fb;
    padding: 20px 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.instruction-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.instruction-item:last-child {
    margin-bottom: 0;
}

.instruction-item .bullet {
    color: #0069a8;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.instruction-item p {
    color: #00528C;
    font-size: 1em;
    line-height: 1.5;
    margin: 0;
}

.welcome-challenge-section {
    text-align: center;
    margin-top: 30px;
}

.challenge-question {
    color: #0069a8;
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.challenge-ready {
    color: #eb6415;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
}

.btn-primary {
    background: #eb6415;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(235, 100, 21, 0.4);
    background: #d45912;
}

/* Game Screen */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.hangman-drawing {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.body-part {
    opacity: 0;
    transition: opacity 0.3s;
}

.body-part.visible {
    opacity: 1;
}

.game-info {
    text-align: center;
    width: 100%;
}

.game-info p {
    font-size: 1.1em;
    color: #00528C;
    margin-bottom: 10px;
    font-weight: 700;
}

.hint {
    font-style: italic;
    color: #00528C;
    font-weight: 500;
}

.phrase-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    padding: 20px;
    background: #fff6f1;
    border-radius: 10px;
}

.word-group {
    display: flex;
    gap: 5px;
}

.letter-box {
    width: 40px;
    height: 50px;
    border: 2px solid #eb6415;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #00528C;
    background: white;
    text-transform: uppercase;
}

.letter-box.space {
    border: none;
    width: 10px;
}

.attempts {
    font-size: 1.3em;
    font-weight: bold;
    color: #eb6415;
}

.timer {
    font-size: 1.3em;
    font-weight: bold;
    color: #eb6415;
}

/* Keyboard */
.keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 8px;
    max-width: 700px;
    width: 100%;
}

.key {
    padding: 15px;
    background: #eb6415;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.key:hover:not(.disabled) {
    background: #d45912;
    transform: translateY(-2px);
}

.key.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.key.correct {
    background: #4caf50;
}

.key.incorrect {
    background: #d32f2f;
}

.key.retry {
    background: #eb6415;
    cursor: pointer;
    opacity: 1;
}

.key.retry:hover {
    background: #d45912;
    transform: translateY(-2px);
}

/* Landing Screen */
.landing-content {
    max-width: 700px;
    margin: 0 auto;
}

.landing-content h2 {
    color: #0069a8;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 700;
}

.landing-text {
    line-height: 1.8;
    color: #00528C;
    margin-bottom: 20px;
}

.final-message {
    background: #e8f4fb;
    color: #0069a8;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.1em;
    font-weight: 600;
    border-left: 4px solid #eb6415;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.modal-content h3 {
    color: #0069a8;
    margin-bottom: 30px;
    font-size: 1.4em;
    line-height: 1.5;
    font-weight: 700;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-btn {
    padding: 15px 25px;
    background: #f0f4ff;
    border: 2px solid #0069a8;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    text-align: left;
    transition: all 0.2s;
    color: #00528C;
}

.answer-btn:hover {
    background: #0069a8;
    color: white;
    transform: translateX(5px);
}

.answer-btn.correct {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.answer-btn.incorrect {
    background: #d32f2f;
    border-color: #d32f2f;
    color: white;
}

/* Footer */
footer.juego-footer {
    background: white;
    text-align: center;
    padding: 20px;
    border-top: none;
    margin-top: 0;
}

.footer-logo {
    max-width: 520px;
    width: 100%;
    height: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .juegos-neurok-container.colgado-container {
        padding: 15px;
        max-width: 100%;
    }

    header {
        padding: 20px 10px;
    }

    .neurok-logo {
        max-height: 70px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .container {
        border-radius: 15px;
        padding: 20px 10px !important;
        max-width: 100% !important;
    }

    .screen {
        padding: 20px 10px !important;
        min-height: auto !important;
    }

    .game-container {
        padding: 0 5px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .welcome-hero-section {
        flex-direction: column;
        text-align: center;
    }

    .welcome-text-section {
        text-align: center;
    }

    .welcome-title {
        font-size: 1.5em;
    }

    .welcome-mission {
        font-size: 1.1em;
    }

    .doctor-image {
        max-width: 150px;
    }

    .challenge-question {
        font-size: 1.2em;
    }

    .challenge-ready {
        font-size: 1.1em;
    }

    .keyboard {
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
        padding: 0 5px;
    }

    .key {
        padding: 12px 8px;
        font-size: 1em;
    }

    .game-container .phrase-display,
    .phrase-display {
        gap: 6px !important;
        padding: 12px 8px !important;
        margin: 20px 0 !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        max-width: 100% !important;
    }

    .phrase-display .word-group,
    .word-group {
        gap: 2px !important;
        flex-shrink: 0 !important;
    }

    .letter-box {
        width: 22px !important;
        height: 32px !important;
        font-size: 0.85em !important;
        border-width: 1.5px !important;
        border-radius: 4px !important;
    }

    .letter-box.space {
        width: 8px !important;
    }

    .modal-content {
        padding: 25px;
    }

    .footer-logo {
        max-width: 390px;
    }
}

/* Estilos para el Ranking */
.ranking-table-container {
    margin: 30px auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    max-width: 800px;
}

.ranking-table-container h3 {
    text-align: center;
    color: #0069a8;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 700;
}

.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 20px;
    overflow: hidden;
}

.ranking-table thead {
    background: linear-gradient(135deg, #0069a8 0%, #004d7a 100%);
    color: white;
}

.ranking-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    color: white;
}

.ranking-table th:first-child {
    border-radius: 10px 0 0 0;
}

.ranking-table th:last-child {
    border-radius: 0 10px 0 0;
}

.ranking-table tbody tr {
    background: #f2f6f7;
    border-bottom: 2px solid white;
    transition: background-color 0.2s;
}

.ranking-table tbody tr:hover {
    background-color: #e8f0f2;
}

.ranking-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 10px;
}

.ranking-table tbody tr:last-child td:last-child {
    border-radius: 0 0 10px 0;
}

.ranking-table td {
    padding: 12px;
    text-align: left;
    color: #0069a8;
    font-weight: 500;
}

.ranking-table tbody tr.top-three {
    background: #e8f4fb;
    font-weight: 700;
}

.ranking-table tbody tr.top-three:hover {
    background: #d9edf7;
}

.no-ranking {
    text-align: center;
    color: #0069a8;
    padding: 40px 20px;
    font-style: italic;
    font-size: 1.1em;
}