/* Nine independent characters use three equal columns without an orphan row. */
.role-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.role-switch [data-character] { grid-column: auto; min-width: 0; }
@media (max-width: 1100px) and (min-width: 761px) {
  .role-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .role-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .role-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .role-switch button { font-size: 11px; padding-left: 3px; padding-right: 3px; }
}

body .item-art.jade { background-image: url('assets/male3-gear-atlas.png?v=32a0d7fa'); }

/* Jade, moon-white silk and pale gold frame the noble's formal robes. */
body[data-character="male3"] .character-panel {
  border-color: #b4c7b078;
  background: linear-gradient(145deg, #213d46, #142b38 66%, #263a43);
}
body[data-character="male3"] .level-tag {
  border-color: #abd4c75e;
  color: #d8f1e5;
}
body[data-character="male3"] .role-switch {
  border-color: #a8cabb4d;
  background: #0e252fcc;
}
body[data-character="male3"] .role-switch button.active {
  color: #fff5df;
  background: linear-gradient(135deg, #577c66, #33594c);
  box-shadow: inset 0 0 0 1px #eadabb24;
}
body[data-character="male3"] .character-stage {
  container-type: inline-size;
  --stage-arch: #8fafb455;
  background: radial-gradient(ellipse at 48% 27%, #fffef6 0, #eef5f6 45%, #cbdfe7 112%);
  border-top-color: #b8c9b94d;
  border-bottom-color: #b8c9b94d;
}
body[data-character="male3"] .character-stage::before {
  background: radial-gradient(ellipse at 11% 45%, #eed0ce2a, transparent 37%),
    radial-gradient(ellipse at 94% 77%, #78c4c529, transparent 40%),
    linear-gradient(115deg, transparent 21%, #ffffff45 22%, transparent 24%);
}
body[data-character="male3"] .portal {
  border-color: var(--stage-arch);
  border-bottom-color: transparent;
}
body[data-character="male3"] .portal::before { inset: 14px; }
body[data-character="male3"] .character-sprite {
  background-image: none;
  filter: drop-shadow(0 7px 8px #345b5724);
}
body[data-character="male3"] .wardrobe-layer { filter: none; }
body[data-character="male3"] .orbit-view { filter: drop-shadow(0 7px 8px #345b5724); }
body[data-character="male3"] .stage-floor {
  width: 246px;
  height: 23px;
  background: radial-gradient(ellipse, #526a612b, #77968e12 46%, transparent 75%);
}
body[data-character="male3"] .mount-companion {
  color: #3d645c;
  text-shadow: 0 1px 1px #fffcf3;
}
body[data-character="male3"] .gear-pin { background-color: #174250db; }
body[data-character="male3"] .preview-label {
  background: #3b5964ef;
  border-color: #c8bf96;
  color: #fff4de;
}
body[data-character="male3"] .character-caption {
  padding-top: 21px;
  padding-bottom: 19px;
  gap: 16px;
  align-items: flex-start;
}
body[data-character="male3"] .character-caption h2 {
  color: #fff1db;
  font-size: 25px;
  letter-spacing: .16em;
}
body[data-character="male3"] .character-caption p { color: #c7dcd3; }
body[data-character="male3"] .character-caption > .text-button { margin-top: 9px; }
body[data-character="male3"] .portrait-button {
  min-height: 88px;
  gap: 13px;
  padding: 5px 14px 5px 5px;
  border-color: #a9c2b580;
  background: linear-gradient(140deg, #f0e7c712, #c5eae407);
  box-shadow: inset 0 0 0 1px #e0f1df0d;
}
body[data-character="male3"] .portrait-thumbnail {
  flex: 0 0 66px;
  width: 66px;
  height: 76px;
  border-color: #c4ccab8c;
  background: #eff5eb;
}
body[data-character="male3"] .portrait-thumbnail img {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 23%;
}
body[data-character="male3"] .portrait-button:hover {
  border-color: #e1d5ad;
  background: #d9f3e41c;
}
body[data-character="male3"] .portrait-button:focus-visible { outline-color: #d8dfb3; }
body[data-character="male3"] .heroine-view-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
body[data-character="male3"] .heroine-view-label {
  color: #cde3d7;
  font-size: 12px;
  letter-spacing: .08em;
  white-space: nowrap;
}
body[data-character="male3"] .heroine-view-modes {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #b2c6b850;
  border-radius: 9px;
  background: #122a31;
}
body[data-character="male3"] .heroine-view-button {
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #d1e3db;
  background: transparent;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  touch-action: manipulation;
}
body[data-character="male3"] .heroine-view-button[aria-pressed="true"],
body[data-character="male3"] .orbit-mode-button[aria-pressed="true"] {
  color: #fff2d9;
  background: linear-gradient(135deg, #648a72, #385f4e);
  border-color: #d4d2a545;
}
body[data-character="male3"] .heroine-view-button:hover:not(:disabled) {
  color: #fff9e9;
  border-color: #bbcda670;
}
body[data-character="male3"] .heroine-view-button:focus-visible {
  outline: 2px solid #d4dfb5;
  outline-offset: 3px;
}
body[data-character="male3"] .orbit-angle-range { accent-color: #b6d6bc; }
body[data-character="male3"] .orbit-angle-label { color: #d0e6db; }
body[data-character="male3"] .orbit-explainer { color: #b6d5c9; }
body[data-character="male3"] .portrait-dialog {
  background: #f1f6f8;
  border-color: #9eae86;
  color: #3f6257;
}
body[data-character="male3"] .portrait-heading h2 { color: #386271; }
body[data-character="male3"] .portrait-heading p,
body[data-character="male3"] .portrait-note { color: #728b7d; }
body[data-character="male3"] .portrait-frame {
  background: radial-gradient(ellipse at 50% 30%, #fffdf5, #eef5f6 77%, #cbdee7);
}
@media (max-width: 1100px) and (min-width: 761px) {
  body[data-character="male3"] .character-caption { gap: 10px; }
  body[data-character="male3"] .character-caption > .text-button { font-size: 12px; }
}
@media (max-width: 760px) {
  body[data-character="male3"] .stage-floor { width: 204px; }
  body[data-character="male3"] .character-caption { gap: 9px; padding: 19px 21px 16px; }
  body[data-character="male3"] .character-caption h2 { font-size: 25px; }
  body[data-character="male3"] .character-caption > .text-button { margin-top: 6px; }
  body[data-character="male3"] .portrait-button { min-height: 82px; gap: 9px; padding-right: 10px; }
  body[data-character="male3"] .portrait-thumbnail { flex-basis: 60px; width: 60px; height: 70px; }
}
@media (max-width: 420px) {
  body[data-character="male3"] .character-caption { padding-right: 17px; padding-left: 17px; gap: 8px; }
  body[data-character="male3"] .character-caption h2 { font-size: 23px; }
  body[data-character="male3"] .portrait-button { min-height: 78px; font-size: 11px; }
  body[data-character="male3"] .portrait-thumbnail { flex-basis: 56px; width: 56px; height: 66px; }
  body[data-character="male3"] .heroine-view-selector { gap: 7px; }
  body[data-character="male3"] .heroine-view-button { padding-right: 10px; padding-left: 10px; }
}


@media (max-width: 420px) {
  body[data-character="male3"] .gear-pin:nth-of-type(5),
  body[data-character="male3"] .gear-pin:nth-of-type(6) { display: none; }
}
