
/* GENERAL STYLES */

:root {
    --bg-dark: #090f1b;
    --bg-panel: #111c2d;
    --text-primary: #f4f0e8;
    --text-secondary: #9caabd;
    --accent-gold: #c8aa6e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            ellipse at 50% 0%,
            #1b3047 0%,
            #0b1423 45%,
            #080d17 100%
        );

    color: var(--text-primary);
    font-family: "Segoe UI", Arial, sans-serif;
}

button {
    font: inherit;
    cursor: pointer;
}

.game-container {
    width: min(1200px, 94%);
    margin: 0 auto;
    padding: 48px 0 80px;
}


/* HEADER */

.game-header {
    text-align: center;
    margin-bottom: 40px;
}

.game-header h1 {
    margin: 0 0 10px;
    color: var(--accent-gold);
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.game-header p {
    margin: 0;
    color: var(--text-secondary);
}


/* GAME SETTINGS */

.game-settings {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 25px;

    background: rgba(17, 28, 45, 0.75);
    border: 1px solid #34465a;
    border-radius: 14px;
}

.setting-group {
    text-align: center;
}

.setting-group h2 {
    margin: 0 0 15px;
    color: var(--accent-gold);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.tier-buttons,
.rarity-buttons,
.pair-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.setting-group button,
#restart-btn,
#next-round-btn {
    padding: 10px 15px;
    background: #172438;
    border: 1px solid #46556a;
    border-radius: 6px;
    color: #e6eaf1;
    transition: 0.2s ease;
}

.setting-group button:hover,
#restart-btn:hover,
#next-round-btn:hover {
    border-color: var(--accent-gold);
    background: #24354c;
    color: #f2d59a;
}

.setting-group button.active {
    background: #3b3225;
    border-color: var(--accent-gold);
    color: #f5d28d;
}


/* BUTTON: NEXT ROUND */

/* Neaktivní - během hry */

#next-round-btn:disabled {
    background: #252c37;
    border-color: #404956;
    color: #747e8b;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Aktivní - po dokončení */

#next-round-btn:not(:disabled) {
    background: #3b3225;
    border-color: #c8aa6e;
    color: #f5d28d;
}

/* Neaktivní - hover */

#next-round-btn:disabled:hover {
    background: #252c37;
    border-color: #404956;
    color: #747e8b;
}


/* GAME INFO */

.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 35px;

    margin: 30px 0;
    padding: 20px;

    border-bottom: 1px solid #34465a;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-label {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e9d4a3;
    font-variant-numeric: tabular-nums;
}

#game-message {
    min-height: 25px;
    text-align: center;
    color: #f18e8e;
    font-size: 0.95rem;
}


/* GAME BOARD */

.game-board,
.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.game-board:empty {
    display: none;
}


/* CARD PREVIEW */

.card-preview {
    margin-top: 55px;
}

.card-preview > h2 {
    margin: 0 0 8px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.card-preview > p {
    margin: 0 0 30px;
    text-align: center;
    color: var(--text-secondary);
}


/* CARD STRUCTURE */

.memory-card {
    --rarity-color: #c8aa6e;
    --rarity-glow: rgba(200, 170, 110, 0.2);
    --card-bg: #141f31;
    --tier-color: #d5ae4e;

    display: block;
    position: relative;

    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 260px;

    padding: 0;
    appearance: none;
    background: transparent;
    border: none;

    text-align: left;
    color: inherit;

    perspective: 1000px;
    -webkit-perspective: 1000px;
    cursor: pointer;

    transition: transform 0.2s ease;
}

.card-inner {
    display: block;
    position: relative;

    width: 100%;
    height: 100%;

    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transition: -webkit-transform 0.6s ease;
    transition: transform 0.6s ease;
}

/* Obě strany */

.card-front,
.card-back {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;

    border-radius: 13px;
    padding: 18px;
    overflow: hidden;

    border: 2px solid transparent;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}


/* CARD FRONT */

.card-front {
    justify-content: space-between;

    border-color: var(--rarity-color);

    background:
        radial-gradient(
            circle at 50% 30%,
            var(--rarity-glow),
            transparent 65%
        ),
        linear-gradient(
            160deg,
            #202a3d 0%,
            var(--card-bg) 55%,
            #0c1422 100%
        );

    box-shadow:
        0 0 18px var(--rarity-glow),
        inset 0 0 18px var(--rarity-glow);
    transform: translateZ(1px);
}

/* Oddělení infa */

.card-front::before {
    content: "";
    position: absolute;
    inset: 6px;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;

    pointer-events: none;
}


/* TIER ZNAK */

.card-top {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    gap: 9px;
}

.tier-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    width: 34px;
    height: 34px;
    flex-shrink: 0;

    color: var(--tier-color);
    font-size: 16px;
    font-weight: 800;

    background: #171c2a;
    border: 2px solid var(--tier-color);

    clip-path: polygon(
        50% 0%,
        95% 25%,
        95% 75%,
        50% 100%,
        5% 75%,
        5% 25%
    );
}

