/* ═══════════════════════════════════════════
   Galaxy Collision — Layout & Styling
   ═══════════════════════════════════════════ */

.gc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    color: #e2e8f0;
}

/* ── Header ─────────────────────────────── */
.gc-header {
    margin-bottom: 0.75rem;
}
.gc-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.gc-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.gc-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0 0 0 2.25rem;
}

/* ── Tabs ────────────────────────────────── */
.gc-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
}
.gc-tab {
    background: transparent;
    border: 1px solid #475569;
    border-radius: 6px 6px 0 0;
    color: #94a3b8;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.gc-tab:hover {
    color: #e2e8f0;
    background: #1e293b;
}
.gc-tab.active {
    color: #a78bfa;
    border-color: #a78bfa;
    background: #1e293b;
}
.gc-tab-num {
    font-weight: 700;
    margin-right: 0.25rem;
}

/* ── Main Layout ─────────────────────────── */
.gc-main {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* ── Controls Panel ──────────────────────── */
.gc-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.gc-scenario-controls {
    display: contents;
}
.gc-scenario-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0;
    padding: 0.4rem 0.5rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    border-left: 3px solid #a78bfa;
}
.gc-control-group {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.6rem;
}
.gc-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.gc-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-bottom: 0.15rem;
}
.gc-value {
    color: #a78bfa;
    font-family: monospace;
    font-size: 0.7rem;
}
.gc-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #475569;
    border-radius: 2px;
    outline: none;
    margin-bottom: 0.4rem;
    cursor: pointer;
}
.gc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a78bfa;
    cursor: pointer;
}
.gc-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a78bfa;
    border: none;
    cursor: pointer;
}

/* ── Buttons ─────────────────────────────── */
.gc-btn {
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.gc-btn:hover {
    background: #475569;
    color: #fff;
}
.gc-btn.active {
    background: #a78bfa;
    color: #1e293b;
    border-color: #a78bfa;
}
.gc-btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}
.gc-btn-row {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}
.gc-center-btns {
    flex-wrap: wrap;
}

/* ── Presets ──────────────────────────────── */
.gc-preset-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.gc-preset {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #94a3b8;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.7rem;
    text-align: left;
    transition: all 0.15s;
}
.gc-preset:hover {
    background: #1e293b;
    color: #a78bfa;
    border-color: #a78bfa;
}

/* ── Checkboxes & Radios ─────────────────── */
.gc-check, .gc-radio {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #cbd5e1;
    cursor: pointer;
    margin-bottom: 0.15rem;
}
.gc-check input[type="checkbox"],
.gc-radio input[type="radio"] {
    accent-color: #a78bfa;
    cursor: pointer;
}

/* ── Canvas Wrapper & Zoom ────────────────── */
.gc-canvas-wrap {
    position: relative;
    flex-shrink: 0;
}
.gc-zoom-btns {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 2;
}

/* ── Canvas Area ─────────────────────────── */
.gc-canvas-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.gc-canvas-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

/* ── Quick-Reference Tips ────────────────── */
.gc-tips {
    flex: 1;
    min-width: 150px;
    max-width: 220px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    font-size: 0.7rem;
    line-height: 1.5;
    color: #94a3b8;
    align-self: stretch;
    overflow-y: auto;
    max-height: calc(100vh - 260px);
}
.gc-tips-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.gc-tips-title:not(:first-child) {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid #334155;
}
.gc-tip {
    margin-bottom: 0.25rem;
    color: #cbd5e1;
    font-size: 0.68rem;
    line-height: 1.45;
}
.gc-tip kbd {
    display: inline-block;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 3px;
    padding: 0 0.3rem;
    font-size: 0.62rem;
    font-family: monospace;
    color: #a78bfa;
    min-width: 1.4em;
    text-align: center;
    margin-right: 0.2rem;
}
.gc-tip i {
    color: #64748b;
    width: 1em;
    text-align: center;
    margin-right: 0.15rem;
}
.gc-tip b {
    color: #a78bfa;
    font-weight: 600;
}
#gcCanvas {
    height: calc(100vh - 260px);
    aspect-ratio: 1;
    max-width: 100%;
    background: #0a0e1a;
    border-radius: 8px;
    border: 1px solid #334155;
    cursor: crosshair;
}

