/* =========================================
   Explorer Base CSS
   配置・サイズ・構造・表示制御のみ
   テーマ色・質感・発光は入れない
   ========================================= */


/* =========================================
   0. 最低限の土台
   ========================================= */

.archive-wrap {
  all: unset;
  display: block;
}

.card,
.archive-card,
.visual-main,
.visual-side-thumbs,
.visual-side-thumb,
.variation-item,
.related-work-card {
  box-sizing: border-box;
}

.card,
.archive-card {
  position: relative;
}


/* =========================================
   2. 詳細カード全体
   detail 21.js の .card 構造に対応
   ========================================= */

.card {
  --accent-safe: var(--accent, #7fd7ff);

  width: min(1280px, calc(100vw - 48px));
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;

  border-radius: 14px;
  overflow: visible;
  isolation: isolate;
}

.card > * {
  position: relative;
}

.classified {
  position: absolute;
  pointer-events: none;
}

.tab-menu {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

.tab-btn {
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.tab-content {
  display: none;
  min-height: 0;
  position: relative;
}

.tab-content.active {
  display: block;
  height: auto;
  overflow: visible;
}

#profile.tab-content.active,
#visual.tab-content.active,
#spoiler.tab-content.active {
  padding: 24px 28px 28px;
  box-sizing: border-box;
}


/* =========================================
   3. PROFILE タブ
   ========================================= */

.profile-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 450px;
  column-gap: 34px;
  align-items: start;
  overflow: visible;
  min-height: 100%;
  box-sizing: border-box;
}

.profile-left {
  position: relative;
  z-index: 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.profile-right {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  overflow: visible;
  padding-right: 8px;
}

.profile-front {
  position: relative;
  z-index: 5;
  overflow: visible;
}

.profile-left h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: .12em;
}

.name-sub {
  margin: 6px 0 14px;
}

.name-sub .roman {
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.name-sub .name-line {
  margin-top: 10px;
  height: 1px;
  width: 240px;
}


/* =========================================
   4. NOTES / 基本情報
   ========================================= */

.note {
  width: 100%;
  max-width: 560px;
  margin: 12px 18px 18px 0;
  padding: 12px 14px 14px;
  position: relative;
}

.note-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 0 0 8px;
}

.note-title {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.note-rule {
  flex: 1 1 auto;
  height: 1px;
}

.note .intro {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-width: none;
  line-height: 1.9;
  letter-spacing: .04em;
}

.info-grid {
  display: grid;
  gap: 8px;
  padding: 12px 0 16px;
}

.info-grid .row {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: baseline;
}

.info-grid .k {
  padding-right: 14px;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.info-grid .v {
  font-size: 14px;
}

.info-grid .row::before {
  content: "";
  position: absolute;
  left: 120px;
  top: 2px;
  bottom: 2px;
  width: 1px;
}


/* =========================================
   5. SAN / Radar
   ========================================= */

.san-wrapper {
  margin: 14px 0 0;
}

.san-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  letter-spacing: .10em;
  font-size: 14px;
}

.san-value {
  font-size: 20px;
  font-weight: 700;
}

.san-max {
  font-size: 12px;
  letter-spacing: .16em;
}

.san-bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
}

.san-fill {
  height: 100%;
}

canvas {
  display: block;
  max-width: 420px;
  margin: 14px 0 0;
  padding-bottom: 16px;
}

.radar-wrap {
  position: relative;
  z-index: 5;
  overflow: visible;
}

.radar-cover {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 100px;

  cursor: pointer;
  border-radius: 50%;
}

.radar-cover-title {
  font-size: 12px;
  letter-spacing: 4px;
}

.radar-cover-desc {
  font-size: 13px;
}

.radar-wrap.open .radar-cover {
  display: none;
}


/* =========================================
   6. 立ち絵と背景レイヤー
   ========================================= */

.profile-bg {
  position: absolute;
  inset: -14% -10% 28% -10%;
  z-index: 1;
  pointer-events: none;
}

.profile-bg::before,
.profile-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.portrait {
  position: relative;
  z-index: 2;

  width: 75%;
  max-width: none;
  margin: -8px 0 24px 0;

transform: translateY(-30px) !important;

  aspect-ratio: 1 / 1.4;
  overflow: visible;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  background: transparent;
  border: none;
  box-shadow: none;

  transform: translateX(-10px);
}

.portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-position: top center;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
  margin-bottom: 0;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 1px;
  transition: all .2s ease;
}

.profile-link::after {
  content: "↗";
  margin-left: 4px;
  font-size: 15px;
}

.link-icon {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}


/* =========================================
   7. spoiler タブ
   ========================================= */

.spoiler-box {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  border-radius: 12px;
}

.spoiler-content {
  padding: 18px;
  line-height: 1.8;
  user-select: none;
  pointer-events: none;
}

.spoiler-cover {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;

  cursor: pointer;
}

.spoiler-title {
  font-size: 12px;
  letter-spacing: 4px;
}

.spoiler-desc {
  font-size: 13px;
}

.spoiler-box.open .spoiler-content {
  user-select: text;
  pointer-events: auto;
}

.spoiler-box.open .spoiler-cover {
  display: none;
}


/* =========================================
   8. VISUAL タブ本体
   ========================================= */

.visual-stage {
  position: relative;
  transform: translateY(-100px); /* 数値は調整 */

  display: flex;
  justify-content: center;
  margin-top: 0 !important;
  padding-top: 0 !important;
  z-index: 10;
}

.visual-main {
  position: relative !important;
  z-index: 10;
  width: 100%;
  height: clamp(460px, 72vh, 820px);
  overflow: hidden !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#visual-main-image {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: block;

  width: auto;
  max-width: 88%;
  height: 96%;

  object-fit: contain;
  object-position: bottom center;

  opacity: 1;
  transition: opacity 0.22s ease;
  will-change: opacity;
}

#visual-main-image.is-switching {
  opacity: 0.8;
}


/* =========================================
   9. VISUAL 右サムネ
   いまの安定構造を優先
   ========================================= */

.visual-side-thumbs {
  position: absolute !important;
  right: 6px !important;
  top: 10% !important;
  transform: translateY(-50%) !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;

  width: 20% !important;
  max-height: min(428px, 58vh) !important;
  margin: 0 !important;
  padding: 0 !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  scrollbar-width: none !important;
  -ms-overflow-style: none !important;

  z-index: 30 !important;
  isolation: isolate !important;
}

.visual-side-thumbs::-webkit-scrollbar {
  display: none !important;
}

.visual-side-thumb {
  position: relative !important;
  width: 20% !important;
  flex: 0 0 auto !important;

  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 18px !important;
  background: transparent !important;

  cursor: pointer;
}

.visual-side-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 18px !important;
  pointer-events: none !important;
}

/* スクロールできる時の上下ヒント */
.visual-side-thumbs.has-scroll.can-scroll-top::before,
.visual-side-thumbs.has-scroll.can-scroll-bottom::after {
  position: sticky !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 35 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  height: 22px !important;
  pointer-events: none !important;

  font-size: 14px !important;
  line-height: 1 !important;

  content: "";
}

.visual-side-thumbs.has-scroll.can-scroll-top::before {
  content: "▲" !important;
  top: 0 !important;
  margin-bottom: -22px !important;
}

.visual-side-thumbs.has-scroll.can-scroll-bottom::after {
  content: "▼" !important;
  bottom: 0 !important;
  margin-top: -22px !important;
}


/* =========================================
   10. VISUAL ロックUI
   ========================================= */

.visual-side-thumbs.is-locked {
  overflow: hidden !important;
}

.visual-side-thumbs.is-locked::before,
.visual-side-thumbs.is-locked::after {
  display: none !important;
}

.visual-side-thumbs.is-locked .visual-side-thumb {
  pointer-events: none !important;
}

.thumb-lock-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 40 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 20px !important;

  cursor: pointer !important;
}

