:root {
    --bg-color: #0d0221;
    --grid-color: rgba(0, 255, 204, 0.15);
    --text-main: #00ffcc;
    --text-accent: #ff007f;
    --terminal-font: 'Courier New', Courier, monospace;
}

/* CRITICAL MOBILE FIX: Forces padding to shrink inward instead of pushing elements off-screen */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-main);
    font-family: var(--terminal-font);
    text-shadow: 0px 0px 5px rgba(0, 255, 204, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden; /* Stops horizontal scrolling on phones */
}

/* Fixed CRT Scanline Effect */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.terminal-box, .panel {
    border: 1px solid var(--text-main);
    border-radius: 12px;
    padding: 30px;
    background: rgba(13, 2, 33, 0.90);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2), inset 0 0 10px rgba(0, 255, 204, 0.1);
    z-index: 10;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.dashboard-grid { 
    display: flex; 
    flex-direction: column; /* Stacks panels smoothly on mobile */
    gap: 20px; 
    width: 100%; 
    max-width: 1200px; 
    margin-top: 20px; 
}

/* On Desktop, sit side by side */
@media (min-width: 768px) {
    .dashboard-grid { flex-direction: row; }
    .panel { flex: 1; }
}

h1, h2, h3 { 
    color: var(--text-accent); 
    text-shadow: 0px 0px 8px rgba(255, 0, 127, 0.6); 
    letter-spacing: 2px; 
    font-size: 1.2rem; /* Better scaling for phones */
}
h1 { font-size: 1.5rem; }

.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

/* Touch-friendly Inputs & Buttons */
input, select { 
    background: rgba(0,0,0,0.5); 
    border: 1px solid var(--text-main); 
    border-radius: 6px; 
    color: var(--text-main); 
    padding: 14px; /* Larger tap targets for fat fingers */
    width: 100%; 
    margin-bottom: 15px; 
    font-family: var(--terminal-font); 
    outline: none; 
    font-size: 1rem; /* Prevents iOS from auto-zooming the screen */
}
input:focus, select:focus { border-color: var(--text-accent); box-shadow: 0 0 10px rgba(255, 0, 127, 0.4); }

.btn {
    display: block; /* Forces full width on mobile */
    padding: 14px 20px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-accent);
    border: 1px solid var(--text-accent);
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

.btn:hover { background: var(--text-accent); color: var(--bg-color); box-shadow: 0 0 20px rgba(255, 0, 127, 0.8); }
.small-btn { padding: 10px 12px; font-size: 0.9rem; margin-top: 5px; }

@media (max-width: 480px) {
    body { padding: 10px; }
    .terminal-box, .panel { padding: 20px 15px; }
}