/* ===== Hyperscale — data center simulator ===== */

.dc-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem;
    font-variant-numeric: tabular-nums;
}

/* ---- Top bar ---- */
.dc-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0 1rem;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.dc-logo {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.25em;
    background: linear-gradient(135deg, #3b82f6, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dc-tagline {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.85rem;
    margin-left: 0.8rem;
}

.dc-session {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
}

/* ---- Layout ---- */
.dc-layout {
    display: grid;
    grid-template-columns: 320px minmax(320px, 1fr) 320px;
    gap: 1rem;
    align-items: start;
}

.dc-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.dc-panel {
    background: var(--bg-card, #1a2235);
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 1rem;
}

.dc-panel h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary, #94a3b8);
    margin: 0.8rem 0 0.5rem;
}

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

/* ---- Stats ---- */
.dc-money {
    font-size: 2.1rem;
    font-weight: 800;
    color: #34d399;
}

.dc-substats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0.3rem 0 0.9rem;
}

.dc-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dc-meter {
    margin-bottom: 0.55rem;
}

.dc-meter-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 0.2rem;
}

.dc-meter-bar {
    height: 7px;
    background: #0d1424;
    border-radius: 4px;
    overflow: hidden;
}

.dc-meter-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.25s linear;
}

.dc-meter-fill.warn { background: #facc15; }
.dc-meter-fill.danger { background: #ef4444; }
.dc-meter-fill.run { background: linear-gradient(90deg, #3b82f6, #34d399); }

/* ---- Crunch button ---- */
.dc-crunch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    width: 100%;
    padding: 0.9rem;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: #f0f4f8;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.05s, filter 0.15s;
}

.dc-crunch:hover { filter: brightness(1.15); }
.dc-crunch:active { transform: scale(0.97); }

.dc-crunch-sub {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    opacity: 0.75;
}

/* ---- Jobs ---- */
.dc-jobs {
    max-height: 46vh;
    overflow-y: auto;
}

.dc-job {
    background: #131c2e;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.5rem;
}

.dc-job-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dc-job-pay { color: #34d399; white-space: nowrap; }

.dc-job-reqs {
    font-size: 0.72rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 0.45rem;
}

.dc-empty {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.82rem;
    font-style: italic;
    padding: 0.3rem 0;
}

/* ---- Buttons ---- */
.dc-btn {
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: #f0f4f8;
    background: #263650;
    border: 1px solid #33466b;
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    transition: filter 0.15s;
}

a.dc-btn {
    display: inline-block;
    text-decoration: none;
}

.dc-btn:hover:not(:disabled) { filter: brightness(1.2); }
.dc-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dc-btn-primary { background: linear-gradient(135deg, #1d4ed8, #3b82f6); border: none; }
.dc-btn-small { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
.dc-btn-block { display: block; width: 100%; margin-bottom: 0.6rem; }
.dc-accept { width: 100%; }

/* ---- Floor / canvas ---- */
.dc-floor-wrap {
    background: var(--bg-card, #1a2235);
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 0.6rem;
}

#dc-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
}

#dc-canvas.dc-placing { cursor: copy; }

.dc-tile-info {
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    padding: 0.2rem 0.4rem;
}

/* ---- Log ---- */
.dc-log {
    height: 170px;
    overflow-y: auto;
    font-size: 0.78rem;
    line-height: 1.5;
}

.dc-log-line { color: var(--text-secondary, #94a3b8); }
.dc-log-earn { color: #34d399; }
.dc-log-buy { color: #93c5fd; }
.dc-log-milestone { color: #facc15; font-weight: 600; }

/* ---- Shop ---- */
.dc-shop {
    max-height: 80vh;
    overflow-y: auto;
}

.dc-shop-section { margin-bottom: 0.9rem; }

.dc-shop-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
    text-align: left;
    font: inherit;
    color: #f0f4f8;
    background: #131c2e;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: border-color 0.15s, filter 0.15s;
}

.dc-shop-item:hover:not(:disabled) { filter: brightness(1.25); }
.dc-shop-item:disabled { opacity: 0.45; cursor: not-allowed; }
.dc-shop-item.selected { border-color: #34d399; box-shadow: 0 0 0 1px #34d399; }
.dc-shop-special { border-color: #facc15; }

.dc-shop-name { font-size: 0.85rem; font-weight: 600; }
.dc-shop-desc { font-size: 0.7rem; color: var(--text-secondary, #94a3b8); }
.dc-shop-cost { font-size: 0.78rem; font-weight: 700; color: #34d399; }

/* ---- Modals ---- */
#dc-modal-root { display: none; }
#dc-modal-root.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.dc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 15, 0.75);
    backdrop-filter: blur(3px);
}

.dc-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, calc(100vw - 2rem));
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-card, #1a2235);
    border: 1px solid #33466b;
    border-radius: 16px;
    padding: 1.6rem;
}

.dc-modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.9rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    color: var(--text-secondary, #94a3b8);
    background: none;
    border: none;
    padding: 0.3rem;
    cursor: pointer;
}

.dc-modal-close:hover { color: #f0f4f8; }

.dc-modal h2 { margin: 0 0 0.7rem; font-size: 1.25rem; }
.dc-modal p { color: var(--text-secondary, #94a3b8); font-size: 0.9rem; line-height: 1.6; }

.dc-learn-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.5);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    margin-bottom: 0.7rem;
}

.dc-field {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 0.8rem;
}

.dc-field input,
.dc-start-lookup input {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    font: inherit;
    font-size: 0.9rem;
    color: #f0f4f8;
    background: #0d1424;
    border: 1px solid #33466b;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    box-sizing: border-box;
}

.dc-hint { font-size: 0.78rem; color: var(--text-secondary, #94a3b8); }

.dc-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
}

.dc-modal-error { color: #fca5a5; font-size: 0.8rem; margin-top: 0.6rem; }

/* ---- Start screen ---- */
.dc-start-logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-align: center;
    background: linear-gradient(135deg, #3b82f6, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.dc-start-sub { text-align: center; margin-bottom: 1.4rem; }

.dc-start-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    margin: 1rem 0 0.6rem;
}

.dc-start-lookup {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.dc-start-lookup input { margin-top: 0; flex: 1; }

.dc-session-row {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
    text-align: left;
    font: inherit;
    color: #f0f4f8;
    background: #131c2e;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
}

.dc-session-row:hover { border-color: #3b82f6; }
.dc-session-name { font-weight: 600; font-size: 0.9rem; }
.dc-session-meta { font-size: 0.75rem; color: var(--text-secondary, #94a3b8); }

/* ---- Ranking page ---- */
.dc-ranking {
    max-width: 640px;
    margin: 1.5rem auto 0;
}

.dc-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dc-ranking-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card, #1a2235);
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 0.8rem 1.1rem;
    margin-bottom: 0.5rem;
}

.dc-ranking-first {
    border-color: #facc15;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.dc-ranking-pos {
    flex: 0 0 2rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-secondary, #94a3b8);
    text-align: center;
}

.dc-ranking-first .dc-ranking-pos { color: #facc15; }

.dc-ranking-name {
    flex: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dc-ranking-score {
    font-weight: 800;
    color: #34d399;
    white-space: nowrap;
}

.dc-ranking-hint {
    text-align: center;
    margin-top: 1rem;
}

/* ---- Toast ---- */
.dc-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translate(-50%, 20px);
    background: #263650;
    border: 1px solid #33466b;
    color: #f0f4f8;
    font-size: 0.85rem;
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1100;
    pointer-events: none;
}

.dc-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .dc-layout { grid-template-columns: 1fr 1fr; }
    .dc-col-center { order: -1; grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .dc-layout { grid-template-columns: 1fr; }
    .dc-jobs { max-height: none; }
    .dc-shop { max-height: none; }
}
