/* Technologies (client/panels-research.js) */
.rs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 2px; }
html.land .rs-grid { grid-template-columns: repeat(6, 1fr); } /* landscape: all six categories in one row instead of three cards taller than the screen */
.rs-card { position: relative; aspect-ratio: 3 / 4.1; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 55%, #2a1c10), #1a120a 70%);
  border: 2px solid color-mix(in srgb, var(--c) 40%, #6b5536); box-shadow: 0 0 0 1px #000, 0 6px 14px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.18); transition: transform .1s; }
.rs-card:active { transform: scale(.96); }
.rs-art { position: absolute; inset: 0 0 34% 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--c) 45%, transparent), transparent 70%); }
.rs-art span { position: absolute; filter: drop-shadow(0 4px 4px rgba(0,0,0,.55)); line-height: 1; }
.rs-art .a1 { font-size: 52px; z-index: 2; } .rs-art .a2 { font-size: 28px; left: 10%; bottom: 8%; opacity: .9; transform: rotate(-12deg); } .rs-art .a3 { font-size: 24px; right: 10%; top: 12%; opacity: .85; transform: rotate(10deg); }
.rs-art.big .a1 { font-size: 64px; }
.rs-foot { position: absolute; left: 0; right: 0; bottom: 0; min-height: 36%; padding: 12px 0 7px; /* two-line names ("Fighter Training") grow the foot instead of being cut */ display: grid; align-content: center; justify-items: center; gap: 2px;
  background: linear-gradient(transparent, rgba(0,0,0,.65) 30%, rgba(0,0,0,.8)); text-align: center; }