.tier-label {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--tier-color);
}


/* TIER COLORS */

.tier-s {
    --tier-color: #f0bd42;
}

.tier-a {
    --tier-color: #71d4a0;
}

.tier-b {
    --tier-color: #79b8ef;
}

.tier-c {
    --tier-color: #e5a46a;
}

.tier-d {
    --tier-color: #d57e86;
}


/* CARDS - obsah */

.card-content {
    position: relative;
    z-index: 1;

    display: flex;
    flex: 1;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    padding: 15px 4px;
    text-align: center;
}

.card-title {
    font-size: clamp(1rem, 1.8vw, 1.5rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.4px;

    color: #f7f0e2;
    overflow-wrap: anywhere;
}

.card-text {
    font-size: clamp(0.78rem, 1.2vw, 0.98rem);
    line-height: 1.55;

    color: #e3e5ec;
    overflow-wrap: anywhere;
}

.card-bottom {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.card-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a9b5c6;
}

.card-rarity {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--rarity-color);
}


/* SILVER cards */

.rarity-silver {
    --rarity-color: #b9c9d8;
    --rarity-glow: rgba(177, 201, 222, 0.18);
    --card-bg: #142231;
}


/* GOLD cards */

.rarity-gold {
    --rarity-color: #deb764;
    --rarity-glow: rgba(230, 179, 75, 0.22);
    --card-bg: #242030;
}


/* PRISMATIC cards */

.rarity-prismatic {
    --rarity-color: #c399ff;
    --rarity-glow: rgba(167, 111, 255, 0.28);
    --card-bg: #211b3c;
}

/* Rámeček front */

.rarity-prismatic .card-front {
    border: 2px solid transparent;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(157, 117, 255, 0.18),
            transparent 65%
        ) padding-box,

        linear-gradient(
            160deg,
            #25213c,
            #17152a 65%,
            #101725
        ) padding-box,

        linear-gradient(
            135deg,
            #8de2ff,
            #cc9aff,
            #f3a6d5,
            #f4c77a,
            #8de2ff
        ) border-box;
}


/* CARD BACK */

.card-back {
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle,
            #22344c 0%,
            #111b2b 65%,
            #0c1320 100%
        );

    border: 2px solid #927746;

    box-shadow:
        0 0 12px rgba(200, 170, 110, 0.18),
        inset 0 0 12px rgba(200, 170, 110, 0.12);

    transform: rotateY(180deg) translateZ(1px);
}

.card-back-symbol {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 90px;
    height: 90px;

    border: 2px solid #c8aa6e;
    border-radius: 50%;

    color: #dfc38d;
    font-size: 3.5rem;
    font-weight: 700;

    text-shadow:
        0 0 15px rgba(225, 183, 92, 0.4);
}


/* FLIPPING */

/* třída v js! */

.memory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* neprosvítání */

.memory-card.flipped .card-front {
    box-shadow: none;
}

/* totožný rub */

.memory-card.flipped .card-back {
    border-color: #927746;

    box-shadow:
        0 0 12px rgba(200, 170, 110, 0.18),
        inset 0 0 12px rgba(200, 170, 110, 0.12);
}


/* ODPOVĚDI */

.memory-card:hover {
    transform: translateY(-5px);
}

.memory-card:focus-visible {
    outline: 3px solid #f0c66c;
    outline-offset: 5px;
}

/* správně */

.memory-card.matched .card-front {
    border-color: #66d69b;

    box-shadow:
        0 0 16px rgba(102, 214, 155, 0.3);
}

