* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #1e2c3a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Roboto, sans-serif;
    padding: 4px;
}

/* Container */
.game-container {
    background: linear-gradient(165deg, #253b4b, #1a2e3d);
    width: 100%;
    max-width: 360px;
    border-radius: 28px;
    padding: 12px 8px 14px;
    border: 1px solid #7b9eb9;
    box-shadow: 0 10px 15px rgba(0,0,0,0.5);
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.top-bar h1 {
    color: #ffecb3;
    font-size: 1.4rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 0 #0b1a24;
}

.counter {
    background: #4a2e2e;
    color: #ffcaca;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #ce9f5a;
}

/* Drawing Area - SVG Container */
.drawing-area {
    background: #b6cfdf;
    border-radius: 24px;
    padding: 8px;
    margin-bottom: 8px;
    border: 2px solid #5c4029;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 140px;
}

.hangman-svg {
    width: 120px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hangman-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Word Area */
.word-area {
    background: #16232e;
    border-radius: 30px;
    padding: 10px 5px 5px;
    margin-bottom: 6px;
    border: 2px solid #e0b27a;
    box-shadow: inset 0 2px 3px #0a131c;
}

.word-letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px 6px;
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Fira Mono', monospace;
    color: #fad896;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.word-letters span {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    border-bottom: 3px solid #f0b86b;
    line-height: 1.2;
}

.word-info {
    text-align: center;
    color: #aac5dd;
    font-size: 0.7rem;
}

/* Hint Row */
.hint-row {
    display: flex;
    gap: 6px;
    margin: 6px 0 8px;
}

.hint-bubble {
    background: #ffe3ac;
    border-radius: 30px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 2;
    border: 2px solid #c8914a;
    box-shadow: 0 2px 0 #836e3d;
}

.hint-icon {
    font-size: 1.1rem;
}

.hint-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f4055;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guessed-bubble {
    background: #1f3c4b;
    border-radius: 30px;
    padding: 6px 12px;
    color: #ffd78c;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
    text-align: center;
    border: 2px solid #b38b52;
    white-space: nowrap;
    overflow-x: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Message */
.message-mini {
    background: #f7e9cc;
    border-radius: 25px;
    padding: 6px 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #1f4f68;
    margin: 6px 0 8px;
    border: 2px solid #b88044;
    box-shadow: 0 2px 0 #695435;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* QWERTY Keyboard Layout */
.keyboard-container {
    background: #1f3847b0;
    border-radius: 20px;
    padding: 8px 4px;
    margin: 5px 0 10px;
    border: 1px solid #c0985a;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.keyboard-row:last-child {
    margin-bottom: 0;
}

.key-btn {
    background: #ede0cc;
    border: 2px solid #7a6243;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1b2c3b;
    box-shadow: 0 3px 0 #5d4832;
    cursor: pointer;
    transition: 0.05s linear;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    min-width: 28px;
    flex: 1 1 auto;
    -webkit-appearance: none;
}

.key-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #5d4832;
}

.key-btn:disabled {
    opacity: 0.35;
    transform: translateY(2px);
    box-shadow: 0 1px 0 #5d4832;
    background: #a9a08b;
}

/* Restart */
.restart-mini {
    background: #facc6f;
    border: none;
    font-size: 1.3rem;
    padding: 8px 0;
    width: 100%;
    border-radius: 40px;
    font-weight: 600;
    color: #1e3545;
    border-bottom: 4px solid #9e712b;
    cursor: pointer;
    box-shadow: 0 4px 0 #614c2e;
    transition: 0.05s linear;
}

.restart-mini:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
}

/* Shake Animation */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

/* Footer */
.footer {
    text-align: center;
    color: #9bb7d1;
    font-size: 0.8rem;
    margin-top: 12px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.powered {
    opacity: 0.7;
    font-size: 0.7rem;
}

.credit {
    color: #ffd966;
    font-weight: 700;
    text-shadow: 0 1px 0 #4a3720;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.2);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid #dba959;
}

/* Small screens */
@media (max-width: 330px) {
    .word-letters { font-size: 1.8rem; }
    .word-letters span { min-width: 25px; }
    .key-btn { font-size: 0.9rem; padding: 4px 0; }
    .hangman-svg { width: 100px; height: 110px; }
}