/* Styling for the per-operator hub page. Follows the same dark
   translucent-card look as css/planner-extra.css/css/calendar-extra.css
   so this feels like the same site -- kept in its own file so it only
   affects this page. (.cnBadge and .iconMissing are shared with the
   edit-modal component and come from css/operator-edit-modal.css, also
   linked on this page -- not redefined here.) */

#operatorJumpBar,
#operatorStatus,
#operatorContent,
#pageCredit {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Matches the other pages' #pageCredit muted-link treatment. */
#pageCredit {
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 0 16px;
  font-size: 0.75rem;
  color: #999;
  text-align: center;
}

#pageCredit a {
  color: #bbb;
}

#pageCredit a:hover {
  color: #ccc;
}

#operatorJumpBar {
  margin-top: 16px;
  margin-bottom: 20px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#operatorJumpBar label {
  font-size: 0.75rem;
  color: #aaa;
}

.operatorStatus {
  text-align: center;
  color: #777;
  padding: 40px 16px;
  font-size: 0.95rem;
}

.operatorStatus.hidden {
  display: none;
}

/* --- Browsable roster grid (landing state) ------------------------------ */

#operatorBrowse {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

#operatorBrowse.hidden {
  display: none;
}

#operatorFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.opFilterGroup {
  display: flex;
  align-items: center;
  gap: 6px;
}

.opFilterGroup label {
  font-size: 0.75rem;
  color: #aaa;
}

.opFilterGroup select {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #1c1c1c;
  color: #eee;
  font-size: 0.85rem;
}

/* Rarity colors as commonly documented for Arknights' own tier-1 through
   tier-6 banners (Aceship's AN-EN-Tags recruitment-tool CSS, the same
   community-maintained asset family this site's icons already draw from
   via ASSET_SOURCE.ACESHIP in util.js) -- a custom property per rarity so
   both the grid item's border and its name strip pick it up from one
   place. */
.opRarity1 {
  --rarity-color: #9f9f9f;
}
.opRarity2 {
  --rarity-color: #dce537;
}
.opRarity3 {
  --rarity-color: #00b2f6;
}
.opRarity4 {
  --rarity-color: #dbb1db;
}
.opRarity5 {
  --rarity-color: #ffae00;
}
.opRarity6 {
  --rarity-color: #ff6600;
}

#operatorGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.opGridItem {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  border: 2px solid var(--rarity-color, #555);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.1s ease;
}

.opGridItem:hover {
  transform: scale(1.05);
  z-index: 1;
}

/* Owned/not-owned filter: the non-matching half of the grid stays put
   (and stays clickable) rather than being removed outright, just
   visually de-emphasized -- see renderGrid() in operator-page.js. */
.opGridItem.opGreyedOut {
  opacity: 0.32;
  filter: grayscale(0.7);
}

.opGridItem.opGreyedOut:hover {
  opacity: 0.6;
}

.opOwnedFilterHint {
  margin: -8px 0 16px;
  font-size: 0.78rem;
  color: #999;
}

.opOwnedFilterHint.hidden {
  display: none;
}

.opOwnedFilterHint a {
  color: #f8d511;
}

.opGridItemImgWrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.opGridItemImgWrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.opGridItemName {
  background: var(--rarity-color, #555);
  color: #1a1a1a;
  font-weight: bold;
  font-size: 0.68rem;
  text-align: center;
  padding: 3px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#operatorContent.hidden {
  display: none;
}

#operatorContent {
  padding: 0 16px 40px;
}

#opBackLink {
  display: inline-block;
  margin-bottom: 12px;
  color: #999;
  text-decoration: none;
  font-size: 0.85rem;
}

#opBackLink:hover {
  color: #ccc;
  text-decoration: underline;
}

#opHeader {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.opIcon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

#opHeaderInfo {
  min-width: 0;
  flex: 1 1 auto;
}

#opNameRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

#opName {
  font-size: 1.3rem;
  margin: 0;
  color: #eee;
}

#opMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.opBadge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: #ccc;
}

.opRarityBadge {
  color: #f8d511;
  border-color: rgba(248, 213, 17, 0.35);
}

.opPoolBadge.opPoolKernel {
  color: #6fb3ff;
  border-color: rgba(111, 179, 255, 0.4);
}

.opPoolBadge.opPoolLimited {
  color: #ff9f43;
  border-color: rgba(255, 159, 67, 0.4);
}

