* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #00ff00;
    min-height: 100vh;
    overflow-x: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #333;
    border: 2px solid #666;
    border-radius: 5px;
}

header h1 {
    font-size: 2.5em;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    margin-bottom: 10px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    font-size: 1.2em;
    background: #000;
    padding: 10px 20px;
    border: 1px solid #555;
    margin-top: 15px;
}

.main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.tablet-area {
    position: relative;
    flex: 1;
    background: #f5f5dc;
    border: 3px solid #8b4513;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

#tablet {
    background: #ffffff;
    border: 2px solid #666;
    display: block;
    cursor: none;
}

.puck {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 100;
    transition: transform 0.1s ease;
}

.puck.pressed {
    transform: scale(0.95);
}

.puck-body {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(200, 200, 200, 0.9) 0%, rgba(150, 150, 150, 0.9) 100%);
    border: 2px solid #666;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: #ff0000;
}

.crosshair::before {
    top: 9px;
    left: 0;
    width: 20px;
    height: 2px;
}

.crosshair::after {
    top: 0;
    left: 9px;
    width: 2px;
    height: 20px;
}

.buttons {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.button {
    width: 12px;
    height: 12px;
    background: #444;
    border: 1px solid #666;
    border-radius: 2px;
    font-size: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}

.button.pressed {
    background: #00ff00;
    color: #000;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.led {
    position: absolute;
    bottom: 5px;
    left: 5px;
    width: 6px;
    height: 6px;
    background: #00ff00;
    border-radius: 50%;
    opacity: 1;
    transition: opacity 0.5s ease;
    box-shadow: 0 0 5px #00ff00;
}

.cable {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #333 0%, #666 50%, #333 100%);
    border-radius: 2px;
    transform-origin: 0 50%;
    transition: transform 0.2s ease;
}

.control-panel {
    width: 300px;
    background: #333;
    border: 2px solid #666;
    border-radius: 5px;
    padding: 20px;
    max-height: fit-content;
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #555;
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    color: #00ff00;
    margin-bottom: 10px;
    font-size: 1.1em;
    text-shadow: 0 0 5px #00ff00;
}

select, button {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    background: #000;
    color: #00ff00;
    border: 1px solid #666;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

select:focus, button:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.tool {
    width: calc(50% - 5px);
    display: inline-block;
    margin: 2px;
}

.tool.active {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.clear-btn {
    background: #ff3300;
    color: white;
    margin-top: 10px;
}

.clear-btn:hover {
    background: #ff5533;
}

button:hover {
    background: #004400;
    transform: translateY(-1px);
}

.tool.active:hover {
    background: #00dd00;
    color: #000;
}

.button-map div {
    padding: 5px 0;
    border-bottom: 1px solid #444;
    font-size: 0.9em;
}

.button-map div:last-child {
    border-bottom: none;
}

#calibration-status,
#distance-traveled,
#movement-speed {
    font-size: 0.9em;
    color: #88ff88;
    margin: 5px 0;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: #222;
    border: 1px solid #555;
    border-radius: 5px;
    color: #888;
    font-size: 0.9em;
}

footer a {
    color: #00ff00;
    text-decoration: none;
}

footer a:hover {
    text-shadow: 0 0 5px #00ff00;
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .panel-section {
        display: inline-block;
        width: calc(50% - 10px);
        margin-right: 20px;
        vertical-align: top;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    #tablet {
        width: 100%;
        height: 400px;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 5px;
    }
    
    .panel-section {
        width: 100%;
        margin-right: 0;
    }
    
    header h1 {
        font-size: 1.8em;
    }
}

/* Scanlines effect */
.tablet-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.02) 2px,
        rgba(0, 255, 0, 0.02) 4px
    );
    pointer-events: none;
    z-index: 10;
}

/* Retro glow effects */
.tool.active,
header h1,
.status-bar {
    animation: subtle-glow 2s ease-in-out infinite alternate;
}

@keyframes subtle-glow {
    from {
        text-shadow: 0 0 5px currentColor;
    }
    to {
        text-shadow: 0 0 10px currentColor, 0 0 15px currentColor;
    }
}