* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.breadcrumb a {
    color: #4ecca3;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

h1 {
    text-align: center;
    color: #4ecca3;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

/* ── Game container ─────────────────────────────────────────────────────── */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

/* ── Score bar ──────────────────────────────────────────────────────────── */
.score-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 8px;
    padding: 0.5rem 2rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.score-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    min-width: 2ch;
    text-align: center;
}

.score-divider {
    font-size: 1.5rem;
    color: #555;
    font-weight: 300;
}

.player-color { color: #4ecca3; }
.ai-color     { color: #e94560; }

/* ── Canvas wrapper ─────────────────────────────────────────────────────── */
.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

#game-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    border: 2px solid #2a2a4e;
    border-radius: 8px;
    background: #000;
    cursor: none;
    touch-action: none;
}

/* ── Stats bar ──────────────────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    gap: 2rem;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 8px;
    padding: 0.4rem 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ── Instructions ───────────────────────────────────────────────────────── */
.instructions {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* ── Game-over overlay ──────────────────────────────────────────────────── */
.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 26, 0.96);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    border: 2px solid #4ecca3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
    text-align: center;
    min-width: 220px;
}

.overlay.hidden {
    display: none;
}

.overlay p {
    font-size: 1.6rem;
    font-weight: 700;
    color: #4ecca3;
}

.overlay p.loss-text {
    color: #e94560;
}

.final-score {
    font-size: 1.2rem !important;
    color: #e0e0e0 !important;
    font-weight: 600 !important;
}

.overlay button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    background: #4ecca3;
    color: #0f0f1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    width: 100%;
}

.overlay button:hover {
    background: #3db892;
}

.share-btn {
    background: #1a1a2e !important;
    color: #4ecca3 !important;
    border: 2px solid #4ecca3 !important;
}

.share-btn:hover {
    background: #4ecca3 !important;
    color: #0f0f1a !important;
}

/* ── Article / SEO content ──────────────────────────────────────────────── */
.content {
    padding-top: 1.5rem;
    border-top: 1px solid #2a2a4e;
}

.last-updated {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.content h2 {
    color: #4ecca3;
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.content h2:first-of-type {
    margin-top: 1rem;
}

.content p {
    margin-bottom: 0.75rem;
    color: #c0c0c0;
}

.content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: #c0c0c0;
}

.content li {
    margin-bottom: 0.5rem;
}

.faq {
    margin: 0.5rem 0 1rem;
}

.faq dt {
    font-weight: 600;
    color: #e0e0e0;
    margin-top: 1rem;
}

.faq dd {
    color: #c0c0c0;
    margin-left: 1rem;
    margin-top: 0.25rem;
}

/* ── Related games ──────────────────────────────────────────────────────── */
.related-games {
    margin-top: 2rem;
    padding: 1rem;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 8px;
}

.related-games h3 {
    color: #4ecca3;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.game-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-links a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: #0f0f1a;
    color: #4ecca3;
    border: 1px solid #2a2a4e;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.game-links a:hover {
    background: #4ecca3;
    color: #0f0f1a;
    border-color: #4ecca3;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
    main {
        padding: 2rem;
    }

    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 400px) {
    .score-bar {
        gap: 1rem;
        padding: 0.5rem 1.2rem;
    }

    .score-value {
        font-size: 1.6rem;
    }

    .stats-bar {
        gap: 1.2rem;
        padding: 0.4rem 1rem;
    }

    .overlay {
        padding: 1.5rem 1.5rem;
        min-width: 180px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    main { padding-top: 0.5rem; }
    h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .score-bar { padding: 0.3rem 1.5rem; }
}
