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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.timeline-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Adjust game title for new logo */
.game-title {
    text-align: center;
    color: white;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Logo icon sizing */
.logo-icon {
    height: 1.2em;
    vertical-align: middle;
    margin-right: 0.3em;
}

.timeline-icon {
    font-size: 1.2em;
}

/* Subtitle styling */
.game-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 1.1em;
    margin-bottom: 40px;
    font-weight: 400;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

 .card h2 {
    color: #06b6d4;
    margin-bottom: 20px;
    text-align: center;
 }

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #06b6d4;
}

.rounds-selector {
    margin-bottom: 15px;
}

.rounds-selector label {
    display: block;
    color: #666;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Spacing for mode selector below rounds selector */
.mode-selector {
    margin-bottom: 15px;
}

/* Description of the game displayed on the home screen */
.game-description {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    margin-bottom: 30px;
    line-height: 1.4;
}

/* Footer with legal links */
footer {
    text-align: center;
    font-size: 0.8em;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.7);
}
footer a {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 5px;
    text-decoration: underline;
    font-size: inherit;
}

/* Header title styling inside the game header */
.game-header .header-title {
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 700;
    font-size: 1.4em;
    color: #06b6d4;
}
.header-logo-icon {
    height: 1.4em;
}

/* Hint button spacing */
#hint-btn {
    margin-top: 10px;
}

/* Hint message styling */
.hint-message {
    margin-top: 10px;
    font-size: 1em;
    font-weight: 600;
    color: #10b981;
    text-align: center;
}

.rounds-selector select,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

 .rounds-selector select:focus,
 select:focus {
    outline: none;
    border-color: #06b6d4;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

 .btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: white;
 }

 .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(6, 182, 212, 0.4);
 }

 .btn-secondary {
    background: #34d399;
    color: white;
 }

 .btn-secondary:hover {
    background: #10b981;
    transform: translateY(-2px);
 }

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.btn-large {
    padding: 20px 40px;
    font-size: 18px;
}

.divider {
    text-align: center;
    color: white;
    font-weight: 600;
    margin: 20px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 2px;
    background: rgba(255,255,255,0.3);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.game-code {
    font-size: 3em;
    font-weight: bold;
    text-align: center;
    color: #06b6d4;
    letter-spacing: 0.2em;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 10px;
    margin: 20px 0;
}

.share-text {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
}

.share-link-container {
    display: flex;
    gap: 10px;
}

.share-link-container input {
    flex: 1;
    margin-bottom: 0;
}

.players-list {
    display: grid;
    gap: 10px;
}

.player-item {
    background: #f7f7f7;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-name {
    font-weight: 600;
    color: #333;
}

.player-score {
    color: #06b6d4;
    font-weight: bold;
}

.host-badge {
    background: #06b6d4;
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
    margin-left: 10px;
}

.waiting-text {
    text-align: center;
    color: white;
    font-size: 1.1em;
    margin-top: 20px;
}

.game-header {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.round-info, .score-info {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.score-info span {
    color: #06b6d4;
}

.event-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.event-category {
    display: inline-block;
    background: #06b6d4;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.event-card h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 15px;
}

.event-card p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}

.guess-controls {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.guess-controls h3 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 1.5em;
}

.timeline-slider-container {
    margin-bottom: 30px;
    position: relative;
}

.era-indicator {
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    color: #06b6d4;
    margin-bottom: 15px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 25px;
    border: 2px solid rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
    animation: eraGlow 2s ease-in-out infinite;
}

@keyframes eraGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(6, 182, 212, 0.2); }
    50% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.4); }
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.timeline-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #06b6d4, #8b5cf6);
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 3px solid #06b6d4;
}

.timeline-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 3px solid #06b6d4;
}

.year-display {
    text-align: center;
    font-size: 2.5em;
    font-weight: bold;
    color: #06b6d4;
    margin-top: 20px;
}

.date-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.date-selector label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.date-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.date-selector select:focus {
    outline: none;
    border-color: #06b6d4;
}

.waiting-message {
    text-align: center;
    color: #06b6d4;
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 20px;
}

