body {
    background: radial-gradient(ellipse at center, #e1e9ff 0, #4365c8 50%, #1a2239 100%) !important;
    min-height: 100vh;
    padding: 10px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-x: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    /* Omezit šířku na šířku hracího pole */
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-left: 10px;
  margin-right: 10px;
}

/* ANIMACE STATISTIK */
.stat-item.time-bonus {
    animation: statBonus 0.8s ease-in-out;
    background: rgba(40, 167, 69, 0.3);
}

.stat-item.score-bonus {
    animation: statBonus 0.8s ease-in-out;
    background: rgba(255, 193, 7, 0.3);
}

.stat-item.time-penalty {
    animation: statPenalty 0.8s ease-in-out;
    background: rgba(220, 53, 69, 0.3);
}

.stat-item.mistake-penalty {
    animation: statPenalty 0.8s ease-in-out;
    background: rgba(220, 53, 69, 0.3);
}

@keyframes statBonus {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.1);
        background: rgba(40, 167, 69, 0.5);
    }
    100% {
        transform: scale(1);
        background: rgba(40, 167, 69, 0.3);
    }
}

@keyframes statPenalty {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.1);
        background: rgba(220, 53, 69, 0.5);
    }
    100% {
        transform: scale(1);
        background: rgba(220, 53, 69, 0.3);
    }
}

/* NOVÉ GRID LAYOUTY PRO RŮZNÉ POČTY KARET */
.cards-container {
    display: grid;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    margin: 0 auto;
    width: 100%;
    place-items: center;
}
/* 2 státy = 6 karet (2×3) */
.cards-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 280px;
}

.cards-2 .card {
    min-width: 110px;
    max-width: 140px;
}

/* 3 státy = 9 karet (3×3) */
.cards-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 400px;
}

/* 4 státy = 12 karet (4×3 na desktopu) */
.cards-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 520px;
}

/* 5 států = 15 karet (5×3 na desktopu) */
.cards-5 {
    grid-template-columns: repeat(5, 1fr);
    max-width: 650px;
}

.card {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    /* Změněno na 0.85 namísto 1, aby byly karty o 15% nižší */
    aspect-ratio: 1 / 0.85;
    width: 100%;
    min-width: 80px;
    transition: transform 0.3s;
}

/* Úprava velikosti karet pro různé layouty */
.cards-3 .card {
    min-width: 100px;
    max-width: 130px;
}

.cards-4 .card {
    min-width: 90px;
    max-width: 120px;
}

.cards-5 .card {
    min-width: 80px;
    max-width: 110px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s, opacity 0.2s;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px;
    text-align: center;
    backface-visibility: hidden;
}

