:root {
    --bg: #1b1f3b;
    --panel: #262b52;
    --accent: #ffcc4d;
    --accent-2: #4dd0e1;
    --text: #f0f2ff;
    --muted: #a9aed6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(180deg, var(--bg), #10132a);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
}

.logo {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

main {
    flex: 1;
    padding: 24px;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 32px 0;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.hero p {
    color: var(--muted);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--panel);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.game-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.game-card h2 {
    margin: 0 0 8px;
    color: var(--accent);
}

.game-card p {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.site-footer {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* --- Widok gry --- */
.game-page main {
    max-width: 700px;
}

.game-back {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--accent-2);
    text-decoration: none;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    background: var(--panel);
    padding: 10px 16px;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
}

#game-canvas {
    display: block;
    background: #0e1024;
    width: 100%;
    height: auto;
    border-radius: 0 0 10px 10px;
    image-rendering: pixelated;
}

.game-message {
    text-align: center;
    margin-top: 12px;
    min-height: 1.4em;
    color: var(--accent);
    font-weight: bold;
}

.touch-controls {
    display: none;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

.touch-controls button {
    flex: 1;
    padding: 16px;
    font-size: 1.4rem;
    border: none;
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
}

.touch-controls button:active {
    background: var(--accent);
    color: #10132a;
}

@media (pointer: coarse) {
    .touch-controls {
        display: flex;
    }
}