.thumb-lock-text {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;

  min-width: 90px !important;
  max-width: 168px !important;
  padding: 15px 13px 13px !important;

  border-radius: 18px !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.lock-icon {
  margin-bottom: 8px !important;
  font-size: 40px !important;
  line-height: 1 !important;
}

.thumb-lock-text .lock-main,
.thumb-lock-text .lock-sub,
.thumb-lock-text .lock-tags {
  white-space: normal !important;
  word-break: keep-all !important;
}

.thumb-lock-text .lock-main {
  font-size: 12px !important;
  line-height: 1.7 !important;
  letter-spacing: 0.05em !important;
}

.thumb-lock-text .lock-sub {
  margin-top: 4px !important;
  font-size: 11px !important;
  line-height: 1.6 !important;
}

.thumb-lock-text .lock-tags {
  margin-top: 8px !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}

.visual-lock-panel {
  position: absolute;
  inset: 0;
  z-index: 25;

  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-lock-card {
  min-width: 220px;
  max-width: 320px;
  padding: 18px 16px;
  border-radius: 18px;
  text-align: center;
}

.visual-lock-title {
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.22em;
}

.visual-lock-text {
  font-size: 13px;
  line-height: 1.8;
}

.visual-lock-sub {
  margin-top: 8px;
  font-size: 11px;
}


/* =========================================
   11. 差分アイコン
   ========================================= */

.variation-section {
  position: relative;

transform: translateY(-35px);

  z-index: 5;
  margin-top: 40px;
}

.variation-heading {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.2;
}

.variation-heading span {
  margin-left: 8px;
  font-size: 16px;
}

.variation-icons {
  position: relative;
  z-index: 31;

  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 22px;
}

.variation-item {
  position: relative;
  z-index: 32;

  width: 110px;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  cursor: pointer;
}

.variation-thumb {
  width: 110px;
  height: 110px;
  overflow: hidden;
  border-radius: 999px;
}

.variation-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.variation-label {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .03em;
}


/* =========================================
   12. Works セクション
   ========================================= */

.related-works-section {
  margin-top: 34px;

 position: relative;

transform: translateY(0px);

}

.related-works-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.related-works-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.related-works-subtitle {
  font-size: 13px;
  letter-spacing: 0.14em;
}

.related-works-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.related-work-card {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 0.95 / 1;
  border-radius: 18px;
  text-decoration: none;
  transition:
    transform .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}

.related-work-card:hover {
  transform: translateY(-3px);
}

.related-work-thumb {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.related-work-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, filter .35s ease;
}

.related-work-card:hover .related-work-thumb img {
  transform: scale(1.04);
}

.related-work-tags {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;

  pointer-events: none;
}

.related-work-type,
.related-work-spoiler {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.related-work-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;

  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.related-work-title {
  width: 100%;
  overflow: hidden;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;

  font-size: 13px;
  line-height: 1.55;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease;
}

.related-work-card:hover .related-work-title {
  transform: translateY(0);
}

.related-work-thumb--novel,
.related-work-thumb--log,
.related-work-thumb--illust,
.related-work-thumb--other,
.related-work-thumb--music,
.related-work-thumb--textcard {
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-work-thumb--novel::after,
.related-work-thumb--log::after,
.related-work-thumb--illust::after,
.related-work-thumb--textcard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.related-work-thumb-novel-inner,
.related-work-thumb-textcard-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.related-work-thumb-novel-inner {
  width: calc(100% - 28px);
  padding: 18px 14px;
}

.related-work-thumb-textcard-inner {
  width: calc(100% - 30px);
  padding: 20px 14px;
}

.related-work-thumb-novel-title,
.related-work-thumb-textcard-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.related-work-thumb-novel-title {
  -webkit-line-clamp: 4;
  font-size: 14px;
  line-height: 1.7;
}

.related-work-thumb-textcard-title {
  -webkit-line-clamp: 4;
  font-size: 15px;
  line-height: 1.75;
}

.related-work-thumb-novel-label,
.related-work-thumb-textcard-label {
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: 0.22em;
}

.related-work-thumb-fallback-label {
  position: relative;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.18em;
}

.related-works-empty,
.related-works-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  font-size: 13px;
  text-align: center;
}


/* =========================================
   13. スマホ
   ========================================= */

@media (max-width: 820px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-right {
    justify-content: center;
    padding-right: 0;
  }

  .profile-right .portrait {
    position: relative;
    top: auto;
    width: min(360px, 90vw);
    max-width: 360px;
    transform: translateX(0);
  }

  .info-grid .row {
    grid-template-columns: 105px 1fr;
  }

  .note {
    max-width: none;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .card {
    width: 100%;
    padding: 16px;
  }

  #profile.tab-content.active,
  #visual.tab-content.active,
  #spoiler.tab-content.active {
    padding: 18px 16px 20px;
  }

  .tab-menu {
    flex-wrap: wrap;
    gap: 8px;
  }

  .visual-side-thumbs {
    right: 2px !important;
    width: 68px !important;
    max-height: min(380px, 54vh) !important;
    gap: 10px !important;
  }

  .visual-side-thumb {
    width: 68px !important;
    height: 68px !important;
    border-radius: 16px !important;
  }

  .visual-side-thumb img {
    border-radius: 16px !important;
  }

  .thumb-lock-overlay {
    border-radius: 18px !important;
  }

  .thumb-lock-text {
    min-width: 122px !important;
    max-width: 156px !important;
    padding: 14px 12px 12px !important;
    border-radius: 16px !important;
  }

  .variation-icons {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .variation-item {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  body {
    padding: 22px;
  }

  #card-container {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }

  .related-works-section {
    margin-top: 28px;
  }

  .related-works-head {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
  }

  .related-works-title {
    font-size: 26px;
  }

  .related-works-subtitle {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .related-works-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .related-work-card {
    border-radius: 16px;
  }

  .related-work-type,
  .related-work-spoiler {
    min-height: 24px;
    padding: 0 8px;
    font-size: 10px;
  }

  .related-work-title {
    font-size: 12px;
  }

  .related-work-thumb-novel-title {
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .card {
    width: min(100%, calc(100vw - 24px));
    max-width: 100%;
    margin-inline: auto;
    padding: 16px;
    overflow-x: clip;
  }

  .visual-stage,
  .visual-main,
  .tab-content.active {
    max-width: 100%;
    overflow-x: clip;
  }

  .visual-side-thumbs {
    position: absolute !important;
    right: 2px !important;
    left: auto !important;
    width: 68px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .visual-side-thumb {
    margin: 0 !important;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .card {
    width: 100%;
    padding: 14px;
  }

  #profile.tab-content.active,
  #visual.tab-content.active,
  #spoiler.tab-content.active {
    padding: 16px 14px 18px;
  }
}

/* 矢印だけ出す */
.visual-side-thumbs.has-scroll.can-scroll-top::before,
.visual-side-thumbs.has-scroll.can-scroll-bottom::after {
  position: sticky !important;
  left: 0 !important;
  right: 0 !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 20 !important;
  pointer-events: none !important;
  font-size: 14px !important;
  line-height: 1 !important;
  color: rgba(255,255,255,0.72) !important;
  text-shadow: 0 0 8px rgba(0,0,0,0.45) !important;
}

.visual-side-thumbs.has-scroll.can-scroll-top::before {
  content: "▲" !important;
  top: 0 !important;
  margin-bottom: -22px !important;
}

.visual-side-thumbs.has-scroll.can-scroll-bottom::after {
  content: "▼" !important;
  bottom: 0 !important;
  margin-top: -22px !important;
}

/* ロック中はスクロールさせない */
.visual-side-thumbs.is-locked {
  overflow: hidden !important;
}

.visual-side-thumbs.is-locked::before,
.visual-side-thumbs.is-locked::after {
  display: none !important;
}

/* warningカードはそのまま上に重ねる */
.thumb-warning-float {
  position: absolute !important;
  top: 50% !important;
  right: 6px !important;
  transform: translateY(-50%) !important;
  z-index: 120 !important;
}

/* ===== スマホ：詳細ページの中身を収める ===== */
@media (max-width: 768px) {
  .card,
  .tab-content,
  .tab-content.active,
  .profile-grid,
  .profile-left,
  .profile-right,
  .profile-meta,
  .notes-box,
  .visual-stage,
  .visual-main {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-meta > div,
  .notes-box,
  .notes-box * {
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .detail-tabs {
    gap: 12px;
  }

  .detail-tab {
    min-width: 0;
    flex: 1 1 0;
    padding: 14px 10px;
  }
}

/* ===== スマホ：サムネ列の箱を少し太くして左右の切れを防ぐ ===== */
@media (max-width: 768px) {

  .visual-side-thumbs {
    right: 2px !important;
    width: 68px !important;
    max-height: calc(68px * 5 + 10px * 4) !important;
    gap: 10px !important;
  }

  .thumb-warning-float {
    right: 2px !important;
  }


  .visual-main {
    padding-right: 108px;
overflow: hidden;
  }

  #visual-main-image {
    right: 108px;
max-width: calc(100% - 12px);
  }

  .visual-side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
 border-radius: 16px !important;

  }
}


/* ===== 選択中サムネの白枠を外側ではなく内側に描く ===== */

.visual-side-thumb.is-active {
  overflow: hidden !important;
}

.visual-side-thumb.is-active img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.visual-side-thumb.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-sizing: border-box;

  /* 内側の白枠 */
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.95),
    inset 0 0 0 3px rgba(255,255,255,0.16),
    0 0 8px rgba(255,255,255,0.08);
}

/* ===== スマホ：見切れ防止用の安全な調整 ===== */
@media (max-width: 768px) {
  .visual-main {
    position: relative !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: clamp(420px, 68vh, 760px);
    padding-right: 92px !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  #visual-main-image {
    position: absolute !important;
    left: 47% !important;
    right: auto !important;
    bottom: 0 !important;
    transform: translateX(-50%) !important;

    width: auto;
    height: 98%;
    max-width: calc(100% - 4px);
    object-fit: contain;
    object-position: bottom center;
  }

 

.visual-side-thumbs {
  position: absolute !important;
  top: 50% !important;
  right: 0 !important;
  left: auto !important;
  transform: translateY(-50%) !important;

  width: 82px;
  padding: 8px 6px !important;
  box-sizing: border-box;

  max-height: calc(72px * 5 + 10px * 4 + 16px);
  overflow-y: auto;
  overflow-x: hidden;
}

  .visual-side-thumb {
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    box-sizing: border-box;
flex: 0 0 auto;
  position: relative;
  overflow: hidden;

border-radius: 16px !important;

  }

  .visual-side-thumb:last-child {
    margin-bottom: 0;
  }
}


/* =========================
   探索者一覧 / 詳細だけ全幅化
   ========================= */

/* 一覧 */
.page-template-page-explorer .l-mainContent__inner,
.page-template-page-explorer .c-entry,
.page-template-page-explorer .post_content,
.page-template-page-explorer .p-pageContent,
.page-template-page-explorer .l-container {
  max-width: none !important;
  width: 100% !important;
}

/* 詳細 */
.page-template-page-explorer-detail .l-mainContent__inner,
.page-template-page-explorer-detail .c-entry,
.page-template-page-explorer-detail .post_content,
.page-template-page-explorer-detail .p-pageContent,
.page-template-page-explorer-detail .l-container {
  max-width: none !important;
  width: 100% !important;
}

/* 余白を詰める */
.page-template-page-explorer .l-mainContent__inner,
.page-template-page-explorer-detail .l-mainContent__inner {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ヘッダー帯が中途半端に縮まないようにする */
.page-template-page-explorer .site-header,
.page-template-page-explorer-detail .site-header,
.page-template-page-explorer #header,
.page-template-page-explorer-detail #header {
  width: 100% !important;
  max-width: none !important;
}


.character-relations {
  margin-top: 18px;
  padding-top: 14px;
}

.character-relations-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.character-relations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.character-relation-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
}

.character-relation-link--disabled {
  opacity: 0.7;
  cursor: default;
}

.character-relation-title {
  display: block;
  font-size: 14px;
  line-height: 1.5;
}

.character-relation-desc {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.5;
}

.character-relation-note {
  display: block;
  margin-top: 6px;
  font-size: 11px;
}


.profile-bg::before,
.profile-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}



/* ===== 詳細ページ：背景ぼかしをカード外へ逃がす ===== */
@media (max-width: 768px) {
  .page-template-page-explorer-detail .card,
  .page-template-page-explorer-detail #profile.tab-content.active,
  .page-template-page-explorer-detail .tab-content.active,
  .page-template-page-explorer-detail .profile-grid,
  .page-template-page-explorer-detail .profile-right {
    overflow: visible !important;
  }
}



/* =========================
   TRPG TOP - layout/base
   ========================= */

.trpg-top-section {
  position: relative;
  padding: 56px 20px;
}

.trpg-top-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.trpg-top-heading {
  margin-bottom: 28px;
  text-align: center;
}

.trpg-top-heading-en {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  line-height: 1;
}

.trpg-top-heading h2,
.trpg-top-heading h3 {
  margin: 0;
  line-height: 1.4;
}

.trpg-top-heading p {
  margin: 10px auto 0;
  max-width: 720px;
  font-size: 0.95rem;
  line-height: 1.9;
}

.trpg-wave-divider {
  height: 72px;
  margin: -1px 0;
  pointer-events: none;
}

.trpg-scenario-banners {
  display: grid;
  gap: 14px;
}

.trpg-banner {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 132px;
  border-radius: 22px;
  text-decoration: none;
}

.trpg-banner-bg {
  position: absolute;
  inset: 0;
}

.trpg-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: center;
  padding: 22px 24px;
}

.trpg-banner-en {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.2em;
  line-height: 1;
}

.trpg-banner strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 700;
}

.trpg-banner small {
  display: block;
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.7;
}

.trpg-banner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 8px;
}

.trpg-banner-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.4;
}