/* ── Info Bar ────────────────────────────── */
.gc-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 0.75rem;
}
.gc-info-item {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}
.gc-info-label {
    color: #64748b;
    font-style: italic;
}
.gc-info-val {
    color: #e2e8f0;
    font-family: monospace;
    font-size: 0.75rem;
}

/* ── How to Use ──────────────────────────── */
.gc-howto {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-top: 0.5rem;
}
.gc-howto summary {
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
}
.gc-howto-content {
    margin-top: 0.5rem;
}
.gc-howto-content p {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

/* ── Hidden utility ──────────────────────── */
.hidden {
    display: none !important;
}

/* ══════════════════════════════════════════
   Responsive: tablet/mobile
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
    .gc-tips {
        display: none;
    }
}

@media (max-width: 768px) {
    .gc-main {
        grid-template-columns: 1fr;
    }
    .gc-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .gc-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .gc-controls {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════
   Night Mode (red-tinted)
   ══════════════════════════════════════════ */
body[data-theme="night"] .gc-container {
    color: #fca5a5;
}
body[data-theme="night"] .gc-title {
    color: #fca5a5;
}
body[data-theme="night"] .gc-subtitle {
    color: #b47070;
}
body[data-theme="night"] .gc-tab {
    color: #b47070;
    border-color: #7f1d1d;
}
body[data-theme="night"] .gc-tab:hover {
    color: #fca5a5;
    background: #7f1d1d;
}
body[data-theme="night"] .gc-tab.active {
    color: #ef4444;
    border-color: #ef4444;
    background: #7f1d1d;
}
body[data-theme="night"] .gc-control-group,
body[data-theme="night"] .gc-howto,
body[data-theme="night"] .gc-info-bar,
body[data-theme="night"] .gc-tips {
    background: #7f1d1d;
    border-color: #991b1b;
}
body[data-theme="night"] .gc-tips-title {
    color: #b47070;
    border-top-color: #991b1b;
}
body[data-theme="night"] .gc-tip {
    color: #fca5a5;
}
body[data-theme="night"] .gc-tip kbd {
    background: #991b1b;
    border-color: #b91c1c;
    color: #ef4444;
}
body[data-theme="night"] .gc-tip i {
    color: #b47070;
}
body[data-theme="night"] .gc-tip b {
    color: #ef4444;
}
body[data-theme="night"] .gc-btn {
    background: #991b1b;
    border-color: #b91c1c;
    color: #fca5a5;
}
body[data-theme="night"] .gc-btn:hover {
    background: #b91c1c;
    color: #fef2f2;
}
body[data-theme="night"] .gc-btn.active {
    background: #ef4444;
    color: #450a0a;
    border-color: #ef4444;
}
body[data-theme="night"] .gc-slider {
    background: #991b1b;
}
body[data-theme="night"] .gc-slider::-webkit-slider-thumb {
    background: #ef4444;
}
body[data-theme="night"] .gc-slider::-moz-range-thumb {
    background: #ef4444;
}
body[data-theme="night"] .gc-preset {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #b47070;
}
body[data-theme="night"] .gc-preset:hover {
    background: #7f1d1d;
    color: #ef4444;
    border-color: #ef4444;
}
body[data-theme="night"] .gc-value {
    color: #ef4444;
}
body[data-theme="night"] .gc-label,
body[data-theme="night"] .gc-check,
body[data-theme="night"] .gc-radio,
body[data-theme="night"] .gc-info-val {
    color: #fca5a5;
}
body[data-theme="night"] .gc-info-label,
body[data-theme="night"] .gc-group-title {
    color: #b47070;
}
body[data-theme="night"] .gc-scenario-desc {
    color: #fca5a5;
    background: #7f1d1d;
    border-color: #991b1b;
    border-left-color: #ef4444;
}
body[data-theme="night"] #gcCanvas {
    background: #1a0505;
    border-color: #7f1d1d;
}
body[data-theme="night"] .gc-check input[type="checkbox"],
body[data-theme="night"] .gc-radio input[type="radio"] {
    accent-color: #ef4444;
}
body[data-theme="night"] .gc-howto summary {
    color: #b47070;
}
body[data-theme="night"] .gc-howto-content p {
    color: #fca5a5;
}