.card-back {
    background-color: #2d1a8a;
    background-image: url('trixeso.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
    opacity: 0.8;
    color: white;
}

.card-front {
    background-color: white;
    opacity: 0;
    transition: opacity 0.3s;
    color: #333;
}

.card.flipped .card-front {
    opacity: 1;
}

.card.flipped .card-back {
    opacity: 0;
}

.card.matched .card-inner {
    box-shadow: 0 0 10px 3px rgba(46, 204, 113, 0.8);
    background-color: #e8f8f0;
}

.card.wrong .card-inner {
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.flag-card .card-front {
    padding: 5px;
}

.flag-card .card-front img {
    max-width: 95%;
    max-height: 80%;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.country-card .card-front {
    font-weight: bold;
    /* Zvětšení písma */
    font-size: 16px;
}

.capital-card .card-front {
    font-style: italic;
     font-weight: 600;
     color: #007bff;
    /* Zvětšení písma */
    font-size: 14px;
}

.controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
  /*  box-shadow: 0 2px 4px rgba(0,0,0,0.2);*/
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.start-message {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    width: 90%;
    max-width: 500px;
    color: #333;
}

.start-message h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.start-message p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* KVIXO FINÁLNÍ POPUP STYLY */
.popup-content {
    background: linear-gradient(135deg, #270c4d, #3d1a69);
    color: white;
    padding: 20px;
    border-radius: 15px;
    max-width: 750px;
    width: 100%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: relative;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(103, 58, 183, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-header {
    margin-bottom: 25px;
}

.center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-display-main-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.score-label {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.score-value-animated {
    font-size: 4em;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    margin-bottom: 10px;
}

.game-info-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 25px 0;
    padding: 0 10px;
}

.info-box {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease;
}

.info-box:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.15);
}

.info-box-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box-value {
    font-size: 1.4em;
    font-weight: 600;
    color: #fff;
}

/* TLAČÍTKA V KVIXO STYLU */
.btn-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: white;
    text-decoration: none;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9em;
}

.mt-4 {
    margin-top: 25px;
}

.mt-2 {
    margin-top: 10px;
}

/* SPECIÁLNÍ STYLING PRO KOLO OKNA */
.round-start-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    border-radius: 15px;
    text-align: center;
    width: 85%;
    max-width: 400px;
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.round-title {
    margin-bottom: 20px;
    font-size: 2.5rem !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* NOVÉ STYLY PRO ANIMACE ČASU */
.time-animation-container {
    font-size: 28px;
    margin: 30px 0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.round-start-message .time-animation-container {
    margin: 25px 0;
    min-height: 70px;
}

.bonus-item {
    color: #28a745;
    font-weight: bold;
    font-size: 32px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease-in-out;
}

.round-start-message .bonus-item {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.bonus-item.animated {
    animation: bonusAppear 1.5s ease-in-out;
}

@keyframes bonusAppear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    30% {
        opacity: 1;
        transform: scale(1.4);
    }
    70% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* TLAČÍTKO POKRAČOVAT - CENTROVANÉ */
.continue-button {
    margin: 20px auto !important;
    display: block !important;
    padding: 15px 30px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    background-color: #28a745 !important;
}

.continue-button:hover {
    background-color: #218838 !important;
}

/* Tlačítko pokračovat pro KOLO okna */
.round-start-message .continue-button {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700 !important;
}

.round-start-message .continue-button:hover {
    background: linear-gradient(45deg, #218838, #1ea896) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6) !important;
}

/* Skrýt Start tlačítko během hry */
.game-active #start-btn {
    display: none;
}

/* VYPNOUT ANIMACI Z MAIN.CSS U NALEZENÝCH TROJIC */
.card.matched:hover,
.card.matched:focus,
.card.matched:active,
.card.matched:visited {
    animation: none !important;
    transform: none !important;
}




/* RESPONZIVNÍ DESIGN */

/* Desktop úpravy - karty o 10% větší a menší mezery */
@media (min-width: 768px) {
.cards-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 308px; /* +10% z 280px */
    gap: 10px;
}

.cards-2 .card {
    min-width: 121px; /* +10% z 110px */
    max-width: 154px; /* +10% z 140px */
}
    .cards-3 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 495px; /* +10% z 450px */
        gap: 10px; /* menší mezery z 12px */
    }
    
    .cards-4 {
        grid-template-columns: repeat(4, 1fr);
        max-width: 660px; /* +10% z 600px */
        gap: 10px; /* menší mezery z 12px */
    }
    
    .cards-5 {
        grid-template-columns: repeat(5, 1fr);
        max-width: 825px; /* +10% z 750px */
        gap: 10px; /* menší mezery z 12px */
    }
    
    /* Větší karty na desktopu */
    .cards-3 .card {
        min-width: 110px; /* +10% z 100px */
        max-width: 143px; /* +10% z 130px */
    }
    
    .cards-4 .card {
        min-width: 99px; /* +10% z 90px */
        max-width: 132px; /* +10% z 120px */
    }
    
    .cards-5 .card {
        min-width: 88px; /* +10% z 80px */
        max-width: 121px; /* +10% z 110px */
    }
    
    .country-card .card-front {
        font-size: 18px;
    }
    
    .capital-card .card-front {
        font-size: 18px;
    }
    
    /* Úprava šířky lišty pro desktop */
    .game-info {
        max-width: 825px; /* odpovídá max šířce největšího hracího pole */
    }

    /* Desktop úpravy pro popup */
    .popup-content {
        width: 90%;
        margin: 0 auto;
    }

    .game-info-boxes {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (min-width: 992px) {
    .cards-3 {
        gap: 8px; /* ještě menší mezery */
    }
    
    .cards-4 {
        gap: 8px;
    }
    
    .cards-5 {
        gap: 8px;
    }
    
    .country-card .card-front {
        font-size: 20px;
    }
    
    .capital-card .card-front {
        font-size: 20px;
    }
}

@media (min-width: 1200px) {
    .country-card .card-front {
        font-size: 22px;
    }
    
    .capital-card .card-front {
        font-size: 22px;
    }
}

/* Mobil portrait - karty 3×5 */
@media (max-width: 767px) and (orientation: portrait) {
.cards-2 {
    grid-template-columns: repeat(2, 1fr);
  /*  max-width: 100%;*/
    gap: 8px;
}

.cards-2 .card {
    min-width: 80px;
    max-width: 115px;
}
    .cards-3 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
        gap: 8px;
    }
    
    .cards-4 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
        gap: 8px;
    }
    
    .cards-5 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
        gap: 8px;
    }
    
    .cards-3 .card,
    .cards-4 .card,
    .cards-5 .card {
        min-width: 70px;
        max-width: 100px;
    }
    
    .country-card .card-front {
        font-size: 14px;
    }
    
    .capital-card .card-front {
        font-size: 14px;
    }
    
    .game-info {
        font-size: 1rem;
        max-width: 100%;
        padding: 0 5px;
    }
    
    .stat-item {
        padding: 3px 6px;
        gap: 3px;
    }

    /* Mobil úpravy pro popup */
    .popup-content {
        width: 95%;
        padding: 15px;
        margin: 10px;
    }

    .game-info-boxes {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .score-value-animated {
        font-size: 3em;
    }
}

/* Mobil landscape */
@media (max-width: 767px) and (orientation: landscape) {
.cards-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.cards-2 .card {
    min-width: 60px;
    max-width: 90px;
}
    .cards-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .cards-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .cards-5 {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .cards-3 .card,
    .cards-4 .card,
    .cards-5 .card {
        min-width: 60px;
        max-width: 90px;
    }
    
    .country-card .card-front {
        font-size: 12px;
    }
    
    .capital-card .card-front {
        font-size: 12px;
    }
    
    .game-info {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .stat-item {
        padding: 2px 5px;
        gap: 2px;
    }

    .game-info-boxes {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Velmi malé displeje */
@media (max-width: 575px) {
    .time-animation-container {
        font-size: 24px;
        min-height: 60px;
    }
    
    .bonus-item {
        font-size: 28px;
    }
    
    .continue-button {
        padding: 12px 25px !important;
        font-size: 16px !important;
    }
    
    .round-start-message {
        width: 95%;
        padding: 25px 15px;
    }
    
    .round-title {
        font-size: 2rem !important;
        letter-spacing: 2px;
    }
    
    .game-info {
        font-size: 0.9rem;
    }

    .score-value-animated {
        font-size: 2.5em;
    }

    .info-box-value {
        font-size: 1.2em;
    }
}
.first-round-instruction {
    color: #ffd700;
    font-size: 16px;
    margin: 20px 0;
    text-align: center;
    line-height: 1.5;
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}