.trpg-top-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.trpg-top-card {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 260px;
  border-radius: 24px;
  text-decoration: none;
}

.trpg-top-card-bg {
  position: absolute;
  inset: 0;
}

.trpg-top-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 24px 22px 20px;
}

.trpg-top-card-en {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.22em;
  line-height: 1;
}

.trpg-top-card h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.5;
}

.trpg-top-card p {
  margin: 10px 0 0;
  font-size: 0.95rem;
  line-height: 1.8;
}

.trpg-top-card ul {
  margin: 14px 0 0;
  padding-left: 1.1em;
}

.trpg-top-card li {
  margin: 6px 0 0;
  line-height: 1.7;
  font-size: 0.93rem;
}

.trpg-top-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding-top: 18px;
  font-size: 1.15rem;
  line-height: 1;
}

.trpg-top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.trpg-top-links.vertical {
  flex-direction: column;
  align-items: stretch;
}

.trpg-top-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none;
  line-height: 1.6;
  font-size: 0.94rem;
}

.trpg-top-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.trpg-top-mini-block {
  padding: 22px 20px;
  border-radius: 22px;
}

.trpg-top-mini-block h3 {
  margin: 0 0 14px;
  line-height: 1.5;
}

.trpg-top-subnav .trpg-top-heading-en,
.trpg-top-mini-block .trpg-top-heading-en {
  margin-bottom: 10px;
}

/* 画像を入れたいとき用の土台 */
.trpg-card-explorers .trpg-top-card-bg,
.trpg-card-relations .trpg-top-card-bg,
.trpg-card-records .trpg-top-card-bg,
.trpg-card-works .trpg-top-card-bg,
.trpg-banner-main .trpg-banner-bg,
.trpg-banner-sub .trpg-banner-bg {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* 必要ならここで個別背景画像指定
.trpg-card-explorers .trpg-top-card-bg {
  background-image: url('/wp/wp-content/uploads/xxxx.jpg');
}
*/

/* tablet */
@media (max-width: 960px) {
  .trpg-top-section {
    padding: 52px 18px;
  }

  .trpg-top-inner {
    width: min(100%, calc(100% - 12px));
  }

  .trpg-top-cards,
  .trpg-top-split {
    grid-template-columns: 1fr;
  }
}

/* smartphone */
@media (max-width: 767px) {
  .trpg-top-section {
    padding: 44px 14px;
  }

  .trpg-top-inner {
    width: 100%;
    margin: 0 auto;
  }

  .trpg-top-heading {
    margin-bottom: 22px;
  }

  .trpg-top-heading h2,
  .trpg-top-heading h3 {
    font-size: 1.5rem;
  }

  .trpg-top-heading p {
    margin-top: 8px;
    font-size: 0.92rem;
    line-height: 1.8;
  }

  .trpg-wave-divider {
    height: 46px;
  }

  .trpg-banner {
    min-height: 116px;
    border-radius: 18px;
  }

  .trpg-banner-content {
    min-height: 116px;
    padding: 18px 18px;
  }

  .trpg-banner strong {
    font-size: 1.02rem;
    line-height: 1.45;
  }

  .trpg-banner small {
    margin-top: 6px;
    font-size: 0.88rem;
  }

  .trpg-banner-links {
    gap: 8px;
  }

  .trpg-banner-links a {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.86rem;
  }

  .trpg-top-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .trpg-top-card {
    min-height: 220px;
    border-radius: 18px;
  }

  .trpg-top-card-body {
    min-height: 220px;
    padding: 18px 16px 16px;
  }

  .trpg-top-card h3 {
    font-size: 1.08rem;
  }

  .trpg-top-card p,
  .trpg-top-card li {
    font-size: 0.89rem;
    line-height: 1.75;
  }

  .trpg-top-links {
    gap: 8px;
  }

  .trpg-top-links a {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 0.88rem;
  }

  .trpg-top-mini-block {
    padding: 18px 16px;
    border-radius: 18px;
  }
}

body {
  outline: 10px solid red !important;
}


/* =========================================
   PROFILEスマホ再配置
   背景＋立ち絵の上に情報を重ねる
   ========================================= */
@media (max-width: 820px) {

 
}

/*====== かなり細い画面だけ微調整============== */
@media (max-width: 390px) {
  .profile-grid,
  .profile-right {
    min-height: 930px;
  }

  .portrait {
    width: 90vw;
    margin-top: 126px;
  }

  .note {
    right: 44%;
  }

  .info-grid {
    width: min(36vw, 148px);
  }

  .san-wrapper {
    top: 60.5%;
  }

  .radar-wrap {
    top: 70%;
    width: min(94vw, 360px);
  }
}
/* =========================================
   PROFILE mobile overlay layout
   親ごと重ねる完成版
   explorer-base.css の一番最後
   ========================================= */
@media (max-width: 820px) {

 #profile.tab-content.active {
    padding: 14px 10px 18px;
  }

  /* 背景＋立ち絵は土台としてそのまま使う */
  .profile-right {
    position: relative;
    z-index: 1;
    min-height: 980px;
    padding-right: 0;
    justify-content: center;
  }

  .profile-bg {
    inset: 4% -10% 18% -10%;
  }

  .portrait {
    width: min(76vw, 360px);
    aspect-ratio: 1 / 1.42;
    margin: 120px auto 0;
    transform: none;
 position: relative !important;
transform: translateY(-30px) !important;
  }

  .portrait img {
    object-fit: contain;
    object-position: top center;
  }

  /* 情報側を上から重ねる */

.profile-left {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}


  .profile-left > *,
  .profile-front > * {
    pointer-events: auto;
max-width: 48vw;   /* ← 横幅制限 */

  }

  .profile-front {
    position: absolute;
    inset: 0;
    z-index: 6;
  }

  /* 名前 */
  .profile-left h2 {
    position: absolute;
    top: 16px;
    left: 14px;
    right: 112px;

width: 46vw;

    margin: 0;
    font-size: clamp(28px, 8.8vw, 40px);
    line-height: 1.08;
    letter-spacing: 0.08em;
  }

  .name-sub {
    position: absolute;
    top: 88px;
    left: 14px;
    right: 120px;
    margin: 0;
width: 46vw; 

  }

  .name-sub .roman {
    font-size: 11px;
    letter-spacing: 0.22em;
  }

  .name-sub .name-line {
    width: min(48vw, 210px);
    margin-top: 8px;
  }

  /* NOTESは箱を消して背景に直接なじませる */
  .note {
    position: absolute;
    top: 146px;
    left: 14px;
    right: 42%;
    max-width: none;
    margin: 0;
width: 46vw; 
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  .note-head {
    gap: 10px;
    margin: 0 0 8px;
    padding: 0 0 5px;
  }

  .note-title {
    font-size: 10px;
    letter-spacing: 0.24em;
  }

  .note .intro {
    font-size: 13px;
    line-height: 1.72;
    letter-spacing: 0.03em;
  }

  /* 基本情報は右上に直書き寄せ */
  .info-grid {
    position: absolute;
    top: 146px;
    right: 12px;
    width: 42vw; 
    gap: 8px;
    padding: 0;
  }

  .info-grid .row {
    grid-template-columns: 1fr;
    gap: 2px;
    align-items: start;
  }

  .info-grid .row::before {
    display: none;
  }

  .info-grid .k {
    padding-right: 0;
    font-size: 9px;
    letter-spacing: 0.18em;
    opacity: 0.72;
  }

  .info-grid .v {
    font-size: 13px;
    line-height: 1.35;
  }

  /* SANは腹あたりの高さ */
  .san-wrapper {
    position: absolute;
    left: 16px;
    right: 14px;
    top: 80%;
    margin: 0;
width: 44vw;   

  }

  .san-label {
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
  }

  .san-value {
    font-size: 28px;
  }

  .san-max {
    font-size: 11px;
  }

  .san-bar {
    height: 8px;
  }

  /* レーダーも下に */
  .radar-wrap {
    position: absolute;

  right: 10px;        /* ←中央じゃなく右寄せ */

  left: auto;         /* ←中央指定解除 */

  transform: none;    /* ←中央寄せ解除 */

  width: 44vw;        /* ←半分サイズ */

  top: 70%;
    z-index: 6;
  }

  .radar-wrap canvas,
  .radar-wrap canvas#radarChart,
  .radar-wrap #radarChart {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 0;
  }

  .radar-cover {
    gap: 56px;
  }

#radarCover{
  width: 1200px !important;
  height: 1200px !important;

  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;

  border-radius: 50%;
}

  /* 全体 */
  .profile-grid{
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    position: relative !important;
    min-height: 980px !important;
    overflow: visible !important;
  }

  /* 左右を同じマスに重ねる */
  .profile-left,
  .profile-right{
    grid-column: 1 / 2 !important;
    grid-row: 1 / 2 !important;
  }

  /* 背景＋立ち絵側
     ここはサイズをいじらず、土台だけ整える */
  .profile-right{
    position: relative !important;
    z-index: 1 !important;
    min-height: 980px !important;
    padding-right: 0 !important;
    overflow: visible !important;

transform: translateX(20px) translateY(250px) scale(0.8) !important;

  }

  /* 情報側をオーバーレイ化 */
  .profile-left{
    position: relative !important;
    z-index: 5 !important;
    min-height: 980px !important;
    display: block !important;
    pointer-events: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .profile-left > *,
  .profile-left .profile-front > *{
    pointer-events: auto !important;
  }

  /* profile-front 自体は親ブロックとして使わない */
 .profile-left .profile-front{
  position: absolute !important;
  inset: 0 !important;
  transform: translateY(-180px) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 6 !important;
}

  /* ---------- 左上：名前 ---------- */
  .profile-left h2{
    position: absolute !important;
    top: 20px !important;
    width: 100% !important;
transform: scale(1.0);
    margin: 0 !important;
    z-index: 6 !important;
    line-height: 1.08 !important;
    font-size: clamp(20px, 7vw, 32px) !important;
  }

  .profile-left .name-sub{
    position: absolute !important;
    top: 40px !important;
    width: 44vw !important;
    margin: 0 !important;
    z-index: 6 !important;
transform: scale(0.8);
  }

  .profile-left .name-sub .name-line{
    width: min(42vw, 200px) !important;
  }

  /* ---------- 左中：NOTES ---------- */
  .profile-left .note{
    position: absolute !important;
    top: 480px !important;
    left: -20px !important;
    width: 80% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 6 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .profile-left .note-head{
    margin: 0 0 8px !important;
    padding: 0 0 5px !important;
  }

  .profile-left .note .intro{
    font-size: 13px !important;
    line-height: 1.7 !important;
  }

  /* ---------- 右上：基本情報 ---------- */
  .profile-left .info-grid{
    position: absolute !important;
    top: 300px !important;
left: -20px !important;
    width: 70% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 6 !important;
transform: scale(1);
    gap: 8px !important;
  }

  .profile-left .info-grid .row{
    grid-template-columns: 1fr !important;
    gap: 2px !important;
  }

  .profile-left .info-grid .row::before{
    display: none !important;
  }

  .profile-left .info-grid .k{
    padding-right: 0 !important;
    font-size: 7px !important;
    opacity: 0.72 !important;
  }

  .profile-left .info-grid .v{
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  /* ---------- 右下：SAN ---------- */
  .profile-left .san-wrapper{
    position: absolute !important;
    top: 370px !important;
    right: -80px !important;
    left: auto !important;
    width: 30vw !important;
    margin: 0 !important;
    z-index: 7 !important;
transform: scale(0.8);
  }

  /* ---------- 右下：レーダー ---------- */
  .profile-left .radar-wrap{
    position: absolute !important;
    top: 320px !important;
    right: -150px !important;
    left: auto !important;
    width: 230px !important;

transform: scale(0.10);  /* ←ここが重要 */

  transform-origin: top right; /* 右上基準で縮小 */

    margin: 0 !important;
    z-index: 7 !important;
  }

  .profile-left .radar-wrap canvas,
  .profile-left .radar-wrap #radarChart{
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
  }

.profile-left .radar-wrap canvas{
  transform: scale(6);
  transform-origin: center;
}


  /* ---------- 右下いちばん下：リンク ---------- */

  /* リンクは下端にまとめる */
  .profile-left .profile-links{
    position: absolute !important;
    top: 650px !important;
    right: 0px !important;
    left: auto !important;
    bottom: auto !important;
    width: 90% !important;
    margin: 0 !important;
    z-index: 7 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    justify-content: flex-start !important;
  }

  .profile-left .profile-link{
    width: 100% !important;
    justify-content: space-between !important;
    padding: 8px 10px !important;
    font-size: 10px !important; 
 letter-spacing: 0.08em;
  }
}

/* =======探索者詳細からうちよそページへのリンク================================== */
.character-relations{
  position: absolute;
  top: 640px;
  left: -5px !important;
  width: 44vw;
}



/* ===== サムネイル列：5件程度表示＋残り縦スクロール ===== */

.visual-main {
  overflow: visible !important;
}

.visual-side-thumbs {
  position: absolute !important;
  right: -30px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
width: 50% !important;
  max-height: calc(76px * 4 + 12px * 4) !important; /* 5件ぶん */
  padding: 0 !important;
  margin: 0 !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  scrollbar-width: none !important;
  -ms-overflow-style: none !important;

  z-index: 6 !important;
  isolation: isolate !important;
}

.visual-side-thumbs::-webkit-scrollbar {
  display: none !important;
}

.visual-side-thumb {
  width: 50% !important;
aspect-ratio: 1 / 1;
  flex: 0 0 auto !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}


/* 背景の丸ぼかし調整 */
.profile-bg img{
  -webkit-mask-image: radial-gradient(
    ellipse 70% 50% at 50% 48%,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.95) 50%,
    rgba(0,0,0,0.6) 75%,
    rgba(0,0,0,0) 100%
  ) !important;

  filter: blur(5px) brightness(0.8) !important;
}

