:root{
    --bg-image: url('image/backgound_body.jpg');
    --page-bg: rgba(0,0,0,0.40);
    --card-bg: rgba(255,255,255,0.20);
    --surface: #f8fafc;
    --text-primary: #0f172a;
    --muted: #6b7280;
    --accent: #3b82f6;
    --accent-hover: #1e40af;
    --shadow: 0 10px 15px rgba(2,6,23,0.15);
    --radius-lg: 12px;
    --radius-md: 8px;
    --max-width-lg: 850px; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; font-family: system-ui, sans-serif; }

body.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    padding: 24px;
    color: var(--text-primary);
    position: relative;
}

.page-overlay {
    position: absolute;
    inset: 0;
    background: var(--page-bg);
    z-index: 0;
}

.card {
    position: relative;
    z-index: 2;
    width: min(95%, var(--max-width-lg));
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px 24px; 
    box-shadow: var(--shadow);
    text-align: center;
}

.title {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 12px; 
}

.game-modal {
    display: none; 
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    padding: 24px;
    border-radius: 12px;
    z-index: 100;
    width: min(92%, 400px);
    box-shadow: 0 8px 30px rgba(2,6,23,0.6);
    text-align: center;
}

.game-modal:not(.hidden) {
    display: block;
}

.modal-content {
    color: #fff;
}

.modal-image {
    max-width: 130px;
    margin: 0 auto 12px;
}

.modal-heading {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-text {
    margin-top: 6px;
    font-size: 1rem;
}

.btn {
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.btn.play-again {
    background: var(--accent);
    color: white;
    margin-top: 15px;
}

.btn.play-again:hover {
    background: var(--accent-hover);
}

.container {
    margin-top: 14px;
    background: var(--surface);
    padding: 18px; 
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(2,6,23,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px; 
}

.word-display {
    list-style: none;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-size: 1rem;
}

.word-display li {
    min-width: 38px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid rgba(15,23,42,0.2);
    font-weight: 600;
    font-size: 1.1rem;
}

.hint-text,
.guess-text {
    color: var(--muted);
    font-size: 1rem;
    text-align: center;
    width: 100%;
}

.hint-text b,
.guess-text b {
    color: var(--text-primary);
    font-weight: 600;
}

.keyboard {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.keyboard button {
    min-width: 42px;
    min-height: 42px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(15,23,42,0.08);
    background: white;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(2,6,23,0.04);
    transition: transform .08s ease, background .12s ease;
}

.keyboard button:active {
    transform: scale(0.95);
}

.keyboard button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.hidden { 
    display: none !important; 
}
.center { display: flex; justify-content: center; align-items: center; }