* {
    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 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Status bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 420px;
    font-size: 0.95rem;
}

.hint-text {
    color: #888;
    font-style: italic;
}

.wrong-counter {
    font-weight: 600;
    color: #e94560;
    font-size: 1rem;
}

/* SVG Gallows */
#gallows {
    width: 200px;
    height: 220px;
    flex-shrink: 0;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 8px;
}

.gallows-part {
    transition: opacity 0.3s ease;
}

.gallows-part.hidden {
    display: none;
}

/* Word display */
.word-display {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    min-height: 2.5rem;
    padding: 0.25rem 0;
}

.letter-slot {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    width: 1.6rem;
    border-bottom: 3px solid #4ecca3;
    color: #e0e0e0;
    text-transform: uppercase;
    line-height: 1.2;
    padding-bottom: 2px;
    transition: color 0.2s;
}

.letter-slot.revealed {
    color: #4ecca3;
    animation: pop-in 0.25s ease;
}

@keyframes pop-in {
    0%   { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

/* Game over overlay */
.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;
    max-width: 90vw;
}

.overlay.hidden {
    display: none;
}

.overlay.loss-border {
    border-color: #e94560;
}

#result-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4ecca3;
}

#result-text.loss {
    color: #e94560;
}

.word-reveal {
    font-size: 1.1rem;
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.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;
}

/* Letter buttons */
.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    max-width: 420px;
    width: 100%;
}

.letter-btn {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: #1a1a2e;
    color: #e0e0e0;
    border: 2px solid #2a2a4e;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
}

.letter-btn:hover:not(:disabled) {
    background: #2a2a3e;
    border-color: #4ecca3;
    color: #4ecca3;
}

.letter-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

.letter-btn.correct {
    background: rgba(78, 204, 163, 0.2);
    border-color: #4ecca3;
    color: #4ecca3;
    opacity: 1;
}

.letter-btn.wrong {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560;
    color: #e94560;
    opacity: 1;
}

/* New game / new word button */
.new-game-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    background: #1a1a2e;
    color: #4ecca3;
    border: 2px solid #4ecca3;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.new-game-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;
}

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

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

    h1 {
        font-size: 2rem;
    }

    #gallows {
        width: 240px;
        height: 264px;
    }

    .word-display {
        font-size: 2.4rem;
        gap: 0.6rem;
    }

    .letter-slot {
        width: 1.9rem;
    }

    .letter-btn {
        width: 2.6rem;
        height: 2.6rem;
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .letter-btn {
        width: 2.1rem;
        height: 2.1rem;
        font-size: 0.8rem;
    }

    .word-display {
        font-size: 1.6rem;
        gap: 0.4rem;
    }

    .letter-slot {
        width: 1.3rem;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    main { padding-top: 0.5rem; }
    h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
    #gallows { width: 160px; height: 176px; }
}