/* 足元フェード強化 */
.profile-stand::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 300px !important;

  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.2) 30%,
    rgba(0,0,0,0.6) 70%,
    rgba(0,0,0,0.95) 100%
  ) !important;

  pointer-events: none;
  z-index: 3;
}

/* 背景レイヤーの位置修正 */
.profile-bg{
  position: absolute !important;
  top: 40% !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;

  display: flex;
  align-items: center;   /* ←縦位置の基準 */
  justify-content: center;

  z-index: 0 !important;
}


.profile-bg img{
  width: 120% !important;
  height: auto !important;

  object-fit: cover;
  object-position: center 90% !important; /* ←ここで上下調整 */

  transform: translateY(0) !important; /* ←ズレリセット */
}

.profile-right{
  position: relative !important;
  transform: translateY(0px) !important;
}

.profile-bg{
  position: absolute !important;
  inset: -300% -12% -500% -12% !important;
transform: translateY(400px) !important;
}

.portrait img{
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translateX(-50%) !important;
}

/* ===== タブボタンを最前面に固定 ===== */
.tab-menu {
  position: relative !important;
  z-index: 1000 !important;
  isolation: isolate;
}

.tab-btn {
  position: relative !important;
  z-index: 1001 !important;
  pointer-events: auto !important;
}

/* タブ本文側はタブより下に置く */
.tab-content,
#profile.tab-content.active,
#visual.tab-content.active,
#spoiler.tab-content.active {
  position: relative;
  z-index: 1;
}

/* 念のため、PROFILE/VISUAL内の前面要素を少し下げる */
.profile-front,
.radar-wrap,
.visual-main,
.visual-side-thumbs,
.variation-section,
.variation-icons,
.variation-item {
  z-index: 1 !important;
}


/* ===== VISUAL右サムネ 最終指定 ===== */
.visual-side-thumbs{
  position: absolute !important;
  top: 20% !important;
  right: clamp(-60px, 0vw, -60px) !important;

transform: scale(0.6);
  transform-origin: center;

transform: none !important;      /* 中央寄せをやめる */
   bottom: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;

width: clamp(48px, 8vw, 64px) !important;
max-height: calc(48px * 4 + 64px * 3);
  margin: 0 !important;
    /* ★ここを変更 */

  padding: 8px 8px !important;  /* 上下にも余白を追加 */
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  z-index: 30 !important;
}

.visual-side-thumbs::-webkit-scrollbar{
  display: none !important;
}

.visual-side-thumb{
  width: 70% !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 10px !important;
}

.visual-side-thumb img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}


@media (max-width: 768px) {

  .visual-stage,
  .visual-main,
  .tab-content.active {
    overflow-x: visible !important;
  }

  .visual-main {
    padding-right: 0px !important;   /* サムネ用の通路 */
    box-sizing: border-box !important;

  }}


/* ===== 差分アイコン：スマホで3〜4列にする ===== */
@media (max-width: 768px) {

  .variation-icons {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* ←4列（3にしたければ3） */
    gap: 20px;
    overflow: visible !important;
  }

  .variation-item {
    width: 100% !important;
  }

  .variation-thumb {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  .variation-label {
    font-size: 11px;
  }
}

  

@media (max-width: 768px) {
  .visual-side-thumbs {
    width: clamp(48px, 8vw, 64px) !important;
    max-height: calc((clamp(48px, 8vw, 64px) * 4) + (10px * 3) + 28px) !important;
    gap: 10px !important;

right: -20px !important;

    padding-top: 14px !important;
    padding-bottom: 14px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .visual-side-thumb {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    margin: 0 !important;
  }

  .visual-side-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}





.profile-bg{
  position: absolute !important;
  inset: -12% -10% -14% -10% !important;

  -webkit-mask-image: radial-gradient(
    ellipse at 50% 42%,
    rgba(0,0,0,1) 24%,
    rgba(0,0,0,0.82) 42%,
    rgba(0,0,0,0.42) 68%,
    rgba(0,0,0,0) 92%
  ) !important;
  mask-image: radial-gradient(
    ellipse at 50% 42%,
    rgba(0,0,0,1) 24%,
    rgba(0,0,0,0.82) 42%,
    rgba(0,0,0,0.42) 68%,
    rgba(0,0,0,0) 92%
  ) !important;

  overflow: visible !important;
}

.profile-bg img{
  opacity: 0.68 !important;
  filter: blur(12px) brightness(0.98) saturate(1.05) !important;
}


.portrait::after{
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -2%;
  height: 28%;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.16) 28%,
    rgba(0,0,0,0.42) 58%,
    rgba(0,0,0,0.82) 82%,
    rgba(0,0,0,1) 100%
  );
  filter: blur(18px);
}


/* 立ち絵基準の足元フェード */


.profile-right .portrait img{
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 40%,
    rgba(0,0,0,0.65) 82%,
    rgba(0,0,0,0) 100%
  ) !important;
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 40%,
    rgba(0,0,0,0.65) 82%,
    rgba(0,0,0,0) 100%
  ) !important;
}

/* 足元の暗いなじませ */
.profile-right .portrait::after{
  content: "" !important;
  position: absolute !important;
  left: -18% !important;
  right: -18% !important;
  bottom: -4% !important;
  height: 34% !important;
  pointer-events: none !important;
  z-index: 5 !important;

  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.22) 35%,
    rgba(0,0,0,0.62) 70%,
    rgba(0,0,0,1) 100%
  ) !important;

  filter: blur(18px) !important;
}

/* 立ち絵の上に黒フェードをかぶせる */
.profile-right .portrait{
  position: relative !important;
  overflow: visible !important;
}

.profile-right .portrait img{
  position: relative !important;
  z-index: 1 !important;
}

.profile-right .portrait::after{
  content: "" !important;
  position: absolute !important;
  z-index: 3 !important;
  left: -20% !important;
  right: -20% !important;
  bottom: 0 !important;
  height: 65% !important;
  pointer-events: none !important;

  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.25) 30%,
    rgba(0,0,0,0.65) 65%,
    rgba(0,0,0,1) 100%
  ) !important;

  filter: blur(10px) !important;
}

.profile-links,
.character-relations{
  position: relative !important;
  transform: none !important;
  width: min(88%, 360px) !important;
  margin: 24px auto 0 !important;
  z-index: 8 !important;
}


.profile-links{
  position: relative !important;
  transform: none !important;
  width: min(88%, 360px) !important;
  margin: 28px auto 0 !important;
  z-index: 8 !important;
}

.character-relations{
  position: relative !important;
  transform: none !important;
  width: min(88%, 360px) !important;
  margin: 22px auto 0 !important;
  z-index: 8 !important;
  clear: both !important;
}

.profile-links,
.character-relations{
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}


#character-relations-mount{
  position: absolute !important;
  top: 760px !important;
  left: 0 !important;
  width: 44vw !important;
  z-index: 9 !important;
}

#character-relations-mount .character-relations{
  position: static !important;
  width: 100% !important;
  margin: 0 !important;
  transform: none !important;
}

#character-relations-mount .character-relation-link{
  width: 100% !important;
}

.profile-links,
#character-relations-mount{
  left: 8% !important;
  right: auto !important;
  width: 54% !important;
}

.profile-links{
  position: absolute !important;
  top: 700px !important;
  margin: 0 !important;
}

#character-relations-mount{
  position: absolute !important;
  top: 850px !important;
  margin: 0 !important;
}

#character-relations-mount .character-relations{
  width: 100% !important;
  margin: 0 !important;
}

.profile-link,
.character-relation-link{
  width: 100% !important;
  box-sizing: border-box !important;
}


.info-grid{
  width: 42vw !important;
}

.note{
  width: 42vw !important;
  top: 470px !important;
  left: 8% !important;
}

