body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.sidebar {
    width: 600px;
    background: #0a0a0a;
    color: #fff;
    padding: 30px;
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: transform 0.3s ease;
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

#toggle-sidebar {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    color: #ff6200;
    border: 1px solid #ff620033;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 11;
    border-radius: 6px;
    font-size: 18px;
    transition: background 0.2s, color 0.2s;
}

#toggle-sidebar:hover {
    background: #ff620033;
    color: #fff;
}

.open-sidebar-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 53px;
    height: 43px;
    background: #ffffff08;
    color: #fff;
    border: 1px solid #ffffff0a;
    font-size: 20px;
    cursor: pointer;
    z-index: 9;
    display: none;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.open-sidebar-btn.visible {
    display: block;
}

.open-sidebar-btn:hover {
    background: #ffffff17;
}

.toggle-stars-btn,
.toggle-stats-btn,
.end-game-btn,
.toggle-solar-btn {
    position: absolute;
    bottom: 25px;
    width: 53px;
    height: 43px;
    background: #ffffff08;
    color: #fff;
    border: 1px solid #ffffff0a;
    font-size: 20px;
    cursor: pointer;
    z-index: 9;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.toggle-stars-btn {
    right: 25px;
}

.toggle-stats-btn {
    right: 90px;
}

.end-game-btn {
    right: 155px;
    display: block !important; /* Immer sichtbar */
    visibility: visible !important;
    opacity: 1 !important;
}

.toggle-solar-btn {
    right: 220px;
}

.toggle-stars-btn:hover,
.toggle-stats-btn:hover,
.end-game-btn:hover,
.toggle-solar-btn:hover {
    background: #ffffff17;
}

.chart-range {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #0a0a0a;
    color: #fff;
    border: 1px solid #ff620033;
    padding: 8px;
    z-index: 9;
    display: none;
    border-radius: 6px;
    font-size: 14px;
}

.chart-range.visible {
    display: block;
}

.sidebar-header {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sidebar h2 {
    font-size: 24px;
    margin: 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
}

.toggle-form-btn {
    background: none;
    color: #ff6200;
    border: 1px solid #ff620033;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 18px;
    transition: background 0.2s, color 0.2s;
    margin-left: 11px;
}

.toggle-form-btn:hover {
    background: #ff620033;
    color: #fff;
}

#bitcoin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 300px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#bitcoin-form.visible {
    max-height: 200px;
    opacity: 1;
}

#bitcoin-form input {
    padding: 10px;
    width: 100%;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #ffffff33;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#bitcoin-form input:focus {
    border-color: #ff6200;
    outline: none;
}

#bitcoin-form input[type="number"]::-webkit-inner-spin-button,
#bitcoin-form input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#bitcoin-form input[type="number"] {
    -moz-appearance: textfield;
}

#bitcoin-form button {
    padding: 10px;
    background: #ff6200;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

#bitcoin-form button:hover {
    background: #e65a00;
}

.purchase-table {
    font-size: 13px;
    max-height: calc(100% - 150px);
    overflow-y: auto;
    background: #1a1a1a;
    border-radius: 6px;
    padding: 10px;
}

/* Scrollbar anpassen */
.purchase-table::-webkit-scrollbar {
    width: 8px;
}

.purchase-table::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 4px;
}

.purchase-table::-webkit-scrollbar-thumb {
    background: #ff6200;
    border-radius: 4px;
}

.purchase-table::-webkit-scrollbar-thumb:hover {
    background: #e65a00;
}

.header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 80px 40px;
    gap: 10px;
    padding: 10px;
    background: #222;
    font-weight: 500;
    border-radius: 6px;
}

.header span {
    text-align: center;
    cursor: pointer;
    color: #ff6200;
    transition: color 0.2s;
}

.header span:nth-child(2),
.header span:nth-child(3),
.header span:nth-child(4),
.header span:nth-child(5) {
    text-align: right;
}

.header span:hover {
    color: #fff;
}

#purchase-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#purchase-list li {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 80px 40px;
    gap: 10px;
    padding: 10px;
    align-items: center;
    border-bottom: 1px solid #ffffff1a;
    transition: background 0.2s;
}

