/* Reactor Idle D7 Edition: "control room" theme. Design tokens, base elements and shared UI
   pieces (panels, buttons, chips). Screen-specific styles live in game.css, screens.css and
   dialogs.css; component and terrain art in tiles.css (generated by tools/art/build-art.mjs). */

:root {
    /* Surfaces */
    --bg: #0a0e13;
    --bg-raised: #10161e;
    --panel: #141b24;
    --panel-hi: #1a2330;
    --inset: #0c1117;
    --line: #243040;
    --line-hi: #34465a;

    /* Text */
    --text: #e8eef4;
    --muted: #93a3b4;
    --dim: #5e6d7d;

    /* Resource colours (also used for the readouts) */
    --money: #ffc44d;
    --power: #4fd5ff;
    --research: #b894ff;
    --heat: #ff6a4d;
    --water: #63a9ff;
    --life: #d6f05a;

    /* Interaction */
    --accent: #2ee6a6;
    --accent-dim: #1d8f69;
    --danger: #ff5a5f;
    --ok: #70e070;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    min-height: 100%;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font: 13px/1.45 var(--font);
    color: var(--text);
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(46, 230, 166, 0.10), transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(79, 213, 255, 0.06), transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 28px 28px,
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    color: #7af5c9;
}

b {
    font-weight: 600;
}

#main {
    width: 1220px;
    margin: 0 auto;
    padding: 0 0 24px;
}

#gameArea {
    min-height: 600px;
}

/* Resource colours, used all over the game's HTML. */
.money { color: var(--money); }
.research { color: var(--research); }
.power { color: var(--power); }
.heat { color: var(--heat); }
.maxHeat { color: #ffa45c; }
.water, .maxWater { color: var(--water); }
.ticks { color: var(--life); }

/* ---- App chrome -------------------------------------------------------------------------- */

.appHeader {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
    padding: 0 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.brandMark {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 0 8px rgba(46, 230, 166, 0.55));
}

.brandMark .spin {
    transform-origin: 16px 16px;
    animation: brandSpin 18s linear infinite;
}

@keyframes brandSpin {
    to { transform: rotate(360deg); }
}

.brandText {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brandName {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brandTag {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent);
}

.appNav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.navTab {
    position: relative;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.15s, background-color 0.15s;
}

.navTab:hover {
    color: var(--text);
    background: var(--panel);
}

.navTab.active {
    color: var(--text);
    background: var(--panel-hi);
}

.navTab.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -12px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.navTab.disabled {
    color: var(--dim);
    pointer-events: none;
}

.appTools {
    display: flex;
    gap: 6px;
}

.toolButton {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: var(--bg-raised);
}

.toolButton:hover {
    color: var(--text);
    border-color: var(--line-hi);
}

.toolButton svg {
    width: 17px;
    height: 17px;
}

.appFooter {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    color: var(--dim);
    font-size: 12px;
}

.appFooter a {
    color: var(--muted);
    text-decoration: underline;
    text-decoration-color: var(--line-hi);
}

/* ---- Panels ------------------------------------------------------------------------------ */

.panel {
    position: relative;
    background: linear-gradient(180deg, var(--panel-hi), var(--panel) 48px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px 14px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 6px 18px rgba(0, 0, 0, 0.25);
}

.panelTitle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.panelTitle::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--led, var(--accent));
    box-shadow: 0 0 8px var(--led, var(--accent));
}

/* ---- Buttons ----------------------------------------------------------------------------- */

.button,
.buyButton,
.sellButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #23c58f, #179a6e);
    color: #04140e;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    user-select: none;
    transition: filter 0.12s, transform 0.06s;
}

.button:hover,
.buyButton:hover,
.sellButton:hover {
    filter: brightness(1.12);
    color: #04140e;
}

.button:active,
.buyButton:active,
.sellButton:active {
    transform: translateY(1px);
}

.button.ghost,
.sellButton {
    background: transparent;
    border-color: var(--line-hi);
    color: var(--muted);
}

.button.ghost:hover,
.sellButton:hover {
    color: var(--text);
    border-color: var(--muted);
    filter: none;
}

.cantBuy,
.cantBuy:hover {
    background: var(--inset) !important;
    border-color: rgba(255, 90, 95, 0.35) !important;
    color: var(--danger) !important;
    filter: none !important;
    cursor: no-drop !important;
}

.priceChip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--inset);
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 11px;
}

.levelBadge {
    display: inline-block;
    min-width: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(46, 230, 166, 0.12);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 11px;
    text-align: center;
}

.textLine {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.brand,
a.brand:hover {
    color: var(--text);
}