.rs-foot b { font: 900 22px/1 system-ui; color: #fff; text-shadow: 0 2px 0 #000; }
.rs-foot span { font: 800 13px/1.1 system-ui; color: #f3e6cf; text-shadow: 0 1px 0 #000; padding: 0 4px; }
.rs-card.max .rs-foot b { color: #ffd23a; text-shadow: 0 2px 0 var(--c-amber-deep), 0 0 10px rgba(255,210,58,.5); }
.rs-line { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #3fa9ff, #8fd8ff); box-shadow: 0 0 6px #3fa9ff; }
.rs-ribbon { position: absolute; left: -2px; right: -2px; top: 42%; z-index: 3; text-align: center; font: 800 11px/1 system-ui; padding: 4px 2px; color: #fff;
  background: linear-gradient(var(--c-good), #2f8a3b); box-shadow: 0 2px 4px rgba(0,0,0,.5); text-shadow: 0 1px 0 #000; }
.rs-ribbon.busy { background: linear-gradient(#ffcf5a, #d9901f); color: #2a1a04; text-shadow: none; }
.rs-thumb { position: absolute; left: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: #2f8a3b; box-shadow: 0 0 0 2px #fff4; }
.rs-spacer { flex: 1 0 24px; }
/* bottom research bar */
.rs-bar { position: sticky; bottom: 0; z-index: 6; margin: 0 -12px calc(-24px - var(--safe-bottom)); /* flush with the screen bottom whether the page scrolls or not (the wrap has 24 px of bottom padding) */ padding: 10px 12px calc(12px + var(--safe-bottom)); display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center;
  background: linear-gradient(#1a2430, #0f151c); border-top: 1px solid #2b3a4c; box-shadow: 0 -6px 18px rgba(0,0,0,.5); }
.rs-back { width: 52px; height: 52px; padding: 0; border-radius: 50%; font-size: 30px; font-weight: 900; color: #3a2a12; background: linear-gradient(#fff2d6, #e8c78f); border: 2px solid #8a6a34; }
.rs-slot { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; }
.rs-ava { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 28px; background: radial-gradient(circle at 50% 35%, var(--c-blue), #1d3352); border: 2px solid #8fd8ff; box-shadow: 0 0 10px rgba(79,170,255,.4); }
.rs-job small { display: block; font: 700 12px/1.2 system-ui; color: #cfe3f5; margin-bottom: 3px; }
.rs-timer { position: relative; height: 24px; border-radius: 6px; background: #0b0f14; border: 1px solid #000; overflow: hidden; display: grid; place-items: center; }
.rs-timer i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(var(--c-good-hi), #4fa52b); }
.rs-timer b { position: relative; font: 900 14px/1 ui-monospace, Menlo, monospace; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.rs-speed { width: 44px; height: 40px; padding: 0; border-radius: 10px; font-size: 18px; background: linear-gradient(#7fd4ff, #2f86d8); border: 2px solid #ffffff55; }
.rs-idle { font: 800 14px/1.2 system-ui; color: #cfe3f5; } .rs-idle small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
/* category screen */
.rs-hero { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; padding: 10px; margin-bottom: 12px; border-radius: 14px; position: relative;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 40%, #1a120a), #12161b); border: 1px solid color-mix(in srgb, var(--c) 50%, #333); }
.rs-hero .rs-art { position: relative; inset: auto; height: 100px; }
.rs-hero-tx { display: grid; gap: 4px; } .rs-hero-tx b { font: 900 28px/1 system-ui; color: #fff; } .rs-hero-tx span { font-size: 13px; color: #d7dde3; } .rs-hero-tx .pn-bar { height: 10px; }
.rs-list { display: grid; gap: 8px; }
.rs-tech { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: linear-gradient(#1c2530, #141a21); border: 1px solid #2b3a4c; }
.rs-tech.done { border-color: #7a5f1f; background: linear-gradient(#2a2416, #17140d); }
.rs-tech.busy { border-color: #d9901f; box-shadow: 0 0 0 1px #d9901f inset, 0 0 14px rgba(217,144,31,.25); }
.rs-tech.locked { opacity: .6; }
.rs-ic { position: relative; width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-size: 28px; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 70%, #fff 0%), color-mix(in srgb, var(--c) 30%, #0b0f14)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.rs-ic i { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font: 800 10px/1 system-ui; font-style: normal; padding: 2px 6px; border-radius: 999px; background: #0b0f14; border: 1px solid #3a4a5c; color: #fff; white-space: nowrap; }
.rs-nm { font: 800 15px/1.2 system-ui; }
.rs-pips { display: flex; gap: 3px; margin: 4px 0; } .rs-pips i { width: 14px; height: 5px; border-radius: 2px; background: #2b3a4c; } .rs-pips i.on { background: var(--c); box-shadow: 0 0 4px var(--c); }
.rs-bonus { font-size: 12px; color: #8fe09a; font-weight: 700; } .rs-bonus span { color: #ffd27a; }
.rs-cost { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 11px; color: #c7d0d9; } .rs-cost .no { color: var(--bad); }
.rs-go { min-width: 84px; min-height: 40px; font-weight: 800; color: #fff; border: 0; border-radius: 10px; background: linear-gradient(#4fa6ff, #2a6fc9); box-shadow: 0 3px 0 #1d4f8f; }
.rs-go:disabled { background: #2b3a4c; box-shadow: none; }
.rs-go.busy { background: linear-gradient(#ffcf5a, #d9901f); color: #2a1a04; box-shadow: 0 3px 0 #8a5a10; }
.rs-max { font: 900 14px/1 system-ui; color: #ffd23a; padding: 0 6px; }
.rs-lock { font-size: 11px; color: var(--muted); max-width: 90px; text-align: right; }

/* tech tree */
.rt-tree { position: relative; margin: 4px auto 0; width: 100%; max-width: 340px; }
.rt-svg { position: absolute; inset: 0; pointer-events: none; }
.rt-node { position: absolute; transform: translate(-50%, -34px); width: 110px; padding: 0; border: 0; background: none; display: grid; justify-items: center; gap: 2px; color: #fff; }
.rt-node .hex { width: 68px; height: 68px; display: grid; place-items: center; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 75%, #fff 10%), color-mix(in srgb, var(--c) 35%, #0b0f14)); }
.rt-node .hex .ic { font-size: 30px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.rt-node b { font: 900 13px/1 system-ui; padding: 2px 8px; border-radius: 999px; background: #0b0f14; border: 1px solid #3a4a5c; }
.rt-node small { font: 700 11px/1.1 system-ui; color: #c7d0d9; text-align: center; max-width: 110px; }
.rt-node.max b { color: #ffd23a; border-color: #7a5f1f; }
.rt-node.locked .hex { filter: grayscale(1) brightness(.55); } .rt-node.locked small { opacity: .6; }
.rt-node.ready .hex { animation: rt-pulse 1.6s ease-in-out infinite; }
.rt-node.busy .hex { box-shadow: none; animation: rt-pulse .8s ease-in-out infinite; }
@keyframes rt-pulse { 50% { filter: brightness(1.35) drop-shadow(0 0 8px var(--c)); } }