#purchase-list li:hover {
    background: #222;
}

#purchase-list span {
    text-align: center;
    cursor: pointer;
    color: #fff;
}

#purchase-list span:nth-child(2),
#purchase-list span:nth-child(3),
#purchase-list span:nth-child(4),
#purchase-list span:nth-child(5) {
    text-align: right;
}

#purchase-list span.profit-loss {
    font-weight: 500;
}

#purchase-list input {
    display: none;
    width: 100%;
    margin: 0;
    padding: 5px;
    background: #333;
    color: #fff;
    border: 1px solid #ff6200;
    border-radius: 4px;
    font-size: 12px;
}

#space-canvas {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0a0a1a 0%, #000 70%);
}

.delete-btn {
    width: 30px;
    height: 30px;
    background: #333;
    border: 1px solid #ffffff1a;
    color: #fff;
    text-align: center;
    line-height: 28px;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: #ff620033;
}

.totals {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #ffffff1a;
    color: #fff;
    font-size: 14px;
    background: #1a1a1a;
    border-radius: 6px;
}

.totals p {
    margin: 8px 0;
}

#game-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    z-index: 100;
    display: none;
}

#game-overlay.visible {
    display: block;
}

#game-overlay p {
    color: #fff;
    font-size: 20px;
    margin: 0 0 20px;
    font-family: 'Courier New', monospace;
}

#game-overlay button {
    padding: 10px 20px;
    background: #ff6200;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

#game-overlay button:hover {
    background: #e65a00;
}

/* Responsivität */
@media (max-width: 1200px) {
    .sidebar {
        width: 500px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 400px;
        padding: 20px;
    }

    .sidebar h2 {
        font-size: 20px;
    }

    #bitcoin-form {
        max-width: 100%;
    }

    .purchase-table {
        font-size: 12px;
    }

    #purchase-list li {
        grid-template-columns: 1fr 1fr 1fr 1fr 60px 30px;
        gap: 5px;
    }

    .header {
        grid-template-columns: 1fr 1fr 1fr 1fr 60px 30px;
        gap: 5px;
    }

    .delete-btn {
        width: 25px;
        height: 25px;
        line-height: 23px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        padding: 15px;
    }

    .sidebar h2 {
        font-size: 18px;
    }

    .purchase-table {
        font-size: 11px;
    }

    #purchase-list li {
        grid-template-columns: 1fr 1fr 1fr 1fr 50px 25px;
        gap: 3px;
        padding: 8px;
    }

    .header {
        grid-template-columns: 1fr 1fr 1fr 1fr 50px 25px;
        gap: 3px;
        padding: 8px;
    }

    .delete-btn {
        width: 20px;
        height: 20px;
        line-height: 18px;
        font-size: 10px;
    }

    .toggle-stars-btn,
    .toggle-stats-btn,
    .end-game-btn,
    .toggle-solar-btn {
        width: 45px;
        height: 35px;
        font-size: 18px;
    }

    .toggle-stats-btn {
        right: 80px;
    }

    .end-game-btn {
        right: 135px;
    }

    .toggle-solar-btn {
        right: 190px;
    }

    .chart-range {
        padding: 6px;
        font-size: 12px;
    }
}

/* Barrierefreiheit */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }

    .sidebar {
        background: #000;
        border-right: 1px solid #fff;
    }

    #purchase-list li {
        border-bottom: 1px solid #fff;
    }

    .totals {
        border-top: 1px solid #fff;
    }

    #bitcoin-form input,
    #bitcoin-form button,
    .chart-range {
        border: 1px solid #fff;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar.hidden,
    #bitcoin-form,
    #bitcoin-form.visible {
        transition: none;
    }

    #toggle-sidebar:hover,
    .toggle-form-btn:hover,
    #bitcoin-form button:hover,
    .delete-btn:hover,
    .open-sidebar-btn:hover,
    .toggle-stars-btn:hover,
    .toggle-stats-btn:hover,
    .end-game-btn:hover,
    .toggle-solar-btn:hover,
    #game-overlay button:hover {
        background: #ff6200; /* Fallback für Hover ohne Animation */
    }
}