.opPoolBadge.opPoolEvent {
  color: #a7e36f;
  border-color: rgba(167, 227, 111, 0.4);
}

.opAddToPlannerBtn {
  flex: 0 0 auto;
  background: rgba(248, 213, 17, 0.12);
  border: 1px solid rgba(248, 213, 17, 0.4);
  color: #f8d511;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.opAddToPlannerBtn:hover {
  background: rgba(248, 213, 17, 0.2);
}

.opAddToPlannerBtn.inPlanner {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ccc;
}

/* --- "Maxed" / "Your stats" toggle (owned operators only) -------------- */

/* --- Machine-translated CN text (js/operator-page.js's tr()/markMt()) --- */

.opMtNotice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 159, 67, 0.08);
  border: 1px solid rgba(255, 159, 67, 0.25);
  font-size: 0.8rem;
  color: #ccc;
}

.opMtNotice.hidden {
  display: none;
}

.opMtNotice span {
  flex: 1 1 280px;
}

.opMtToggle {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #555;
  border-radius: 6px;
  color: #eee;
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
}

.opMtToggle:hover {
  border-color: #ff9f43;
}

.mtText {
  text-decoration: underline dotted rgba(255, 159, 67, 0.7);
  text-underline-offset: 3px;
}

.opStatsViewToggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
}

.opStatsViewToggle.hidden {
  display: none;
}

.opStatsViewLabel {
  font-size: 0.75rem;
  color: #999;
}

.opStatsViewBtn {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #ccc;
  font-size: 0.78rem;
  cursor: pointer;
}

.opStatsViewBtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #eee;
}

.opStatsViewBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.opStatsViewBtnActive {
  background: rgba(248, 213, 17, 0.15);
  border-color: rgba(248, 213, 17, 0.5);
  color: #f8d511;
}

/* Generic "not reached yet" de-emphasis, shared by the Potential-upgrade
   rows and Module stages below the "Your stats" toggle -- same greyed-
   out-not-hidden spirit as .opGridItem.opGreyedOut on the browse grid,
   but a plain class since it's applied to a handful of different element
   types rather than just one. */
.opValueLocked {
  opacity: 0.35;
  filter: grayscale(0.6);
}

