/* ====== YLEINEN TYYLI ====== */

body {
    font-family: 'Inter', 'Arial', sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    text-align: center;
    color: #1a1a1a;
}

h1 {
    font-size: 28px;
    margin-top: 10px;
    color: #1a1a1a;
    font-weight: 700;
}

h2 {
    font-size: 20px;
    color: #444;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ====== HEADER + LOGO ====== */

header {
    padding: 20px;
}

.logo {
    width: 140px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ====== PAINIKKEET ====== */

.btn, button {
    background: #ff9f1c;
    border: none;
    padding: 12px 22px;
    border-radius: 12px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: 0.15s ease;
}

.btn:hover, button:hover {
    background: #ff8c00;
    transform: translateY(-2px);
}

/* ====== INDEX: TEHTÄVÄLISTA ====== */

.menu {
    width: 90%;
    max-width: 420px;
    margin: 0 auto;
}

.menu-item {
    background: white;
    padding: 16px;
    margin: 12px 0;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.menu-item span {
    font-size: 18px;
    font-weight: 600;
}

.status {
    margin-left: 8px;
    font-size: 20px;
}

/* ====== PELIALUEET (palapeli, muistipeli) ====== */

#puzzle, #game-board {
    margin-top: 20px;
}

/* ====== PALAPELI ====== */

#puzzle {
    width: 300px;
    height: 300px;
    margin: 20px auto;
    position: relative;
    background: #eee;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.piece {
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: left 0.15s ease, top 0.15s ease;
}

/* ====== MUISTIPELI ====== */

#game-board {
    width: 90%;
    max-width: 420px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

.card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    transform-style: preserve-3d;
    transition: transform 0.4s;
    cursor: pointer;
}

.card.flip {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    backface-visibility: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-front {
    background: #ff9f1c;
}

.card-back {
    background-size: cover;
    background-position: center;
    transform: rotateY(180deg);
}

/* ====== SUORITUSILMOITUS ====== */

#done {
    margin-top: 20px;
}
