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

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    background: #000010;
}

#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

#ui-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
}

/* Title Screen */
#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 200;
    pointer-events: none;
    padding: 20px 0;
    background: linear-gradient(to bottom, rgba(0, 0, 16, 0.9) 0%, rgba(0, 0, 16, 0.7) 50%, rgba(0, 0, 16, 0) 100%);
}

#game-title {
    font-size: 3em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.2),
        3px 3px 6px rgba(0, 0, 0, 0.8);
    margin: 0;
    letter-spacing: 0.2em;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.5),
            0 0 20px rgba(255, 215, 0, 0.3),
            0 0 30px rgba(255, 215, 0, 0.2),
            3px 3px 6px rgba(0, 0, 0, 0.8);
    }
    100% {
        text-shadow: 
            0 0 15px rgba(255, 215, 0, 0.7),
            0 0 30px rgba(255, 215, 0, 0.5),
            0 0 45px rgba(255, 215, 0, 0.3),
            3px 3px 6px rgba(0, 0, 0, 0.8);
    }
}

#currency-display {
    position: absolute;
    top: 100px;
    left: 20px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#shard-count {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #ffd700;
}

#alloy-count {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #c0c0c0;
}

#singularity-count {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #9b59b6;
}

#sps-display {
    font-size: 1.2em;
    color: #0ff;
    margin-top: 10px;
}

.panel {
    position: absolute;
    background: rgba(0, 0, 20, 0.9);
    border: 2px solid #0ff;
    border-radius: 8px;
    color: #fff;
    pointer-events: auto;
    min-width: 250px;
    user-select: none;
    transition: box-shadow 0.2s;
    z-index: 100;
}

.panel.dragging {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    z-index: 1000;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #0ff;
    cursor: move;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 6px 6px 0 0;
}

.panel-header:hover {
    background: rgba(0, 255, 255, 0.1);
}

.panel-header h3 {
    margin: 0;
    padding: 0;
    color: #0ff;
    border-bottom: none;
    flex: 1;
    cursor: move;
}

.panel-content {
    padding: 15px;
    overflow: hidden;
    max-height: 1000px; /* Large enough for content */
    opacity: 1;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
}

.panel.collapsed .panel-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.panel.collapsed .collapse-btn {
    transform: rotate(-90deg);
}

.collapse-btn {
    background: transparent;
    border: 1px solid #0ff;
    color: #0ff;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: transform 0.3s ease, background 0.2s;
    flex-shrink: 0;
    pointer-events: auto;
}

.collapse-btn:hover {
    background: rgba(0, 255, 255, 0.2);
}

.collapse-btn:active {
    background: rgba(0, 255, 255, 0.3);
}

#upgrades-panel {
    top: 20px;
    right: 20px;
}

#fleet-panel {
    top: 20px;
    right: 300px;
}

#refinery-panel {
    bottom: 20px;
    right: 20px;
}

#prestige-panel {
    bottom: 20px;
    left: 20px;
}

#debug-panel {
    top: 200px;
    right: 20px;
}

#camera-panel {
    top: 200px;
    right: 300px;
}

.panel-content h3,
.panel-content h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

.panel-content h3 {
    color: #0ff;
}

.panel-content h3:first-child {
    margin-top: 0;
}

.panel-content h4 {
    color: #ffd700;
}

.button-group {
    margin: 8px 0;
    display: flex;
    gap: 5px;
    align-items: center;
}

.button-group > button:first-child {
    flex: 1;
}

.bulk-buttons {
    display: flex;
    gap: 3px;
}

.bulk-btn {
    width: 50px !important;
    min-width: 50px;
    padding: 8px 5px !important;
    font-size: 12px !important;
    margin: 0 !important;
}

button {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    background: #001122;
    border: 1px solid #0ff;
    color: #0ff;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    background: #003344;
    border-color: #0ffff0;
    color: #0ffff0;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444;
}

#refine-cost-display,
#prestige-points-display,
#prestige-boost-display {
    margin: 10px 0;
    padding: 8px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    border-radius: 4px;
    font-size: 12px;
}

.hidden {
    display: none !important;
}

#currency-display h1,
#currency-display h2 {
    margin-bottom: 5px;
}

.sps-item {
    margin: 5px 0;
    padding: 3px 0;
    color: #0ff;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

/* Permanent Restart Button */
.restart-button {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    background: #001122;
    border: 1px solid #ff4444;
    color: #ff4444;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    border-radius: 3px;
    transition: all 0.2s;
    z-index: 1000;
    pointer-events: auto;
    width: auto;
    min-width: auto;
}

.restart-button:hover {
    background: #003344;
    border-color: #ff6666;
    color: #ff6666;
}
