.mr {
  --mr-ink: #342446;
  --mr-muted: #685479;
  --mr-line: #dac9e7;
  --mr-paper: #fcf8ff;
  color: var(--mr-ink);
  font: 1rem/1.65 var(--sans);
}
.mr :where(h2, h3, p) { margin: 0 0 .7rem; }
.mr h2 { font-size: 1.2rem; }
.mr-intro { margin-bottom: clamp(22px, 4vw, 42px); }
.mr-intro h1 { margin: .15em 0; font: 800 clamp(2rem, 6vw, 4.2rem)/1.1 var(--serif, serif); letter-spacing: .055em; }
.mr-intro h1:focus { outline: none; }
.mr-intro p { color: #5b476b; }
.mr-collection-head, .mr-stage-head, .mr-panel-head, .mr-room-intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.mr-collection-head { margin-bottom: 1rem; }
.mr-collection-head h2, .mr-panel-head h2 { margin: 0; }
.mr-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: .8rem; }
.mr-character { min-width: 0; display: grid; gap: .25rem; align-content: start; padding: .75rem; border: 1px solid var(--mr-line); background: #ffffffb8; color: inherit; border-radius: 12px; cursor: pointer; text-align: left; transition: border-color .2s, background .2s; }
.mr-character[aria-pressed="true"] { border-color: #8156ab; background: #faf1ff; box-shadow: inset 0 0 0 1px #8156ab; }
.mr-selected, .mr small { color: var(--mr-muted); font-size: .82rem; }
.mr-selected { margin-top: .4rem; font-weight: 700; }
.mr-empty, .mr-backup { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--mr-line); border-radius: 14px; background: #fff9; }
.mr-backup { margin-top: 1rem; }
.mr details > :not(summary) { margin-top: .75rem; }
.mr summary { cursor: pointer; padding-block: .4rem; font-weight: 700; }
.mr-actions { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.mr .dtp-btn { cursor: pointer; width: auto; min-width: 0; min-height: 44px; padding: .4rem .8rem; font-size: .9rem; letter-spacing: .035em; }
.mr button:disabled { cursor: default; opacity: .62; transform: none; }
.mr :focus-visible { outline: 2px solid #7946aa; outline-offset: 3px; }
.mr label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
.mr select, .mr textarea { min-height: 44px; min-width: 0; max-width: 100%; padding: .45rem .65rem; border: 1px solid #a78ab9; border-radius: 6px; background: #fff; color: inherit; font: inherit; }
.mr select { max-width: min(100%, 310px); }
.mr textarea { width: 100%; resize: vertical; }
.mr-back-link { text-underline-offset: 4px; font-size: .85rem; letter-spacing: .12em; }
.mr-room-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: clamp(.8rem, 2vw, 1.6rem); }
.mr-stage { border-radius: 14px; overflow: hidden; border: 1px solid var(--mr-line); background: var(--mr-paper); }
.mr-stage { box-shadow: 0 18px 36px #472b6220; }
.mr-stage-head { padding: .75rem 1rem; background: #39284c; color: #f9eeff; }
.mr-time, .mr-dp { font-variant-numeric: tabular-nums; }
.mr-dp { color: #fbd7a4; letter-spacing: .1em; }
.mr-scene { width: 100%; height: auto; display: block; background: #352846; }
.mr-scene[data-period="朝"] { --mr-sky-top: #867fc0; --mr-sky-bottom: #f8c4ad; --mr-side: #8b739e; --mr-wall-top: #c3aacb; --mr-wall-bottom: #a788ae; --mr-floor: #ad8fae; --mr-shadow: #53385a60; --mr-land: #846e9e; --mr-city: #574774; --mr-ray: .22; }
.mr-scene[data-period="昼"] { --mr-sky-top: #7498d1; --mr-sky-bottom: #d7e4ff; --mr-side: #9f8aab; --mr-wall-top: #ded0e1; --mr-wall-bottom: #b7a0c0; --mr-floor: #bca8bf; --mr-shadow: #735a7840; --mr-land: #7891b5; --mr-city: #566985; --mr-ray: .34; }
.mr-scene[data-period="夕方"] { --mr-sky-top: #745e9b; --mr-sky-bottom: #ffab88; --mr-side: #765a7c; --mr-wall-top: #bb95b0; --mr-wall-bottom: #957294; --mr-floor: #9d7894; --mr-shadow: #49334d90; --mr-land: #77547b; --mr-city: #513957; --mr-ray: .29; --mr-glow: .35; }
.mr-scene[data-period="夜"] { --mr-sky-top: #29224a; --mr-sky-bottom: #6d5998; --mr-side: #534163; --mr-wall-top: #847197; --mr-wall-bottom: #6e577f; --mr-floor: #806789; --mr-shadow: #332341a0; --mr-land: #574270; --mr-city: #392f53; --mr-moon: 1; --mr-glow: 1; }
.mr-scene[data-period="深夜"] { --mr-sky-top: #13162f; --mr-sky-bottom: #41345e; --mr-side: #36304d; --mr-wall-top: #625676; --mr-wall-bottom: #554564; --mr-floor: #64516e; --mr-shadow: #251c35a8; --mr-land: #382c50; --mr-city: #261e3c; --mr-moon: 1; --mr-glow: .66; }
.mr-sky-high { stop-color: var(--mr-sky-top); }
.mr-sky-low { stop-color: var(--mr-sky-bottom); }
.mr-wall-high { stop-color: var(--mr-wall-top); }
.mr-wall-low { stop-color: var(--mr-wall-bottom); }
.mr-moon { opacity: var(--mr-moon, 0); }
.mr-ray { opacity: var(--mr-ray, 0); }
.mr-glow, .mr-bulbs { opacity: var(--mr-glow, 0); }
.mr-scene:is([data-period="夜"], [data-period="深夜"]) .mr-sun { display: none; }
.mr-scene[data-period="朝"] .mr-sun { transform: translate(-54px, 28px); }
.mr-scene[data-period="夕方"] .mr-sun { transform: translate(25px, 36px); }
.mr-scene[data-period="深夜"] .mr-moon { transform: translate(-30px, 7px); }
.mr-scene:is([data-period="夜"], [data-period="深夜"]) .mr-lampshade { fill: #ffe0ab; }
.mr-grid circle { fill: #f8e8ffcc; stroke: #694880; stroke-width: 2; cursor: pointer; }
.mr-grid circle:hover { fill: #fff; }
.mr-builder:not(:empty), .mr-progress { padding: .8rem 1rem; }
.mr-builder:not(:empty) { background: #f0e3f8; }
.mr-progress { display: flex; flex-wrap: wrap; gap: .4rem .85rem; align-items: center; line-height: 1.45; }
.mr-progress strong { color: #673d87; }
.mr-progress progress { width: 100%; height: .65rem; accent-color: #8051a7; }
.mr-progress.is-level-up { animation: mr-level 1s ease-out; }
@keyframes mr-level { 30% { background: #ead0ff; box-shadow: inset 0 0 20px #bb84ed; } }
.mr-status { margin: 0; padding: .6rem 1rem; color: #603a7d; }
.mr-status:empty { padding: 0; }
.mr-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #efe4f6; }
.mr-tab { min-height: 48px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: inherit; cursor: pointer; font: 700 .9rem var(--sans); }
.mr-tab[aria-pressed="true"] { border-color: #8359aa; background: #fff8; }
.mr-tab:focus-visible { outline-offset: -4px; }
.mr-panel { padding: clamp(.85rem, 2vw, 1.25rem); }
.mr-panel-head { margin-bottom: .8rem; }
.mr-panel-head span { font-size: .85rem; color: var(--mr-muted); }
.mr-task-list, .mr-shop, .mr-conversation, .mr-history { list-style: none; margin: .75rem 0; padding: 0; }
.mr-task-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .6rem 0; border-top: 1px solid var(--mr-line); }
.mr-task-list small { display: block; }
.mr-shop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.mr-shop li { display: grid; align-content: start; grid-template-rows: auto auto auto; gap: .2rem; border: 1px solid var(--mr-line); border-radius: 8px; padding: .5rem; }
.mr-shop strong { font-size: .9rem; }
.mr-preview { background: #eee2f6; border-radius: 4px; }
.mr-preview svg { display: block; width: 100%; max-height: 98px; }
.mr-history, .mr-conversation { max-height: 20rem; overflow: auto; overflow-wrap: anywhere; }
.mr-history li, .mr-conversation li { padding: .55rem .65rem; margin: .35rem 0; background: #f2e8f8; border-radius: 6px; }
.mr-history li button { margin-left: .5rem; }
.mr-conversation li.user { margin-left: 1.4rem; background: #e8dcf3; }
.mr-conversation time { display: inline-block; margin-left: .5rem; color: var(--mr-muted); font-size: .8rem; }
.mr-conversation p { margin: .3rem 0 0; white-space: pre-wrap; }
.mr-panel form { display: grid; justify-items: start; gap: .5rem; margin-bottom: .8rem; }
.mr-memory { margin-top: 1.25rem; padding-top: .85rem; border-top: 1px solid var(--mr-line); }
@media (max-width: 800px) { .mr-room-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .dtp-room .dtp-bar { position: static; }
  .dtp-room .dtp-nav { gap: .5rem .75rem; }
  .mr-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mr-room-intro > label { width: 100%; }
  .mr-room-intro select { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .mr *, .mr .is-level-up { animation: none; transition: none; } }

/* Collection and room share the lavender paper of the result pages. */
.dtp-room .dtp-main { width: min(1280px, calc(100% - 72px)); max-width: none; }
.mr [hidden] { display: none !important; }
.mr { --mr-ink: #30253c; --mr-muted: #62536d; --mr-line: #dacae4; }
.mr-intro { margin-bottom: clamp(1rem, 2.8vw, 2.25rem); }
.mr-intro h1 { font-weight: 600; letter-spacing: .075em; }
.mr-intro p:last-child { margin-bottom: 0; }
.mr-collection { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .47fr); column-gap: clamp(1rem, 3vw, 2.5rem); align-items: start; }
.mr-feature { grid-row: span 2; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; border: 1px solid #cfc0db; border-radius: 24px; overflow: hidden; min-height: 27rem; background: #fbf7ff; }
.mr-portrait { min-width: 0; position: relative; isolation: isolate; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: hsl(var(--mr-hue, 265) 17% 26%); }
.mr-portrait::before { content: ''; position: absolute; width: 72%; height: 81%; border: 1px solid #eee0ff4a; border-radius: 50% 50% 42% 42%; z-index: -1; background: radial-gradient(ellipse at 50% 43%, hsl(var(--mr-hue, 265) 22% 49%), transparent 74%); }
.mr-portrait img { width: 100%; height: 100%; object-fit: contain; }
.mr-image-fallback { color: #f4eafd; font: 700 .9rem/1.2 var(--sans); letter-spacing: .08em; }
.mr-portrait.is-hero { border-radius: 0; width: 100%; height: 100%; aspect-ratio: auto; min-height: 25rem; }
.mr-portrait.is-hero img { position: absolute; inset: 0; padding: clamp(1rem, 3vw, 2.4rem); animation: mr-portrait-in .42s ease-out both; }
.mr-feature-copy { padding: clamp(1rem, 2.7vw, 2.25rem); min-width: 0; animation: mr-copy-in .32s ease-out both; overflow-wrap: anywhere; }
.mr-feature-copy h2 { margin: 0; font: 700 clamp(1.55rem, 3.2vw, 2.85rem)/1.19 var(--serif, serif); }
.mr-subtitle { margin-top: .6rem; }
.mr-code { color: #725588; font-size: .82rem; font-weight: 750; letter-spacing: .12em; }
.mr-feature-stats { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin: 1.4rem 0 .4rem; padding: .9rem 0 0; border-top: 1px solid var(--mr-line); font-size: .84rem; }
.mr-feature-stats strong { font-size: 1.05rem; white-space: nowrap; }
.mr-feature progress { width: 100%; height: .6rem; accent-color: #8051a7; }
.mr-feature small { display: block; margin-bottom: 1rem; }
.mr-feature .dtp-btn { justify-content: center; text-align: center; min-width: min(100%, 11rem); }
.mr-collection-head { min-width: 0; margin-bottom: .6rem; font-size: .85rem; color: var(--mr-muted); }
.mr-collection-head h2 { color: var(--mr-ink); }
.mr-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 25rem; overflow: auto; padding: .2rem .4rem .35rem .2rem; align-self: stretch; }
.mr-character { background: #fcf9ff; border-radius: 14px; padding: .55rem; line-height: 1.45; font-size: .86rem; }
.mr-character:hover { border-color: #9c7bb6; background: #f2e8fa; }
.mr-character[aria-pressed="true"] { border-color: #8765a3; background: #eee1f5; }
.mr-character strong, .mr-character span { overflow-wrap: anywhere; }
.mr-selected { margin-top: 0; color: #56376e; }
.mr-empty { grid-column: 1/-1; }
@keyframes mr-portrait-in { from { opacity: .35; transform: translateY(.6rem) scale(.97); } }
@keyframes mr-copy-in { from { opacity: .3; transform: translateY(.35rem); } }

.mr-room-grid { display: block; }
.mr-stage { border-radius: 22px; }
.mr-stage-head { background: #f8f2fc; color: #503b5f; padding-inline: clamp(1rem, 3vw, 1.75rem); }
.mr-dp { color: #654278; }
.mr-viewport { position: relative; isolation: isolate; background: radial-gradient(ellipse at 47% 44%, #685676, #372d48 72%); }
.mr-environment { height: clamp(27rem, 58vh, 45rem); }
.mr-environment canvas { display: block; width: 100%; height: 100%; background: transparent; cursor: grab; touch-action: pan-y; }
.mr-environment canvas.is-placing { cursor: crosshair; touch-action: none; }
.mr-environment canvas:active { cursor: grabbing; }
.mr-environment svg { height: 100%; object-fit: contain; }
.mr-scene-message { position: absolute; bottom: .55rem; left: .85rem; margin: 0; color: #f6eafb; font-size: .85rem; pointer-events: none; }
.mr-view-tools { position: absolute; bottom: .7rem; left: .7rem; display: flex; gap: .3rem; }
.mr-view-tools button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9px; border: 1px solid #ece2ff53; background: #261c369c; color: #fff4ff; font: 600 1.2rem/1 var(--sans); cursor: pointer; }
.mr-view-tools button:hover { background: #625071; }
.mr-tabs { display: flex; justify-content: center; gap: .25rem; padding: .35rem; background: #f8f2fc; border-bottom: 1px solid var(--mr-line); }
.mr-tab { min-width: min(30%, 10rem); border: 1px solid transparent; border-radius: 8px; padding: .3rem .65rem; }
.mr-tab span { margin-right: .43rem; color: #725185; font-size: 1.15em; }
.mr-tab:hover, .mr-tab[aria-expanded="true"] { background: #eaddf2; border-color: #d1bbdf; }
.mr-panel { position: absolute; inset: .6rem .6rem .6rem auto; width: min(430px, 54%); z-index: 1; border-radius: 15px; background: #fcf7ff; box-shadow: 0 12px 35px #251a3c88; overflow: auto; overscroll-behavior: contain; }
.mr-drawer-bar { display: flex; justify-content: flex-end; margin-bottom: .35rem; }
.mr-preview { background: #ece1f0; border-radius: 8px; min-height: 4.5rem; }
.mr-preview img { width: 100%; height: auto; display: block; }
.mr-shop li { border-radius: 12px; }
.mr-builder:not(:empty) { border-bottom: 1px solid var(--mr-line); }
@media (max-width: 920px) {
  .mr-collection { grid-template-columns: minmax(0, 1fr); }
  .mr-feature { grid-row: auto; margin-bottom: 1.35rem; }
  .mr-card-grid { grid-template-columns: repeat(auto-fill, minmax(9rem,1fr)); max-height: none; }
}
@media (max-width: 650px) {
  .dtp-room .dtp-main { width: calc(100% - 26px); }
  .mr-intro h1 { font-size: clamp(1.75rem, 8vw, 3rem); }
  .mr-feature { grid-template-columns: 1fr; min-height: 0; border-radius: 17px; }
  .mr-portrait.is-hero { height: clamp(13rem, 62vw, 20rem); min-height: 0; }
  .mr-feature-copy { padding: 1rem; }
  .mr-feature-copy h2 { font-size: 1.7rem; }
  .mr-feature-stats { margin-top: .8rem; }
  .mr-feature .dtp-btn { width: 100%; }
  .mr-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mr-environment { height: clamp(19rem, 96vw, 31rem); }
  .mr-stage { border-radius: 15px; }
  .mr-panel { inset: auto .3rem .3rem; width: auto; max-height: 86%; border-radius: 13px; }
  .mr-tab { flex: 1; min-width: 0; }
  .mr-room-intro select { width: 100%; }
}
.dtp-room .dtp-main:has(.mr-room-grid) { padding-top: clamp(1rem, 4vh, 2.25rem); }
.mr-feature { scroll-margin-top: 5rem; }
.mr-card-grid { align-content: start; align-items: stretch; }
@media (min-width: 921px) { .mr-collection { grid-template-rows: auto 1fr; } }

@media (prefers-reduced-motion: no-preference) {
  .mr-collection, .mr-room-grid { animation: mr-page-in .24s ease-out both; }
  @keyframes mr-page-in { from { opacity: .55; transform: translateY(.25rem); } }
}

/* Keep the selection controls in place while the portrait and page change. */
.mr-collection { position: relative; }
.mr-feature.mr-feature-previous { position: absolute; z-index: 2; pointer-events: none; margin: 0; }
.mr-character { grid-template-rows: auto auto auto auto minmax(1.15em,auto); }
.mr-feature-copy h2 { min-block-size: 1.19em; }
.mr-subtitle { min-block-size: 1.65em; }

html[data-mr-transit] .mr-collection,
html[data-mr-transit] .mr-room-grid,
html[data-mr-transit] .mr-feature :is(.mr-portrait img,.mr-feature-copy) { animation: none; }
html[data-mr-transit] [data-mr-route="my-characters"] .mr-feature:not(.mr-feature-previous) .is-hero,
html[data-mr-transit] [data-mr-route="shop"] .mr-shop-viewport,
html[data-mr-transit] [data-mr-route="my-room"] .mr-environment { view-transition-name: mr-focus; }
html[data-mr-transit]::view-transition { pointer-events: none; }
html[data-mr-transit]::view-transition-group(mr-focus) { animation-duration: 650ms; animation-timing-function: cubic-bezier(.23,.72,.21,1); }
html[data-mr-transit]::view-transition-image-pair(mr-focus) { isolation: isolate; overflow: clip; border-radius: 16px; }
html[data-mr-transit]::view-transition-old(mr-focus),
html[data-mr-transit]::view-transition-new(mr-focus) { mix-blend-mode: normal; animation-duration: 650ms; animation-timing-function: cubic-bezier(.23,.72,.21,1); }
html[data-mr-transit="enter"]::view-transition-old(mr-focus) { animation-name: mr-portrait-depart; z-index: 2; }
html[data-mr-transit="enter"]::view-transition-new(mr-focus) { animation-name: mr-room-arrive; }
html[data-mr-transit="return"]::view-transition-old(mr-focus) { animation-name: mr-room-recede; }
html[data-mr-transit="return"]::view-transition-new(mr-focus) { animation-name: mr-portrait-return; z-index: 2; }
html[data-mr-transit]::view-transition-old(root) { animation: mr-chrome-out 400ms ease both; }
html[data-mr-transit]::view-transition-new(root) { animation: mr-chrome-in 620ms cubic-bezier(.23,.72,.21,1) both; }
@keyframes mr-portrait-depart { 0% { opacity: 1; } 52%,100% { opacity: 0; transform: scale(1.09); filter: blur(5px); } }
@keyframes mr-room-arrive { 0% { opacity: .25; clip-path: inset(8% 10% round 30px); transform: scale(1.027); } 100% { opacity: 1; clip-path: inset(0 round 0px); transform: none; } }
@keyframes mr-room-recede { 0% { opacity: 1; } 75%,100% { opacity: 0; filter: blur(4px); transform: scale(.96); } }
@keyframes mr-portrait-return { 0%,16% { opacity: 0; transform: scale(1.065); filter: blur(4px); } 90%,100% { opacity: 1; transform: none; filter: none; } }
@keyframes mr-chrome-out { to { opacity: 0; transform: scale(.993); } }
@keyframes mr-chrome-in { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.mr-panel[inert] { pointer-events: none; }
.mr-edit-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem .8rem; margin-bottom: .6rem; }
.mr-edit-head button[aria-pressed="true"] { background: #503860; color: #fff; border-color: #503860; }
.mr-rotation-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .85rem; }
.mr-angle-slider { flex: 1 1 11rem; min-width: 0; }
.mr-angle-slider input { width: 100%; margin: 0; min-height: 32px; }
.mr-angle-input input { box-sizing: border-box; width: 5.75rem; min-height: 44px; padding: .35rem .45rem; border: 1px solid #a78ab9; border-radius: 6px; font: inherit; color: inherit; background: #fff; }
.mr-angle-value { font-variant-numeric: tabular-nums; }
.mr-angle-hint, .mr-angle-feedback { margin: .5rem 0 0; color: #62536d; font-size: .85rem; }
.mr-angle-feedback { color: #8b324f; }
.mr-angle-feedback:empty { display: none; }
.mr .mr-snap { display: flex; align-items: center; min-height: 44px; gap: .4rem; }
.mr-snap input, .mr-angle-slider input { accent-color: #68467f; }
.mr-rotation-dial { width: 55px; height: 55px; flex: 0 0 55px; padding: 5px; border: 1px solid #846398; border-radius: 50%; background: #fbf3ff; color: #634779; cursor: grab; touch-action: none; }
.mr-rotation-dial:active { cursor: grabbing; }
.mr-rotation-dial span { position: relative; display: block; width: 100%; height: 100%; border: 1px dashed #9b7aac; border-radius: 50%; transform: rotate(var(--mr-angle,0deg)); pointer-events: none; }
.mr-rotation-dial span::before { content: ''; position: absolute; left: 50%; top: 1px; translate: -50%; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.mr-environment canvas.is-input-blocked { cursor: default; }
@media (max-width: 650px) {
  .mr-panel { inset: auto 0 0; max-height: 83%; border-radius: 17px 17px 0 0; padding-bottom: 1rem; }
  .mr-panel::before { content: ''; display: block; width: 34px; height: 4px; border-radius: 4px; margin: 0 auto 3px; background: #c3abcF; }
  .mr-angle-slider { flex-basis: calc(100% - 73px); }
}

.mr-drawer-bar { position: sticky; top: -.15rem; z-index: 1; background: #fcf7ff; }
.mr-view-tools button:disabled { opacity: .45; cursor: default; }
@media (max-width: 650px) {
  .mr-tab { white-space: nowrap; padding-inline: .3rem; font-size: .83rem; }
  .mr-tab span { margin-right: .28rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mr-portrait.is-hero img, .mr-feature-copy, .mr-progress.is-level-up { animation: none; }
}

.mr-actor-info { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .3rem .7rem;
  padding: .25rem clamp(1rem, 3vw, 1.75rem); border-top: 1px solid #e8deed; background: #f8f2fc; }
.mr-actor-label { color: var(--mr-muted); font-size: .85rem; }
.mr .mr-actor-action { font-size: .85rem; background: transparent; }

/* Life room */
.mr-living-stage { position: relative; }
.mr-living-stage .mr-viewport { background: radial-gradient(ellipse at 48% 47%,var(--mr-room-tint,#5c456e),#292236 78%); }
.mr-living-stage .mr-environment { height: clamp(27rem,61vh,39rem); }
.mr-room-meta { display:flex; align-items:center; gap:.9rem; }
.mr-chat-marker { position:absolute; z-index:2; transform:translate(-50%,-55%); width:46px; height:46px;
  border:1px solid #f4eaff; border-radius: 50% 50% 50% 30%; background:#352744e8; color:white; font:700 1.45rem/1 var(--sans); cursor:pointer; }
.mr-chat-marker:hover { background:#5b4374; }
.mr-life-actions { display:flex; align-items:center; padding: 0 .6rem; gap:.4rem; background:#f8f2fc; border-bottom:1px solid var(--mr-line); }
.mr-life-actions .mr-tabs { flex:1; border:0; }
.mr-life-actions > a { text-align:center; }
.mr-living-stage .mr-panel { inset:3.6rem .65rem auto auto; height: min(53vh, 33rem); max-height:none; width:min(390px,38%); }
.mr-gift-reaction { flex:1 1 100%; margin:0; padding:.45rem .65rem; background:#eee1f5; border-radius:.55rem; }
.mr-gift-list { list-style:none; margin:0 0 .85rem; padding:0; }
.mr-gift-list li { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:.5rem; padding:.4rem 0; border-bottom:1px solid var(--mr-line); }
.mr-gift-list small { display:block; }
.mr-gift-list .mr-product-art { min-height:44px; width:44px; height:44px; margin:0; border-radius:8px; }
.mr-gift-list .mr-product-art span { width:21px; height:21px; }
.mr-shop-service,.mr-shop-stock { min-width:0; background:#fcf8ff; border:1px solid var(--mr-line); border-radius:1.25rem; padding:clamp(.85rem,2vw,1.55rem); }
.mr-shop-stock { margin-top:1rem; }
.mr-catalog-count { font-size:.86rem; color:var(--mr-muted); white-space:nowrap; }
.mr-catalog-filters { display:flex; flex-wrap:wrap; gap:.4rem; margin:.8rem 0 1rem; }
.mr-category { min-height:44px; padding:.35rem .7rem; font:inherit; font-size:.83rem; border:1px solid #d9c7e4; border-radius:2rem; background:#f4e9f9; color:var(--mr-ink); cursor:pointer; }
.mr-category[aria-pressed="true"] { background:#533965; border-color:#533965; color:#fff; }
.mr-catalog-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-content:start; gap:.7rem; padding:.2rem; max-height:min(60vh,35rem); overflow:auto; }
.mr-product-card { display:grid; align-content:start; gap:.28rem; min-width:0; min-height:44px; padding:.5rem; border:1px solid #d9c9e3; border-radius:1rem; cursor:pointer; text-align:left; background:#faf4fd; color:#3a2a47; font:inherit; }
.mr-product-card:hover { border-color:#9f76ae; background:#f4e8f9; }
.mr-product-card[aria-pressed="true"] { border-color:#82588f; box-shadow:inset 0 0 0 1px #82588f; background:#efe1f6; }
.mr-product-card > strong { line-height:1.35; }
.mr-product-card > span { color:#603871; font-weight:750; }
.mr-product-card .mr-product-art { min-height:0; height:clamp(5.1rem,10vw,8.6rem); border-radius:.64rem; }
.mr-product-card .mr-product-art span { width:clamp(29px,5vw,69px); height:clamp(30px,5.3vw,74px); }
.mr-shop-service { display:grid; gap:.8rem; background:#f7edf9; }
.mr-clerk-note { position:relative; align-self:start; width:100%; min-height:3.5rem; margin:0; padding:.55rem .7rem; border-radius:.85rem; background:#fff8fe; color:#352742; font-size:.9rem; }
.mr-clerk-note::after { content:''; position:absolute; left:48%; bottom:-.35rem; width:.7rem; height:.7rem; background:inherit; transform:rotate(45deg); }
.mr-order-details { min-width:0; }
.mr-order-details h2,.mr-order-details p { margin:0 0 .35rem; }
.mr-order-details button { width:100%; margin-top:.45rem; }
.mr-order-line { display:flex; justify-content:space-between; align-items:center; gap:.35rem; }
.mr-item-price { color:#603871; }
.mr-order-shortfall { display:block; margin-top:.35rem; }
.mr-buy-dialog { padding:1.4rem; width:min(440px,calc(100% - 28px)); color:var(--mr-ink); background:#fbf5ff; border:1px solid #c6b2d5; border-radius:1.1rem; }
.mr-buy-dialog::backdrop { background:#261c3b99; }
.mr-product-art { min-height:15rem; display:grid; place-items:center; position:relative; isolation:isolate; background:radial-gradient(ellipse,#e7cfe9,#ccc0e4); border-radius:1rem; overflow:hidden; }
.mr-product-art span { display:block; width:clamp(40px,8vw,100px); height:clamp(45px,9vw,112px); position:relative;
  background:linear-gradient(130deg,#bb9ecf,#543a74 75%); border-radius:10%; box-shadow:10px 14px 18px #3d284865; transform:rotate(-13deg); }
.mr-product-art span::after { content:''; position:absolute; inset:15%; border:1px solid #f6e0b5a8; border-radius:inherit; }
.mr-product-art.is-tea span { height:clamp(36px,6vw,76px); border-radius:14% 14% 45% 45%; background:linear-gradient(105deg,#f2e2ee,#935a8a 78%); transform:none; }
.mr-product-art.is-tea span::after { inset:0 0 auto; height:22%; background:#7f4266; border-radius:50%; }
.mr-product-art.is-cake span { height:clamp(32px,5vw,64px); border-radius:42% 42% 24% 24%; background:linear-gradient(#803c6d 0 45%,#ce9c80 48% 69%,#965f60 72%); transform:rotate(3deg); }
.mr-product-art.is-gem span { clip-path:polygon(50% 0,87% 22%,100% 60%,50% 100%,4% 62%,12% 22%); background:conic-gradient(from 25deg,#dac3f5,#8f6ebf,#3b2465,#9872be,#f2c68c,#dac3f5); height:clamp(52px,10vw,130px); }
.mr-product-art.is-flower span { background:radial-gradient(circle at 50% 26%,#f1d7e8,#a77ba4 32%,transparent 33%),linear-gradient(90deg,transparent 46%,#548375 48% 51%,transparent 54%); box-shadow:none; transform:rotate(16deg); }
.mr-product-art.is-music span { background:linear-gradient(145deg,#e0b180,#6c3f64 64%); height:clamp(41px,6.5vw,78px); }
@media (max-width:650px) {
  .mr-living-stage .mr-environment { height:clamp(22rem,100vw,30rem); }
  .mr-living-stage .mr-panel { position:relative; inset:auto; height:min(42vh,340px); width:auto; max-height:none; border-radius:0; box-shadow:none; border-bottom:1px solid var(--mr-line); }
  .mr-life-actions { padding-inline:.2rem; }
  .mr-life-actions .mr-tab { font-size:.75rem; }
  .mr-life-actions .mr-tab > span { display:none; }
  .mr-catalog-grid { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:none; }
  .mr-catalog-filters { gap:.32rem; }
  .mr-category { padding-inline:.55rem; }
  .mr-clerk-note::after { left:auto; right:-.28rem; top:45%; }

}
.dtp-room .dtp-main:has(.mr-life-shop) { padding-top:clamp(1.1rem,4vh,2.7rem); }
@media (max-width:650px) {
  .mr-catalog-grid { max-height:38vh; }
  .mr-life-shop .mr-intro { margin-bottom:.8rem; }
}

/* Shared room and shop controls. */
.mr:has(.mr-world-header) {
  --mr-control: #fcf8ff;
  --mr-control-hover: #eee1f4;
  --mr-control-edge: #ccb6d8;
  --mr-action: #553765;
  --mr-action-hover: #684779;
  --mr-focus: #9161a3;
  --mr-radius: .8rem;
  --mr-target: 44px;
  --mr-ease: cubic-bezier(.22,.67,.27,1);
}
.mr:has(.mr-world-header) :is(.dtp-btn,.mr-category) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .36rem;
  min-block-size: var(--mr-target);
  padding: .45rem .85rem;
  border: 1px solid var(--mr-control-edge);
  border-radius: var(--mr-radius);
  background: var(--mr-control);
  color: #422d50;
  box-shadow: none;
  font: 680 .87rem/1.25 var(--sans, sans-serif);
  letter-spacing: .012em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 200ms var(--mr-ease), border-color 200ms var(--mr-ease), translate 200ms var(--mr-ease);
}
.mr:has(.mr-world-header) :is(.dtp-btn,.mr-category):hover { background: var(--mr-control-hover); border-color: var(--mr-focus); }
.mr:has(.mr-world-header) :is(.dtp-btn,.mr-category):active:not(:disabled) { translate: 0 1px; }
.mr:has(.mr-world-header) :is(button,a,summary,select):focus-visible { outline: 2px solid var(--mr-focus); outline-offset: 3px; }
.mr:has(.mr-world-header) :is(.dtp-btn.is-primary,.mr-category[aria-pressed="true"],.mr-tab[aria-expanded="true"]) {
  background: var(--mr-action); border-color: var(--mr-action); color: #fff8ff;
}
.mr:has(.mr-world-header) :is(.dtp-btn.is-primary,.mr-category[aria-pressed="true"],.mr-tab[aria-expanded="true"]):hover { background: var(--mr-action-hover); }
.mr:has(.mr-world-header) .dtp-btn.is-tertiary { background: transparent; border-color: transparent; }
.mr:has(.mr-world-header) .dtp-btn.is-tertiary:hover { background: var(--mr-control-hover); }
.mr:has(.mr-world-header) .dtp-btn:disabled { opacity: .55; cursor: not-allowed; }
.mr:has(.mr-world-header) .dtp-btn[aria-busy="true"] { cursor: progress; }
.mr:has(.mr-world-header) .dtp-btn.mr-icon-button {
  width: var(--mr-target); padding: 0; background: #39294c; color: #fff6ff; border-color: #c8add7; font-size: 1.15rem;
}
.mr:has(.mr-world-header) .dtp-btn.mr-icon-button:hover { background: var(--mr-action-hover); }
.mr:has(.mr-world-header) .dtp-btn[hidden] { display: none; }
.mr .mr-world-header { margin-bottom: clamp(.75rem,2vw,1.4rem); align-items: end; }
.mr-world-header h1 { font-size: clamp(1.85rem,4vw,3.35rem); }
.mr-world-header p { margin: 0; }
.mr-world-header .mr-wayfinding { margin-bottom: .35rem; }
.mr-wallet {
  display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .65rem;
  border: 1px solid #decee8; border-radius: var(--mr-radius); color: #554763; background: #fbf2f9;
  font-size: .76rem; white-space: nowrap;
}
.mr-wallet .mr-dp { font-size: .9rem; color: var(--mr-action); letter-spacing: .055em; }
.mr-life-actions { padding: .45rem .7rem; }
.mr-life-actions .mr-tabs { justify-content: start; padding: 0; }
.mr-life-actions .mr-tab { min-width: 0; }
.mr-life-actions .mr-tab span { margin-right: 0; color: inherit; }
.mr-life-actions > .dtp-btn { flex-shrink: 0; }
.mr-buy-dialog,.mr-stage,.mr-shop-service,.mr-shop-stock,.mr-living-stage .mr-panel { border-radius: 1rem; }

/* The catalog controls are anchored to shop furniture in WebGL. */
.mr-shop-layout { display: grid; grid-template-columns: minmax(0,2.8fr) minmax(16rem,1fr); gap: clamp(.75rem,2vw,1.4rem); align-items: start; }
.mr-shop-viewport {
  position: relative; isolation: isolate; display: grid; gap: .7rem;
  background: radial-gradient(ellipse at 55% 48%,#bf9eae,#655576 85%);
}
.mr-shop-environment { display: none; }
.mr-shop-viewport[data-scene="ready"] .mr-shop-environment {
  display: block; height: clamp(25rem,49vw,37rem);
}
.mr-shop-environment canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.mr-shop-loading { margin: .9rem .9rem 0; color: #fff5ff; }
.mr-shop-viewport[data-scene="loading"] { min-height: clamp(19rem,43vw,32rem); align-content: start; }
.mr-shop-viewport:not([data-scene="ready"]) .mr-catalog-grid { margin-inline: .8rem; }
.mr-shop-viewport:not([data-scene="ready"]) .mr-clerk-note { margin: 0 .8rem .85rem; width: auto; grid-row: 4; }
.mr-shop-viewport:not([data-scene="ready"]) .mr-clerk-note::after { display: none; }
.mr-shop-clerk-fallback { width: 88px; height: 88px; object-fit: contain; margin-inline: auto; }
.mr-shop-viewport[data-scene="ready"] .mr-shop-clerk-fallback { display: none; }
.mr-shop-viewport[data-scene="ready"] .mr-catalog-grid { position: absolute; inset: 0; display: block; overflow: visible; max-height: none; pointer-events: none; }
.mr-shop-viewport[data-scene="ready"] .mr-product-card {
  position: absolute; translate: -50% 0; display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border-radius: 50%; background: #fbf0e5; border: 1px solid #68506f; box-shadow: 0 3px 7px #30213936;
  pointer-events: auto;
}
.mr-shop-viewport[data-scene="ready"] .mr-product-card:hover { background: #f1dbe7; }
.mr-shop-viewport[data-scene="ready"] .mr-product-card[aria-pressed="true"] { background: #553765; border-color: #f7d6a4; box-shadow: 0 0 0 2px #553765; }
.mr-shop-viewport[data-scene="ready"] .mr-product-card > :not(.mr-product-number) { display: none; }
.mr-shop-viewport[data-scene="ready"] .mr-product-card > .mr-product-number { display: block; color: #4d3158; }
.mr-shop-viewport[data-scene="ready"] .mr-product-card[aria-pressed="true"] > .mr-product-number { color: #fff2db; }
.mr-product-number { display: none; }
.mr-shop-viewport[data-scene="ready"] .mr-clerk-note {
  position: absolute; z-index: 2; pointer-events: none; translate: -67% calc(-100% - .45rem);
  width: clamp(8rem,27%,15rem); min-height: 0; padding: .5rem .65rem; font-size: .82rem;
  box-shadow: 0 2px 9px #442c5330;
}
.mr-shop-viewport[data-scene="ready"] .mr-clerk-note::after { left: 66%; }
.mr-shop-service { background: #fcf7fb; }
.mr-shop-service .mr-catalog-filters { margin: .25rem 0 0; padding-top: .7rem; border-top: 1px solid var(--mr-line); }
.mr-shop-service .mr-order-details > p:not(.mr-code) { min-height: 2.75em; }
.mr-order-details .mr-item-price { font-size: 1.22rem; }
.mr-shop-stock { display: grid; gap: .5rem; }
.mr-shop-stock summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; }
html[data-mr-transit^="shop-"]::view-transition-group(mr-focus),
html[data-mr-transit^="shop-"]::view-transition-new(mr-focus),
html[data-mr-transit^="shop-"]::view-transition-old(mr-focus) { animation-duration: 470ms; }
html[data-mr-transit^="shop-"]::view-transition-old(mr-focus) { animation-name: mr-room-recede; }
html[data-mr-transit^="shop-"]::view-transition-new(mr-focus) { animation-name: mr-room-arrive; }
@media (max-width: 760px) {
  .mr-shop-layout { grid-template-columns: minmax(0,1fr); }
  .mr-shop-viewport[data-scene="ready"] .mr-shop-environment { height: clamp(17.5rem,76vw,30rem); }
  .mr-shop-service { padding: .8rem; }
  .mr-shop-service .mr-order-details > p:not(.mr-code) { min-height: 0; }
  .mr-life-shop .mr-world-header { position: sticky; z-index: 4; top: 0; padding: .45rem 0; background: #f6eff9; }
  .mr-life-shop .mr-world-header h1 { font-size: 1.6rem; }
  .mr-life-shop .mr-world-header p { font-size: .83rem; }
}
@media (max-width: 440px) {
  .mr-life-actions { flex-wrap: wrap; }
  .mr-life-actions .mr-tabs { flex-basis: 100%; }
  .mr-life-actions > .dtp-btn { width: 100%; }
  .mr-shop-viewport[data-scene="ready"] .mr-clerk-note { translate: -72% calc(-100% - .25rem); font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mr:has(.mr-world-header) :is(.dtp-btn,.mr-category) { transition: none; }
}
.mr-shop-viewport[data-scene="ready"] .mr-shop-clerk-fallback.is-scene-card {
  display: block; position: absolute; object-fit: contain; translate: -50% -50%;
  pointer-events: none; margin: 0; clip-path: inset(0 0 12% 0);
}
.mr-life-shop .mr-order-details [data-buy] { width: 100%; }
@media (max-width: 550px) {
  .mr-shop-viewport[data-scene="ready"] .mr-product-card,
  .mr-shop-viewport[data-scene="ready"] .mr-product-card:is(:hover,[aria-pressed="true"]) {
    border: 0; background: transparent; box-shadow: none;
  }
  .mr-shop-viewport[data-scene="ready"] .mr-product-card > .mr-product-number {
    display: grid; place-items: center; width: 29px; height: 29px;
    border-radius: 50%; border: 1px solid #68506f; background: #fbf0e5;
  }
  .mr-shop-viewport[data-scene="ready"] .mr-product-card[aria-pressed="true"] > .mr-product-number {
    background: #553765; border-color: #f7d6a4; box-shadow: 0 0 0 1px #553765;
  }
}
.mr-shop-viewport[data-scene="ready"] .mr-clerk-note {
  --clerk-bubble: clamp(8rem, 27%, 14rem);
  width: var(--clerk-bubble);
  left: clamp(calc(var(--clerk-bubble) * .70 + 8px),var(--clerk-x,75%),calc(100% - var(--clerk-bubble) * .30 - 8px));
  top: max(74px,var(--clerk-y,34%));
  translate: -70% calc(-100% - .3rem);
}
.mr-shop-viewport[data-scene="ready"] .mr-clerk-note::after { left: 69%; }

/* Full-viewport game routes. The surrounding site keeps its normal scroll. */
html[data-mr-game], html[data-mr-game] body {
  width:100%; height:100%; overflow:hidden; overscroll-behavior:none; scrollbar-width:none;
  background:#21192e;
}
html[data-mr-game]::-webkit-scrollbar, html[data-mr-game] body::-webkit-scrollbar { display:none; }
#dt-page.dtp-game {
  position:fixed; inset:0; display:block; width:100vw; height:100dvh;
  min-height:0; overflow:hidden; isolation:isolate; background:#2c223d;
}
.dtp-game > .mr:not(.mr-game) {
  position:absolute; inset:50% auto auto 50%; translate:-50% -50%;
  width:min(28rem,calc(100vw - 2rem)); margin:0; padding:1.5rem; background:#f6edf8; border-radius:1rem;
}
.mr-game {
  --hud-edge:#e6d2ef77;
  --hud-paper:#34263ce8;
  --hud-ink:#fff2ff;
  --hud-curve:14px;
  --hud-gap:clamp(.65rem,1.9vw,1.65rem);
  --hud-top:max(var(--hud-gap),env(safe-area-inset-top));
  --hud-right:max(var(--hud-gap),env(safe-area-inset-right));
  --hud-left:max(var(--hud-gap),env(safe-area-inset-left));
  --hud-bottom:max(var(--hud-gap),env(safe-area-inset-bottom));
  position:absolute; inset:0; isolation:isolate; overflow:hidden;
}
.mr-game .mr-world-stage,
.mr-game .mr-environment,
.mr-game .mr-shop-viewport,
.mr-game .mr-shop-viewport[data-scene="ready"] .mr-shop-environment { position:absolute; inset:0; width:100%; height:100%; min-height:0; }
.mr-game .mr-world-stage { background:radial-gradient(ellipse at 46% 46%,#695475,#231a32 82%); }
.mr-game-shop .mr-world-stage { background:radial-gradient(ellipse at 47% 43%,#997b95,#2d223b 85%); }
.mr-game .mr-shop-viewport[data-scene="ready"] { background:transparent; }
.mr-game .mr-environment canvas, .mr-game .mr-shop-environment canvas { width:100%; height:100%; touch-action:none; }
.mr-game .mr-environment svg { display:block; width:100%; height:100%; }
.mr-game .mr-shop-viewport:not([data-scene="ready"]) { align-content:center; padding:4.5rem 4.75rem 1rem 1rem; overflow:auto; }
.mr-game .mr-shop-viewport[data-scene="loading"] { background:#352740; }
.mr-hud-place,.mr-hud-wallet,.mr-hud-menu { position:absolute; z-index:4; }
.mr-hud-place {
  top:var(--hud-top); left:var(--hud-left); display:flex; align-items:center; gap:.68rem;
  color:var(--hud-ink); max-width:calc(100% - 9rem);
}
.mr-hud-place > div {
  padding:.45rem .72rem; border-radius:var(--hud-curve); background:#282032ce;
  box-shadow:0 5px 18px #21152543; backdrop-filter:blur(9px);
}
.mr-hud-place h1 { font:700 clamp(.95rem,2vw,1.21rem)/1.35 var(--serif,serif); margin:0; }
.mr-hud-place span,.mr-hud-wallet span { color:#e9cfe9; font-size:.72rem; }
.mr-hud-wallet {
  top:var(--hud-top); right:var(--hud-right); display:grid; gap:.15rem;
  min-width:6.3rem; padding:.38rem .65rem; text-align:right;
  background:var(--hud-paper); color:var(--hud-ink); border:1px solid var(--hud-edge);
  border-radius:var(--hud-curve); box-shadow:0 5px 18px #21152543; backdrop-filter:blur(9px);
}
.mr-hud-wallet .mr-dp { color:#ffe2ae; line-height:1.2; letter-spacing:.04em; }
.mr-hud-menu {
  top:50%; right:var(--hud-right); transform:translateY(-50%);
  display:grid; justify-items:end; gap:clamp(.3rem,1.3dvh,.65rem);
}
.mr-game .mr-hud-button {
  position:relative; display:grid; place-items:center; width:49px; height:49px; min-width:44px; min-height:44px;
  color:var(--hud-ink); background:var(--hud-paper); border:1px solid var(--hud-edge);
  border-radius:var(--hud-curve); box-shadow:0 4px 13px #1c102c55,inset 0 1px #ffffff15; backdrop-filter:blur(8px);
  cursor:pointer; padding:0; text-decoration:none; transition:background-color .21s ease,border-color .21s,translate .21s;
}
.mr-hud-button svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.mr-game .mr-hud-button:is(:hover,[aria-expanded="true"]) { background:#674974; border-color:#efceec; }
.mr-game .mr-hud-button:active { translate:0 1px; }
.mr-game :is(button,a,select):focus-visible { outline:2px solid #ffd5ab; outline-offset:3px; }
.mr-hud-label {
  position:absolute; pointer-events:none; top:50%; right:calc(100% + .5rem); translate:.34rem -50%;
  padding:.35rem .65rem; border-radius:9px; background:#31243fec; color:#fff1ff;
  opacity:0; white-space:nowrap; font:650 .8rem/1.45 var(--sans,sans-serif);
  transition:opacity .21s cubic-bezier(.22,.67,.27,1),translate .21s cubic-bezier(.22,.67,.27,1);
}
.mr-hud-place .mr-hud-label { right:auto; left:0; top:calc(100% + .4rem); translate:0 -.25rem; }
.mr-hud-button:focus-visible .mr-hud-label { opacity:1; translate:0 -50%; }
.mr-hud-place .mr-hud-button:focus-visible .mr-hud-label { translate:0 0; }
@media (pointer:fine) {
  .mr-hud-menu .mr-hud-button:hover .mr-hud-label { opacity:1; translate:0 -50%; }
  .mr-hud-place .mr-hud-button:hover .mr-hud-label { opacity:1; translate:0 0; }
}
.mr-game :is(.mr-panel,.mr-game-drawer) {
  position:absolute; inset:50% calc(var(--hud-right) + 62px) auto auto; translate:0 -50%;
  z-index:3; width:min(25rem,35vw); max-height:min(70dvh,40rem);
  border-radius:16px; padding:.85rem 1rem 1rem; background:#f9f0faf5; color:#372848;
  border:1px solid #e8cfe9; box-shadow:0 12px 42px #190e2c63; backdrop-filter:blur(12px);
  overflow:auto; overscroll-behavior:contain; scrollbar-width:thin;
}
.mr-game :is(.mr-panel,.mr-game-drawer)[hidden] { display:none; }
.mr-game .mr-game-drawer:not([hidden]) { display:block; animation:mr-chrome-in .23s ease both; }
.mr-game .mr-drawer-bar { display:flex; justify-content:flex-end; }
.mr-game .mr-drawer-bar .mr-hud-button { width:44px; height:44px; }
.mr-game .mr-game-products { display:grid; gap:.28rem; margin:.38rem 0 .68rem; }
.mr-game .mr-game-products .dtp-btn { justify-content:flex-start; text-align:left; }
.mr-game .mr-game-products [aria-pressed="true"] { background:#eee0f3; border-color:#8e639d; }
.mr-game .mr-shop-stock { background:transparent; border:0; padding:0; margin:0; }
.mr-game .mr-view-tools { left:var(--hud-left); bottom:var(--hud-bottom); }
.mr-game .mr-scene-message { bottom:calc(var(--hud-bottom) + 55px); left:var(--hud-left); }
.mr-game :is(.mr-status,.mr-gift-reaction):not(:empty):not([hidden]) {
  position:absolute; z-index:5; left:var(--hud-left); bottom:calc(var(--hud-bottom) + 55px);
  max-width:min(calc(100% - 5rem),32rem); border-radius:.75rem; margin:0; padding:.55rem .75rem;
  color:#fff1ff; background:#362446ee; box-shadow:0 5px 18px #21152543; pointer-events:none;
}
.mr-game .mr-gift-reaction:not([hidden]) { bottom:calc(var(--hud-bottom) + 106px); }
.mr-game .mr-clerk-note { --clerk-bubble:clamp(8rem,18%,14rem); }
.mr-game .mr-order-details { border-top:1px solid var(--mr-line); padding-top:.6rem; }
.mr-game .mr-order-details [data-buy] { width:100%; }
.mr-game .dtp-btn { border-radius:10px; }
@media (max-width:760px), (orientation:portrait) {
  .mr-game :is(.mr-panel,.mr-game-drawer) {
    inset:auto calc(var(--hud-right) + 55px) var(--hud-bottom) var(--hud-left); translate:none;
    width:auto; max-height:min(44dvh,28rem); padding:.65rem .8rem .85rem;
  }
  .mr-hud-menu { top:48%; }
}
@media (pointer:coarse) {
  .mr-hud-menu .mr-hud-button { width:51px; height:49px; gap:.02rem; align-content:center; }
  .mr-hud-menu .mr-hud-button svg { width:18px; height:18px; }
  .mr-hud-menu .mr-hud-label {
    position:static; opacity:1; translate:none; padding:0; background:none;
    font-size:.53rem; white-space:normal; line-height:1.13; max-width:48px; text-align:center;
  }
}
@media (max-height:475px) and (orientation:landscape) {
  .mr-hud-menu { gap:3px; top:54%; }
  .mr-game .mr-hud-button { width:44px; height:44px; }
}

/* The transition layer stays outside both game roots while their renderers swap. */
.mr-travel {
  position:fixed; inset:0; z-index:1000; overflow:hidden; isolation:isolate;
  display:grid; place-items:center; background:#2a1d3e; color:#fbebff; opacity:0;
  pointer-events:auto; transition:opacity .25s ease;
}
html[data-mr-game-travel="depart"] .mr-travel,
html[data-mr-game-travel="corridor"] .mr-travel { opacity:1; }
html[data-mr-game-travel="depart"] .mr-travel { animation:mr-travel-cover .28s ease both; }
html[data-mr-game-travel="arrive"] .mr-travel { opacity:0; pointer-events:none; }
html[data-mr-game-travel="depart"] .mr-game :is(.mr-hud-place,.mr-hud-wallet,.mr-hud-menu,.mr-panel,.mr-game-drawer,.mr-view-tools) {
  opacity:0; transition:opacity .17s ease;
}
html[data-mr-game-travel="arrive"] .mr-game :is(.mr-hud-place,.mr-hud-wallet,.mr-hud-menu) { animation:mr-chrome-in .3s .08s both; }
.mr-travel-corridor {
  position:absolute; inset:0; perspective:630px;
  background:radial-gradient(ellipse at 50% 46%,#c494d7 0%,#65437f 27%,#342448 58%,#21162c 92%);
}
.mr-travel-corridor > i {
  position:absolute; inset:6% 23%; border:2px solid #e4bff285; border-bottom-color:#f0d2fb38;
  border-radius:46% 46% 14% 14% / 60% 60% 12% 12%;
  box-shadow:0 0 25px #e4bcf05e,inset 0 0 21px #f5ccff26;
  animation:mr-travel-arch 2.1s linear infinite;
}
.mr-travel-corridor i:nth-child(2) { animation-delay:-.3s; }
.mr-travel-corridor i:nth-child(3) { animation-delay:-.6s; }
.mr-travel-corridor i:nth-child(4) { animation-delay:-.9s; }
.mr-travel-corridor i:nth-child(5) { animation-delay:-1.2s; }
.mr-travel-corridor i:nth-child(6) { animation-delay:-1.5s; }
.mr-travel-corridor i:nth-child(7) { animation-delay:-1.8s; }
.mr-travel-glint { position:absolute; top:45%; left:50%; translate:-50% -50%; color:#ffe8f8; fill:currentColor; width:30px; }
.mr-travel-loading {
  position:relative; width:min(24rem,78vw); padding:1.1rem 1.3rem;
  border-radius:1rem; background:#2f204bea; border:1px solid #e3c3f0a1; text-align:center; opacity:0;
}
.mr-travel[data-waiting="true"] .mr-travel-loading { opacity:1; transition:opacity .2s ease; }
.mr-travel-loading strong { font:700 1.35rem var(--serif,serif); letter-spacing:.1em; }
.mr-travel-loading p { margin:.37rem 0 1.22rem; }
.mr-travel-track { position:relative; }
.mr-travel-track progress { width:100%; height:.62rem; accent-color:#edc9f2; }
.mr-travel-walker {
  position:absolute; top:-22px; left:0; width:14px; height:22px; color:#ffe9fb;
  animation:mr-walker-traverse 2.5s ease-in-out infinite alternate;
}
.mr-travel-walker::before,.mr-travel-walker::after { content:''; position:absolute; background:currentColor; border-radius:50%; }
.mr-travel-walker::before { width:7px; height:7px; left:4px; }
.mr-travel-walker::after { width:6px; height:9px; top:7px; left:4px; border-radius:3px; }
.mr-travel-walker i { position:absolute; top:14px; left:6px; width:2px; height:8px; background:currentColor; transform-origin:50% 0; animation:mr-walker-step .45s ease-in-out alternate infinite; }
.mr-travel-walker i:nth-child(2n) { animation-direction:alternate-reverse; }
.mr-travel-walker i:nth-child(n+3) { top:8px; height:7px; }
@keyframes mr-travel-cover { from {opacity:0} to {opacity:1} }
@keyframes mr-travel-arch { from { transform:translateZ(-1200px); opacity:0 } 28% { opacity:.72 } to { transform:translateZ(360px); opacity:0 } }
@keyframes mr-walker-step { from {transform:rotate(-34deg)} to {transform:rotate(33deg)} }
@keyframes mr-walker-traverse { to {left:calc(100% - 14px)} }
@media (prefers-reduced-motion:reduce) {
  .mr-game .mr-hud-button,.mr-game .mr-hud-label { transition:none; }
  .mr-game .mr-game-drawer:not([hidden]) { animation:none; }
}
.mr-hud-place h1:focus { outline:none; }
@media (pointer:coarse) {
  .mr-hud-menu .mr-hud-label[data-short] { font-size:0; }
  .mr-hud-menu .mr-hud-label[data-short]::after { content:attr(data-short); font-size:.56rem; }
}
/* Blur the surface only so tooltips stay outside the icon hit area. */
.mr-game .mr-hud-button { isolation:isolate; backdrop-filter:none; overflow:visible; }
.mr-game .mr-hud-button::before {
  content:''; position:absolute; z-index:-1; inset:0; border-radius:inherit; backdrop-filter:blur(8px);
}
.mr-game .mr-drawer-bar { background:#f9f0fa; }

/* XREA 広告欄（画面下端）の上までをゲーム画面として使う */
#dt-page.dtp-game { height: calc(100dvh - var(--ad-h, 0px)); }
