body {
    margin: 0;
    padding: 0;
    background-color: #000;
    font-family: 'Courier New', monospace;
    color: #00ff00;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#gameContainer {
    width: 1920px;
    height: 1080px;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
}

canvas {
    background-color: #000;
    display: block;
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #00ff00;
    font-size: 18px;
    z-index: 10;
}

#controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #666;
    font-size: 14px;
    z-index: 10;
}

/* Designer overlay mode — activated from debug console */
#formationDesigner.designer-active,
#bossDesigner.designer-active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    z-index: 9999;
    margin: 0;
    border: none;
    border-radius: 0;
}

.designer-close-btn {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 10001;
    padding: 8px 18px;
    background: #aa0000;
    color: #fff;
    border: 1px solid #ff4444;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
}

/* Formation Designer Styles */
#formationDesigner {
    display: none;
    width: 1920px;
    margin: 20px auto;
    padding: 20px;
    background-color: #111;
    border: 2px solid #333;
    color: #00ff00;
}

.designer-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.level-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-navigation input {
    width: 60px;
    background-color: #222;
    border: 1px solid #666;
    color: #00ff00;
    padding: 5px;
    font-family: 'Courier New', monospace;
}

.designer-actions {
    display: flex;
    gap: 10px;
}

.designer-actions button, .level-navigation button {
    background-color: #333;
    border: 2px solid #666;
    color: #ffff00;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

.designer-actions button:hover, .level-navigation button:hover {
    background-color: #555;
    border-color: #888;
}

.designer-main {
    display: flex;
    gap: 30px;
}

.formation-grid {
    display: grid;
    grid-template-columns: repeat(13, 50px);
    grid-template-rows: repeat(6, 50px);
    gap: 2px;
    background-color: #222;
    padding: 10px;
    border: 2px solid #444;
}

.grid-slot {
    width: 50px;
    height: 50px;
    border: 1px solid #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.1s;
}

.grid-slot:hover {
    border-color: #888;
    transform: scale(1.05);
}

.grid-slot.empty {
    background-color: #1a1a1a;
}

.grid-slot.boss-level {
    background: repeating-linear-gradient(
        45deg,
        #330000,
        #330000 10px,
        #440000 10px,
        #440000 20px
    );
    cursor: not-allowed;
    color: #ff6666;
    font-weight: bold;
}

.designer-sidebar {
    flex: 1;
}

.enemy-legend {
    margin-bottom: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #444;
    cursor: pointer;
    transition: all 0.1s;
}

.legend-item:hover {
    border-color: #888;
    background-color: #222;
}

.legend-item.selected {
    border-color: #00ff00;
    background-color: #003300;
}

.legend-color {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border: 1px solid #666;
}

.legend-info {
    flex: 1;
}

.legend-name {
    font-weight: bold;
    color: #ffff00;
}

.legend-points {
    font-size: 12px;
    color: #888;
}

.formation-stats {
    background-color: #222;
    padding: 15px;
    border: 1px solid #444;
}

.formation-stats div {
    margin: 5px 0;
    font-size: 14px;
}

.saved-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #00aa00;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    display: none;
    animation: fadeOut 2s ease-in-out;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Boss Designer Styles */
#bossDesigner {
    display: none;
    width: 1920px;
    margin: 20px auto;
    padding: 20px;
    background-color: #1a1a2e;
    border: 2px solid #16213e;
    border-radius: 10px;
    color: #ffff00;
    font-family: 'Courier New', monospace;
}

.boss-designer-controls {
    margin-bottom: 20px;
}

.boss-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.boss-actions button, .file-input-label {
    background-color: #333;
    border: 2px solid #666;
    color: #ffff00;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.file-input-label {
    display: inline-block;
}

.boss-actions button:hover, .file-input-label:hover {
    background-color: #555;
    border-color: #888;
}

.boss-designer-main {
    display: flex;
    gap: 30px;
}

.boss-canvas-container {
    position: relative;
}

#bossCanvas {
    border: 2px solid #444;
    background-color: #0a0a0a;
    background-image: 
        linear-gradient(45deg, #111 25%, transparent 25%),
        linear-gradient(-45deg, #111 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #111 75%),
        linear-gradient(-45deg, transparent 75%, #111 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.damage-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffff00;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    display: none;
}

.canvas-controls-hint {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    text-align: center;
    color: #666;
    font-size: 11px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 3px;
    border-radius: 3px;
}

.boss-designer-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.component-palette {
    background-color: #16213e;
    padding: 15px;
    border-radius: 5px;
}

.component-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    background-color: #333;
    border: 1px solid #555;
    color: #999;
    padding: 8px;
    cursor: pointer;
    font-size: 12px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background-color: #555;
    color: #ffff00;
    border-color: #777;
}

.component-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.component-item {
    background-color: #333;
    border: 2px solid #555;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.component-item:hover {
    background-color: #444;
    border-color: #777;
}

.component-item.selected {
    border-color: #ffff00;
    background-color: #555;
}

.boss-properties, .selected-component {
    background-color: #16213e;
    padding: 15px;
    border-radius: 5px;
}

.property-group label {
    display: block;
    margin-bottom: 10px;
}

.property-group input {
    width: 100%;
    padding: 5px;
    background-color: #333;
    border: 1px solid #555;
    color: #ffff00;
    border-radius: 3px;
}

.hp-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.hp-stats p {
    margin: 5px 0;
    font-size: 14px;
}

#hpMultiplierValue {
    margin-left: 10px;
    color: #00ff00;
}

.sprite-size-controls {
    margin-top: 10px;
}

.sprite-size-controls label {
    display: block;
    margin: 5px 0;
    font-size: 13px;
}

.sprite-size-controls input {
    width: 80px;
    padding: 3px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #00ff00;
    border-radius: 3px;
}

#applySpriteSize {
    width: 100%;
    padding: 5px;
    background: #004400;
    color: #00ff00;
    border: 1px solid #006600;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

#applySpriteSize:hover {
    background: #006600;
}

/* Weapon Properties Panel */
.weapon-properties {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.weapon-properties h4 {
    margin: 0 0 10px 0;
    color: #ffff00;
    font-size: 14px;
}

.weapon-properties label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.weapon-properties input[type="number"],
.weapon-properties select {
    flex: 1;
    margin-left: 10px;
    padding: 4px;
    background-color: #333;
    border: 1px solid #555;
    color: #ffff00;
    border-radius: 3px;
    font-size: 11px;
}

.weapon-properties .unit {
    margin-left: 5px;
    color: #888;
    font-size: 10px;
}