/* Alapvető  változók */
:root {
    /* Világos téma */
    --primary-color: #2ecc71;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --text-color: #2c3e50;
    --text-secondary: #666;
    --header-gradient: linear-gradient(120deg, #4e54c8 0%, #8754d8 50%, #da3e98 100%);
    --button-background: #4A5568;
    --button-text: #ffffff;
    --info-button-background: #4A5568;
    --info-button-text: #ffffff;
    --info-button-hover-background: #2D3748;
    --heading-color: #2c3e50;
    --code-background: #f0f0f0;
    --code-text: #333;
}

/* Hátralévő párok száma */
.remaining-pairs {
    font-weight: 600;
    transition: all 0.3s ease;
    background: var(--accent-color);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    color: white;
}

/* Kis számú hátralévő pár kiemelt megjelenítése */
.remaining-pairs.almost-done {
    background: var(--primary-color);
    animation: pulse 1.5s infinite;
}

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

/* Sötét téma */
[data-theme="dark"] {
    --primary-color: #4ade80;
    --secondary-color: #e2e8f0;
    --accent-color: #f87171;
    --background-color: #0f172a;
    --card-background: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --text-color: #f8fafc;
    --text-secondary: #94a3b8;
    --header-gradient: linear-gradient(120deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    --button-background: #4A5568;
    --button-text: #ffffff;
    --info-button-background: #4A5568;
    --info-button-text: #ffffff;
    --info-button-hover-background: #2D3748;
    --heading-color: #2c3e50;
    --code-background: #f0f0f0;
    --code-text: #333;
}

/* Témaváltó gomb stílusai */
.theme-toggle {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    margin: 0 1rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-toggle-light,
.theme-toggle-dark {
    font-size: 1.2rem;
    line-height: 1;
}

/* Sötét témában csak a hold, világos témában csak a nap látszik */
[data-theme="dark"] .theme-toggle-light {
    display: none;
}

[data-theme="dark"] .theme-toggle-dark {
    display: block;
}

[data-theme="light"] .theme-toggle-light {
    display: block;
}

[data-theme="light"] .theme-toggle-dark {
    display: none;
}

/* Játék konténer */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 0 2rem;
}

/* Fejléc */
.game-header {
    background: var(--header-gradient);
    color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color);
    position: relative;
    height: auto;
    min-height: 200px;
    border-radius: 20px;
    overflow: hidden;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-text {
    max-width: 600px;
}

.header-text h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    line-height: 1.1;
}

.header-text p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    line-height: 1.3;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.header-stats {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.header-buttons button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--button-background);
    color: var(--button-text);
}

.header-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(-5px);
}

.header-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
}

.game-theme-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    mask-image: linear-gradient(to left, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, black 50%, transparent 100%);
}

/* Játék információk */
.game-info {
    text-align: center;
    margin-bottom: 1rem;
}

.game-info h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
}

/* Játék statisztika és gombok */
.game-stats {
    display: none;  /* Elrejtjük a duplikált statisztikát */
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--card-background);
    border-radius: 8px;
    color: var(--text-color);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.stat-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.8;
}

#timer, #score {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 60px;
    text-align: center;
}

.game-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Gombok */
.rules-btn, .new-game-btn, .panic-btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.rules-btn {
    background: #4CAF50;
    color: white;
}

.new-game-btn {
    background: #2196F3;
    color: white;
}

.panic-btn {
    background: #f44336;
    color: white;
}

.rules-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.panic-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Játéktér */
.game-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem auto;
    max-width: 1400px;
    width: 95%;
    overflow: visible;
    min-height: calc(100vh - 350px);
}

/* Kiemelt kártya terület */
#highlighted-card-area {
    width: 100%;
    height: 0;
    overflow: hidden;
    transition: height 0.4s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

#highlighted-card-area.active {
    height: 200px;
    margin-bottom: 20px;
}

/* Oszlopok konténer */
#columns-container {
    display: flex;
    justify-content: space-between;
    transition: all 0.4s ease-in-out;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

/* Kártyák */
.card {
    background: white;
    border-radius: 8px;
    padding: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease, opacity 0.5s ease;
    border: 3px solid #e2e8f0;
    height: auto;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    margin-bottom: 0.5rem;
}

/* Bal oldali kártyák */
#left-cards .card {
    background: linear-gradient(135deg, #ffffff, #e0edff);
    border-left-color: #3b82f6;
    border-left-width: 4px;
    animation: subtle-pulse 2s infinite;
}

