/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #1a1a2e;
    --surface:   #16213e;
    --accent:    #e94560;
    --text:      #eaeaea;
    --muted:     #8892a4;
    --win:       #4caf50;
    --lose:      #e94560;
    --key-bg:    #0f3460;
    --key-used:  #2a2a3e;
    --radius:    8px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Crimson Pro', Georgia, serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-wrapper {
    width: 100%;
    max-width: 700px;
    padding: 2rem 1rem;
}

/* ── Title ── */
.game-title {
    font-family: 'Crimson Pro', serif;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

/* ── Game board ── */
.game-board {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ── SVG Gallows ── */
.gallows-container {
    flex-shrink: 0;
}

#hangman-svg {
    width: 180px;
    height: 200px;
    color: var(--text);
}

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

.body-part.hidden {
    opacity: 0;
}

/* ── Word area ── */
.word-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.masked-word {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--text);
    min-width: 200px;
    text-align: center;
}

.game-message {
    font-size: 1.3rem;
    font-weight: 600;
    min-height: 2rem;
    text-align: center;
}

.game-message.win  { color: var(--win); }
.game-message.lose { color: var(--lose); }

/* ── Stats ── */
.wrong-count {
    text-align: center;
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.guessed-letters-area {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    min-height: 1.5rem;
}

.guessed-label {
    color: var(--muted);
    margin-right: 0.5rem;
}

/* ── Keyboard ── */
.keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    max-width: 520px;
    margin: 0 auto 2rem;
}

.key-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius);
    background: var(--key-bg);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, opacity 0.2s;
}

.key-btn:hover:not(:disabled) {
    background: var(--accent);
    transform: translateY(-2px);
}

.key-btn:active:not(:disabled) {
    transform: translateY(0);
}

.key-btn.used,
.key-btn:disabled {
    background: var(--key-used);
    color: var(--muted);
    cursor: default;
    opacity: 0.5;
}

/* ── New game button ── */
.new-game-btn {
    display: block;
    margin: 0 auto;
    font-family: 'Crimson Pro', serif;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.6rem 2.5rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.2s, color 0.2s;
}

.new-game-btn:hover {
    background: var(--accent);
    color: #fff;
}
