* {
    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: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

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

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

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

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

.accent {
    color: #4ecca3;
}

.muted {
    color: #888;
}

/* ── Status text ────────────────────────────────────────────────────────── */
.status-text {
    font-size: 1rem;
    font-weight: 600;
    color: #c0c0c0;
    min-height: 1.5rem;
    text-align: center;
    letter-spacing: 0.02em;
}

/* ── Simon board ────────────────────────────────────────────────────────── */
.simon-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
    background: #1a1a2e;
    border: 2px solid #2a2a4e;
    border-radius: 20px;
}

/* ── Simon buttons ──────────────────────────────────────────────────────── */
.simon-btn {
    width: 140px;
    height: 140px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: filter 0.08s ease, box-shadow 0.08s ease, transform 0.08s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.simon-btn:focus-visible {
    outline: 3px solid #4ecca3;
    outline-offset: 3px;
}

/* Dimmed (default) states */
.simon-btn.green {
    background: #0d5c2a;
}

.simon-btn.red {
    background: #6e1e2c;
}

.simon-btn.blue {
    background: #1a3a7a;
}

.simon-btn.yellow {
    background: #7a4e05;
}

/* Active (lit up) states */
.simon-btn.green.active {
    background: #1db954;
    box-shadow: 0 0 28px 8px rgba(29, 185, 84, 0.7);
    transform: scale(1.04);
}

.simon-btn.red.active {
    background: #e94560;
    box-shadow: 0 0 28px 8px rgba(233, 69, 96, 0.7);
    transform: scale(1.04);
}

.simon-btn.blue.active {
    background: #3b82f6;
    box-shadow: 0 0 28px 8px rgba(59, 130, 246, 0.7);
    transform: scale(1.04);
}

.simon-btn.yellow.active {
    background: #f59e0b;
    box-shadow: 0 0 28px 8px rgba(245, 158, 11, 0.7);
    transform: scale(1.04);
}

/* Wrong flash */
.simon-btn.wrong {
    filter: brightness(0.3);
    animation: wrong-flash 0.15s ease-in-out 2;
}

@keyframes wrong-flash {
    0%   { filter: brightness(0.3); }
    50%  { filter: brightness(1.4); }
    100% { filter: brightness(0.3); }
}

/* Disabled state during computer's turn */
.simon-btn.disabled {
    cursor: default;
}

/* Hover: only when not disabled and not mobile */
@media (hover: hover) {
    .simon-btn.green:not(.disabled):hover {
        background: #17a347;
        box-shadow: 0 0 12px 3px rgba(29, 185, 84, 0.35);
    }

    .simon-btn.red:not(.disabled):hover {
        background: #c93a52;
        box-shadow: 0 0 12px 3px rgba(233, 69, 96, 0.35);
    }

    .simon-btn.blue:not(.disabled):hover {
        background: #2f70d8;
        box-shadow: 0 0 12px 3px rgba(59, 130, 246, 0.35);
    }

    .simon-btn.yellow:not(.disabled):hover {
        background: #d68a09;
        box-shadow: 0 0 12px 3px rgba(245, 158, 11, 0.35);
    }
}

/* ── Start button ───────────────────────────────────────────────────────── */
.start-btn {
    padding: 0.75rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: #4ecca3;
    color: #0f0f1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.03em;
}

.start-btn:hover {
    background: #3db892;
}

.start-btn:active {
    transform: scale(0.97);
}

/* ── Overlay (game over) ────────────────────────────────────────────────── */
.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 26, 0.97);
    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.5rem;
    font-weight: 700;
    color: #e94560;
}

.overlay p.new-best {
    color: #4ecca3;
}

.overlay-score {
    font-size: 1rem !important;
    font-weight: 400 !important;
    color: #c0c0c0 !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;
}

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

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

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

/* ── 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 {
    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;
    cursor: pointer;
}

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

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

    h1 {
        font-size: 2rem;
    }

    .simon-btn {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 380px) {
    .simon-btn {
        width: 110px;
        height: 110px;
    }

    .simon-board {
        gap: 8px;
        padding: 10px;
    }

    .score-bar {
        gap: 2rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 300px) {
    .simon-btn {
        width: 90px;
        height: 90px;
    }
}

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

    .simon-btn {
        width: 110px;
        height: 110px;
    }
}
