:root {
    --bg: #0d1117;
    --card-back: #7c3aed;
    --card-front: #161b22;
    --text: #e6edf3;
    --text-dim: #8b949e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    text-align: center;
    padding: 24px 16px;
}

#moves {
    color: var(--text-dim);
}

.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 20px auto;
}

.card {
    aspect-ratio: 1 / 1;
    perspective: 600px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.4s;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border-radius: 10px;
    backface-visibility: hidden;
}

.card-back {
    background: var(--card-back);
}

.card-front {
    background: var(--card-front);
    border: 1px solid #30363d;
    transform: rotateY(180deg);
}

.card.matched .card-front {
    border-color: #3fb950;
}

button {
    background: var(--card-back);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 18px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.home-link {
    position: absolute;
    top: 16px;
    left: 16px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
}

.home-link:hover {
    color: var(--text);
}