.results-title {
    text-align: center;
    color: white;
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.correct-answer-card {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.correct-answer-card h2 {
    color: white;
    margin-bottom: 15px;
}

.correct-date {
    font-size: 1.5em;
    margin-top: 10px;
}

.date-label {
    opacity: 0.9;
}

.date-value {
    font-weight: bold;
    margin-left: 10px;
}

.guesses-list {
    display: grid;
    gap: 15px;
}

.guess-item {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guess-player {
    flex: 1;
}

.guess-player-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.guess-date {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.guess-points {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 40px;
    min-height: 250px;
}

.podium-place {
    text-align: center;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
    opacity: 0;
    animation: podiumRise 0.8s ease-out forwards;
}

@keyframes podiumRise {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    60% {
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.podium-place:hover {
    transform: translateY(-10px);
}

.podium-1 {
    order: 2;
    width: 200px;
}

.podium-2 {
    order: 1;
    width: 180px;
}

.podium-3 {
    order: 3;
    width: 180px;
}

.podium-medal {
    font-size: 3em;
    margin-bottom: 10px;
}

.podium-name {
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
    margin-bottom: 5px;
}

.podium-score {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1em;
}

.rankings-list {
    display: grid;
    gap: 10px;
}

.ranking-item {
    background: #f7f7f7;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    animation: rankingSlide 0.5s ease-out forwards;
}

@keyframes rankingSlide {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.ranking-position {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
}

.ranking-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.ranking-score {
    font-weight: bold;
    color: #667eea;
}

.event-reveal-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.event-reveal-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.event-detail-text {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    opacity: 0;
    animation: fadeInDetail 0.8s ease-in 3s forwards;
}

@keyframes fadeInDetail {
    to { opacity: 1; }
}

.timeline-visualization {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 250px;
}

.timeline-track {
    position: relative;
    padding: 50px 40px 30px;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 4px;
    background: linear-gradient(to right, #667eea, #764ba2);
    border-radius: 2px;
    transform: translateY(-50%);
}

#timeline-markers-container {
    position: relative;
    height: 120px;
}

.timeline-marker {
    position: absolute;
    transform: translateX(-50%);
    bottom: 40px;
    opacity: 0;
    animation: markerAppear 0.6s ease-out forwards;
}

@keyframes markerAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.5);
    }
    60% {
        transform: translateX(-50%) translateY(-5px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.timeline-marker.correct-answer {
    bottom: auto;
    top: 40px;
    animation: correctMarkerAppear 1s ease-out forwards;
    z-index: 10;
}

@keyframes correctMarkerAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0);
    }
    50% {
        transform: translateX(-50%) translateY(5px) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.timeline-flag {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.timeline-flag:hover {
    transform: scale(1.15);
}

.flag-pole {
    width: 3px;
    height: 40px;
    background: #333;
    margin: 0 auto;
}

.flag-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    margin-bottom: -3px;
}

.flag-player {
    font-weight: 700;
    margin-bottom: 2px;
}

.flag-date {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 500;
}

.flag-body.rank-1 { 
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); 
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
}
.flag-body.rank-2 { 
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); 
    box-shadow: 0 4px 16px rgba(148, 163, 184, 0.5);
}
.flag-body.rank-3 { 
    background: linear-gradient(135deg, #cd7f32 0%, #b8691c 100%); 
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.5);
}

.pulse-in {
    animation: pulseIn 0.8s ease-out;
}

@keyframes pulseIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.correct-marker {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 30px solid #10b981;
    position: relative;
}

.correct-marker.pulse {
    animation: markerPulse 1.5s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(16, 185, 129, 1));
    }
}

.correct-marker::after {
    content: '✓';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.marker-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

.marker-label.glow {
    animation: labelGlow 1.5s ease-in-out infinite;
}

@keyframes labelGlow {
    0%, 100% { 
        box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.3);
    }
    50% { 
        box-shadow: 0 3px 20px rgba(16, 185, 129, 0.6), 0 0 40px rgba(16, 185, 129, 0.5);
    }
}

.timeline-axis {
    position: absolute;
    bottom: 0;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.timeline-tick {
    position: relative;
    padding-top: 15px;
}

.timeline-tick::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: #999;
}

.rankings-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.rankings-card h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

#rankings-list-results {
    display: grid;
    gap: 10px;
}

.ranking-result-item {
    background: #f7f7f7;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    opacity: 0;
}

.ranking-result-item.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.ranking-result-item:hover {
    background: #ececec;
    transform: translateX(5px);
}

.ranking-result-rank {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

.ranking-result-rank.rank-1 { color: #f59e0b; text-shadow: 0 2px 4px rgba(245, 158, 11, 0.3); }
.ranking-result-rank.rank-2 { color: #94a3b8; text-shadow: 0 2px 4px rgba(148, 163, 184, 0.3); }
.ranking-result-rank.rank-3 { color: #cd7f32; text-shadow: 0 2px 4px rgba(205, 127, 50, 0.3); }

.ranking-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ranking-result-name {
    font-weight: 700;
    color: #333;
    font-size: 1.1em;
}

.ranking-result-guess {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

.ranking-result-points {
    font-weight: bold;
    color: #667eea;
    font-size: 1.3em;
    min-width: 70px;
    text-align: right;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }
    
    .date-selectors {
        grid-template-columns: 1fr;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-place {
        width: 100% !important;
        max-width: 300px;
    }
    
    .podium-1 { order: 1; }
    .podium-2 { order: 2; }
    .podium-3 { order: 3; }
    
    .timeline-track {
        padding: 50px 20px 30px;
    }
    
    .timeline-line {
        left: 20px;
        right: 20px;
    }
    
    .timeline-axis {
        left: 20px;
        right: 20px;
        font-size: 11px;
    }
}
