/* Token wallet, purchase conversion, and compact research controls. */
.wallet-research-status{display:inline-flex;align-items:center;justify-content:center;gap:6px;max-width:100%;margin:10px auto 0;padding:5px 10px;border:1px solid #b8954a80;border-radius:20px;background:#5b492d45;color:#f6d591;font-size:12px;line-height:1.4;cursor:pointer}.wallet-research-status[hidden]{display:none}.wallet-research-status:before{content:'';width:6px;height:6px;flex:0 0 auto;border-radius:50%;background:#f1ca75;box-shadow:0 0 8px #efc96a66}.wallet-research-status.is-waiting{color:#b1c5d3;background:#233d5055;border-color:#68829580}.wallet-research-status.is-waiting:before{background:#9db5c7;box-shadow:none}.wallet-research-status:hover,.wallet-research-status:focus-visible{border-color:#f3d18a;background:#6f563745;outline-offset:3px}
.shop-column>.shop-heading{padding:14px 18px 9px;min-height:0;border-bottom:0}
.shop-exchange {
  flex: 0 0 auto;
  display: grid;
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 11px;
  align-items: center;
  padding: 8px 15px 10px;
  text-align: left;
  cursor: pointer;
  color: #daebf2;
  background: linear-gradient(110deg, #253d48, #142d3e 76%);
  border-block: 1px solid #506775;
  box-shadow: inset 0 -2px #263e4e;
}
.exchange-coin {
  grid-column: 1; grid-row: 1 / span 3;
  width: 44px; height: 44px; padding: 4px;
  object-fit: contain;
  background: #122634;
  border: 1px solid;
  border-color: #091b26 #46606c #536b76 #091b26;
  border-radius: 2px;
}
.shop-exchange .exchange-label {
  grid-column: 2; color: #bacdd5; font-size: 11px; line-height: 1.3;
}
.shop-exchange #shopRate {
  grid-column: 2; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
#shopRateUnit { font-size: 12px; color: #cedde2; }
#shopRateValue { font-size: clamp(18px, 1.35vw, 22px); color: #f4d393; font-weight: 700; }
.shop-exchange .exchange-hint { grid-column: 2; color: #bfd5df; font-size: 11px; line-height: 1.4; }
.shop-exchange:hover, .shop-exchange:focus-visible { background: #234253; outline-offset: -3px; }
.shop-exchange:is(:hover, :focus-visible) .exchange-hint { text-decoration: underline; text-underline-offset: 2px; }

.shop-heading{gap:14px;justify-content:space-between}.shop-heading>span{font-size:11px;letter-spacing:0;color:#b4d0e2;white-space:nowrap}.item-price:before{content:none}.tip-conversion{font-size:11px;line-height:1.5;color:#9ebbd0;margin:5px 0 12px}.tip-conversion small{color:#769db7;margin-left:4px}
.infrastructure-details .power-values{line-height:1.6}.infrastructure-details .infra-heading{margin-top:0}
/* The model header and meter share the metal edges of the equipment rows. */
.gpt-research-card {
  --research-inset: clamp(12px, 1.4vw, 18px);
  --meter-dark: #4b697d;
  --meter-mid: #7d9eb0;
  --meter-light: #a9c3d2;
  padding: 0 var(--research-inset) 13px;
  background: #132a3a;
  border-bottom: 3px solid #38525f;
}
.gpt-research-heading {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline: calc(0px - var(--research-inset));
  padding: 10px var(--research-inset);
  background: linear-gradient(#254052, #183142 78%);
  border-block: 1px solid #476374;
  border-bottom-color: #091e2b;
  box-shadow: inset 0 -2px #344d5c;
}
.gpt-research-heading::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 1px 48px 3px auto;
  width: min(45%, 260px);
  background: url('./scenes/strips/robotics.png') no-repeat center / auto 110%;
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000 82%, transparent);
  opacity: .65;
  pointer-events: none;
}
.research-model-chip {
  width: 42px;
  height: 42px;
  flex: none;
  object-fit: contain;
}
.research-model-name { flex: 1; min-width: 0; }
.economy-eyebrow { color: #b0c6d2; font-size: 11px; }
.gpt-research-heading h2 { margin: 1px 0 0; font-size: 23px; line-height: 1.12; font-weight: 700; }
.gpt-research-heading h2:focus-visible { outline: 2px solid #95ceed; outline-offset: 2px; }
.research-level {
  flex: none;
  padding: 3px 7px;
  border: 1px solid #547080;
  border-radius: 2px;
  background: #102737;
  color: #c7dee9;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.research-meter {
  margin: 12px 0;
  padding: 9px 12px 12px;
  background: #0e2432;
  border: 1px solid #467;
  border-color: #0a1d29 #3a535f #506776 #0a1d29;
  border-radius: 2px;
}
.research-price-step, .research-progress-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-variant-numeric: tabular-nums;
}
.research-price-step { margin-bottom: 10px; color: #a7becb; font-size: 12px; }
.research-price-step b { font-size: 18px; font-weight: 650; color: #e3eff4; }
.research-price-step b:last-of-type, .research-price-step small { color: #f1ce90; }
.research-price-step small { margin-left: auto; font-size: 11px; }
.research-progress-caption { justify-content: space-between; margin-bottom: 5px; font-size: 12px; color: #b4cad5; }
.research-progress-caption b { display: inline-flex; align-items: center; gap: 7px; color: #dcebf2; font-weight: 600; }
.research-progress-caption b::before {
  content: '';
  height: 7px;
  width: 7px;
  border: 1px solid var(--meter-light);
  background: transparent;
}
.gpt-progress {
  position: relative;
  height: 16px;
  overflow: hidden;
  border: 2px solid;
  border-color: #071722 #536c7b #5d7886 #071722;
  border-radius: 2px;
  background: linear-gradient(#0b1b27, #1c3442);
  box-shadow: inset 0 2px 2px #07172299;
}
.gpt-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(to bottom, var(--meter-light) 0 2px, var(--meter-mid) 2px 70%, var(--meter-dark) 70%);
}
.gpt-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to left, #061a2980 1px, transparent 1px);
  background-size: 10% 100%;
}
.gpt-research-card[data-progress-state="active"] { --meter-dark: #a57737; --meter-mid: #deae55; --meter-light: #f8d98a; }
.gpt-research-card[data-progress-state="complete"] { --meter-dark: #507b72; --meter-mid: #81b7a0; --meter-light: #b6dfc5; }
[data-progress-state="active"] .research-progress-caption b::before, [data-progress-state="complete"] .research-progress-caption b::before {
  background: var(--meter-light);
}
[data-progress-state="paused"] .research-progress-caption b::before { border-width: 0 2px; }
[data-progress-state="waiting"] .research-progress-caption b::before { border-color: #e3bb76; }
.research-team { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin: 11px 0 5px; }
.research-team > div { display: flex; align-items: center; gap: 6px; }
.research-team > [hidden] { display: none; }
.research-team .tibo-face { height: 27px; width: 27px; flex-shrink: 0; }
.research-team b { font-size: 12px; font-weight: 500; color: #d8e7ef; }
.research-team b span { color: #abcbdc; }
.research-team b span[id] { margin-left: 3px; }

/* One silhouette per resource, repeated where players choose or spend it. */
:is([data-shop-filter="compute"], [data-tab="facilities"], .shop-item[data-role="compute"] .item-role) { --resource-cell: 33.333333%; }
:is([data-shop-filter="power"], [data-tab="power"], .shop-item[data-role="power"] .item-role) { --resource-cell: 66.666667%; }
:is([data-shop-filter="research"], [data-tab="research"], .shop-item[data-role="research"] .item-role),
#walletResearchStatus { --resource-cell: 100%; }
:is([data-shop-filter="compute"], [data-tab="facilities"]) { --resource-ink: #9bcae4; }
:is([data-shop-filter="power"], [data-tab="power"]) { --resource-ink: #a4d2b9; }
:is([data-shop-filter="research"], [data-tab="research"]) { --resource-ink: #c7b8df; }
:is(.wallet .eyebrow[data-text="tokens"], .research-token-use, .item-role,
    [data-shop-filter]:not([data-shop-filter="all"]), [data-tab="facilities"], [data-tab="research"], [data-tab="power"])::before,
#walletResearchStatus::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -.12em;
  margin-inline-end: .34em;
  background: var(--resource-ink, currentColor);
  mask: url('./resource-icons.svg') var(--resource-cell, 0%) center / 400% 100% no-repeat;
}
#walletResearchStatus::before { margin: 0; border-radius: 0; box-shadow: none; }
.research-token-use {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #b3c7d2;
  font-variant-numeric: tabular-nums;
}
.gpt-research-card[data-progress-state="active"] .research-token-use { color: #f0cd8c; }

/* Compact effort picker. The range remains native for touch and keyboard input. */
.research-effort{position:relative;width:max-content;max-width:100%;padding:0;border:0;margin:0 0 10px;min-width:0;z-index:2}.research-effort summary{list-style:none;display:flex;align-items:center;gap:14px;width:max-content;min-height:28px;padding:4px 11px;border:1px solid #48677d;border-radius:99px;background:#19374b;color:#a9c2d3;font-size:11px;line-height:18px;cursor:pointer;user-select:none}.research-effort summary::-webkit-details-marker{display:none}.research-effort summary:hover{background:#21455c;color:#d4e6f1}.effort-chevron{width:6px;height:6px;border:solid currentColor;border-width:0 1px 1px 0;transform:translateY(-2px) rotate(45deg)}.research-effort[open] .effort-chevron{transform:translateY(2px) rotate(225deg)}.effort-control{position:absolute;left:0;top:calc(100% + 6px);width:190px;max-width:calc(100vw - 42px);box-sizing:border-box;padding:10px;border:1px solid #45657c;border-radius:12px;background:#122d43;box-shadow:0 8px 20px #00111d70}.effort-control output{display:block;text-align:center;font-size:14px;line-height:20px;font-weight:650;color:#6aa7ff;margin-bottom:7px}.effort-slider{position:relative;height:26px;--effort-fill:calc(20% + 7.2px)}.effort-rail{position:absolute;inset:3px 0;border-radius:99px;background:linear-gradient(to right,#3d82f6 0 var(--effort-fill),#29465c var(--effort-fill) 100%);box-shadow:inset 0 0 0 1px #86b1d01c}.effort-stops{position:absolute;inset:0 12px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.effort-stops i{height:3px;width:3px;border-radius:50%;background:#b3cce581}.effort-slider input{position:absolute;inset:0;width:100%;height:26px;padding:0;margin:0;background:transparent;appearance:none;-webkit-appearance:none;cursor:pointer;border-radius:99px}.effort-slider input::-webkit-slider-runnable-track{height:20px;background:transparent;border:0;border-radius:99px}.effort-slider input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:24px;height:24px;margin-top:-2px;border-radius:50%;background:#fff;border:1px solid #d5e0eb;box-shadow:0 1px 4px #00122355}.effort-slider input::-moz-range-track{height:20px;background:transparent;border:0;border-radius:99px}.effort-slider input::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:#fff;border:1px solid #d5e0eb;box-shadow:0 1px 4px #00122355}.research-effort summary:focus-visible,.effort-slider input:focus-visible,.research-actions button:focus-visible{outline:2px solid #b1d7ff;outline-offset:3px}.effort-slider:has(input:disabled){opacity:.45}.effort-slider input:disabled{cursor:default}
.research-actions{display:flex;gap:7px;flex-wrap:wrap}.research-actions .action-button{margin:0;font-size:12px;padding:7px 10px}.research-actions button:disabled{opacity:.4}.research-metrics{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:11px}.research-metrics>div{display:flex;flex-direction:column;gap:3px}.research-metrics span{font-size:10px;color:#7e9db5}.research-metrics b{font-weight:500;font-size:14px;color:#bad7ea}
@media(max-width:1180px){.shop-heading{gap:8px}.shop-heading>span{font-size:10px}.research-price-step{gap:6px}.research-price-step b{font-size:16px}}
@media(max-width:570px){.shop-heading>span{font-size:11px}.research-price-step b{font-size:18px}}

/* Roles keep the shop and central scenes easy to scan. */
.shop-filters{display:flex;flex:0 0 auto;gap:3px;padding:6px 9px;background:#0b2236;border-bottom:1px solid #47667e}.shop-filters button{flex:1;min-width:0;border:1px solid transparent;border-radius:4px;padding:5px 2px;font-size:11px;color:#8eb1cb;white-space:nowrap}.shop-filters button[aria-pressed=true]{background:#244d68;border-color:#6089a6;color:#e0f1fd}.shop-filters button:focus-visible{outline:2px solid #c4e8fb;outline-offset:1px}.item-role-line{display:flex;align-items:center;gap:5px;margin-top:4px;min-width:0;white-space:nowrap}.item-role-line[hidden]{display:none}.item-role{flex-shrink:0;border:1px solid #6689a05c;border-radius:3px;padding:1px 4px;font-size:11px;line-height:1.25;color:#315e7d;background:#d6e5ee8c;letter-spacing:.02em}.item-purpose{font-size:10px;color:#577284;overflow:hidden;text-overflow:ellipsis;line-height:1.3}.shop-item[data-role=research] .item-role{color:#565d88;border-color:#6f6e985c;background:#e0e1ef99}.shop-item[data-role=power] .item-role{color:#39745d;border-color:#467c6560;background:#dcecdfb0}.item-role-line.power-limited .item-purpose{color:#9c5c30;font-weight:600}.item-price{margin-top:4px}.tip-role{font-size:11px;line-height:1.5;color:#9abccf;margin:3px 0 10px}.tip-role b{color:#d6e8f4}.center-empty{font-size:12px;line-height:1.7;color:#86a7bf;padding:20px;margin:0;background:#0c2337d9;border-bottom:1px solid #29465d}.production-head .center-tabs{gap:17px}
@media(max-width:1180px){.item-purpose{display:none}.item-role-line{margin-top:3px}.item-role{font-size:10px;padding:1px 3px}.shop-filters{padding:5px 6px}.shop-filters button{font-size:10px}.production-head .center-tabs{gap:10px}.production-head .center-tabs button{font-size:12px}html[lang=en] .production-head .center-tabs{gap:7px}html[lang=en] .production-head .center-tabs button{font-size:10px}html[lang=en] .production-head .ascend-button{font-size:10px;padding:5px}}
@media(max-width:900px){.item-purpose{display:inline}.production-head .center-tabs{gap:20px}.production-head .center-tabs button{font-size:13px}html[lang=en] .production-head .center-tabs button{font-size:12px}.item-role{font-size:11px}.shop-filters button{font-size:11px}}
.shop-filters{flex-wrap:wrap}.shop-filters button{flex:1 0 auto;min-width:max-content;padding:5px 6px}
@media(max-width:570px){.production-head .center-tabs{gap:16px}html[lang=en] .production-head .center-tabs{gap:9px}html[lang=en] .production-head .center-tabs button{font-size:11px}.center-empty{padding:17px 20px}}
.power-upgrade-bonus{font-size:11px;line-height:1.6;color:#9cc0d5;padding:9px 0;margin:0}

.research-efficiency{font-size:10px;line-height:1.5;color:#d6be87;font-variant-numeric:tabular-nums}
.research-workspace{display:grid;grid-template-columns:minmax(140px,auto) minmax(0,1fr);align-items:start;gap:22px}
.research-controls{min-width:0}.research-workspace .research-activity{min-width:0}
@media(min-width:901px) and (max-width:1180px){.research-workspace{grid-template-columns:1fr;gap:12px}}
@media(max-width:480px){.research-workspace{grid-template-columns:1fr;gap:12px}}
.research-team-agent{width:30px;height:30px}.research-power-shortage{font-size:11px;line-height:1.6;color:#d6bd8a;margin:0 0 12px}.effort-rail{background:linear-gradient(to right,#3d82f6 0 var(--effort-fill),#29465c var(--effort-fill) var(--effort-limit),#1b2b37 var(--effort-limit) 100%)}.effort-stops i.is-locked{background:#566673;opacity:.65}.effort-control .effort-limit,.effort-control .effort-next{font-size:10px;line-height:1.5;margin:8px 0 0;color:#b5cbdb}.effort-control .effort-next{margin-top:3px;color:#819eb4}
.facility-row[data-facility="22"]{--scene-backdrop:url('./scenes/strips/virtual-lab.png')}

.research-personnel-icon>img{object-position:center bottom}.facility-row[data-facility="23"]{--scene-backdrop:url('./scenes/strips/robotics.png')}
/* Every research team uses the original Tibo crowd's scale and staggered rows. */
.research-team-row .research-team-scene{display:block;height:184px;padding:0;isolation:isolate}
.research-team-scene .researcher-person{position:absolute;display:block;width:110px;height:112px;margin:0;pointer-events:none}
.research-team-scene .researcher-person[hidden]{display:none}
.research-team-scene:after{z-index:5}
.research-team-scene .unit-overflow{z-index:6;bottom:45px;background:#0b203cdd}
.research-team-scene .research-personnel-icon>img{position:absolute;left:50%;bottom:1px;width:84px;height:101px;transform:translateX(-50%);transform-origin:center bottom;filter:none}
.research-team-scene .crew-turned>img{transform:translateX(-50%) scaleX(-1)}
.research-team-scene .crew-leaning>img{transform:translateX(-50%) skewX(-3deg)}

.power-network>div:first-child{flex-wrap:wrap}

@media (min-width:901px) and (max-width:1180px){
  .item-role-line.has-power-supply .item-purpose { display: block; font-size: 9px; }
  .item-role-line.has-power-supply .item-role { padding: 0; border: 0; background: none; font-size: 0; }
  .item-role-line.has-power-supply .item-role::before { width: 12px; height: 12px; margin: 0; }
}

/* Equipment readouts use the same inset and ten divisions as the research meter. */


.power-readout, .header-power-zone {
  --supply-light: #b1d8c5;
  --supply-mid: #78ad98;
  --supply-dark: #4d846f;
}
.power-readout {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  padding: 7px 10px 8px 6px;
  border: 1px solid;
  border-color: #081d2b #405966 #4c6673 #081d2b;
  border-radius: 2px;
  background: #102736;
  color: #d9e8ed;
}
.power-readout.constrained, .header-power-zone.constrained {
  --supply-light: #f2ce8c;
  --supply-mid: #ce9f55;
  --supply-dark: #956e36;
}
.power-readout.idle, .header-power-zone.idle { --supply-light: #b1c5cf; }
.power-readout-art { width: 100%; height: auto; object-fit: contain; }
.power-readout-body { min-width: 0; }
.power-readout-body > strong {
  display: block; margin-bottom: 4px; line-height: 1.3; font-size: 15px;
  color: var(--supply-light); font-variant-numeric: tabular-nums;
}
.utility-track {
  display: block;
  position: relative;
  height: 10px; overflow: hidden;
  background: linear-gradient(#0b1b27, #1c3442);
  border: 1px solid; border-color: #061923 #496574 #567381 #061923;
  border-radius: 1px;
}
.utility-track > i {
  display: block; height: 100%;
  background: linear-gradient(var(--supply-light) 0 1px, var(--supply-mid) 1px 70%, var(--supply-dark) 70%);
}
.utility-track::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to left, #061a2980 1px, transparent 1px);
  background-size: 10% 100%;
}
.power-readout-amounts {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1px 8px;
  margin-top: 3px; color: #b2c8d3; font-size: 10px; line-height: 1.4; font-variant-numeric: tabular-nums;
}
.infrastructure-details .power-readout {
  grid-template-columns: 56px minmax(0,1fr); gap: 13px;
  margin-bottom: 8px; padding: 12px; background: #102634;
}
.infrastructure-details .power-readout-body > strong { font-size: 17px; }
.infrastructure-details .utility-track { height: 13px; }
.infrastructure-details .power-readout-amounts { font-size: 12px; }
.power-deficit { display: block; margin-top: 4px; color: var(--supply-light); font-size: 11px; }
@media (max-width: 600px) {
  .power-readout { grid-template-columns: 34px minmax(0, 1fr); column-gap: 5px; padding-inline: 4px 6px; }
}

/* Supply and Earth remain together when the tabs wrap in a narrow center column. */
.production-head {
  flex-wrap: wrap;
  row-gap: 1px;
  column-gap: 9px;
}
.production-head .center-tabs { flex: 0 0 auto; }
.world-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px auto;
  max-width: 100%;
}
.world-controls .earth-open, .header-power {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 33px;
  margin: 0;
  border-radius: 4px;
  line-height: 1.2;
}
.world-controls .earth-open { padding: 5px 8px; }
.earth-glyph { flex: none; }
.header-power {
  padding: 4px 7px 4px 5px;
  border: 1px solid #39596b;
  background: #0f2738;
  color: #bed4dc;
  text-align: left;
}
.header-power:is(:hover,:focus-visible) { border-color: #76a1b1; }
.header-power img { flex: none; object-fit: contain; }
.header-power-lines { display: grid; gap: 4px; }
.header-power-zone { display: block; }
.header-power-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.header-power-value b { color: var(--supply-light); font-size: 12px; font-variant-numeric: tabular-nums; }
.header-power .utility-track { height: 4px; margin-top: 2px; border: 0; }

.click-column #bigLogo:disabled { opacity: 1; }
.click-column #bigLogo:disabled > img { opacity: .45; }
.click-column .wallet-meta {
  background-color: #102639;
  color: #cae1ee;
}
.click-column .wallet-model { color: #eff9ff; }
:is(.gold-progress, .fever) .click-column .wallet-meta { background-color: #292a24; color: #ffe5aa; }
:is(.gold-progress, .fever) .click-column .wallet-model { color: #ffdfa0; }
.click-column #walletResearchStatus { background-color: #332c22; color: #ffe0a0; }
.click-column #walletResearchStatus.is-waiting { background-color: #1c3141; color: #d1dfe9; }
.click-column #walletResearchStatus:disabled { opacity: 1; }
.click-column #cursorLevel { align-self: center; padding: 2px 6px; border-radius: 4px; background-color: #19394d; color: #e1f1fa; }