/* 基本情報＋NOTESを同じ左カラム内で縦積みにする */
.profile-left .profile-front{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}

/* 基本情報 */
.profile-left .info-grid{
  position: relative !important;
  top: auto !important;
  left: 8% !important;
  width: 42vw !important;
  margin-top: 260px !important;
  margin-bottom: 28px !important; /* ←基本情報とNOTESの固定余白 */
}

/* NOTES */
.profile-left .note{
  position: relative !important;
  top: auto !important;
  left: 8% !important;
  width: 42vw !important;
  margin-top: 0 !important;
}


/* 基本情報 → NOTES の順に固定 */
.profile-left .profile-front{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}

/* 基本情報を先に表示 */
.profile-left .info-grid{
  order: 1 !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 42vw !important;
  margin-left: 4% !important;   /* 左端調整 */
  margin-top: 300px !important;
  margin-bottom: 28px !important;
}

/* NOTESを基本情報の下に表示 */
.profile-left .note{
  order: 2 !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 42vw !important;
  margin-left: 4% !important;   /* info-gridと揃える */
  margin-top: 0 !important;
}

/* 他の要素はflexの縦積みに巻き込まない */
.profile-left .san-wrapper,
.profile-left .radar-wrap,
.profile-left .profile-links,
#character-relations-mount{
  position: absolute !important;
}

/* 左カラムの左端を基本情報に揃える */
.profile-left .info-grid,
.profile-left .note,
.profile-left .profile-links,
.profile-left #character-relations-mount{
  left: auto !important;
  right: auto !important;
  margin-left: 4% !important;
  width: 42vw !important;
}

/* NOTES */
.profile-left .note{
  position: relative !important;
}

/* リンク */
.profile-left .profile-links{
  position: relative !important;
  margin-top: 28px !important;
}

/* うちよそリンク */
.profile-left #character-relations-mount{
  position: relative !important;
  margin-top: 36px !important;
}

.profile-left #character-relations-mount .character-relations,
.profile-left #character-relations-mount .character-relation-link{
  width: 100% !important;
}

/* 左カラムを縦積みに整理 */
.profile-left .profile-front{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}








/* 右側に置くものは縦積みから除外 */
.profile-left .san-wrapper,
.profile-left .radar-wrap{
  position: absolute !important;
}


/* うちよそリンクを通常リンクカードに寄せる */
#character-relations-mount .character-relations{
  width: 100% !important;
  margin: 0 !important;
}

#character-relations-mount .character-relations-head{
  margin: 0 0 10px !important;
  padding: 0 !important;
  border-top: none !important;
  display: flex !important;
  gap: 8px !important;
  align-items: baseline !important;
  opacity: .72 !important;
}

#character-relations-mount .character-relations-eyebrow,
#character-relations-mount .character-relations-count{
  font-size: 11px !important;
  letter-spacing: .18em !important;
  line-height: 1 !important;
}

#character-relations-mount .character-relations-list{
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

#character-relations-mount .character-relation-link{
  width: 100% !important;
  box-sizing: border-box !important;

  min-height: 54px !important;
  padding: 12px 14px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;

  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.045) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: none !important;

  font-size: 14px !important;
  line-height: 1.35 !important;
  letter-spacing: .06em !important;
  color: #fff !important;
  text-decoration: none !important;
}

#character-relations-mount .character-relation-title{
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

#character-relations-mount .character-relation-desc,
#character-relations-mount .character-relation-note{
  display: none !important;
}
#character-relations-mount .character-relations::before,
#character-relations-mount .character-relations-head::before,
#character-relations-mount .character-relations-head::after{
  display: none !important;
}

/* うちよそリンクをリンク集と完全一致させる */
#character-relations-mount .character-relation-link{
  all: unset !important; /* 既存スタイル全部リセット */

  /* ↓ここから .profile-link をコピー */
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;

  width: 100% !important;
  min-height: 64px !important;
  padding: 14px 18px !important;
  box-sizing: border-box !important;

  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.22) !important;

  background: inherit !important; /* ←これ重要（親のアクセントをそのまま受ける） */
  backdrop-filter: inherit !important;

  font-size: 13px !important;
  letter-spacing: .12em !important;
  color: rgba(255,255,255,.9) !important;

  text-decoration: none !important;
}

/* テキストも揃える */
#character-relations-mount .character-relation-title{
  font-size: inherit !important;
  letter-spacing: inherit !important;
}

/* 余計な説明消す */
#character-relations-mount .character-relation-desc{
  display: none !important;
}

/* 名前ブロックを1つの箱として扱う */
.profile-left .name-block{
  position: absolute !important;
  top: 120px !important;
  left: 4% !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;

  margin: 0 !important;
}

/* 名前 */
.profile-left h2{
  position: static !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

/* ふりがな */
.profile-left .name-sub{
  position: static !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

/* 下線 */
.profile-left .name-sub .name-line{
  margin-top: 4px !important;
  width: 100% !important;
}

/* 名前 → ふりがな の間 */
.profile-left h2{
  margin-bottom: 8px !important;  /* ←ここ増やす */
}

/* ふりがな → 下線 の間 */
.profile-left .name-sub .name-line{
  margin-top: 12px !important;   /* ←ここ増やす */
}

/* 名前・ふりがな・下線・基本情報の左端を統一 */

.profile-left h2,
.profile-left .name-sub,
.profile-left .info-grid{
  margin-left: 4% !important;
  left: auto !important;
  padding-left: 0 !important;
}

.profile-left .name-sub .roman,
.profile-left .name-sub .name-line{
  margin-left: 0 !important;
}

/* ふりがな内のズレ防止 */
.profile-left .name-sub .roman,
.profile-left .name-sub .name-line{
  margin-left: 0 !important;
}


/* ふりがな＋下線の左端ズレ修正 */
.profile-left .name-sub{
  transform-origin: left top !important;
}

.profile-left .name-sub .roman{
  display: block !important;
  margin-left: 0 !important;
}

.profile-left .name-sub .name-line{
  display: block !important;
  margin-left: 0 !important;
}


/* SANを基準にする */
.profile-left .san-wrapper{
  position: absolute !important;
}

/* レーダーをSANの下に固定 */
.profile-left .radar-wrap{
  position: absolute !important;

  top: calc(370px + 80px) !important; /* ←ここがポイント */
  right: -100px !important;
}

@media (max-width: 820px){

  .profile-left .profile-front{
    --san-top: 370px;
    --san-right: -150px;
    --radar-gap: 130px;
  }

  .profile-left .san-wrapper{
    position: absolute !important;
    top: var(--san-top) !important;
    right: var(--san-right) !important;
  }

  .profile-left .radar-wrap{
    position: absolute !important;
    top: calc(var(--san-top) + var(--radar-gap)) !important;
    right: -20px !important;
  }

}

.archive-card .thumb img {
  object-fit: cover !important;
  object-position: 50% 0% !important;
}

#visual-main-image {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);

  height: 100%;
  width: auto;

  object-fit: cover;          /* ←ここ重要 */
  object-position: bottom center;
}


#visual #visual-main-image {
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;

  width: auto !important;
  height: 100% !important;

  max-width: none !important; /* ←これが重要 */
  max-height: none !important;

  transform: translateX(-50%) !important;
  transform-origin: bottom center !important;

  object-fit: contain !important;
  object-position: bottom center !important;
}


/* ===== VISUALタブ微調整 ===== */

/* Worksがカード全体フェードの下に潜らないようにする */
#visual,
.visual-stage,
.variation-section,
.related-works-section,
.related-works-gallery {
  position: relative;
  z-index: 5;
}

/* Worksカード本体をさらに前面へ */
.related-work-card {
  position: relative;
  z-index: 6;
}

/* 差分とWorksの間を詰める */
.related-works-section {
  margin-top: 18px !important;
}

/* 差分アイコン下の余白も少し抑える */
.variation-icons {
  padding-bottom: 2px !important;
}

/* 見出しの英字補足を統一 */
.variation-heading span,
.related-works-subtitle {
  font-family: "Courier New", monospace;
  font-size: 13px !important;
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1.4;
  opacity: 0.52;
  text-transform: none;
}

/* 見出し横並びの見え方を揃える */
.variation-heading,
.related-works-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

/* Works側の余白を差分見出しに寄せる */
.related-works-head {
  margin-bottom: 14px !important;
}

/* VISUALタブではカード全体の下フェードを弱める */
.card:has(#visual.active)::after {
  opacity: 0.18 !important;
}

/* ===== VISUAL立ち絵を少し下げる ===== */

#visual-main-image{
  top: 45px !important;
  bottom: auto !important;
}



/* ===== Works：案E寄せ（タグ左下・フェードなし） ===== */

