/* rise3-research — Academy tables and commander talents share Rise tokens. */
.rise3d .r3-panel[data-view="research"],
.rise3d .r3-panel[data-view="talents"] { width: min(1040px, calc(100% - 244px)); max-width: none; }
.r3-research { min-width: 0; }
.r3-research-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.r3-research-summary p { margin: 0; color: var(--r3-gold); }
.r3-research-tabs { display: flex; gap: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--r3-line); }
.rise3d .r3-research-tabs button { border: 0; background: transparent; border-radius: 6px 6px 0 0; padding: 10px 4px; min-height: 44px; border-bottom: 2px solid transparent; }
.rise3d .r3-research-tabs button[aria-selected="true"] { color: var(--r3-gold); border-bottom-color: var(--r3-gold); }
.r3-research-layout { display: grid; grid-template-columns: minmax(0, 1fr) 252px; align-items: start; gap: 20px; }
.r3-tech-scroll { overflow: auto; overscroll-behavior: contain; padding-bottom: 12px; scrollbar-color: var(--r3-line) transparent; }
.r3-tech-map { position: relative; min-height: 0; }
.r3-tech-tier { position: absolute; top: 4px; color: var(--r3-muted); }
.r3-tech-edges { position: absolute; width: 100%; height: 100%; fill: none; stroke: var(--r3-line); stroke-width: 2; }
.r3-tech-edges .complete { stroke: var(--r3-gold); }
.rise3d .r3-tech-node { position: absolute; width: 136px; min-height: 94px; padding: 10px 8px; border-radius: 8px; display: grid; grid-template-columns: 24px 1fr; gap: 6px 8px; text-align: left; background: var(--r3-paper); }
.r3-tech-node strong { font-size: 13px; line-height: 1.35; align-self: center; font-weight: 600; }
.r3-tech-node small { grid-column: 1 / -1; font-size: 11px; color: var(--r3-muted); }
.r3-tech-node .r3-icon { width: 24px; height: 24px; color: var(--r3-gold); }
.rise3d .r3-tech-node[aria-pressed="true"] { border-color: var(--r3-gold); background: var(--r3-control); }
.rise3d .r3-tech-node[data-status="locked"] { border-style: dashed; }
.r3-tech-node[data-status="locked"] .r3-icon { color: var(--r3-muted); }
.r3-tech-node[data-status="researching"] small, .r3-tech-node[data-status="maxed"] small { color: var(--r3-gold); }
.r3-tech-detail { padding-left: 20px; border-left: 1px solid var(--r3-line); min-width: 0; }
.r3-tech-detail-head { display: flex; gap: 10px; align-items: center; }
.r3-tech-detail-head .r3-icon { width: 30px; height: 30px; color: var(--r3-gold); flex-shrink: 0; }
.rise3d .r3-tech-detail h3 { font-size: 21px; margin: 0; text-wrap: balance; }
.rise3d .r3-tech-detail h4 { margin: 18px 0 6px; font-size: 13px; font-weight: 600; }
.r3-tech-effects { display: grid; gap: 8px; margin: 16px 0; }
.r3-tech-effects dt { color: var(--r3-muted); font-size: 12px; }
.r3-tech-effects dd { margin: -4px 0 4px; color: var(--r3-gold); font-variant-numeric: tabular-nums; }
.r3-tech-requirements p { font-size: 12px; margin: 6px 0; }
.r3-tech-requirements .met { color: var(--r3-muted); }
.r3-tech-costs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; font-size: 12px; }
.r3-tech-costs span { display: flex; align-items: center; gap: 6px; }
.r3-tech-costs .r3-icon { width: 17px; height: 17px; color: var(--r3-gold); }
.r3-tech-costs .shortage { color: #f09a83; }
.r3-tech-timer { display: grid; gap: 10px; margin: 20px 0; }
.r3-tech-timer progress { width: 100%; }
.r3-tech-detail > button { margin-top: 10px; min-height: 44px; width: 100%; }
.r3-research-footer { font-size: 12px; color: var(--r3-muted); margin: 18px 0 0; max-width: 72ch; line-height: 1.6; }
.r3-tech-complete { color: var(--r3-gold); }
.theme-light .r3-tech-costs .shortage { color: #a83522; }
@container (max-width: 960px) {
  .rise3d .r3-panel[data-view="research"], .rise3d .r3-panel[data-view="talents"] { width: calc(100% - 28px); }
}
.rise3d.is-phone .r3-panel[data-view="research"], .rise3d.is-phone .r3-panel[data-view="talents"] { width: auto; }
.rise3d.is-phone .r3-research-layout { grid-template-columns: 1fr; gap: 16px; }
.rise3d.is-phone .r3-tech-scroll { max-height: 218px; padding: 0 0 4px; }
.rise3d.is-phone .r3-tech-map { width: auto !important; height: auto !important; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px; }
.rise3d.is-phone .r3-tech-node { position: static; width: auto; min-height: 90px; }
.rise3d.is-phone .r3-tech-edges, .rise3d.is-phone .r3-tech-tier { display: none; }
.rise3d.is-phone .r3-tech-detail { border-left: 0; border-top: 1px solid var(--r3-line); padding: 16px 0 0; }
.rise3d.is-phone .r3-tech-effects { grid-template-columns: 1fr auto; align-items: baseline; }
.rise3d.is-phone .r3-tech-effects dd { margin: 0; }
.rise3d.is-phone .r3-research-tabs { gap: 12px; }
.rise3d.is-phone .r3-research-summary { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .r3-tech-node { transition: none; } }
/* An opaque study surface keeps map labels from competing with technology text. */
.rise3d .r3-panel[data-view="research"], .rise3d .r3-panel[data-view="talents"] { background: #221f1a; }
body.theme-light .rise3d .r3-panel[data-view="research"], body.theme-light .rise3d .r3-panel[data-view="talents"] { background: var(--r3-paper); }
/* Short windows keep actions outside the scrolling reading area. */
.rise3d:not(.is-phone) .r3-panel[data-view="research"], .rise3d:not(.is-phone) .r3-panel[data-view="talents"] { display: flex; flex-direction: column; overflow: hidden; }
.rise3d:not(.is-phone) .r3-research { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rise3d:not(.is-phone) .r3-research-layout { flex: 1; min-height: 0; align-items: stretch; }
.rise3d:not(.is-phone) .r3-tech-detail { display: flex; flex-direction: column; overflow: hidden; padding-right: 6px; }
.rise3d:not(.is-phone) .r3-research-footer { flex-shrink: 0; margin-top: 12px; }
.rise3d:not(.is-phone) .r3-tech-reading { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--r3-line) transparent; }
.rise3d:not(.is-phone) .r3-tech-detail > button, .rise3d:not(.is-phone) .r3-tech-detail > .r3-speedup-actions { position: static; flex-shrink: 0; }
.r3-tech-scroll { scrollbar-width: thin; }
.rise3d.is-phone .r3-tech-detail > button, .rise3d.is-phone .r3-tech-detail > .r3-speedup-actions { position: sticky; bottom: 0; z-index: 1; }
@media (max-height: 780px) {
  .rise3d:not(.is-phone) .r3-panel[data-view="research"] > .r3-panel-header,
  .rise3d:not(.is-phone) .r3-panel[data-view="talents"] > .r3-panel-header { padding: 4px 0 8px; margin-bottom: 10px; }
  .rise3d:not(.is-phone) .r3-research-summary { margin-bottom: 8px; }
  .rise3d:not(.is-phone) .r3-research-tabs { margin-bottom: 8px; }
  .rise3d:not(.is-phone) .r3-research-footer { display: none; }
}
