/* Page-local styles for SIMULATIONS (moved out of simulations.html). */

header.row { display:flex; align-items:center; gap:22px; flex-wrap:wrap; }
.hero-sprite { width:96px; height:96px; image-rendering:pixelated; }
h1.px { font-size:20px; } .sub { color:var(--teal); font-size:22px; margin-top:6px; }
section { margin-top:34px; }
.simcard { background:var(--bg2); border:2px solid var(--line); box-shadow:4px 4px 0 #000; padding:20px; }
.simcard h2 { font-family:'Press Start 2P',monospace; font-size:13px; color:var(--cream); }
.simcard .desc { font-family:'Literata',Georgia,serif; font-size:16px; line-height:1.6; color:var(--cream); margin:10px 0 16px; max-width:70ch; }
.canvas-frame { border:2px solid var(--line); background:#000; border-radius:8px; overflow:hidden; position:relative; }
.canvas-frame canvas { display:block; width:100%; height:340px; }
.controls { display:flex; gap:12px; align-items:center; margin-top:12px; flex-wrap:wrap; font-size:18px; }
.controls label { color:var(--muted); }
.controls input[type=range] { accent-color: var(--teal); width:160px; }
.readout { color:var(--amber); font-family:'VT323',monospace; font-size:19px; margin-left:auto; }
.duo { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width:900px){ .duo { grid-template-columns:1fr; } }
.zoo { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.zoo .card { background:var(--bg2); border:2px solid var(--line); box-shadow:3px 3px 0 #000; padding:14px;
  text-decoration:none; color:var(--cream); display:flex; flex-direction:column; gap:6px;
  transition:transform .12s steps(2), background .12s steps(2); }
.zoo .card:hover { transform:translate(-2px,-2px); background:#23233a; }
.zoo .card .t { font-family:'Press Start 2P',monospace; font-size:9px; color:var(--teal); }
.zoo .card p { font-family:'Literata',Georgia,serif; font-size:14.5px; color:var(--muted); line-height:1.5; }
@media (max-width:900px){ .zoo { grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .zoo { grid-template-columns:1fr; } }

/* ----- Edgeworth lab ----- */
.edgeworth-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:20px; align-items:start; }
.edgeworth-visual { min-width:0; }
.edgeworth-lab .canvas-frame { width:100%; aspect-ratio:1/1; }
.edgeworth-lab .canvas-frame canvas { display:block; width:100%; height:100%; touch-action:none; cursor:crosshair; }
.edgeworth-legend {
  list-style:none; margin:8px 0 0; padding:6px 8px;
  display:flex; flex-wrap:wrap; gap:4px 14px;
  font-family:'VT323',monospace; font-size:16px; color:var(--muted);
  min-width:0; max-width:100%;
}
.edgeworth-legend .swatch { display:inline-block; width:18px; height:0; margin-right:6px; vertical-align:middle; border-top:3px solid; }
.edgeworth-legend .swatch-a { color:#2ee6d6; }
.edgeworth-legend .swatch-b { color:#ff6ea9; }
.edgeworth-legend .swatch-contract { color:var(--amber); }
.edgeworth-legend .swatch-path { color:#3ddc84; border-top-style:dashed; }
.edgeworth-panel { display:flex; flex-direction:column; gap:14px; min-width:0; }
.edgeworth-panel .eq { font-family:'VT323',monospace; font-size:18px; color:var(--muted); line-height:1.5; }
.edgeworth-panel .eq .ua { color:var(--teal); }
.edgeworth-panel .eq .ub { color:var(--pink); }
.edgeworth-sliders { display:flex; flex-direction:column; gap:10px; }
.edgeworth-sliders label { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:18px; min-height:44px; }
.edgeworth-sliders input[type=range] { flex:1; min-width:0; height:44px; accent-color:var(--teal); }
.edgeworth-sliders .val { font-family:'VT323',monospace; color:var(--cream); width:5ch; text-align:right; }
.edgeworth-buttons { display:flex; flex-wrap:wrap; gap:10px; }
.edgeworth-buttons .btn { min-height:44px; }
.edgeworth-lab table { width:100%; border-collapse:collapse; font-family:'VT323',monospace; font-size:17px; }
.edgeworth-lab th, .edgeworth-lab td { border:1px solid var(--line); padding:4px 6px; text-align:right; }
.edgeworth-lab th { color:var(--muted); font-weight:normal; text-align:left; font-family:'VT323',monospace; }
.edgeworth-lab .agent-a { color:var(--teal); }
.edgeworth-lab .agent-b { color:var(--pink); }
.edgeworth-lab .prices, .edgeworth-lab .counts { font-family:'VT323',monospace; font-size:18px; color:var(--amber); display:flex; flex-wrap:wrap; gap:4px 16px; }
.edgeworth-status { font-family:'VT323',monospace; font-size:17px; color:var(--cream); background:#0b0b12; border:1px solid var(--line); padding:6px 8px; min-height:1.5em; }
.edgeworth-tabs { display:flex; border:2px solid var(--line); background:#0b0b12; }
.edgeworth-tab {
  flex:1 1 0; min-width:0; min-height:44px; padding:8px 6px;
  background:transparent; border:0; border-right:2px solid var(--line);
  color:var(--muted); cursor:pointer;
  font-family:'Press Start 2P',monospace; font-size:8px; line-height:1.5;
  text-transform:uppercase; word-break:break-word; hyphens:auto;
}
.edgeworth-tab:last-child { border-right:0; }
.edgeworth-tab[aria-selected="true"] { background:var(--teal); color:#0b0b12; }
.edgeworth-tab[aria-selected="false"]:hover { background:#23233a; color:var(--cream); }
.edgeworth-tab:focus-visible { outline:2px solid var(--teal); outline-offset:-3px; }
.edgeworth-tab-panel { display:flex; flex-direction:column; gap:14px; min-width:0; }
.edgeworth-tab-panel[hidden] { display:none; }
.edgeworth-alphas label { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:18px; min-height:44px; }
.edgeworth-alphas input[type=range] { flex:1; min-width:0; height:44px; accent-color:var(--amber); }
.edgeworth-alphas .val { font-family:'VT323',monospace; color:var(--cream); width:5ch; text-align:right; }
.edgeworth-how { font-family:'Literata',Georgia,serif; font-size:14px; color:var(--muted); line-height:1.55; }
.edgeworth-how h3 { font-family:'Press Start 2P',monospace; font-size:9px; color:var(--teal); margin:6px 0 4px; }
.edgeworth-how code { font-family:'VT323',monospace; font-size:16px; color:var(--cream); }
.edgeworth-how a { color:var(--teal); }
@media (max-width:960px){
  .edgeworth-layout { grid-template-columns:1fr; }
  .readout { margin-left:0; }
}
@media (min-width:961px){
  /* Bounded right panel: the chart column sets the visual rhythm and tab
     switches never resize the card. Active panel scrolls internally. */
  .edgeworth-layout { grid-template-columns:minmax(0,1fr) 340px; align-items:start; }
  .edgeworth-panel { height:744px; gap:10px; }
  .edgeworth-tab-panel { gap:10px; }
  .edgeworth-tab-panel:not([hidden]) {
    flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain;
    scrollbar-width:thin; scrollbar-color:var(--line) transparent;
    padding-right:4px;
  }
  .edgeworth-tab-panel:not([hidden])::-webkit-scrollbar { width:8px; }
  .edgeworth-tab-panel:not([hidden])::-webkit-scrollbar-track { background:transparent; }
  .edgeworth-tab-panel:not([hidden])::-webkit-scrollbar-thumb {
    background:var(--line); border-radius:4px;
  }
  .edgeworth-panel .eq { line-height:1.35; }
  .edgeworth-lab th, .edgeworth-lab td { padding:3px 6px; }
}
@media (max-width:560px){
  .hud { position:static; left:auto; right:auto; bottom:auto; margin-top:24px; }
  .hud-inner { flex-wrap:wrap; }
  .wrap { padding-bottom:24px; }
}
@media (prefers-reduced-motion: reduce){
  .zoo .card { transition:none; }
}
