:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --correct: #4ade80;
    --wrong: #f87171;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at center, #1e293b 0%, var(--bg-color) 100%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    width: 100%;
    max-width: 1100px;
}

.game-container.hidden, .hidden {
    display: none !important;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    font-size: 1.3rem;
}

.accent {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.stats-bar {
    display: flex;
    gap: 8px;
}

.stat-box {
    background: var(--panel-bg);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.75rem;
}

/* Responsive Adaptive Dashboard Layouts */
.management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

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

.dynamic-box {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.screen h3 {
    margin-bottom: 10px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.emergency-panel {
    border: 1px dashed rgba(56, 189, 248, 0.4);
}

.blitz-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-family: 'Orbitron', sans-serif;
}

#blitz-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--accent);
    color: var(--text-main);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-family: 'Orbitron', sans-serif;
}

.mode-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    text-align: center;
}

.mode-btn.active {
    background: var(--accent);
    color: var(--bg-color);
    font-weight: 600;
    border-color: var(--accent);
}

/* Main Arena Layout */
.gameplay-area {
    display: grid;
    grid-template-columns: 1.8fr 3fr;
    gap: 15px;
}

.gameplay-area.disabled-blur {
    opacity: 0.15;
    pointer-events: none;
    filter: blur(5px);
}

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

.visual-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#hangman-svg {
    width: 60%;
    max-width: 180px;
    height: auto;
}

.scaffold {
    stroke: var(--text-main);
    stroke-width: 3.5;
    stroke-linecap: round;
}

.body-part {
    stroke: var(--wrong);
    stroke-width: 4.5;
    stroke-linecap: round;
    fill: none;
    opacity: 0;
}

.body-part.visible {
    opacity: 1;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.starter-clue-box {
    padding: 10px 15px;
    font-size: 0.8rem;
    border-left: 3px solid var(--accent);
}

.accent-label {
    font-weight: 600;
    color: var(--accent);
}

.word-display {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
    align-items: center;
}

.letter-slot {
    width: 24px;
    height: 32px;
    border-bottom: 2px solid var(--text-muted);
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.letter-slot.revealed {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.hint-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.hint-btn {
    width: 100%;
}

.hint-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Smartphone Native Optimized Grid Keyboard Layout */
.keyboard {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.key {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
}

.key.correct-guess {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--correct);
    color: var(--correct);
}

.key.wrong-guess {
    background: rgba(248, 113, 113, 0.1);
    border-color: var(--wrong);
    color: var(--wrong);
    opacity: 0.4;
}

/* Overlays */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border);
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

input[type="text"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 6px;
    color: var(--text-main);
    text-align: center;
    margin-top: 10px;
}

.action-btn {
    background: var(--accent);
    color: var(--bg-color);
    font-weight: bold;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}