.memory-card.matched {
    cursor: default;
}

/* špatně */

.memory-card.incorrect .card-front {
    border-color: #eb7777;

    box-shadow:
        0 0 16px rgba(235, 119, 119, 0.25);
}


/* GAME RESULTS */

.game-result {
    margin: 35px auto;
    padding: 30px;

    text-align: center;
    max-width: 550px;

    background: #162336;
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
}

.game-result[hidden] {
    display: none;
}

.game-result h2 {
    color: #eac677;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 25px;

    color: #d4dae4;
}


/* JEBKA NESNÁŠIM TO >:-( */

@media (max-width: 900px) {

    .game-board,
    .preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

}

@media (max-width: 650px) {

    .game-container {
        width: 95%;
        padding-top: 30px;
    }

    .game-settings {
        gap: 22px;
        padding: 20px 12px;
    }

    .game-board,
    .preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .memory-card {
        min-height: 220px;
    }

    .card-front,
    .card-back {
        padding: 12px;
    }

    .tier-badge {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .tier-label {
        font-size: 0.75rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-text {
        font-size: 0.76rem;
    }

    .game-info {
        gap: 18px;
    }

}

@media (prefers-reduced-motion: reduce) {

    .card-inner,
    .memory-card,
    .setting-group button {
        transition: none;
    }

}


/* FEEDBACK */

.game-footer {
    margin-top: 65px;
    padding: 30px 20px;
    text-align: center;

    border-top: 1px solid #34465a;
}

.game-footer p {
    margin: 0 0 20px;

    color: #9caabd;
    font-size: 0.95rem;
}

.feedback-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    padding: 13px 28px;

    background: #172438;
    border: 1px solid #c8aa6e;
    border-radius: 6px;

    color: #e9d4a3;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.feedback-button:hover {
    background: #3b3225;
    color: #f5d28d;

    box-shadow: 0 0 16px rgba(200, 170, 110, 0.22);

    transform: translateY(-2px);
}

.feedback-button:focus-visible {
    outline: 3px solid #f0c66c;
    outline-offset: 4px;
}


/* DISCLAIMER */

.riot-disclaimer {
    max-width: 680px;
    margin: 45px auto 0;
    padding: 25px 20px 0;

    border-top: 1px solid #34465a;
    text-align: center;
}

.disclaimer-label {
    margin-bottom: 12px !important;

    color: #c8aa6e !important;
    font-size: 0.75rem !important;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.disclaimer-text {
    margin-bottom: 12px !important;

    color: #9caabd !important;
    font-size: 0.82rem !important;
    line-height: 1.7;
}

.disclaimer-link {
    display: inline-block;

    color: #c8aa6e;
    font-size: 0.78rem;
    text-decoration: none;

    transition: color 0.2s ease;
}

.disclaimer-link:hover {
    color: #f5d28d;
    text-decoration: underline;
}

.disclaimer-link:focus-visible {
    outline: 2px solid #f5d28d;
    outline-offset: 4px;
}

@media (max-width: 600px) {
    .riot-disclaimer {
        margin-top: 35px;
        padding: 22px 10px 0;
    }

    .disclaimer-text {
        font-size: 0.8rem !important;
    }
}


/*PATCH INFO */

.patch-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    margin: 20px auto 25px;
    padding: 10px 20px;

    text-align: center;
}

.patch-label {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.patch-note {
    color: #8295a9;
    font-size: 0.75rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .patch-info {
        padding: 10px 12px;
        margin: 15px auto 20px;
    }

    .patch-label {
        font-size: 0.78rem;
    }

    .patch-note {
        font-size: 0.72rem;
    }
}

.patch-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.patch-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #c8aa6e;
}


/* zvýraznění instrukce */

#game-message.game-instruction {
    width: fit-content;
    max-width: 100%;
    margin: 25px auto;
    padding: 14px 28px;

    border: 1px solid #eb7777;
    border-radius: 8px;

    color: #eb7777;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;

    box-shadow: 0 0 3px 1px #eb7777;
}

@media (max-width: 600px) {
    #game-message.game-instruction {
        margin: 20px auto;
        padding: 12px 18px;
        font-size: 0.95rem;
    }
}


/* FIX PRO MOBILY */

.card-front,
.card-back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
