/* RAM Factory: an instrument panel, revealed one system at a time. */
:root {
  color-scheme: light;
  --bg-primary: #f3f4ee;
  --bg-secondary: #edf0e7;
  --bg-card: #fafbf7;
  --bg-card-hover: #e7ecdf;
  --bg-input: #fff;
  --border: #cdd3c5;
  --border-light: #e2e6dc;
  --text-primary: #233329;
  --text-secondary: #59675c;
  --text-muted: #6e796e;
  --accent-blue: #286444;
  --accent-green: #347345;
  --accent-amber: #8b641c;
  --accent-purple: #69608b;
  --accent-red: #a64132;
  --accent-blue-dim: #e4ecdf;
  --accent-green-dim: #e4ecdf;
  --radius-md: 5px;
  --radius-lg: 5px;
  --space-lg: 22px;
  --shadow-sm: none;
  --shadow-md: 0 4px 18px #2639230d;
}
[hidden] { display: none !important; }
body { background: var(--bg-primary); color: var(--text-primary); }
.header { position: static; padding: 20px max(28px, calc((100vw - 1280px) / 2)); background: transparent; gap: 18px; }
.header__title { display: flex; align-items: center; font-family: var(--font-body); font-size: 23px; letter-spacing: -1px; color: var(--text-primary); }
.brand-dot { color: #549856; }
.brand-chip { display: inline-grid; place-items: center; width: 30px; height: 28px; background: #244f36; color: #e4edbd; margin-right: 10px; font-size: 22px; border-radius: 3px; }
.header__counter { font-size: 11px; color: var(--text-secondary); margin-left: auto; }
.header__stage { font: 10px var(--font-mono); border: 0; padding-left: 15px; border-left: 1px solid var(--border); border-radius: 0; }
#header-actions .btn { background: transparent; border: 0; min-height: 32px; font-size: 11px; padding: 6px 8px; }
.game-container { max-width: 1336px; padding: 0 28px 24px; }
.console-intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; padding: 36px 0 32px; }
.eyebrow { display: block; font: 10px/1.5 var(--font-mono); letter-spacing: 1.3px; color: var(--text-secondary); }
h1 { font-size: clamp(30px, 3.5vw, 46px); font-weight: 500; letter-spacing: -1.9px; line-height: 1.15; margin: 12px 0; }
.console-heading p { color: var(--text-secondary); font-size: 13px; max-width: 390px; line-height: 1.8; }
.memory-board { position: relative; width: 100%; max-width: 410px; justify-self: end; padding: 15px 19px 25px; background: #2e5038; border: 1px solid #193c27; border-radius: 5px; box-shadow: 0 9px 0 -4px #dce2d5; transform: rotate(-3deg); }
.board-label { display: flex; justify-content: space-between; gap: 10px; color: #cfdbab; font: 8px var(--font-mono); letter-spacing: .8px; }
.board-chips { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin: 16px 0 3px; }
.board-chips i { height: 37px; background: #192b20; border: 1px solid #7f936766; border-radius: 2px; box-shadow: 3px 3px 0 #213e2b; }
.board-pins { position: absolute; height: 9px; left: 20px; right: 20px; bottom: -4px; background: repeating-linear-gradient(90deg,#b4ac6e 0 5px,transparent 5px 8px); }
.board-pins::after { content: ''; position: absolute; left: 55%; width: 9px; height: 9px; background: var(--bg-primary); }
.console-metrics { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; align-items: center; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 22px 0; gap: 30px; }
.metric strong { display: block; font: 23px var(--font-mono); letter-spacing: -.8px; margin-top: 7px; font-weight: 400; }
.metric-total strong { font-size: 36px; line-height: 1; color: #265b3b; }
.console-live { display: flex; align-items: center; gap: 8px; font: 9px var(--font-mono); letter-spacing: .6px; color: #466a45; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #56864a; box-shadow: 0 0 0 4px #56864a13; }
.directive { display: flex; gap: 18px; align-items: center; padding: 16px 0 23px; font-size: 12px; color: var(--text-secondary); }
.directive .eyebrow { font-size: 9px; border: 1px solid #b7c8a9; border-radius: 3px; padding: 3px 7px; color: #446a36; }
.directive-arrow { margin-left: auto; font-size: 20px; color: #47703b; }
.stage-one, .stage-two, .stage-three { gap: 16px; }
.stage-one .col-left, .stage-one .col-center, .stage-one .col-right,
.stage-two .col-left, .stage-two .col-center, .stage-two .col-right,
.stage-three .col-left, .stage-three .col-center, .stage-three .col-right { gap: 16px; min-width: 0; }
.card { padding: 21px; box-shadow: none; animation: none; }
.card__title { font: 10px var(--font-mono); letter-spacing: 1px; color: #4c6351; margin-bottom: 17px; }
.stat { padding: 6px 0; gap: 12px; }
.stat__label { font-size: 12px; line-height: 1.5; }
.stat__value { font-size: 13px; text-align: right; }
.divider { margin: 14px 0; opacity: .8; }
.btn { font-size: 11px; border-radius: 3px; min-height: 36px; white-space: normal; line-height: 1.5; }
.btn:disabled { opacity: 1; color: #798174; border-color: #dce1d5; background: #eff1ea; cursor: not-allowed; }
.btn--fab { background: #2d613f; color: #f8faec; width: 100%; font-size: 14px; font-weight: 500; padding: 16px; box-shadow: inset 0 0 0 1px #ffffff17; }
.btn--fab:hover:not(:disabled) { background: #234e32; transform: none; box-shadow: none; }
.btn--fab::before, .btn--fab::after { display: none; }
.btn--primary { color: #fff; }
.btn--primary:hover:not(:disabled) { background: #204d33; }
.btn__cost { font-size: 10px; }
.price-control__btn { width: 30px; height: 30px; color: var(--text-primary); border-color: var(--border); }
.price-control__value { font-size: 15px; color: #2d613f; }
.progress { height: 4px; background: #e3e7dd; margin-top: 6px; }
.chart-container { background: #edf0e7; border: 1px solid var(--border-light); border-radius: 4px; padding: 14px; animation: none; }
.chart-container__title { color: var(--text-secondary); font: 9px var(--font-mono); letter-spacing: .9px; }
.factory-visual { height: 74px; border: 1px solid #cdd3c5; background: #e7ece1; margin: 0; opacity: .85; }
.message-log { background: transparent; padding: 9px 16px; max-height: 100px; border-style: dashed; }
.message-log__entry { font: 10px/1.6 var(--font-mono); }
.project-item { border-color: var(--border-light); background: transparent; }
.project-item__name { font-size: 12px; }
.project-item__desc { color: var(--text-secondary); line-height: 1.6; }
.toast { background: #fafbf7; color: #233329; border-color: #8da27f; box-shadow: 0 4px 16px #253c2520; font-size: 12px; }
.toast-container { top: auto; bottom: 18px; max-width: min(380px, calc(100vw - 32px)); }
.market-control { display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-top: 22px; padding: 18px 0; }
.market-control select { margin-top: 6px; width: 250px; max-width: 100%; border: 1px solid var(--border); background: #fafbf7; border-radius: 3px; color: var(--text-primary); font: 12px var(--font-body); padding: 9px; }
.market-control p { font-size: 11px; line-height: 1.7; color: var(--text-secondary); flex: 1; }
.market-control strong { font: 12px var(--font-mono); white-space: nowrap; }
.diagnostic { display: flex; gap: 20px; align-items: baseline; padding: 18px 0; }
.diagnostic .eyebrow { font-size: 9px; flex-shrink: 0; }
.diagnostic p { color: var(--text-secondary); font-size: 11px; line-height: 1.7; }
.console-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--border-light); color: var(--text-muted); font: 8px/1.8 var(--font-mono); letter-spacing: .4px; }
.console-footer a { color: var(--text-secondary); }
.footer-separator { padding: 0 8px; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #3e7046; outline-offset: 3px; }
body[data-stage="3"] .memory-board { background: #39443c; }
@media (min-width: 1200px) {
  .stage-one, .stage-two, .stage-three { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.15fr) minmax(0, .8fr); }
}
@media (max-width: 767px) {
  .header { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .header__title { font-size: 22px; }
  .header__counter { display: none; }
  .header > div:last-child { margin-left: auto; }
  .header__stage { display: none; }
  .game-container { padding: 0 18px 20px; }
  .console-intro { gap: 18px; padding: 27px 0; grid-template-columns: 1fr; }
  .memory-board { display: none; }
  h1 { font-size: 36px; }
  .console-metrics { grid-template-columns: 1fr 1fr; gap: 20px 12px; padding: 20px 0; }
  .metric-total { grid-row: span 2; align-self: center; }
  .metric strong { font-size: 18px; }
  .metric-total strong { font-size: 38px; }
  .console-live { grid-column: 1 / -1; }
  .directive { align-items: flex-start; font-size: 11px; line-height: 1.7; }
  .directive-arrow { display: none; }
  .card { padding: 19px; }
  .btn { min-height: 42px; }
  .price-control__btn { width: 38px; height: 38px; }
  .market-control { flex-wrap: wrap; gap: 12px; }
  .market-control > div { width: 100%; }
  .market-control select { width: 100%; }
  .diagnostic { gap: 12px; }
  .console-footer { flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; scroll-behavior: auto !important; }
}
