/* ===== Learn LLM — AI lab tycoon ===== */

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

/* ---- Top bar ---- */
.ll-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;
}

.ll-logo {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.25em;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

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

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

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

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

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

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

.ll-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;
}

.ll-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;
}

.ll-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.82rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.ll-stat-row:last-child { border-bottom: none; }
.ll-stat-row span:first-child { color: var(--text-secondary, #94a3b8); }
.ll-stat-row em {
    font-style: normal;
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
}

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

.ll-meter-big { height: 12px; }

.ll-meter-fill {
    height: 100%;
    background: #8b5cf6;
    border-radius: 4px;
    transition: width 0.25s linear;
}

.ll-meter-fill.run { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.ll-meter-fill.danger { background: #ef4444; }

/* ---- Tune button ---- */
.ll-tune {
    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, #7c3aed, #a855f7);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.05s, filter 0.15s;
}

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

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

/* ---- Run status (left) ---- */
.ll-run-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ll-run-stage {
    font-size: 0.72rem;
    font-weight: 600;
    color: #c4b5fd;
    margin-left: 0.4rem;
}

.ll-run-nums {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 0.4rem;
}

/* ---- Pipeline (center) ---- */
.ll-stages {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.ll-stage {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    border: 1px solid #1e293b;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
}

.ll-stage.active {
    color: #e9d5ff;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4);
}

.ll-stage.done { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.ll-stage-arrow { color: var(--text-muted, #64748b); font-size: 0.72rem; }

.ll-bp-list { display: flex; flex-direction: column; gap: 0.4rem; }

.ll-bp {
    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;
    cursor: pointer;
    transition: border-color 0.15s, filter 0.15s;
}

.ll-bp:hover { filter: brightness(1.25); }
.ll-bp.selected { border-color: #a855f7; box-shadow: 0 0 0 1px #a855f7; }

.ll-bp-name { font-size: 0.88rem; font-weight: 600; }
.ll-bp-name em { font-style: normal; color: #c4b5fd; font-weight: 500; font-size: 0.78rem; }
.ll-bp-desc { font-size: 0.72rem; color: var(--text-secondary, #94a3b8); }
.ll-bp-price { font-size: 0.75rem; font-weight: 700; color: #34d399; }

.ll-ratio-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.ll-ratio {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
    font: inherit;
    color: #f0f4f8;
    background: #131c2e;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    cursor: pointer;
    transition: border-color 0.15s, filter 0.15s;
}

.ll-ratio:hover { filter: brightness(1.25); }
.ll-ratio.selected { border-color: #a855f7; box-shadow: 0 0 0 1px #a855f7; }
.ll-ratio-label { font-size: 0.78rem; font-weight: 700; }
.ll-ratio-desc { font-size: 0.68rem; color: var(--text-secondary, #94a3b8); }

.ll-plan {
    background: #0d1424;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin: 0.9rem 0;
}

.ll-plan-formula {
    font-size: 0.78rem;
    color: #c4b5fd;
    margin-bottom: 0.45rem;
}

.ll-plan-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.78rem;
    padding: 0.15rem 0;
    color: var(--text-secondary, #94a3b8);
}

.ll-plan-row span:last-child { color: #f0f4f8; }
.ll-plan-row em { font-style: normal; font-size: 0.72rem; }
.ll-plan-row em.ok { color: #34d399; }
.ll-plan-row em.bad { color: #fca5a5; }

#ll-start.ll-blocked { filter: saturate(0.3) brightness(0.8); }

/* ---- Model Hub ---- */
.ll-models { max-height: 44vh; overflow-y: auto; }

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

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

.ll-model-price { color: #34d399; white-space: nowrap; }

.ll-model-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.45rem;
}

.ll-tag {
    font-size: 0.66rem;
    font-weight: 600;
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 999px;
    padding: 0.08rem 0.45rem;
}

.ll-tag.gold { color: #fde68a; border-color: rgba(250, 204, 21, 0.45); }

.ll-model-demand {
    font-size: 0.66rem;
    color: var(--text-muted, #64748b);
    margin-left: auto;
}

.ll-model-demand.low { color: #fbbf24; }

.ll-sell { width: 100%; }

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

/* ---- Buttons ---- */
.ll-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.ll-btn {
    display: inline-block;
    text-decoration: none;
}

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

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

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

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

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

.ll-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;
}

.ll-shop-item:hover:not(:disabled) { filter: brightness(1.25); }
.ll-shop-item:disabled { opacity: 0.45; cursor: not-allowed; }
.ll-shop-special { border-color: #a855f7; }

.ll-research-done {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--text-secondary, #94a3b8);
    background: transparent;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.3rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.ll-research-done:hover {
    border-color: #a855f7;
    color: #f0f4f8;
}

.ll-research-done-name { font-size: 0.78rem; font-weight: 600; color: #c4b5fd; }
.ll-research-done-effect { font-size: 0.68rem; white-space: nowrap; }

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

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

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

.ll-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;
}

.ll-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;
}

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

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

.ll-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;
}

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

.ll-field input,
.ll-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;
}

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

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

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

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

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

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

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

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

.ll-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;
}

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

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

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

.ll-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;
}

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

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

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

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

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

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

/* ---- Toast ---- */
.ll-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;
}

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

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

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