:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #14b8a6;
    --primary-hover: #0d9488;
    --success: #10b981;
    --danger: #ef4444;
}

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

.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;
}

#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: 600px;
    display: flex; flex-direction: column;
}

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

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

.game-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; color: #5eead4; }
.instructions { color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; padding: 0 20px; }
.final-score { font-size: 1.5rem; font-weight: 700; color: #5eead4; 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.small { padding: 8px 16px; font-size: 0.9rem; max-width: 150px; }
.btn.mt { margin-top: 20px; }
.btn:active { transform: scale(0.95); }
.btn.primary { background-color: var(--primary); }
.btn.primary:hover { background-color: var(--primary-hover); }
.btn.warning { background-color: #475569; }

.header { display: flex; justify-content: center; width: 100%; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #334155; font-weight: 700; font-size: 1.2rem; color: #5eead4; }
.puzzle-area { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Hex Grid Container - we use a staggered square grid to simulate hex visually for simplicity */
.hex-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #0f172a;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.hex-row {
    display: flex;
    justify-content: center;
    margin-bottom: -6px; /* tighter vertical spacing to simulate hex */
}

/* Base hex cell visually is just a circle/polygon for MVP */
.h-cell {
    width: 32px; height: 36px;
    background: #1e293b;
    margin: 0 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: background 0.2s;
}

.h-cell.filled { background: var(--primary); }

/* Blocks container */
.blocks-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 120px;
}

.shape-wrapper {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 30%; height: 100%;
    border: 2px dashed #475569;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.shape-wrapper.selected { border-color: var(--primary); background: rgba(20,184,166,0.1); transform: scale(1.1); }
.shape-wrapper.used { opacity: 0; pointer-events: none; }

.shape-row { display: flex; justify-content: center; margin-bottom: -3px; pointer-events: none; }
.shape-h-cell {
    width: 16px; height: 18px;
    margin: 0 1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
}
.shape-h-cell.filled { background: var(--primary); }
