/* 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.capsula-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: 900px;
    margin: 0 auto;
    background: white;
    padding: 0;
}

.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;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.welcome-text-section > * {
    margin: 0;
}

.welcome-title {
    color: #00528C;
    font-size: 2.6em;
    font-weight: 900;
    margin-bottom: 10px;
    font-family: 'AvenirNextCondensed', 'TevaSans', sans-serif;
}

.welcome-subtitle {
    color: #0069a8;
    font-size: 2.6em;
    font-weight: 900;
    margin-bottom: 0;
    font-family: 'AvenirNextCondensed', 'TevaSans', sans-serif;
}

.welcome-challenge {
    color: #FF6B35;
    font-size: 2.6em;
    font-weight: 900;
    margin-bottom: 25px;
    margin-top: 0;
    line-height: 1.1;
    font-family: 'AvenirNextCondensed', 'TevaSans', sans-serif;
}

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

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

.question-mark {
    position: absolute;
    top: -20px;
    right: 30%;
    font-size: 4em;
    color: #FF6B35;
    font-weight: bold;
}

.welcome-questions-section {
    text-align: left;
    margin: 25px 0;
}

.info-question {
    color: #00528C;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-statement {
    color: #00528C;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.challenge-description {
    color: #00528C;
    font-size: 1.1em;
    line-height: 1.6;
    text-align: left;
    margin-top: 10px;
    font-weight: 700;
}

.welcome-meta-section {
    text-align: left;
    margin: 25px 0;
}

.game-duration,
.game-objective {
    color: #FF6B35;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 10px;
}

.game-duration strong,
.game-objective strong {
    color: #FF6B35;
}

.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;
    max-width: 700px;
    margin: 0 auto;
}

.progress-container {
    width: 100%;
}

.question-counter {
    text-align: center;
    font-size: 1.1em;
    color: #eb6415;
    margin-bottom: 10px;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #eb6415 0%, #e96109 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* Capsule */
.capsule-container {
    margin: 20px 0;
}

.capsule {
    width: 120px;
    height: 50px;
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.capsule:hover {
    transform: scale(1.1);
}

.capsule-half {
    width: 50%;
    height: 100%;
}

.capsule-left {
    background: #e96109;
}

.capsule-right {
    background: #0069a8;
}

.capsule.correct {
    animation: correctPulse 0.5s ease;
}

.capsule.incorrect {
    animation: incorrectShake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Question */
.question-container {
    width: 100%;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #eb6415;
}

.question-text {
    color: #1e3c72;
    font-size: 1.3em;
    line-height: 1.6;
    text-align: center;
}

/* Answer Buttons */
.answer-buttons {
    display: flex;
    gap: 20px;
    width: 100%;
}

.answer-btn {
    flex: 1;
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

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

.correct-btn:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

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

.incorrect-btn:hover:not(:disabled) {
    background: #c62828;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.4);
}

.answer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback */
.feedback-container {
    width: 100%;
    background: #f0f4ff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.feedback-container.hidden {
    display: none;
}

.feedback-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: block;
}

.feedback-text {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #0069a8;
}

.feedback-text.correct {
    color: #0069a8;
}

.feedback-text.incorrect {
    color: #0069a8;
}

.explanation-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.btn-next {
    background: #eb6415;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Result Screen */
.result-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.result-top-section {
    background: #e8f4fb;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.result-title {
    color: #0069a8;
    margin-bottom: 15px;
    font-size: 2em;
    font-weight: 700;
}

.result-subtitle {
    color: #0069a8;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.result-score {
    margin: 20px 0;
}

.score-big {
    font-size: 3.5em;
    font-weight: bold;
    color: #eb6415;
}

.result-percentage {
    font-size: 1.3em;
    color: #0069a8;
    font-weight: 600;
    margin-bottom: 20px;
}

.result-message {
    font-size: 1.1em;
    line-height: 1.6;
    color: #0069a8;
    margin: 20px 0;
}

.result-celebration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    padding: 20px;
    flex-direction: row;
}

.celebration-image {
    flex-shrink: 0;
    order: 1;
}

.win-image {
    max-width: 220px;
    height: auto;
    display: block;
}

.celebration-text {
    flex: 1;
    text-align: left;
    order: 2;
    max-width: 400px;
}

.celebration-title {
    color: #eb6415;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 10px;
}

.celebration-message {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}

/* Download Section */
.download-section {
    text-align: center;
    margin: 30px 0;
}

.download-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #0069a8;
    margin-bottom: 10px;
}

.download-description {
    font-size: 1em;
    color: #0069a8;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-download {
    background: #eb6415;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
}

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

.btn-restart {
    background: #0069a8;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 105, 168, 0.4);
    background: #005580;
}

/* 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;
}

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

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

    header {
        padding: 20px 10px;
    }

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

    .container {
        border-radius: 15px;
    }

    .screen {
        padding: 20px;
    }

    .welcome-hero-section {
        flex-direction: column;
        gap: 20px;
    }

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

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

    .welcome-subtitle {
        font-size: 1.4em;
    }

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

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

    .question-mark {
        right: 25%;
        font-size: 3em;
    }

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

    .info-question {
        font-size: 1.1em;
    }

    .info-statement {
        font-size: 1em;
    }

    .challenge-description {
        font-size: 1em;
        text-align: center;
    }

    .game-duration,
    .game-objective {
        font-size: 1em;
        text-align: center;
    }

    .btn-primary {
        font-size: 1em;
        padding: 12px 30px;
    }

    .question-counter,
    .timer {
        font-size: 1em;
    }

    .question-text {
        font-size: 1.1em;
    }

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

    .answer-btn {
        font-size: 1em;
        padding: 15px;
    }

    .capsule {
        width: 100px;
        height: 42px;
    }

    .feedback-icon {
        width: 60px;
        height: 60px;
    }

    .feedback-text {
        font-size: 1.1em;
    }

    .explanation-text {
        font-size: 1em;
    }

    .result-title {
        font-size: 1.6em;
    }

    .result-subtitle {
        font-size: 1em;
    }

    .score-big {
        font-size: 2.5em;
    }

    .result-percentage {
        font-size: 1.1em;
    }

    .result-message {
        font-size: 1em;
    }

    .result-celebration {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }

    .celebration-text {
        text-align: center;
    }

    .celebration-title {
        font-size: 1.3em;
    }

    .celebration-message {
        font-size: 1em;
    }

    .win-image {
        max-width: 180px;
    }

    .download-title {
        font-size: 1.2em;
    }

    .download-description {
        font-size: 0.95em;
    }

    .btn-download {
        font-size: 1em;
        padding: 12px 30px;
    }

    .btn-restart {
        font-size: 0.95em;
        padding: 10px 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;
}