.opModuleEquippedBadge {
  font-size: 0.68rem;
  color: #f8d511;
  background: rgba(248, 213, 17, 0.12);
  border: 1px solid rgba(248, 213, 17, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
}

.opSection {
  margin-bottom: 20px;
}

.opSectionHeading {
  font-size: 1rem;
  margin: 0 0 10px;
  color: #eee;
}

.opInfoRows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opInfoRow {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.opInfoLabel {
  color: #999;
  flex: 0 0 130px;
}

.opInfoValue {
  color: #eee;
}

.opInfoValue a {
  color: #6fb3ff;
}

.opFactionBadge.hidden {
  display: none;
}

.opOwnedSummary {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #f8d511;
}

.opOwnedSummary.hidden {
  display: none;
}

.opNote {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #ccc;
}

/* --- Skins (js/operator-page.js's renderSkins()/showSkinPreview()) ----- */

.opSkinsGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.opSkinCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  text-align: center;
}

@media (hover: hover) {
  .opSkinCard:hover {
    border-color: #f8d511;
    background: rgba(248, 213, 17, 0.06);
  }
}

/* Dimmed when this skin is NOT in the synced account's owned-skins list
   and the page's "Maxed"/"Your stats" toggle is set to "Your stats" --
   see js/operator-page.js's skinsShouldGreyUnowned(). Same 0.35 opacity
   /store's own canvas-based greying uses (js/shoplist.js's
   ctx.globalAlpha), just as a CSS class here since this gallery is plain
   DOM, not a Chart.js canvas. */
.opSkinCard.opSkinCardUnowned {
  opacity: 0.35;
}

.opSkinCardImg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.opSkinCardName {
  font-size: 0.72rem;
  color: #ccc;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.skinPreviewOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

.skinPreviewOverlay.hidden {
  display: none;
}

.skinPreview {
  position: relative;
  width: 100%;
  /* Wide enough to show a full illustration large -- the art is a
     1024px square, so on a typical desktop it ends up limited by the
     image's max-height below rather than by this -- while still looking
     fine for the small circular avatar placeholder shown before that
     finishes loading (see showSkinPreview() in js/operator-page.js). */
  max-width: 880px;
  margin: 0;
  padding: 14px 40px 16px 14px;
  background: #232323;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid #f8d511;
  border-radius: 12px;
  text-align: center;
}

.skinPreviewClose {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #999;
  cursor: pointer;
}

.skinPreviewClose:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
}

.skinPreviewClose::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f00d"; /* fa-times */
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

.skinPreviewImg {
  /* Initial state: the small circular avatar, shown immediately as a
     placeholder while the full illustration loads in the background. */
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  margin: 0 auto 10px;
}

.skinPreviewImg.skinPreviewImgFull {
  /* Swapped in once the full illustration has finished loading --
     uncropped (illustrations are tall/portrait-oriented, not square)
     and sized to fit the modal/viewport rather than the fixed avatar
     box above. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
}

/* Clicking the full art opens the zoom view below. */
.skinPreviewImg.skinPreviewImgFull {
  cursor: zoom-in;
}

/* --- Full-screen zoom of a skin's art (operator-page.js, "zoomed art") --- */

.skinZoom {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
}

.skinZoom.hidden {
  display: none;
}

.skinZoomImg {
  max-width: 100vw;
  max-height: 100vh;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}

/* Zoomed in: the image keeps its set width and the overlay scrolls. */
.skinZoom.zoomed {
  display: block;
}

.skinZoom.zoomed .skinZoomImg {
  display: block;
  max-width: none;
  max-height: none;
  margin-left: auto;
  margin-right: auto;
  cursor: zoom-out;
}

.skinZoomImg:focus-visible {
  outline: 2px solid #f8d511;
  outline-offset: 2px;
}

.skinZoomClose {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #ddd;
  font-size: 1.1rem;
  cursor: pointer;
}

.skinZoomClose::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f00d"; /* fa-times */
}

.skinZoomClose:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* No page scrolling behind the zoom view. */
body.skinZoomOpen {
  overflow: hidden;
}

.skinPreviewName {
  font-size: 1.05rem;
  font-weight: bold;
  color: #eee;
}

.skinPreviewMeta {
  font-size: 0.78rem;
  color: #999;
  margin-top: 2px;
}

.skinPreviewMeta:empty {
  display: none;
}

.skinPreviewContent {
  /* Keep the flavour text to a readable line length in the wider modal. */
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.85rem;
  color: #ccc;
  line-height: 1.5;
  font-style: italic;
  margin-top: 10px;
}

.skinPreviewContent:empty {
  display: none;
}

/* --- Shared range-slider controls (stats Elite/Level, skill Lv1-M3) ---- */

.opStatsControls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.opStatsSliderRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.opStatsSliderRow label {
  flex: 0 0 40px;
  font-size: 0.75rem;
  color: #999;
}

.opStatsSlider {
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.opStatsSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8d511;
  cursor: pointer;
}

.opStatsSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8d511;
  border: none;
  cursor: pointer;
}

.opStatsSlider:disabled {
  opacity: 0.4;
}

.opStatsSliderValue {
  flex: 0 0 90px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: bold;
  color: #eee;
}

/* Elite/Module/Stage are a handful of discrete options each, so they're
   small dropdowns rather than sliders -- styled to match .opFilterGroup
   select's dropdowns elsewhere on this page, but sized to sit in a
   .opStatsSliderRow alongside the Level slider's own label width. */
.opStatsSelect {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #1c1c1c;
  color: #eee;
  font-size: 0.82rem;
}

.opStatsNote {
  font-size: 0.75rem;
  color: #999;
  margin-top: 2px;
}

/* --- Stats ------------------------------------------------------------- */

.opStatsTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.opStatsTable th,
.opStatsTable td {
  text-align: left;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.opStatsTable thead th {
  color: #999;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: bold;
}

.opStatsTable tbody th {
  color: #ccc;
  font-weight: normal;
  white-space: nowrap;
}

.opStatsTable tbody td {
  color: #eee;
  font-weight: bold;
}

/* --- Talents ------------------------------------------------------------ */

.opTalentBlock {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.opTalentBlock:last-child {
  margin-bottom: 0;
}

.opTalentHeading {
  font-weight: bold;
  color: #eee;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.opTalentCandidate {
  padding: 4px 0;
  font-size: 0.85rem;
}

.opTalentCandidate + .opTalentCandidate {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.opTalentUnlock {
  color: #999;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.opTalentDescription {
  color: #ccc;
  line-height: 1.4;
}

/* --- Base skills ---------------------------------------------------------- */
/* Each slot is an .opTalentBlock; its tiers (a later one replaces an earlier
   one once unlocked) are rows with the game's colored icon tile. */

.opBaseSkillRow {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 4px 0;
  font-size: 0.85rem;
}

.opBaseSkillRow + .opBaseSkillRow {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.opBaseSkillIcon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.opBaseSkillIcon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.opBaseSkillBody {
  flex: 1 1 auto;
  min-width: 0;
}

.opBaseSkillHead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.opBaseSkillName {
  margin-bottom: 0;
}

.opBaseSkillRoom {
  font-size: 0.72rem;
  color: #aaa;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1px 6px;
}

.opBaseUp {
  color: #6fcf6f;
}

.opBaseDown {
  color: #ff7b72;
}

.opBaseKeyword {
  color: #6fb3ff;
}

.opBaseNote {
  color: #999;
}

/* --- Potential upgrades --------------------------------------------------- */

.opPotentialRow {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.opPotentialRow:last-child {
  margin-bottom: 0;
}

.opPotentialLabel {
  color: #f8d511;
  font-weight: bold;
  flex: 0 0 90px;
}

.opPotentialDescription {
  color: #ccc;
}

/* --- Skills -------------------------------------------------------------- */

.opSkillBlock {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.opSkillBlock:last-child {
  margin-bottom: 0;
}

.opSkillHeading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  color: #eee;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.opSkillIcon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.opSkillSliderRow {
  margin-bottom: 8px;
}

.opSkillSliderValueMastery {
  color: #6fb3ff;
}

.opSkillLevelDetail {
  font-size: 0.85rem;
}

.opSkillLevelSp {
  color: #999;
  margin-bottom: 2px;
}

.opSkillLevelDescription {
  color: #ccc;
  line-height: 1.4;
}

/* --- Modules -------------------------------------------------------------- */

.opModuleRow {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.opModuleRow:last-child {
  margin-bottom: 0;
}

.opModuleHeading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  color: #eee;
  font-size: 0.9rem;
}

.opModuleCode {
  color: #999;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1px 6px;
}

/* Pushed to the far right of .opModuleHeading's flex row regardless of
   how long the code/name before it run. */
.opModuleLoreToggle {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.opModuleLoreToggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #eee;
}

.opModuleDescription {
  color: #ccc;
  font-size: 0.85rem;
  margin-top: 4px;
  line-height: 1.4;
}

.opModuleDescription.hidden {
  display: none;
}

.opModuleStageList {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opModuleStage {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.opModuleStageHeading {
  color: #f8d511;
  font-weight: bold;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}

.opModuleStageStats {
  color: #6fb3ff;
  margin-bottom: 2px;
}

.opModuleStageEffect {
  color: #ccc;
  line-height: 1.4;
}

.opModuleStageEffect + .opModuleStageEffect {
  margin-top: 2px;
}

@media (max-width: 560px) {
  #opHeader {
    flex-wrap: wrap;
  }

  .opAddToPlannerBtn {
    flex: 1 1 100%;
  }

  .opInfoRow {
    flex-direction: column;
    gap: 2px;
  }

  .opInfoLabel {
    flex: none;
  }

  .opStatsSliderRow label {
    flex: 0 0 36px;
  }

  #operatorGrid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 8px;
  }

  .opFilterGroup select {
    font-size: 0.8rem;
  }

  .opStatsSliderValue {
    flex: 0 0 76px;
    font-size: 0.78rem;
  }
}

/* --- Animated chibi in the skin preview (js/chibi-viewer.js) ----------- */

.chibiPanel {
  margin: 4px 0 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chibiPanel.hidden {
  display: none;
}

.chibiHeading {
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.chibiControls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.chibiAnimSelect {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #1a1a1a;
  color: #ddd;
  font-size: 0.78rem;
}

.chibiStage {
  position: relative;
  height: 240px;
  margin-top: 6px;
}

.chibiPlayerHost {
  width: 100%;
  height: 100%;
}

/* The player draws its own loading animation; keep it out of sight and
   show the plain "Loading..." line under the stage instead. */
.chibiStageLoading .chibiPlayerHost {
  visibility: hidden;
}

.chibiStatus {
  min-height: 1em;
  font-size: 0.75rem;
  color: #999;
}
