/* R31 reviewed bilingual UI. English remains the original label; both lines
   belong to the existing target. The shared local Japanese font is unchanged. */
@font-face {
  font-family: "Aether Japanese R31";
  src: url("../miora-monuments-r31/fonts/DotGothic16-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.r31-bi { min-inline-size: 0; max-inline-size: 100%; }
.r31-bi > .r31-bi-en {
  display: block;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.35;
  overflow-wrap: break-word;
}
.r31-bi > .r31-bi-ja {
  display: block;
  margin-block-start: 4px;
  color: #f6dfc1 !important;
  -webkit-text-fill-color: #f6dfc1;
  font-family: "Aether Japanese R31", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
  word-break: normal;
  line-break: strict;
  overflow-wrap: anywhere;
}
.r31-bi-ja :is(.r31-ja-unit, .phrase) {
  display: inline-block;
  white-space: nowrap;
}
a.r31-bi, button.r31-bi {
  flex-direction: column;
  justify-content: center;
  height: auto;
  white-space: normal;
  text-align: center;
}

/* Keep the two-tone English treatment confined to the English line. */
.aether-two-tone.r31-bi {
  background: none;
  color: #f6dfc1;
}
@supports (background-clip: text) {
  .aether-two-tone.r31-bi > .r31-bi-en {
    background: linear-gradient(to bottom, #f6dfc1 0 56%, #da783d 56% 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* Preserve the existing frame, colors, active marker and focus styles.
   Each desktop cell fits the six-character Japanese artist label at 16px. */
.site-header nav[aria-label="Main"]:has(> a.r31-bi) {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  align-items: stretch;
}
.site-header nav[aria-label="Main"] :is(a.r31-bi, a.r31-bi[aria-current="page"]) {
  display: flex;
  flex: none;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 76px;
  padding: 8px 4px;
}
.site-header nav[aria-label="Main"] a.r31-bi > .r31-bi-ja {
  overflow-wrap: normal;
}
@media (max-width: 800px) {
  .site-header nav[aria-label="Main"]:has(> a.r31-bi) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 0 1 100%;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }
  .site-header nav[aria-label="Main"] a.r31-bi:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 8px) / 2);
  }
}

.site-footer .background-sound button.r31-bi {
  height: auto;
  min-height: 76px;
  max-width: 100%;
  padding: 10px 12px;
  white-space: normal;
}

/* Only the visual wrapper receives the existing stationary edge mask.
   Its image and all registered effects retain one exact 2:1 coordinate box. */
.secondary-page-hero.r31-bilingual-hero {
  aspect-ratio: auto;
  height: auto;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
.r31-bilingual-hero > .secondary-page-hero__visual-r31 {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: #000;
}
.r31-bilingual-hero > .secondary-page-hero__copy {
  max-width: calc(100% - 32px);
}
@media (forced-colors: none) {
  .r31-bilingual-hero > .secondary-page-hero__visual-r31 {
    -webkit-mask-image: var(--r30-edge-x), var(--r30-edge-y);
    mask-image: var(--r30-edge-x), var(--r30-edge-y);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }
}
@media (max-width: 600px) {
  .r31-bilingual-hero > .secondary-page-hero__copy {
    position: relative;
    inset: auto;
    transform: none;
    width: 100%;
    max-width: none;
    padding: 16px 16px 24px;
    background: #000;
    text-shadow: none;
  }
  .r31-bilingual-hero > .secondary-page-hero__copy p { margin-top: 12px; }
}
@media (forced-colors: active) {
  .aether-two-tone.r31-bi > .r31-bi-en,
  .r31-bi > .r31-bi-ja {
    background: none;
    color: CanvasText !important;
    -webkit-text-fill-color: CanvasText;
  }
  .r31-bilingual-hero > .secondary-page-hero__copy {
    background: Canvas;
    color: CanvasText;
  }
}

/* R34: primary English labels retain equal or greater visual emphasis. */
.site-header nav[aria-label="Main"] a.r31-bi > .r31-bi-en {
  font-size: 16px;
}
