* { box-sizing: border-box; }

body {
  margin: 0;
  color: #503021;
  background: #41281f;
  font-family: "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}

.title-shop {
  position: relative;
  isolation: isolate;
  background: radial-gradient(ellipse at 40% 19%, #865733, #41281f 75%);
}

.title-shop__art {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: -1;
  width: min(100%, 54vh);
  width: min(100%, 54dvh);
  height: 100%;
  object-fit: cover;
  transform: translateX(-50%);
}

.title-shop__content {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  text-align: center;
}

.title-shop__heading h1 { margin: 0; }

.title-shop__logo {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

.title-shop__heading p {
  margin: 2px 0 0;
  color: #57301b;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 16px;
  text-shadow: 0 0 3px #ffe9c8, 0 1px 2px #ffe9c8;
}

@media (orientation: portrait) and (max-height: 640px) {
  .title-shop__heading p { font-size: 11px; text-shadow: 0 1px 3px #ffe7bc; }
}

.title-shop__navigation {
  grid-row: 3;
  display: grid;
  gap: 8px;
  width: min(100%, 360px);
  margin-inline: auto;
}

.title-shop__modes,
.title-shop__utilities { display: grid; gap: 7px; }

.title-shop__mode,
.title-shop__utilities > * {
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #452719;
  text-decoration: none;
  touch-action: manipulation;
}

.title-shop__mode::before,
.title-shop__utilities > *::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--button-fallback) center / calc(100% - 20px) 72% no-repeat;
  border-image: var(--button-art) 44 76 fill / 34.375% var(--button-end, 26px) stretch;
  content: "";
  pointer-events: none;
}

.title-shop__mode {
  --button-art: url("/assets/demo-title/button-stage.webp");
  --button-fallback: linear-gradient(#982e1a, #782210);
  --button-end: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  align-items: center;
  min-height: 64px;
  padding: 2px 30px 11px;
  text-align: center;
  color: #fff6e1;
  text-shadow: 0 1px 3px #2c180d;
}

.title-shop__mode::after {
  position: absolute;
  right: 22px;
  top: calc(50% - 7px);
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  content: "";
  transform: rotate(45deg);
}

.title-shop__mode--infinity {
  --button-art: url("/assets/demo-title/button-infinity.webp");
  --button-fallback: linear-gradient(#135468, #0c3f48);
}

.title-shop__mode-name {
  font-size: 17px;
  font-weight: 750;
  line-height: 1.25;
}

.title-shop__mode-detail { font-size: 12px; line-height: 1.25; }

.title-shop__utilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.title-shop__utilities > * {
  --button-art: url("/assets/demo-title/button-utility.webp");
  --button-fallback: linear-gradient(#f9e0b7, #efc892);
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 5px 8px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.title-shop__utilities button:disabled { cursor: default; }
.title-shop__utilities button[aria-pressed="true"]::before { filter: brightness(.92); }
.title-shop__version {
  justify-self: end;
  padding: 2px 7px;
  border-radius: 10px;
  color: #fff2d7;
  background: #3c241cc4;
  font: 10px/1.2 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.title-shop a:focus-visible,
.title-shop button:focus-visible { outline: 2px solid #142e43; outline-offset: 2px; }

.title-shop a:active,
.title-shop button:active:not(:disabled) { filter: brightness(.93); }

@media (orientation: landscape) {
  .title-shop { --art-width: min(49vw, 81vh); }
  @supports (height: 100dvh) { .title-shop { --art-width: min(49vw, 81dvh); } }

  .title-shop__art {
    left: 0;
    width: var(--art-width);
    object-position: center 46%;
    transform: none;
  }

  .title-shop__content {
    grid-template-rows: auto auto;
    align-content: center;
    gap: 13px;
    margin-inline-start: var(--art-width);
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
  }

  .title-shop__logo { max-height: max(40px, calc(100vh - 210px)); max-height: max(40px, calc(100dvh - 210px)); }
  .title-shop__heading p { color: #f9dcaa; text-shadow: none; }
  .title-shop__navigation { grid-row: 2; }
  .title-shop__utilities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (orientation: portrait) and (max-height: 760px), (orientation: landscape) {
  .title-shop__modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .title-shop__mode {
    --button-end: 32px;
    grid-template-columns: minmax(0, 1fr);
    min-height: 54px;
    padding: 5px 9px 8px;
    text-align: center;
  }

  .title-shop__mode-name { font-size: 13px; }
  .title-shop__mode-detail, .title-shop__mode::after { display: none; }
}
