/* Általános stílusok */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Beállítások képernyő stílusa */
#settings-screen {
    background-color: white;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    max-width: 500px;
}
#settings-screen h1 {
    margin-top: 0;
    margin-bottom: 25px;
}
.setting {
    margin-bottom: 20px;
    text-align: left;
}
.setting label, .setting legend {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}
#player-count, #card-count {
    width: 60px;
    padding: 8px;
    font-size: 1em;
}
#category-options label {
    font-weight: normal;
    display: block;
    margin-bottom: 5px;
}
#category-options input {
    margin-right: 10px;
}

#player-names-container input {
    display: block;
    width: 95%;
    padding: 8px;
    margin-bottom: 5px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#start-game-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#start-game-button:hover {
    background-color: #218838;
}
#start-game-button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Játék képernyő */
#game-screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
}

#game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 5px;
}

#game-status-text {
    flex-grow: 1;
    text-align: left;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0px;
    color:#007bff;
}

.game-over-message {
    font-size: 1.5em;
    font-weight: bold;
    color: #28a745;
}

#player-hand-header {
    width: 100%;
    max-width: 1200px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #007bff;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}
.player-stats {
    font-size: 0.8em;
    font-weight: normal;
    margin-left: 15px;
}
.stat-hand {
    color: #007bff; /* Kék */
}
.stat-correct {
    color: #28a745; /* Zöld */
}
.stat-incorrect {
    color: #dc3545; /* Piros */
}
#timeline-container, #player-hand-container {
    display: flex;
    gap: 10px;
    padding: 5px;
    margin: 0 auto;
    overflow-x: auto;
    background-color: #e9e9e9;
    border-radius: 10px;
    min-height: 250px;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
}
#player-hand-container {
    background-color: #d0e0ff;
}

/* Idővonalon és kézben lévő kártyák */
.timeline-card, .hand-card {
    flex-shrink: 0;
    width: 150px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 5px;
    text-align: center;
    font-size: 0.8em;
}
.hand-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hand-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    position: relative; /* MÓDOSÍTVA */
}
.timeline-card img, .hand-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}


.hand-card .year {
    font-weight: bold;
    font-size: 1.2em;
    margin-top: 5px;
}

.timeline-card .year {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: normal;
    font-size: 1.3em;
    color:#007bff;
    margin: 0px 0;
    padding: 2px 0;
    position: relative;
    transition: color 0.3s ease-in-out;
    font-variant-numeric: lining-nums tabular-nums; 
}

.timeline-card .year::before,
.timeline-card .year::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background-color:#ccc
}
.timeline-card .year::before { top: 0; }
.timeline-card .year::after { bottom: 0; }

.hand-card p, .timeline-card p {
     min-height: 3.6em;
     margin-top: 5px;
     margin-bottom: 0;
     font-weight: bold;
     cursor: help;
}

.timeline-card .year.correct-placement {
    color: #28a745;
}

.hand-card.selected {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 0 15px 5px #007bff;
}

.hand-card.incorrect-guess {
    box-shadow: 0 0 15px 5px #dc3545;
    cursor: pointer;
}
.hand-card .year.incorrect {
    color: #dc3545;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.drop-zone {
    flex-shrink: 0;
    width: 30px;
    height: 200px;
    border: 2px dashed #888;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: lighter;
    color: #888;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.drop-zone:hover {
    background-color: #c8e6c9;
    border-color: #4caf50;
}

/* MÓDOSÍTVA: Hang gomb pozicionálása */
.sound-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#new-game-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
}
#new-game-button:hover {
    background-color: #c82333;
}
#final-stats-container {
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.stats-table th, .stats-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
}
.stats-table th {
    background-color: #f2f2f2;
}
.winner-row {
    background-color: #c8e6c9;
    font-weight: bold;
}

#descriptionModal {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 100;
}
.modal-content {
    background-color: white; padding: 25px; border-radius: 10px;
    width: 90%; max-width: 500px;
    position: relative; text-align: justify;
}
.modal-close-button {
    position: absolute; top: 10px; right: 15px;
    font-size: 28px; font-weight: bold;
    cursor: pointer;
}
.modal-hidden {
    display: none !important;
}

.timeline-flash-green {
    animation: flash-green 1s ease-out;
}
.timeline-flash-red {
    animation: flash-red 1s ease-out;
}
#game-screen h2 {
    margin: 0px;
    font-size: 1.2em;
}