﻿:root {
    color-scheme: light;
    font-family: "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
    color: #0f172a;
}

.game-shell {
    width: min(92vw, 460px);
    padding: 24px;
    border-radius: 24px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
}

.hero-image {
    display: block;
    width: 100%;
    margin-bottom: 18px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(167, 139, 250, 0.18);
}

.game-header {
    margin-bottom: 16px;
}

.game-subtitle {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.reset-button {
    justify-self: center;
    width: min(100%, 220px);
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    background-color: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.reset-button:hover {
    background-color: #1d4ed8;
}

.scoreboard {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 16px;
    background-color: #f8fafc;
}

.scoreboard-top {
    margin-bottom: 20px;
}

.scoreboard-bottom {
    margin-top: 20px;
}

.scoreboard p {
    margin: 0;
}

#message {
    color: #6b21a8;
    font-weight: 600;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.tile {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    overflow: hidden;
    border: 2px solid #4b5563;
    border-radius: 12px;
    background: linear-gradient(145deg, #cbd5e1, #e2e8f0);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.tile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tile-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(191, 219, 254, 0.98), rgba(224, 231, 255, 0.98));
    color: #6b21a8;
    font-size: clamp(28px, 7vw, 34px);
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.tile.flipped,
.tile.matched {
    border-color: #7c3aed;
}

.tile.flipped .tile-image,
.tile.matched .tile-image {
    opacity: 1;
}

.tile.flipped .tile-cover,
.tile.matched .tile-cover {
    opacity: 0;
}

.tile.matched {
    cursor: default;
    box-shadow: 0 10px 22px rgba(134, 239, 172, 0.35);
}

.version-note {
    margin: 18px 0 0;
    color: #b6bfd0;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-align: center;
}

.page-footer {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
}

.page-footer p {
    margin: 0;
}

.page-footer a {
    color: #64748b;
    text-decoration: none;
}

.page-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .game-shell {
        padding: 18px;
    }

    .hero-image {
        margin-bottom: 16px;
    }

    .reset-button {
        width: 100%;
    }
}
