.cover-match-game {
    --cover-match-ink: #15162b;
    --cover-match-accent: #e0245e;
    --cover-match-yellow: #ffd21f;
    --cover-match-good: #1a8f4c;
    --cover-match-bad: #d6294a;
    --cover-match-cell: #c8cbd3;
    color: var(--cover-match-ink);
    font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
}

.cover-match-game *,
.cover-match-game *::before,
.cover-match-game *::after {
    box-sizing: border-box;
}

.cover-match-game :focus-visible {
    outline: 3px solid var(--cover-match-accent);
    outline-offset: 3px;
}

.cover-match-game__title,
.cover-match-game__tray-head h2,
.cover-match-game__score {
    font-family: "Bangers", Impact, "Arial Narrow", sans-serif;
    font-weight: 400;
    text-transform: uppercase;
}

.cover-match-game__title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    letter-spacing: .04em;
    line-height: .82;
    margin: 0;
    text-shadow: 3px 3px 0 #fc0016;
}

.cover-match-game__instructions {
    color: #565975;
    font-size: 1.05rem;
    font-weight: 600;
    max-width: 620px;
}

.cover-match-game__instructions p {
    margin: 0 0 7px;
}

.cover-match-game__tray-wrap {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 145px);
    padding: 14px;
    position: sticky;
    top: 125px;
}

.cover-match-game__tray-wrap.is-over {
    outline: 3px solid var(--cover-match-accent);
    outline-offset: 2px;
}

.cover-match-game__tray-head {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
}

.cover-match-game__tray-head h2 {
    font-size: 1.5rem;
    letter-spacing: .05em;
    margin: 0;
}

#cover-match-tray-count,
#cover-match-progress {
    color: #565975;
    font-size: .9rem;
    font-weight: 700;
}

.cover-match-game__tray {
    display: grid;
    flex: 1 1 auto;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
    overflow-y: auto;
}

.cover-match-game__tray-slot {
    aspect-ratio: 2 / 3;
    min-width: 0;
}

.cover-match-game__cover {
    background: #777;
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--cover-match-ink);
    cursor: grab;
    height: 96%;
    overflow: hidden;
    position: relative;
    touch-action: none;
    transition: transform .12s ease, box-shadow .12s ease;
    width: 96%;
    margin-left: 2%;
    margin-top: 2%;
}

.cover-match-game__cover img {
    display: block;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    width: 100%;
}

.cover-match-game__cover.is-selected {
    box-shadow: 0 0 0 3px var(--cover-match-accent), 0 6px 14px rgba(0, 0, 0, .35);
    transform: translateY(-3px);
}

.cover-match-game__cover.is-lifted {
    opacity: .3;
}

.cover-match-game__cover--ghost {
    box-shadow: 0 12px 26px rgba(0, 0, 0, .45), 0 0 0 2px var(--cover-match-ink);
    cursor: grabbing;
    left: 0;
    opacity: .96;
    pointer-events: none;
    position: fixed;
    top: 0;
    transition: none;
    z-index: 2000;
}

.cover-match-game__zoom {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border: 2px solid #111;
    border-radius: 50%;
    color: #111;
    cursor: zoom-in;
    display: flex;
    font-size: 14px;
    height: 26px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 3px;
    top: 3px;
    width: 26px;
    z-index: 2;
}

.cover-match-game__zoom:hover {
    background: var(--cover-match-yellow);
}

.cover-match-game__tabs {
    border-bottom: 0;
    display: flex;
    gap: 6px;
    margin-bottom: -3px;
    padding-left: 14px;
    position: relative;
    z-index: 1;
    margin-left: 5px;
}

.cover-match-game__tabs::before {
    border-bottom: 0;
}

.cover-match-game__tabs > * {
    margin: 0;
    padding-left: 0;
}

.cover-match-game__tabs > * > a {
    background: #d3d8e8;
    border: 3px solid var(--cover-match-ink);
    border-radius: 12px 12px 0 0;
    color: #565975;
    font-family: "Bangers", Impact, "Arial Narrow", sans-serif;
    font-size: 1.25rem;
    letter-spacing: .06em;
    line-height: 1.1;
    padding: 8px 18px 6px;
    text-transform: uppercase;
    border-bottom: none;
}

.cover-match-game__tabs > .uk-active > a {
    background: #fff;
    border-bottom-color: #fff;
    box-shadow: inset 0 5px 0 var(--cover-match-yellow);
    color: var(--cover-match-ink);
    padding-top: 11px;
}

.cover-match-game__frame {
    border: 3px solid var(--cover-match-ink);
    border-radius: 14px;
    box-shadow: 4px 4px 0 var(--cover-match-ink);
    padding: 14px;
}

