/* Año o Fake - Mobile-first Styles */

:root {
    --color-bg: #1a1a2e;
    --color-card: #16213e;
    --color-primary: #e94560;
    --color-primary-hover: #d13350;
    --color-secondary: #0f3460;
    --color-text: #ffffff;
    --color-text-dim: #a0a0a0;
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-error: #ef4444;

    --transition-speed: 0.3s;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

/* Buttons */
.btn {
    min-height: 56px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    max-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text);
}

.btn-primary:hover,
.btn-primary:active {
    background: var(--color-primary-hover);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover,
.btn-secondary:active {
    background: var(--color-card);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    -webkit-tap-highlight-color: transparent;
}

.btn-help {
    background: transparent;
    border: none;
    color: var(--color-text-dim);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 20px;
    -webkit-tap-highlight-color: transparent;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--color-text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 12px;
    -webkit-tap-highlight-color: transparent;
}

.btn-link:hover {
    color: var(--color-text);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    -webkit-tap-highlight-color: transparent;
}

/* Start Screen */
.logo {
    font-size: 64px;
    margin-bottom: 10px;
    animation: bounce 2s ease infinite;
}

.logo-emoji {
    display: inline-block;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: var(--color-text-dim);
    margin-bottom: 30px;
}

.highscore-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    color: var(--color-warning);
    margin-top: 20px;
}

.trophy {
    font-size: 24px;
}

/* Game Screen */
#screen-game {
    padding-top: 0;
    gap: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    width: 100%;
}

.event-counter {
    font-size: 16px;
    font-weight: 600;
}

.current-score {
    font-size: 16px;
}

.event-card {
    background: var(--color-card);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

.event-emoji {
    font-size: 72px;
    margin-bottom: 20px;
    animation: pulse 2s ease infinite;
}

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

.event-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.event-description {
    font-size: 14px;
    color: var(--color-text-dim);
    line-height: 1.4;
}

/* Year Slider */
.slider-container {
    width: 100%;
    padding: 20px 10px;
}

.year-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    background: var(--color-secondary);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(233, 69, 96, 0.5);
    transition: transform 0.1s;
}

.year-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(233, 69, 96, 0.5);
}

.year-slider:active::-webkit-slider-thumb {
    transform: scale(1.1);
}

.year-display {
    text-align: center;
    margin: 16px 0 8px;
}

.selected-year {
    font-size: 48px;
    font-weight: 800;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--color-text-dim);
}

/* Result Screen */
.result-emoji {
    font-size: 80px;
    animation: celebrate 0.5s ease;
}

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

.result-message {
    font-size: 28px;
    font-weight: 700;
}

.result-details {
    background: var(--color-card);
    border-radius: var(--border-radius);
    padding: 20px;
    width: 100%;
    max-width: 280px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.result-row:first-child {
    border-bottom: 1px solid var(--color-secondary);
}

.result-label {
    color: var(--color-text-dim);
}

.result-value {
    font-weight: 600;
    font-size: 18px;
}

.result-correct {
    color: var(--color-success);
}

.points-earned {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.points-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--color-success);
}

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

.difference-text {
    font-size: 14px;
    color: var(--color-text-dim);
}

/* Color classes for points */
.points-perfect { color: var(--color-success); }
.points-good { color: var(--color-warning); }
.points-bad { color: var(--color-error); }

/* End Screen */
.final-trophy {
    font-size: 80px;
    animation: trophy-bounce 1s ease;
}

@keyframes trophy-bounce {
    0% { transform: translateY(-50px); opacity: 0; }
    60% { transform: translateY(10px); }
    100% { transform: translateY(0); opacity: 1; }
}

.final-title {
    font-size: 28px;
    font-weight: 700;
}

.final-score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.final-score-value {
    font-size: 72px;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.final-score-label {
    font-size: 20px;
    color: var(--color-text-dim);
}

.record-display {
    font-size: 18px;
    color: var(--color-warning);
    padding: 12px 24px;
    background: var(--color-card);
    border-radius: var(--border-radius);
}

.record-display.new-record {
    animation: glow 1s ease infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px var(--color-warning); }
    to { box-shadow: 0 0 20px var(--color-warning); }
}

.final-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-card);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modal-in 0.3s ease;
}

@keyframes modal-in {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--color-secondary);
}

.modal-header h3 {
    font-size: 20px;
}

/* Help Modal */
.help-content {
    padding: 20px;
}

.help-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.help-step p {
    line-height: 1.5;
    text-align: left;
}

.help-scoring {
    background: var(--color-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 20px;
}

.help-scoring h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.help-scoring ul {
    list-style: none;
    text-align: left;
}

.help-scoring li {
    padding: 4px 0;
    font-size: 14px;
}

/* Summary Modal */
.summary-list {
    padding: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-secondary);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-event {
    flex: 1;
    text-align: left;
}

.summary-event-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.summary-years {
    font-size: 12px;
    color: var(--color-text-dim);
}

.summary-points {
    font-weight: 700;
    font-size: 16px;
    margin-left: 12px;
}

.summary-points.perfect { color: var(--color-success); }
.summary-points.good { color: var(--color-warning); }
.summary-points.bad { color: var(--color-error); }

/* Toast notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-card);
    color: var(--color-text);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 200;
    animation: toast-in 0.3s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.hide {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Responsive */
@media (min-width: 768px) {
    .title {
        font-size: 40px;
    }

    .event-card {
        padding: 40px 30px;
    }

    .event-emoji {
        font-size: 96px;
    }

    .event-title {
        font-size: 24px;
    }

    .selected-year {
        font-size: 64px;
    }
}