.related-works-gallery {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.related-work-card {
  aspect-ratio: 1.42 / 1;
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.13);
  box-shadow:
    0 14px 34px rgba(0,0,0,0.26),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.related-work-thumb img {
  filter: none !important;
}

.related-work-card:hover .related-work-thumb img {
  transform: scale(1.025);
  filter: none !important;
}

/* タグを左下へ */
.related-work-tags {
  top: auto !important;
  right: auto !important;
  left: 14px !important;
  bottom: 14px !important;

  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

/* タグの差し色を活かす */
.related-work-type,
.related-work-spoiler {
  min-height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  box-shadow:
    0 4px 14px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

/* 画像を主役にするため、タイトルフェードは消す */
.related-work-overlay {
  display: none !important;
}

.related-work-title {
  display: none !important;
}


/* ===== Works：ホバー時タイトル表示を復活 ===== */

.related-work-overlay {
  display: flex !important;
}

.related-work-title {
  display: -webkit-box !important;
  opacity: 0 !important;
}

.related-work-card:hover .related-work-title {
  opacity: 1 !important;
  transform: translateY(0) !important;
}


/* Explorer詳細ページ：縮小感・右はみ出し対策 */
body:has(#detail-container) {
  padding: 0 !important;
  margin: 0 !important;
  overflow-x: hidden !important;
}

body:has(#detail-container) .l-content,
body:has(#detail-container) .l-mainContent,
body:has(#detail-container) .l-mainContent__inner,
body:has(#detail-container) .post_content,
body:has(#detail-container) .c-container {
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body:has(#detail-container) #detail-container {
  width: 100% !important;
  max-width: 100vw !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

body:has(#detail-container) .card {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}



/* Explorer一覧ページ：縮小感・左右余白対策 */
body:has(#card-container) {
  padding: 0 !important;
  margin: 0 !important;
  overflow-x: hidden !important;
}

body:has(#card-container) .l-content,
body:has(#card-container) .l-mainContent,
body:has(#card-container) .l-mainContent__inner,
body:has(#card-container) .post_content,
body:has(#card-container) .c-container {
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body:has(#card-container) .archive-wrap {
  width: 100% !important;
  max-width: 100vw !important;
  padding: 0 8px 40px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

body:has(#card-container) #card-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}


/* 詳細ページ：タイトルと戻るリンクだけ余白 */
body:has(#detail-container) h1,
body:has(#detail-container) .back-to-list {
  width: calc(100% - 32px) !important;
  max-width: calc(100% - 32px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 詳細ページ：戻るリンク余白 */
body:has(#detail-container) .back-link-wrap,
body:has(#detail-container) .back-to-list {
  width: calc(100% - 32px) !important;
  max-width: calc(100% - 32px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}



/* 詳細ページ：カード内スクロールをやめて、ページ全体でスクロール */
body:has(#detail-container) {
  overflow-y: auto !important;
}

body:has(#detail-container) #detail-container,
body:has(#detail-container) .card,
body:has(#detail-container) .tab-content,
body:has(#detail-container) .tab-content.active {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}


/* 詳細ページ：プロフィールタブの下余白を内容量に合わせる */
body:has(#detail-container) .card,
body:has(#detail-container) #profile.tab-content.active,
body:has(#detail-container) .profile-grid,
body:has(#detail-container) .profile-left,
body:has(#detail-container) .profile-front {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

body:has(#detail-container) .profile-grid {
  align-items: start !important;
}

/* カード下の余白量 */
body:has(#detail-container) .card {
  padding-bottom: 32px !important;
}

/* 詳細ページ：スマホのプロフィールカードが中身より短くならないようにする */
@media (max-width: 820px) {
  body:has(#detail-container) #profile.tab-content.active .profile-grid,
  body:has(#detail-container) #profile.tab-content.active .profile-left,
  body:has(#detail-container) #profile.tab-content.active .profile-right {
    min-height: 860px !important;
  }

  body:has(#detail-container) .card {
    height: auto !important;
    overflow: visible !important;
  }
}


@media (max-width: 820px){
  .profile-left .radar-wrap{
    right: -80px !important;
  }
}



/* PROFILE：立ち絵だけ一回り小さくする */
@media (max-width: 820px){
  #profile .profile-right .portrait img{
    transform: translateX(-50%) scale(0.9) !important;
    transform-origin: bottom center !important;
  }
}

/* ===== VISUAL 背景画像：馴染ませ＋スポットライト ===== */

#visual .visual-stage {
  --visual-stage-bg: url("http://mame.wew.jp/wp/wp-content/uploads/2026/05/0CC6DFB4-B763-4614-BA2A-97F161CFF2C1.png");
}

/* 背景レイヤー */
#visual .visual-stage::before {
  content: "";
  position: absolute;

  left: -6%;
  right: -6%;
  top: -4%;
  bottom: -2%;

  z-index: 0;
  pointer-events: none;

  background:

    /* 中央スポットライト */
    radial-gradient(
      ellipse at 50% 34%,
      rgba(255,255,255,0.26) 0%,
      rgba(255,255,255,0.14) 18%,
      rgba(255,255,255,0.04) 42%,
      rgba(255,255,255,0.00) 68%
    ),

    /* 足元の光 */
    radial-gradient(
      ellipse at 50% 84%,
      rgba(255,255,255,0.18) 0%,
      rgba(255,255,255,0.08) 22%,
      rgba(255,255,255,0.00) 58%
    ),

    /* 背景画像 */
    var(--visual-stage-bg) center center / cover no-repeat;

  opacity: 0.82;

/* 周囲をもっと滑らかに透明化 */
-webkit-mask-image:
  radial-gradient(
    ellipse at center,

    rgba(0,0,0,1.00) 0%,
    rgba(0,0,0,1.00) 34%,

    rgba(0,0,0,0.96) 46%,
    rgba(0,0,0,0.88) 56%,
    rgba(0,0,0,0.72) 66%,
    rgba(0,0,0,0.48) 76%,
    rgba(0,0,0,0.22) 86%,

    rgba(0,0,0,0.00) 100%
  );

mask-image:
  radial-gradient(
    ellipse at center,

    rgba(0,0,0,1.00) 0%,
    rgba(0,0,0,1.00) 34%,

    rgba(0,0,0,0.96) 46%,
    rgba(0,0,0,0.88) 56%,
    rgba(0,0,0,0.72) 66%,
    rgba(0,0,0,0.48) 76%,
    rgba(0,0,0,0.22) 86%,

    rgba(0,0,0,0.00) 100%
  );

  filter:
    brightness(1.08)
    contrast(1.04)
    saturate(0.92);
}

/* 立ち絵より後ろ */
#visual .visual-main,
#visual .visual-side-thumbs,
#visual .variation-section {
  position: relative;
  z-index: 2;
}

/* 立ち絵は absolute のまま、重なり順だけ指定 */

#visual #visual-main-image {

  z-index: 3;

}

#visual .visual-stage::before {
  top: -4%;
  bottom: -10%; /* ←下に伸ばす。-16%くらいまで調整OK */
}


/* =========================
   VISUAL見出し色の統一
   Variation / Works
========================= */

#visual .variation-heading,
#visual .related-works-title {
  color: rgba(255,255,255,0.94) !important;
  opacity: 1 !important;
}

#visual .variation-heading span,
#visual .related-works-subtitle {
  color: rgba(255,255,255,0.48) !important;
  opacity: 1 !important;
}

/* ===== PROFILE mobile: NOTEを基本情報側に統一・最終上書き ===== */

@media (max-width: 820px) {
  #detail-container .profile-left .note-title,
  #detail-container .profile-left .info-grid .k {
    font-size: 7px !important;
    line-height: 1.35 !important;
    letter-spacing: 0.18em !important;
    font-weight: inherit !important;
    text-transform: uppercase !important;
  }

  #detail-container .profile-left .note .intro,
  #detail-container .profile-left .info-grid .v {
    font-size: 11px !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    font-weight: inherit !important;
  }
}

@media (min-width: 821px) {
  #detail-container .note-title,
  #detail-container .info-grid .k {
    font-size: 11px !important;
    letter-spacing: .22em !important;
  }

  #detail-container .note .intro,
  #detail-container .info-grid .v {
    font-size: 14px !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
  }
}


/* ===== PROFILE 見出し色統一 ===== */

#detail-container .profile-left .note-title,
#detail-container .profile-left .info-grid .k {
  color: rgba(255,255,255,0.56) !important;
}


/* ===== PROFILE: うちよそリンクを通常リンクに揃える ===== */

#detail-container .character-relations {
  border-top: none !important;
  padding-top: 0 !important;
}

#detail-container .character-relations::before,
#detail-container .character-relations::after {
  content: none !important;
  display: none !important;
}

#detail-container .character-relations-head {
  margin: 0 0 12px !important;
}

#detail-container .character-relation-link {
  width: 100% !important;
  min-height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;

  padding: 8px 10px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;

  text-decoration: none !important;
  font-size: 10px !important;
  line-height: 1.5 !important;
  letter-spacing: 0.08em !important;
}

#detail-container .character-relation-title {
  display: block !important;
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

#detail-container .character-relation-link::before {
  content: "■";
  flex: 0 0 auto;
  margin-right: 6px;
  font-size: 10px;
  line-height: 1;
}

#detail-container .character-relation-link::after {
  content: "↗";
  flex: 0 0 auto;
  margin-left: 8px;
  font-size: 15px;
  line-height: 1;
  opacity: 0.7;
}

#detail-container .character-relation-desc,
#detail-container .character-relation-note {
  display: none !important;
}


#detail-container .character-relation-link {
  color: rgba(255,255,255,0.70) !important;
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

#detail-container .character-relation-link:hover {
  color: #fff !important;
  border-color: var(--accent-safe) !important;
}

/* ===== PROFILE links: 中央揃え・色統一 ===== */

#detail-container .profile-link,
#detail-container .character-relation-link {
  display: grid !important;
  grid-template-columns: 24px 1fr 24px !important;
  align-items: center !important;
  column-gap: 8px !important;
  text-align: center !important;
}

#detail-container .profile-link .link-icon,
#detail-container .character-relation-link::before {
  justify-self: start !important;
  color: rgba(255,255,255,0.70) !important;
  opacity: 0.75 !important;
}

#detail-container .profile-link::after,
#detail-container .character-relation-link::after {
  justify-self: end !important;
}

#detail-container .character-relation-title {
  justify-self: center !important;
  color: rgba(255,255,255,0.70) !important;
  opacity: 0.75 !important;
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}


/* ===== PROFILE: リンク色完全統一 ===== */

/* 通常リンク基準に合わせる */
#detail-container .character-relation-link {
  color: rgba(255,255,255,0.70) !important;
}

/* ■アイコン */
#detail-container .character-relation-link::before {
  color: rgba(255,255,255,0.70) !important;
  opacity: 1 !important;
}

/* タイトル */
#detail-container .character-relation-title {
  color: rgba(255,255,255,0.70) !important;
  opacity: 1 !important;
}


/* ===== PROFILE: 通常リンクをRELATION側の見え方に合わせる ===== */

#detail-container .profile-link,
#detail-container .profile-link:link,
#detail-container .profile-link:visited {
  color: rgba(255,255,255,0.62) !important;
}

#detail-container .profile-link .link-icon {
  color: rgba(255,255,255,0.62) !important;
  fill: currentColor !important;
  opacity: 1 !important;
}

#detail-container .profile-link::after {
  color: rgba(255,255,255,0.62) !important;
  opacity: 1 !important;
}

/* ===== PROFILE: リンク集は透明度を使わず色で制御 ===== */

/* 親のopacityを無効化（重要） */
#detail-container .profile-links {
  opacity: 1 !important;
}

/* 枠線・背景はそのまま */
#detail-container .profile-link {
  border-color: rgba(255,255,255,0.08) !important;
  background: rgba(255,255,255,0.02) !important;
}

/* 文字だけRELATION側に合わせる */
#detail-container .profile-link,
#detail-container .profile-link .link-icon,
#detail-container .profile-link::after {
  color: rgba(255,255,255,0.62) !important;
  fill: currentColor !important;
}


.note-spoiler {
  position: relative;
}

/* ぼかし本体 */
.note-spoiler-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;

  backdrop-filter: blur(10px) brightness(0.7);
  -webkit-backdrop-filter: blur(10px) brightness(0.7);

  background: linear-gradient(
    to bottom,
    rgba(10,12,16,0.6),
    rgba(10,12,16,0.4)
  );
}

/* テキストぼかし */
.note-spoiler .intro {
  filter: blur(6px);
  opacity: 0.4;
}

/* 解除後 */
.note-spoiler.open .note-spoiler-cover {
  display: none;
}

.note-spoiler.open .intro {
  filter: none;
  opacity: 1;
}


.note-spoiler-cover::before {
  content: "SPOILER";

  position: absolute;
  top: 10px;
  left: 14px;
  z-index: 3;

  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;

  color: rgba(255,255,255,0.32);

  text-shadow:
    0 0 8px rgba(0,0,0,0.28);

  pointer-events: none;
}


.info-grid .v {
  white-space: pre-line;
}