.cover-match-game__board {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cover-match-game__cell {
    background: var(--cover-match-cell);
    border: 2px solid var(--cover-match-ink);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 5px;
    position: relative;
}

.cover-match-game__cell.is-over {
    outline: 3px solid var(--cover-match-accent);
    outline-offset: 1px;
}

.cover-match-game__cell.is-correct {
    border-color: var(--cover-match-good);
    box-shadow: 0 0 0 2px var(--cover-match-good);
}

.cover-match-game__cell.is-wrong {
    border-color: var(--cover-match-bad);
    box-shadow: 0 0 0 2px var(--cover-match-bad);
}

.cover-match-game__cell.is-correct::after,
.cover-match-game__cell.is-wrong::after {
    align-items: center;
    border: 2px solid var(--cover-match-ink);
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-size: 12px;
    font-weight: 700;
    height: 20px;
    justify-content: center;
    position: absolute;
    right: 8px;
    top: 8px;
    width: 20px;
    z-index: 4;
}

.cover-match-game__cell.is-correct::after {
    background: var(--cover-match-good);
    content: "✓";
}

.cover-match-game__cell.is-wrong::after {
    background: var(--cover-match-bad);
    content: "×";
}

.cover-match-game__slot {
    aspect-ratio: 2 / 3;
    background: rgba(255, 255, 255, .4);
    border: 1px dashed rgba(17, 17, 17, .4);
    border-radius: 4px;
}

.cover-match-game__cell.is-filled .cover-match-game__slot {
    background: none;
    border-color: transparent;
}

.cover-match-game__label,
.cover-match-game__big-title {
    align-items: center;
    color: #111;
    display: flex;
    flex: 1;
    flex-direction: column;
    font-family: "KomikaTitle", "Arial Narrow", sans-serif;
    font-size: .82rem;
    justify-content: center;
    letter-spacing: .02em;
    line-height: 1.06;
    overflow-wrap: anywhere;
    text-align: center;
    text-transform: uppercase;
}

.cover-match-game__big-title {
    font-size: clamp(.7rem, 1.8vw, 1.7rem);
    inset: 2px;
    padding: 3px;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.cover-match-game__issue {
    font-size: 1.2em;
    letter-spacing: .05em;
}

.cover-match-game__actions {
    gap: 14px;
    margin-top: 16px;
}

.cover-match-game__button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.cover-match-game__result {
    background: var(--cover-match-yellow);
    border: 3px solid var(--cover-match-ink);
    border-radius: 12px;
    box-shadow: 4px 4px 0 var(--cover-match-ink);
    color: var(--cover-match-ink);
    margin-top: 16px;
    padding: 16px 18px 18px;
    text-align: center;
}

.cover-match-game__score {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    letter-spacing: .04em;
}

#cover-match-score-number {
    font-size: clamp(2.5rem, 8vw, 3.8rem);
    line-height: 1;
}

#cover-match-score-percent {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    line-height: 1;
}

#cover-match-verdict {
    font-size: clamp(1.7rem, 5vw, 2.4rem);
    letter-spacing: .04em;
    line-height: 1.05;
    margin: 8px 0 14px;
}

.cover-match-game__result .cover-match-game__button {
    background: var(--cover-match-ink);
    border: 0;
    border-radius: 14px;
    box-shadow: none;
    color: var(--cover-match-yellow);
    font-family: "Bangers", Impact, "Arial Narrow", sans-serif;
    font-size: 1.55rem;
    line-height: 1.1;
    padding: 10px 28px 8px;
}

.cover-match-game__result .cover-match-game__button:hover,
.cover-match-game__result .cover-match-game__button:focus {
    background: #2a2b42;
    color: #fff;
}

.cover-match-game__lightbox {
    align-items: center;
    background: rgba(0, 0, 0, .82);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 16px;
    position: fixed;
    z-index: 3000;
}

.cover-match-game__lightbox img {
    border-radius: 6px;
    box-shadow: 0 0 0 3px #fff, 0 16px 40px rgba(0, 0, 0, .6);
    max-height: 90vh;
    max-width: min(92vw, 640px);
}

.cover-match-game__lightbox-close {
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    position: absolute;
    right: 14px;
    top: 12px;
}

@media (max-width: 959px) {
    .cover-match-game__tray-wrap {
        max-height: none;
        position: static;
    }
}

@media (max-width: 640px) {
    .cover-match-game__tray {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .cover-match-game__tray-slot {
        flex: 0 0 52px;
    }

    .cover-match-game__tabs {
        gap: 4px;
        margin-bottom: -3px;
        padding-left: 6px;
    }

    .cover-match-game__tabs > * > a {
        font-size: 1.1rem;
        padding: 6px 13px 5px;
    }

    .cover-match-game__tabs > .uk-active > a {
        padding-top: 10px;
    }

    .cover-match-game__board {
        gap: 4px;
    }

    .cover-match-game__cell {
        border-radius: 5px;
        border-width: 1px;
        gap: 3px;
        padding: 3px;
    }

    .cover-match-game__label {
        font-size: .52rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cover-match-game *,
    .cover-match-game *::before,
    .cover-match-game *::after {
        transition: none !important;
    }
}
