/**
 * pendu-tech.css — Styles dédiés au jeu Pendu Tech
 * Styles propres au jeu uniquement — communs dans games.css
 */

/* ── Conteneur principal ─────────────────────────────────────────────────────── */
.pt-board {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 24px;
    align-items: start;
    margin: 16px 0;
}

@media (max-width: 768px) {
    .pt-board {
        grid-template-columns: 1fr;
    }
}

/* ── Potence (SVG) ───────────────────────────────────────────────────────────── */
.pt-gallows-wrapper {
    background: var(--surface-elevated, #f8f9fa);
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pt-gallows {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
}

.pt-gallows .pt-part {
    stroke: var(--text-color, #212529);
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
    opacity: 0;
    transition: opacity .35s ease;
}

.pt-gallows .pt-part.pt-part--shown {
    opacity: 1;
}

.pt-gallows .pt-part--head {
    stroke-width: 3;
}

[data-theme="dark"] .pt-gallows-wrapper {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .pt-gallows .pt-part {
    stroke: #f1f3f5;
}

/* ── Zone de jeu (mot + indice) ──────────────────────────────────────────────── */
.pt-play-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Indice (définition) */
.pt-hint {
    background: linear-gradient(135deg, rgba(13, 110, 253, .08), rgba(13, 110, 253, .02));
    border-left: 4px solid #0d6efd;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
}

.pt-hint-label {
    display: block;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #0d6efd;
    font-weight: 700;
    margin-bottom: 4px;
}

[data-theme="dark"] .pt-hint {
    background: linear-gradient(135deg, rgba(91, 156, 255, .12), rgba(91, 156, 255, .04));
    border-left-color: #5b9cff;
}

[data-theme="dark"] .pt-hint-label {
    color: #8fb8ff;
}

/* Mot à deviner */
.pt-word {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 18px 8px;
    background: var(--surface-elevated, #ffffff);
    border: 2px dashed var(--border-color, #dee2e6);
    border-radius: 12px;
    min-height: 80px;
}

[data-theme="dark"] .pt-word {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.pt-letter-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 44px;
    border-bottom: 3px solid var(--text-color, #212529);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-color, #212529);
    transition: all .25s ease;
}

.pt-letter-slot--space {
    border-bottom: none;
    width: 16px;
}

.pt-letter-slot--reveal {
    color: #198754;
    animation: pt-flip .4s ease;
}

[data-theme="dark"] .pt-letter-slot {
    border-bottom-color: #f1f3f5;
}

[data-theme="dark"] .pt-letter-slot--reveal {
    color: #51cf66;
}

@keyframes pt-flip {
    0%   { transform: rotateY(90deg); opacity: 0; }
    100% { transform: rotateY(0deg);  opacity: 1; }
}

/* ── Clavier (A-Z) ───────────────────────────────────────────────────────────── */
.pt-keyboard {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 6px;
    margin-top: 8px;
}

@media (max-width: 576px) {
    .pt-keyboard {
        grid-template-columns: repeat(7, 1fr);
    }
}

.pt-key {
    aspect-ratio: 1 / 1.1;
    min-height: 38px;
    border: 2px solid var(--border-color, #ced4da);
    background: var(--surface-elevated, #ffffff);
    color: var(--text-color, #212529);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
    text-transform: uppercase;
    user-select: none;
}

.pt-key:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: #0d6efd;
    background: rgba(13, 110, 253, .06);
}

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

.pt-key:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.pt-key--correct {
    background: #d1e7dd !important;
    border-color: #198754 !important;
    color: #0f5132 !important;
}

.pt-key--wrong {
    background: #f8d7da !important;
    border-color: #dc3545 !important;
    color: #842029 !important;
    text-decoration: line-through;
}

[data-theme="dark"] .pt-key {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f1f3f5;
}

[data-theme="dark"] .pt-key:hover:not(:disabled) {
    background: rgba(91, 156, 255, .15);
    border-color: #5b9cff;
}

[data-theme="dark"] .pt-key--correct {
    background: rgba(40, 167, 69, .25) !important;
    border-color: #51cf66 !important;
    color: #b6f0c1 !important;
}

[data-theme="dark"] .pt-key--wrong {
    background: rgba(220, 53, 69, .25) !important;
    border-color: #ff6b6b !important;
    color: #ffc9c9 !important;
}

/* ── Bandeau de fin ──────────────────────────────────────────────────────────── */
.pt-end-banner {
    background: linear-gradient(135deg, rgba(25, 135, 84, .12), rgba(25, 135, 84, .04));
    border: 2px solid #198754;
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
}

.pt-end-banner--lose {
    background: linear-gradient(135deg, rgba(220, 53, 69, .12), rgba(220, 53, 69, .04));
    border-color: #dc3545;
}

[data-theme="dark"] .pt-end-banner {
    background: linear-gradient(135deg, rgba(81, 207, 102, .15), rgba(81, 207, 102, .05));
    border-color: #51cf66;
}

[data-theme="dark"] .pt-end-banner--lose {
    background: linear-gradient(135deg, rgba(255, 107, 107, .15), rgba(255, 107, 107, .05));
    border-color: #ff6b6b;
}

/* ── Pill catégorie mot ──────────────────────────────────────────────────────── */
.pt-category-pill {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(13, 110, 253, .12);
    color: #0d6efd;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

[data-theme="dark"] .pt-category-pill {
    background: rgba(91, 156, 255, .2);
    color: #8fb8ff;
}