.profile-png-btn {
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.72);
  font-size: 11px;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.profile-png-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.28);
}

.profile-png-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}

/* PNG保存時だけ、PROFILE部分を少し安定させる */
body.is-profile-png-saving #profile {
  background: transparent;
}

body.is-profile-png-saving .tab-menu,
body.is-profile-png-saving .profile-png-btn {
  display: none !important;
}


body.is-profile-png-saving #profile,
body.is-profile-png-saving #profile * {
  color: rgb(230, 230, 230) !important;
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.is-profile-png-saving #profile {
  background: rgb(11, 13, 16) !important;
}

body.is-profile-png-saving #profile .profile-bg,
body.is-profile-png-saving #profile .portrait,
body.is-profile-png-saving #profile .classified {
  display: none !important;
}

body.is-profile-png-saving #profile .san-fill,
body.is-profile-png-saving #profile .name-line {
  background: rgb(230, 230, 230) !important;
}


/* レーダー秘匿カバーを確実にクリック可能にする */
.radar-wrap {
  position: relative !important;
  z-index: 20 !important;
}

.radar-cover {
  z-index: 30 !important;
  pointer-events: auto !important;
}

.radar-wrap.open .radar-cover {
  display: none !important;
}

/* 装飾レイヤーがクリックを奪わない保険 */
.card::before,
.card::after,
.profile-grid::before,
.profile-grid::after,
.profile-front::before,
.profile-front::after {
  pointer-events: none !important;
}




/* ===== PCプロフィール崩れ修正：スマホ用指定の漏れを戻す ===== */
@media (min-width: 821px) {
  #detail-container .profile-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 450px !important;
    column-gap: 34px !important;
    align-items: start !important;
    min-height: 0 !important;
  }

  #detail-container .profile-left {
    position: relative !important;
    display: block !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  #detail-container .profile-front {
    position: relative !important;
    display: block !important;
    inset: auto !important;
    transform: none !important;
    min-height: 0 !important;
  }

  #detail-container .profile-left h2,
  #detail-container .profile-left .name-sub,
  #detail-container .profile-left .info-grid,
  #detail-container .profile-left .note,
  #detail-container .profile-left .san-wrapper,
  #detail-container .profile-left .radar-wrap,
  #detail-container .profile-left .profile-links,
  #detail-container .profile-left #character-relations-mount {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 560px !important;
  }

  #detail-container .profile-left h2 {
    margin: 0 0 10px !important;
    width: auto !important;
  }

  #detail-container .profile-left .name-sub {
    margin: 6px 0 14px !important;
    width: auto !important;
  }

  #detail-container .profile-left .info-grid {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
  }

  #detail-container .profile-left .note {
    margin: 12px 0 18px !important;
  }

  #detail-container .profile-left .san-wrapper {
    margin: 14px 0 0 !important;
  }

  #detail-container .profile-left .radar-wrap {
    margin: 14px 0 0 !important;
    width: 360px !important;
  }

  #detail-container #radarChart {
    width: 360px !important;
    height: auto !important;
    max-width: 100% !important;
  }

  #detail-container .profile-left .profile-links {
    margin: 24px 0 0 !important;
  }

  #detail-container .profile-left #character-relations-mount {
    margin: 22px 0 0 !important;
  }

  #detail-container .profile-right {
    transform: none !important;
  }

  #detail-container .portrait {
    width: min(400px, 100%) !important;
    margin: -8px 0 24px 0 !important;
  }
}


@media (max-width: 820px) {

  /* 基本情報 */
  .profile-left .info-grid{
    order: 1 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin-left: 4% !important;
    margin-top: 300px !important;
    margin-bottom: 28px !important;
    width: 42vw !important;
  }

  /* NOTES */
  .profile-left .note{
    order: 2 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin-left: 4% !important;
    margin-top: 0 !important;
    margin-bottom: 36px !important;
    width: 42vw !important;
  }

  /* リンク */
  .profile-left .profile-links{
    order: 3 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin-left: 4% !important;
    margin-top: 0 !important;
    margin-bottom: 40px !important;
    width: 42vw !important;
  }

  /* うちよそ */
  .profile-left #character-relations-mount{
    order: 4 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin-left: 4% !important;
    margin-top: 0 !important;
    width: 42vw !important;
  }

}




/* =========================================
   PC only: profile tab redesign
   スマホには影響させない
   ========================================= */
@media (min-width: 821px) {

  #profile.tab-content.active {
    padding: 26px 34px 34px !important;
  }

  .profile-grid {
    display: grid !important;
    grid-template-columns: minmax(420px, 0.9fr) minmax(500px, 1.1fr) !important;
    column-gap: 18px !important;
    align-items: start !important;
    min-height: 760px !important;
  }

  .profile-left {
    display: contents !important;
  }

  .profile-left > h2,
  .profile-left > .name-sub {
    grid-column: 1;
    position: relative;
    z-index: 8;
  }

  .profile-left > h2 {
    margin-top: 42px !important;
    padding-left: 24px !important;
  }

  .profile-left > .name-sub {
    padding-left: 24px !important;
    margin-bottom: 26px !important;
  }

  .profile-front {
    display: grid !important;
    grid-template-columns: 360px 420px !important;
    grid-template-areas:
      "note note"
      "info radar"
      "san  radar"
      "links links";
    gap: 18px 26px !important;

    grid-column: 1 / 3;
    grid-row: 3;
    position: relative !important;
    z-index: 8 !important;
    align-items: end !important;
    padding-left: 24px !important;
    padding-top: 10px !important;
  }

  .note {
    grid-area: note;
    width: 640px !important;
    max-width: 640px !important;
    margin: 0 !important;
    box-sizing: border-box;
  }

  .info-grid {
    grid-area: info;
    width: 360px !important;
    margin: 0 !important;
    padding: 8px 0 10px !important;
    border: 0 !important;
  }

  .san-wrapper {
    grid-area: san;
    width: 360px !important;
    margin: 0 !important;
  }

  .radar-wrap {
    grid-area: radar;
    width: 420px !important;
    margin: 0 0 -10px -20px !important;
    align-self: end !important;
  }

  .radar-wrap canvas,
  #radarChart {
    width: 420px !important;
    max-width: 420px !important;
    margin: 0 !important;
  }

  .profile-links {
    grid-area: links;
    width: 760px !important;
    justify-content: flex-start !important;
    align-items: flex-end !important;
    gap: 10px !important;
    margin: -8px 0 0 !important;
    opacity: 0.62 !important;
  }

  .profile-link {
    min-height: 34px !important;
    padding: 5px 10px !important;
    font-size: 10px !important;
    background: rgba(255,255,255,0.035) !important;
  }

  .profile-right {
    grid-column: 2;
    grid-row: 1 / 5;
    position: relative !important;
    z-index: 4 !important;
    min-height: 760px !important;
    justify-content: center !important;
    align-items: flex-start !important;
    padding-right: 0 !important;
  }

  .portrait {
    width: 560px !important;
    aspect-ratio: 1 / 1.22 !important;
    margin: 8px 0 0 -70px !important;
    transform: none !important;
  }

  .portrait img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
  }

  .profile-bg {
    inset: 20% -6% 12% -22% !important;
  }
}





/* ===== mobile/profile：立ち絵・背景・フェード・SAN/レーダー安定化 ===== */
@media (max-width: 820px) {

  #detail-container #profile .profile-grid {
    position: relative !important;
    overflow: hidden !important;
    min-height: 1050px !important;
  }

  #detail-container #profile .profile-left,
  #detail-container #profile .profile-front {
    position: static !important;
  }

  /* 立ち絵レイヤー */
  #detail-container #profile .profile-right {
    position: absolute !important;
    inset: 0 !important;
    z-index: 6 !important;
    pointer-events: none !important;
    overflow: visible !important;
  }

  /* 立ち絵：大きさは既存寄り、中央 */
  #detail-container #profile .portrait {
    position: absolute !important;
    top: 120px !important;
    left: 52% !important;
    transform: translateX(-50%) !important;
    z-index: 20 !important;
    margin: 0 !important;
  }

  /* 背景円：立ち絵の頭上〜腰あたり、立ち絵の後ろ */
  #detail-container #profile .profile-bg {
    position: absolute !important;
    top: 100px !important;
    left: 52% !important;
    right: auto !important;
    bottom: auto !important;

    width: min(470px, 72%) !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;

    transform: translateX(-50%) !important;
    z-index: 8 !important;
    pointer-events: none !important;
  }

  /* 背景のぼかし本体は既存を使う。前面に出ないようにだけ固定 */
  #detail-container #profile .profile-bg::before,
  #detail-container #profile .profile-bg::after {
    z-index: 1 !important;
  }

  /* 足元フェード：カード幅いっぱい */
  #detail-container #profile .profile-grid::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 34% !important;

    z-index: 30 !important;
    pointer-events: none !important;

    background: linear-gradient(
      to bottom,
      rgba(5,8,10,0) 0%,
      rgba(5,8,10,.38) 42%,
      rgba(5,8,10,.88) 78%,
      rgba(5,8,10,1) 100%
    ) !important;
  }

  /* SAN：カード右端 */
  #detail-container #profile .san-wrapper {
    position: absolute !important;
    top: 360px !important;
    right: 44px !important;
    left: auto !important;
    width: 230px !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 40 !important;
  }

/* レーダーだけ修正 */
#detail-container #profile .radar-wrap {
  position: absolute !important;

  top: 470px !important;
  right: 18px !important;
  left: auto !important;

  width: 170px !important;
  height: 170px !important;

  margin: 0 !important;
  padding: 0 !important;

  transform: none !important;
  overflow: visible !important;

  z-index: 38 !important;
}

/* canvas巨大化を止める */
#detail-container #profile .radar-wrap canvas {
  width: 170px !important;
  height: 170px !important;

  max-width: 170px !important;
  max-height: 170px !important;

  transform: none !important;
}

  /* 文字・リンクはフェードより上 */
  #detail-container #profile .profile-left,
  #detail-container #profile .profile-front,
  #detail-container #profile .profile-links,
  #detail-container #profile #character-relations-mount {
    position: relative !important;
    z-index: 45 !important;
  }
}


/* レーダー解除カバーだけ、レーダーサイズに合わせる */
#detail-container #profile .radar-cover,
#detail-container #profile .radar-lock,
#detail-container #profile .spoiler-radar-cover {
  position: absolute !important;
  inset: 0 !important;

  width: 170px !important;
  height: 170px !important;
  max-width: 170px !important;
  max-height: 170px !important;

  transform: none !important;
  z-index: 45 !important;
}

/* coverが親からはみ出さないようにする */
#detail-container #profile .radar-wrap {
  overflow: hidden !important;
  border-radius: 50% !important;
}



