:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

.new-game-wrapper {
    background-color: var(--bg-color); color: var(--text-main);
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; overflow: hidden; touch-action: manipulation;
}

#game-container {
    width: 100%; max-width: 500px; background-color: var(--card-bg);
    border-radius: 16px; padding: 16px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    position: relative;
    min-height: 550px;
}

.screen { display: none; flex-direction: column; align-items: center; text-align: center; animation: fadeIn 0.3s; }
.screen.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.game-title { font-size: 2rem; font-weight: 800; margin-bottom: 16px; color: #c4b5fd; }
.instructions { color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; }
.final-score { font-size: 1.5rem; font-weight: 700; color: #fcd34d; margin-bottom: 24px; }

.btn {
    border: none; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 700;
    color: white; cursor: pointer; transition: all 0.2s; width: 100%; max-width: 250px;
}
.btn:active { transform: scale(0.95); }
.btn.primary { background-color: var(--primary); }
.btn.primary:hover { background-color: var(--primary-hover); }
.btn.success { background-color: var(--success); }
.btn.warning { background-color: var(--warning); }

.header { display: flex; justify-content: space-between; width: 100%; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #334155; font-weight: 600; font-size: 0.9rem; }
.puzzle-area { width: 100%; display: flex; flex-direction: column; gap: 16px; align-items: center; }

.crossword-grid {
    display: grid;
    gap: 4px;
    background: #334155;
    padding: 8px;
    border-radius: 8px;
}

.cell {
    width: 40px; height: 40px; background: #0f172a;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.2rem; font-weight: 700; color: #fff;
    cursor: pointer; text-transform: uppercase;
    position: relative;
    border: 2px solid transparent;
}
.cell.empty { background: transparent; pointer-events: none; }
.cell.active { border-color: var(--primary); background: #1e293b; }
.cell.highlight { background: rgba(139, 92, 246, 0.3); }
.cell.correct { color: var(--success); pointer-events: none; }
.cell.wrong { color: var(--danger); }

.cell-num {
    position: absolute; top: 2px; left: 2px;
    font-size: 0.6rem; color: #94a3b8; font-weight: 400;
}

.clue-box {
    background: #0f172a; border-left: 4px solid var(--primary);
    padding: 12px; border-radius: 4px; width: 100%; text-align: left;
    min-height: 50px; display: flex; align-items: center;
}
#clue-text { color: #e2e8f0; font-size: 0.95rem; line-height: 1.4; }

.input-area { width: 100%; display: flex; justify-content: center; }
.cell-input {
    width: 60px; height: 60px; text-align: center; font-size: 2rem;
    font-weight: bold; text-transform: uppercase;
    background: #0f172a; border: 2px solid var(--primary);
    color: white; border-radius: 8px; outline: none;
}
.cell-input:focus { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5); }

.controls { display: flex; gap: 12px; justify-content: center; width: 100%; }
.controls .btn { width: auto; flex: 1; }

.feedback-text { font-weight: 700; font-size: 1rem; height: 20px; }
.feedback-text.success { color: var(--success); }
.feedback-text.error { color: var(--danger); }