/* Jobb oldali kártyák */
#right-cards .card {
    background: linear-gradient(135deg, #ffffff, #dcfce7);
    border-right-color: #22c55e;
    border-right-width: 4px;
    opacity: 0.6;
    cursor: not-allowed;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.card:not(.selected):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #cbd5e0;
}

.card.selected {
    border-color: #2196F3;
    background: #E3F2FD;
    pointer-events: none;
}

.card.matched {
    border-color: #4CAF50;
    background: #E8F5E9;
    cursor: default;
}

.card.highlighted {
    transform: scale(1.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.card-inner {
    width: 100%;
}

.card-content {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    color: var(--text-color);
}

/* Helyes/helytelen párosítás */
.card.correct-match {
    background-color: rgba(76, 175, 80, 0.2);
    border: 3px solid #4CAF50;
    animation: pulse-green 1s;
}

.card.wrong-match {
    background-color: rgba(244, 67, 54, 0.2);
    border: 3px solid #F44336;
    animation: shake 0.5s;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Animáció után visszaállás az eredeti állapotba */
.card.wrong-match:not(.selected) {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Animációk */
@keyframes pulse-green {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 30px rgba(74, 222, 128, 0.7);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
}

.card.pulse-green {
    animation: pulse-green 0.8s ease-in-out;
    z-index: 100;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Visszajelző terület */
#feedback-area {
    text-align: center;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#feedback-area.correct {
    background-color: #E8F5E9;
    color: #2E7D32;
}

#feedback-area.wrong {
    background-color: #FFEBEE;
    color: #C62828;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px var(--shadow-color);
    font-family: 'Montserrat', sans-serif;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal h2 {
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.modal p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.time-display {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 15px;
    margin: 1rem 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.time-display h3 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-family: 'Montserrat', sans-serif;
}

.final-time {
    color: var(--primary-color) !important;
    font-size: 2.5rem !important;
    font-weight: bold;
    margin: 0.5rem 0 !important;
    font-family: 'Montserrat', sans-serif;
}

.penalty-info {
    color: var(--accent-color) !important;
    font-size: 0.9rem !important;
    margin-top: 0.25rem !important;
    font-family: 'Montserrat', sans-serif;
}

.end-game-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    gap: 15px;
    flex-wrap: nowrap;
}

.end-game-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    min-width: 120px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: #2196F3;
    color: white;
}

.end-game-buttons button span {
    margin-left: 0.5rem;
    margin-top: 0;
}

.end-game-buttons .new-game-btn {
    background-color: #4CAF50;
}

.end-game-buttons .back-btn {
    background-color: #607D8B;
}

.end-game-buttons .save-image-btn {
    background: #2196F3;
}

.end-game-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0.9;
}

/* Sötét téma specifikus stílusok a modalhoz */
[data-theme="dark"] .modal-content {
    background: var(--card-background);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
}

[data-theme="dark"] .time-display {
    background: rgba(0,0,0,0.2);
}

[data-theme="dark"] .end-game-buttons .new-game-btn {
    background: var(--primary-color);
}

[data-theme="dark"] .end-game-buttons .back-btn {
    background: var(--text-secondary);
}

/* Pánik modal */
.panic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.panic-modal-content {
    background-color: #1a202c;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    padding: 2rem;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    position: relative;
    font-family: 'Montserrat', sans-serif;
}

.panic-modal-content h2 {
    font-family: 'Montserrat', sans-serif;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
}

.panic-pairs {
    margin-top: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
}

.pair-container {
    display: flex;
    gap: 4rem;
    align-items: stretch;
    padding: 0.5rem 1rem;
    position: relative;
}

/* Elválasztó vonal a párok között */
.pair-container:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.panic-pair {
    position: relative;
    padding: 1rem;
    background: #2d3748;
    border-radius: 8px;
    border: 1px solid #4a5568;
    flex: 1;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.panic-pair .content {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: #e2e8f0;
    line-height: 1.4;
}

/* Összekötő vonal a párok között */
.panic-pair.left::after {
    content: '';
    position: absolute;
    right: -2rem;
    top: 50%;
    width: 4rem;
    height: 2px;
    background: #4CAF50;
    transform: translate(50%, -50%);
    transition: all 0.3s ease;
}

/* Hover effektek */
.pair-container:hover .panic-pair {
    background: #374151;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pair-container:hover .panic-pair.left::after {
    background: #45a049;
}

/* Sötét téma specifikus stílusok */
[data-theme="dark"] body {
    background-color: var(--background-color);
    color: var(--text-color);
}

[data-theme="dark"] .card {
    background-color: var(--card-background);
    border: 1px solid #2d3748;
    color: var(--text-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .card:hover {
    background-color: #2d3748;
    border-color: #4a5568;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .card.selected {
    border-color: #3b82f6;
    background-color: #1e40af;
}

[data-theme="dark"] .card.matched {
    border-color: #22c55e;
    background-color: #065f46;
}

[data-theme="dark"] .card.correct-match {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

[data-theme="dark"] .card.wrong-match {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

[data-theme="dark"] .info-panel {
    background-color: var(--card-background);
    border: 1px solid #2d3748;
}

[data-theme="dark"] .info-toggle {
    background-color: #2d3748;
    color: var(--text-color);
    border-bottom: 1px solid #4a5568;
}

[data-theme="dark"] .info-toggle:hover {
    background-color: #374151;
}

[data-theme="dark"] .info-content {
    background-color: var(--card-background);
    color: var(--text-color);
}

[data-theme="dark"] .modal-content {
    background-color: var(--card-background);
    color: var(--text-color);
    border: 1px solid #2d3748;
}

[data-theme="dark"] .rules-content h2 {
    color: var(--text-color);
}

[data-theme="dark"] .rules-content li {
    color: var(--text-secondary);
}

[data-theme="dark"] .rules-content li:before {
    color: #3b82f6;
}

[data-theme="dark"] #feedback-area.correct {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

[data-theme="dark"] #feedback-area.wrong {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .panic-modal-content {
    background-color: #1a202c;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

[data-theme="dark"] .panic-modal-content h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .panic-pair {
    background-color: #2d3748;
    border: 1px solid #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .panic-pair .content {
    color: #e2e8f0;
}

[data-theme="dark"] .panic-modal .close {
    color: #e2e8f0;
}

/* Kártya oszlopok */
.cards-column {
    width: 48%;
    transition: all 0.4s ease-in-out;
    display: grid;
    grid-auto-rows: auto;
    gap: 1.5rem;
}

/* Keverés animáció */
.cards-column.shuffling {
    animation: shuffle-flash 0.5s ease;
}

@keyframes shuffle-flash {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* Középre pozicionált jobb oszlop */
#right-cards.center-column {
    width: 90%;
    margin: 0 auto;
}

/* Elrejtett bal oszlop */
#left-cards.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* Sötét téma specifikus stílusok a kártyákhoz */
[data-theme="dark"] #left-cards .card {
    background: linear-gradient(135deg, #1e293b, #1e3a8a);
    border-left-color: #3b82f6;
    animation: subtle-pulse-dark 2s infinite;
}

[data-theme="dark"] #right-cards .card {
    background: linear-gradient(135deg, #1e293b, #064e3b);
    border-right-color: #22c55e;
    opacity: 0.4;
}

/* Hover állapotok */
#left-cards .card:hover {
    background: linear-gradient(135deg, #ffffff, #bfdbfe);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

#right-cards .card:hover {
    background: linear-gradient(135deg, #ffffff, #bbf7d0);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.15);
}

/* Sötét téma hover állapotok felülírása */
[data-theme="dark"] #left-cards .card:hover {
    background: linear-gradient(135deg, #1e293b, #2563eb);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] #right-cards .card:hover {
    background: linear-gradient(135deg, #1e293b, #059669);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .card:hover .card-content {
    color: #e2e8f0;
}

/* Értesítések stílusa */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    z-index: 1000;
    animation: notification-slide-in 0.3s ease-out;
}

.notification.info {
    background: rgba(33, 150, 243, 0.9);
}

.notification.wrong, .notification.correct {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: rgba(0, 0, 0, 0.95);
    font-weight: 400;
    font-size: 1.4rem;
    padding: 1.5rem 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: auto;
    min-width: 800px;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.notification.wrong.show, .notification.correct.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification.wrong.hide, .notification.correct.hide {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
}

.notification.correct .pair-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    width: 100%;
    padding: 0 1rem;
}

.notification.correct .card-preview {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 2px solid #4ade80;
    color: white;
    min-width: 200px;
}

.notification.correct .arrow {
    color: #4ade80;
    font-size: 2rem;
}

.notification.fade-out {
    animation: notification-fade-out 0.5s ease-out forwards;
}

@keyframes notification-slide-in-correct {
    0% { 
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    100% { 
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes notification-stay {
    0% { 
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    70% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% { 
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* Ha van kiválasztott bal oldali kártya, aktiváljuk a jobb oldaliakat */
.left-card-selected #right-cards .card {
    opacity: 1;
    cursor: pointer;
}

/* Pulzáló animáció a bal oldali kártyáknak */
@keyframes subtle-pulse {
    0% { box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1); }
    50% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2); }
    100% { box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1); }
}

/* Sötét témában */
[data-theme="dark"] #left-cards .card {
    animation: subtle-pulse-dark 2s infinite;
}

[data-theme="dark"] #right-cards .card {
    opacity: 0.4;
}

[data-theme="dark"] .left-card-selected #right-cards .card {
    opacity: 1;
}

@keyframes subtle-pulse-dark {
    0% { box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3); }
    100% { box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2); }
}

.instruction-container {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 1.5rem;
    margin: 0.25rem 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    font-size: 1.1rem;
    background: var(--background-color);
    border-bottom: 1px solid var(--shadow-color);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.instruction-content {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    align-items: center;
    padding: 0.5rem 0;
    gap: 1rem;
    justify-content: space-between;
}

.instruction-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-left: 0;
    margin-right: auto;
    order: 1;
}

.selected-card-container {
    position: relative;
    transition: all 0.3s ease;
    display: none;
    width: 48%;
    flex: 0 0 auto;
    margin-right: 0;
    margin-left: auto;
    order: 2;
}

.selected-card-container.active {
    display: block;
}

.selected-card-container .card {
    margin: 0;
    transform: scale(1);
    width: 100%;
    max-width: none;
    background: var(--card-background);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.8rem;
    min-height: 70px;
    position: relative;
}

.selected-card-container .card:after {
    content: '❌ Kattints a törléshez';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.selected-card-container .card:hover:after {
    opacity: 1;
}

.selected-card-container .card:hover {
    background: #f0f0f0;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--accent-color);
}

[data-theme="dark"] .selected-card-container .card:hover {
    background: #2d3748;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-color: var(--accent-color);
}

[data-theme="dark"] .selected-card-container .card:after {
    color: var(--accent-color);
}

.selected-card-container .card-content {
    font-size: 1.3rem;
    line-height: 1.5;
    font-weight: 500;
}

.stats-container {
    display: flex;
    gap: 1rem;
}

.instruction-text {
    margin: 0;
    padding-right: 1rem;
    border-right: 3px solid var(--primary-color);
    border-left: none;
    text-align: left;
    white-space: nowrap;
}

/* Reszponzív dizájn a statisztikákhoz */
@media (max-width: 768px) {
    .instruction-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .instruction-bottom {
        width: 100%;
        align-items: flex-start;
        margin-left: 0;
        order: 1;
    }
    
    .selected-card-container {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        order: 2;
    }
    
    .stats-container {
        justify-content: flex-start;
    }
    
    .instruction-text {
        text-align: left;
        padding-right: 0;
        padding-left: 0;
        border-right: none;
        border-bottom: 3px solid var(--primary-color);
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    /* Kártya oszlopok maradjanak egymás mellett */
    #columns-container {
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
        overflow: visible;
    }
    
    /* Kártyák szélességének beállítása mobil nézetben */
    .cards-column {
        width: 49%;
        gap: 0.75rem;
    }
    
    /* Kártyák tartalmának igazítása */
    .card-content {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    /* Középre pozicionált jobb oszlop */
    #right-cards.center-column {
        width: 100%;
    }

    /* Kártyák megjelenítése mobil nézetben */
    .card {
        padding: 0.6rem;
        min-height: 50px;
        margin-bottom: 0.3rem;
    }
    
    /* Játéktér beállítása */
    .game-container {
        margin: 0.5rem auto;
        gap: 0.5rem;
        width: 98%;
        overflow: visible;
        min-height: calc(100vh - 300px);
    }
}

/* Amikor van kiválasztott kártya */
.has-selected-card .card {
    opacity: 1 !important;
    filter: none !important;
    transition: all 0.3s ease;
}

.has-selected-card .card.selected {
    opacity: 1 !important;
    filter: none !important;
}

/* Helyes párosítás modal */
.match-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-modal.show {
    opacity: 1;
}

.match-modal-content {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    font-family: 'Montserrat', sans-serif;
}

.match-modal.show .match-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.match-pair-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    width: 100%;
}

.match-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    flex: 1;
    max-width: 300px;
    text-align: center;
    position: relative;
    border: 3px solid var(--primary-color);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.match-card-content {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    line-height: 1.4;
    color: var(--text-color);
    font-weight: 500;
}

.match-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

.match-success {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-align: center;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

/* Sötét téma specifikus stílusok a match modalhoz */
[data-theme="dark"] .match-modal-content {
    background: #1a202c;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .match-card {
    background: #2d3748;
    border-color: #4ade80;
}

[data-theme="dark"] .match-arrow {
    color: #4ade80;
}

[data-theme="dark"] .match-success {
    color: #4ade80;
}

/* Helytelen párosítás animáció */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.card.shake {
    animation: shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
}

.card.wrong-match {
    border: 2px solid #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

[data-theme="dark"] .notification.wrong {
    background: rgba(0, 0, 0, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Eredmény modal */
.result-content {
    padding: 1.5rem !important;
    max-width: 450px !important;
}

.result-content h2 {
    font-size: 1.8rem !important;
    margin-bottom: 0.3rem !important;
}

.result-content p {
    font-size: 1rem !important;
    margin-bottom: 0.8rem !important;
}

.game-details {
    background: var(--background-color);
    padding: 0.8rem;
    border-radius: 10px;
    margin: 0.8rem 0;
}

.game-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-family: 'Montserrat', sans-serif;
}

.game-title {
    font-size: 4rem !important;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #48bb78 !important;
}

.game-date {
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
}

.time-display {
    background: var(--background-color);
    padding: 0.8rem;
    border-radius: 10px;
    margin: 0.8rem 0;
}

.time-display h3 {
    font-size: 0.9rem !important;
    margin-bottom: 0.3rem !important;
    color: var(--text-secondary) !important;
}

.final-time {
    font-size: 2rem !important;
    font-weight: bold;
    margin: 0 !important;
    color: var(--primary-color) !important;
}

.penalty-info {
    font-size: 0.8rem !important;
    margin: 0.2rem 0 0 0 !important;
    color: var(--accent-color) !important;
}

.end-game-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    gap: 15px;
    flex-wrap: nowrap;
}

.end-game-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    min-width: 120px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: #2196F3;
    color: white;
}

.end-game-buttons button span {
    margin-left: 0.5rem;
    margin-top: 0;
}

.end-game-buttons .new-game-btn {
    background: #4CAF50;
}

.end-game-buttons .back-btn {
    background: #607D8B;
}

.end-game-buttons .save-image-btn {
    background: #2196F3;
}

.end-game-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0.9;
}

/* Sötét téma specifikus stílusok */
[data-theme="dark"] .game-details,
[data-theme="dark"] .time-display {
    background: rgba(0,0,0,0.2);
}

/* Érdekességek gomb */
.info-btn {
    background: #2196F3 !important;
    color: white !important;
    padding: 0.7rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.info-btn:hover {
    background: #1976D2 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

/* Modal tartalom scrollozása */
.modal .info-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1.5rem;
    margin: 1rem -0.5rem;
    font-family: 'Montserrat', sans-serif;
}

.modal .info-content::-webkit-scrollbar {
    width: 8px;
}

.modal .info-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.modal .info-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Markdown tartalom stílusai */
.modal .info-content h1,
.modal .info-content h2,
.modal .info-content h3 {
    color: var(--text-color);
    margin: 1.5rem 0 1rem 0;
    font-family: 'Montserrat', sans-serif;
}

.modal .info-content p {
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.6;
    text-align: justify;
    hyphens: auto;
    font-family: 'Montserrat', sans-serif;
}

.modal .info-content ul,
.modal .info-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
    font-family: 'Montserrat', sans-serif;
}

.modal .info-content li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
}

/* Sötét téma specifikus stílusok */
[data-theme="dark"] .info-btn {
    background: #2196F3 !important;
}

[data-theme="dark"] .info-btn:hover {
    background: #1976D2 !important;
}

[data-theme="dark"] .modal .info-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

/* Pánik gomb számláló */
.panic-count-display {
    background: var(--background-color);
    padding: 0.8rem;
    border-radius: 10px;
    margin: 0.8rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}

.panic-count-display h3 {
    font-size: 1.1rem !important;
    margin: 0 0.5rem 0 0 !important;
    color: var(--text-secondary) !important;
    font-family: 'Montserrat', sans-serif;
    display: inline-flex;
    align-items: center;
}

.panic-count {
    font-size: 1.5rem !important;
    font-weight: bold;
    margin: 0 !important;
    color: #f59e0b !important; /* Narancssárga szín */
    font-family: 'Montserrat', sans-serif;
    display: inline-flex;
    align-items: center;
}

/* Sötét téma specifikus stílusok */
[data-theme="dark"] .panic-count-display {
    background: #2d3748;
}

/* Bal oldali oszlop elsötétítése kiválasztott kártya esetén */
.left-card-selected #left-cards {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

/* Hover esetén visszavilágosítás */
.left-card-selected #left-cards:hover {
    opacity: 1 !important;
} 