/* ===== mobile：SAN / レーダーをカード右端基準にする ===== */
@media (max-width: 820px) {

  /* SAN/レーダーの基準箱をカード幅いっぱいに戻す */
  #detail-container #profile .profile-left {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    z-index: 45 !important;
    pointer-events: none !important;
  }

  #detail-container #profile .profile-left .profile-front {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    pointer-events: none !important;
  }

  /* 左半分制限をSAN/レーダーだけ解除 */
  #detail-container #profile .profile-left .profile-front > .san-wrapper,
  #detail-container #profile .profile-left .profile-front > .radar-wrap,
  #detail-container #profile .profile-left .san-wrapper,
  #detail-container #profile .profile-left .radar-wrap {
    max-width: none !important;
    pointer-events: auto !important;
  }

  /* SAN：カード右端へ */
  #detail-container #profile .profile-left .san-wrapper {
    position: absolute !important;
    top: 370px !important;
    right: 26px !important;
    left: auto !important;
    width: 220px !important;
    margin: 0 !important;
    z-index: 80 !important;
  }

  /* レーダー：SANの下、カード右端へ */
  #detail-container #profile .profile-left .radar-wrap {
    position: absolute !important;
    top: 430px !important;
    right: 20px !important;
    left: auto !important;
    width: 170px !important;
    height: 170px !important;
    margin: 0 !important;
    z-index: 78 !important;
  }
}

/* ===== mobile：名前以外のプロフィール要素をまとめて上へ ===== */
@media (max-width: 820px) {

  #detail-container #profile {
    --profile-content-shift: -120px;
  }

  /* 立ち絵・背景 */
  #detail-container #profile .profile-right {
    transform: translateY(var(--profile-content-shift)) !important;
  }

  /* 基本情報・NOTE・リンク類 */
  #detail-container #profile .info-grid,
  #detail-container #profile .note,
  #detail-container #profile .profile-links,
  #detail-container #profile #character-relations-mount {
    transform: translateY(var(--profile-content-shift)) !important;
  }

  /* SAN / レーダー */
  #detail-container #profile .profile-left .san-wrapper,
  #detail-container #profile .profile-left .radar-wrap {
    transform: translateY(var(--profile-content-shift)) !important;
  }

  /* 足元フェードも一緒に上げる */
  #detail-container #profile .profile-grid::after {
    transform: translateY(var(--profile-content-shift)) !important;
  }
}


/* ===== mobile：profile-rightの箱縮小をやめる ===== */
@media (max-width: 820px) {

  /* 背景・立ち絵・フェードを包む箱はカード幅いっぱいに戻す */
  #detail-container #profile .profile-right {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 980px !important;
    transform: translateY(var(--profile-content-shift, 0px)) !important;
    overflow: visible !important;
    z-index: 1 !important;
  }

  /* 背景は箱全体基準。ぼかし/mask指定は触らない */
  #detail-container #profile .profile-bg {
    left: 50% !important;
    top: 70px !important;
    width: 86% !important;
    transform: translateX(-50%) !important;
    overflow: visible !important;
  }

  /* 立ち絵だけ位置調整する。親箱は縮めない */
  #detail-container #profile .portrait {
    position: absolute !important;
    top: 120px !important;
    left: 52% !important;
    transform: translateX(-50%) scale(0.95) !important;
    transform-origin: top center !important;
    overflow: visible !important;
    z-index: 20 !important;
  }

  /* 足元フェードをカード幅基準に広げる */
  #detail-container #profile .profile-right .portrait::after {
    left: -80vw !important;
    right: -80vw !important;
    width: auto !important;
  }
}






@media (max-width: 820px) {

  #detail-container #profile .profile-grid {
    position: relative !important;
    overflow: hidden !important;
  }

  /* profile-rightを箱として使わない */
  #detail-container #profile .profile-right {
    position: static !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    overflow: visible !important;
  }

  /* 背景はカード全体基準にする */
  #detail-container #profile .profile-bg {
    position: absolute !important;
    top: 115px !important;
    left: 0 !important;
    right: 0 !important;

    transform: translateY(var(--profile-content-shift, 0px)) !important;
    z-index: 5 !important;
    overflow: visible !important;
  }

  /* 立ち絵もカード全体基準にする */
  #detail-container #profile .portrait {
    position: absolute !important;
    top: 150px !important;
    left: 50% !important;

    transform: translateX(-50%) translateY(var(--profile-content-shift, 0px)) !important;
    z-index: 20 !important;
    overflow: visible !important;
  }

  /* 足元フェードはカード幅いっぱい */
  #detail-container #profile .profile-grid::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 38% !important;
    z-index: 30 !important;
    pointer-events: none !important;

    background: linear-gradient(
      to bottom,
      rgba(5,8,10,0) 0%,
      rgba(5,8,10,.38) 42%,
      rgba(5,8,10,.88) 78%,
      rgba(5,8,10,1) 100%
    ) !important;
  }
}

/* ===== mobile：背景円をカード内で自然に縮む正方形にする ===== */
@media (max-width: 820px) {

  #detail-container #profile .profile-bg {
    position: absolute !important;

    top: 95px !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;

    width: min(480px, calc(100% - 40px)) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;

    transform: translateX(-50%) translateY(var(--profile-content-shift, 0px)) !important;

    overflow: visible !important;
    z-index: 5 !important;
  }

  #detail-container #profile .profile-bg img,
  #detail-container #profile .profile-bg::before,
  #detail-container #profile .profile-bg::after {
    width: 100% !important;
    height: 100% !important;
  }
}


/* ===== mobile：背景位置・SAN・レーダー微調整 ===== */
@media (max-width: 820px) {

  /* 背景円：少し下へ */
  #detail-container #profile .profile-bg {
    position: absolute !important;

    top: 160px !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;

    width: min(480px, calc(100% - 40px)) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;

    transform: translateX(-50%) translateY(var(--profile-content-shift, 0px)) !important;

    overflow: visible !important;
    z-index: 5 !important;
  }

  #detail-container #profile .profile-bg img,
  #detail-container #profile .profile-bg::before,
  #detail-container #profile .profile-bg::after {
    width: 100% !important;
    height: 100% !important;
  }

  /* SAN：右側50%内に収める */
  #detail-container #profile .profile-left .san-wrapper {
    position: absolute !important;

    top: 375px !important;
    right: 24px !important;
    left: auto !important;

    width: min(220px, calc(50% - 28px)) !important;
    max-width: calc(50% - 28px) !important;

    margin: 0 !important;
    transform: none !important;
    z-index: 80 !important;
  }

  /* レーダー：少し小さく */
  #detail-container #profile .profile-left .radar-wrap {
    position: absolute !important;

    top: 445px !important;
    right: 22px !important;
    left: auto !important;

    width: 145px !important;
    height: 145px !important;
    max-width: 145px !important;
    max-height: 145px !important;

    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;

    overflow: hidden !important;
    border-radius: 50% !important;
    z-index: 78 !important;
  }

  #detail-container #profile .profile-left .radar-wrap canvas,
  #detail-container #profile .profile-left .radar-wrap .radar-cover {
    width: 145px !important;
    height: 145px !important;
    max-width: 145px !important;
    max-height: 145px !important;
  }
}


/* ===== mobile：リンクボタンを小さく横並び ===== */
@media (max-width: 820px) {

  #detail-container #profile .profile-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  #detail-container #profile .profile-links a,
  #detail-container #profile .profile-links .profile-link {
    width: calc(50% - 5px) !important;
    margin: 0 !important;

    display: flex !important;
    justify-content: center !important;
  }

  /* タイトル文字だけ少し小さく */
  #detail-container #profile .profile-links .link-title,
  #detail-container #profile .profile-links strong {
    font-size: 0.95rem !important;
    letter-spacing: 0.14em !important;
  }
}

/* ===== mobile：リンクを2列横並び ===== */
@media (max-width: 820px) {

  #detail-container #profile .profile-links {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  #detail-container #profile .profile-links > * {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #detail-container #profile .profile-links a {
    width: 100% !important;

  }
}


/* ===== mobile：リンクボタン少し広げる ===== */
@media (max-width: 820px) {

  #detail-container #profile .profile-links {
    display: grid !important;

    /* 少し右側を広く */
    grid-template-columns: 1fr 1fr !important;

    gap: 3px !important;
  }

  #detail-container #profile .profile-links > * {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #detail-container #profile .profile-links a {
    width: 100% !important;

    /* 横幅に対して中身余裕 */

    display: flex !important;
    justify-content: space-between !important;

    overflow: hidden !important;
  }

  /* 文字少しだけ縮小 */
  #detail-container #profile .profile-links .link-title,
  #detail-container #profile .profile-links strong {
    font-size: 0.88rem !important;
    letter-spacing: 0.12em !important;
  }

  /* 矢印位置 */
  #detail-container #profile .profile-links .arrow,
  #detail-container #profile .profile-links i {
    flex-shrink: 0 !important;
    margin-left: 10px !important;
  }
}


@media (max-width: 820px) {

  #detail-container #profile .profile-links {
    grid-template-columns: 1fr 1fr !important;
    column-gap: 4px !important;
  }

  /* ← これが重要 */
  #detail-container #profile .profile-links > * {
    width: 100% !important;
    max-width: none !important;
  }

  #detail-container #profile .profile-links a {
    width: 100% !important;
    max-width: none !important;
  }
}


@media (max-width: 820px) {

  #detail-container #profile .profile-left .profile-links {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    column-gap: 8px !important;
    row-gap: 10px !important;
    justify-items: stretch !important;
  }

  #detail-container #profile .profile-left .profile-links > a.profile-link {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;

    justify-self: stretch !important;

    justify-content: space-between !important;
  }
}

@media (max-width: 820px) {

  #detail-container #profile .profile-left .profile-links > a.profile-link {
    min-height: unset !important;
    height: auto !important;
  }
}

/* ===== mobile：プロフィールリンクボタンの高さをリレーションと同じ系統に戻す ===== */
@media (max-width: 820px) {

  #detail-container #profile .profile-left .profile-links > a.profile-link,
  #detail-container #profile .profile-links > a.profile-link,
  #detail-container #profile .profile-links a {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    aspect-ratio: auto !important;

    padding-top: 10px !important;
    padding-bottom: 10px !important;

    align-items: center !important;
  }
}

/* ===== スマホ：プロフィールリンクを低め・横並びに戻す ===== */
@media (max-width: 768px) {
  .page-template-page-explorer-detail .profile-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
    row-gap: 10px !important;
    align-items: start !important;
    justify-content: stretch !important;
  }

  .page-template-page-explorer-detail .profile-link {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    height: auto !important;
    min-height: 0 !important;

    padding: 10px 12px !important;
    box-sizing: border-box !important;

    display: grid !important;
    grid-template-columns: 14px 1fr 16px !important;
    align-items: center !important;
    gap: 8px !important;

    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  .page-template-page-explorer-detail .profile-link::after {
    margin-left: 0 !important;
    justify-self: end !important;
  }
}