/* 
   RETRO ENGINE STUDIO - MODERN VANILLA CSS 
   Target Audience: 10-15 Years Old
   Aesthetic: Clean, Sharp, Playful but Professional (Mario Maker vibes)
*/

:root {
    --bg-deep: #0f172a;
    --bg-surface: #1e293b;
    --bg-higher: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #10b981;
    --danger: #ef4444;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --font-inter: 'Inter', system-ui, sans-serif;
}

/* RESET & BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    background-color: var(--bg-deep); 
    color: var(--text-main); 
    font-family: var(--font-inter);
    overflow: hidden;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* SHARED UI COMPONENTS */
.card {
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    color: white;
}

.btn-primary { 
    background: var(--primary); 
    box-shadow: 0 4px 0 #1d4ed8, 0 8px 15px var(--primary-glow); 
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #1d4ed8; }

.btn-secondary { background: var(--bg-higher); }
.btn-secondary:hover { background: #475569; }

/* BOOT SCREEN REDESIGN */
.fullscreen-overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    z-index: 1000;
}

#boot-title {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 0.9;
    background: linear-gradient(135deg, #fff 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

/* EDITOR LAYOUT */
#editor-layout {
    display: grid;
    grid-template-columns: 100px 1fr 340px;
    height: 100vh;
}

#toolbar {
    background: var(--bg-deep);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    gap: 12px;
    align-items: center;
}

.tool-btn {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
}

.tool-btn:hover { background: var(--bg-higher); transform: scale(1.05); }
.tool-btn.active {
    background: var(--primary);
    border-color: #60a5fa;
    box-shadow: 0 0 20px var(--primary-glow);
}

.tool-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 6px;
    color: var(--text-muted);
}
.tool-btn.active .tool-label { color: white; }

/* GRID AREA */
#canvas-area {
    background: #020617;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#grid-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.05);
}

#grid-container {
    background: #000;
    border: 4px solid var(--bg-surface);
    border-radius: var(--radius-sm);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    display: grid;
    image-rendering: pixelated;
}

/* ASSET LIBRARY */
#asset-library {
    background: var(--bg-surface);
    border-left: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
}

#library-header {
    padding: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* SEQUENCER (VISUAL MAP) */
#sequencer-overlay {
    position: fixed; inset: 0;
    background: rgba(2, 6, 23, 0.95);
    z-index: 500;
    display: flex; flex-direction: column;
    padding: 40px;
}

.level-node {
    width: 180px; height: 120px;
    background: var(--bg-surface);
    border: 2px solid var(--bg-higher);
    border-radius: var(--radius-md);
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.level-node:hover { border-color: var(--primary); transform: translateY(-5px); }
.level-node.title-screen { border-color: #eab308; box-shadow: 0 0 20px rgba(234, 179, 8, 0.3); }

.level-preview {
    width: 100%; height: 60px;
    background: #000;
    border-radius: 4px;
    margin-bottom: 8px;
    image-rendering: pixelated;
    background-size: contain; background-repeat: no-repeat; background-position: center;
}

.level-name { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-main); }
