:root { color-scheme: dark; font-family: system-ui, sans-serif; color: #fff5e7; background: #190e0a; }
* { box-sizing: border-box; }
body { margin: 0; }
/* Fit the intact artwork and composer into typical desktop windows. */
#interior { --scene-ratio: 1.7768; margin-inline: auto; }
body[data-host="onee"] #interior { --scene-ratio: 1.3333; }
.counter-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: .4rem; }
.counter-toolbar header, .counter-toolbar .text-size-control { margin: 0; }
.checkout-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
#checkout .checkout-actions button { margin: 0; }
#checkout-note { margin: 0; }
.checkout-terms { font-size: .86rem; line-height: 1.6; }
.checkout-terms summary { cursor: pointer; color: #ffe1a4; min-height: 28px; padding-block: .2rem; }
#interior #checkout { margin: 0 0 .45rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .8rem; }
#interior #checkout[hidden], #interior #refill[hidden] { display: none; }
#interior #refill { margin: 0 0 .4rem; }
#refill-note { margin: 0; }
@media (min-width: 641px) {
  main:has(#interior:not([hidden])) { margin-block: .4rem; }
  #interior { width: min(100%, max(560px, calc((100dvh - 245px) * var(--scene-ratio)))); }
  #interior form { margin-top: .35rem; }
}
a { color: #ffe1a4; text-underline-offset: .2em; }
.purchase-terms { color: #f3d7c4; line-height: 1.6; font-size: .9rem; }
.settings-page dl dt { font-weight: 700; color: #ffd991; margin-top: .8rem; }
.settings-page dl dd { margin-left: 0; }
body[data-host="onee"] { background: #200e24; color: #fff4df; }
body[data-host="onee"] .art { aspect-ratio: 1448 / 1086; background-image: url('/onee/counter.png'); }
body[data-host="onee"] .conversation { inset: 15% 49% 41% 8%; }
body[data-host="onee"] .conversation strong { color: #f0cf8c; }
body[data-host="onee"] .conversation .guest { color: #fff; }
body[data-host="onee"] .entrance { background: #321238; }
body[data-host="onee"] .entrance-art { background-image: linear-gradient(90deg, #220c26ed, #2e1035df 36%, #210b2870 53%, transparent 68%), url('/onee/counter.png'); }
main { width: min(100% - 2rem, 1120px); margin: 1.2rem auto; }
header { display: flex; align-items: baseline; flex-wrap: wrap; gap: .6rem 1rem; margin-bottom: .8rem; }
header span, small, strong { color: #ffd991; }
header a { color: #ffd991; text-underline-offset: .2em; }
h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.scene { position: relative; border: 1px solid #936342; border-radius: .65rem; overflow: hidden; }
.art { position: relative; aspect-ratio: 1672 / 941; background: url('/counter.png') center / 100% 100%; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.conversation { position: absolute; inset: 16% 48% 41% 10%; overflow: auto; padding: .4rem .65rem; overflow-wrap: anywhere; font-size: 18px; }
.conversation[data-text-size="large"] { font-size: 22px; }
.conversation[data-text-size="extra-large"] { font-size: 28px; }
.conversation strong { font-size: .8em; }
.text-size-control { display: flex; align-items: center; gap: .7rem; margin-bottom: .65rem; }
.text-size-control label { margin: 0; }
.text-size-control select { font: inherit; min-height: 44px; min-width: 6.5rem; padding: .4rem .7rem; color: #fff5e7; background: #321b16; border: 1px solid #ae784d; border-radius: .4rem; }
.conversation p { margin: 0 0 .65rem; line-height: 1.6; white-space: pre-wrap; }
.idle { color: #ffdfb8; }
.guest { color: white; }
strong { display: block; font-size: .82rem; }
form { margin-top: .8rem; }
label { display: block; margin-bottom: .3rem; }
.entry { display: flex; gap: .5rem; }
input, button { font: inherit; padding: .7rem .85rem; border-radius: .4rem; border: 1px solid #ae784d; }
input { min-width: 0; flex: 1; background: #321b16; color: inherit; }
button { background: #ffd894; color: #30150e; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid #ffd991; outline-offset: 2px; }
#status { margin: .4rem 0 0; min-height: 1.5em; color: #ffdbb4; }
#refill { margin-block: .75rem 1.25rem; }
#refill button { margin: .25rem .35rem .25rem 0; }
.entrance {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(29rem, 56vw, 39rem);
  overflow: hidden;
  border: 1px solid #a96c3b;
  border-radius: .65rem;
  background: #321310;
  box-shadow: 0 1rem 3rem #100603a0;
}
.entrance-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #190806ed, #260c09df 36%, #210b0870 53%, transparent 68%),
    url('/counter.png') center / cover no-repeat;
}
.entrance-sign { width: 55%; padding: clamp(1.4rem, 5.5vw, 4.4rem); }
#shop-title {
  color: #ffe1a4;
  font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  font-size: clamp(2.3rem, 5vw, 3.85rem);
  letter-spacing: .02em;
  line-height: 1.17;
  text-shadow: 0 2px 12px #160604;
  white-space: nowrap;
}
#shop-title span { display: block; font-size: .43em; letter-spacing: .12em; margin-bottom: .48em; }
.entrance-greeting {
  margin: 1.15rem 0 1.5rem;
  font-size: clamp(1.08rem, 2.35vw, 1.65rem);
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 2px 7px #180604;
}
.entrance-entry { max-width: 23rem; }
#admission-price { margin: 0 0 .55rem; font-size: 1.05rem; font-weight: 700; color: #ffe1a4; }
#admit-action {
  width: 100%;
  min-height: 3.45rem;
  padding: .6rem 1rem;
  border: 1px solid #ffd78b;
  background: #f5ca80;
  box-shadow: inset 0 1px #fff1c4;
  font-size: 1.2rem;
}
#admit-action:hover:not(:disabled) { background: #ffe3a9; }
#admission-consent { margin: .65rem 0 0; color: #f3d7c4; font-size: .9rem; line-height: 1.65; }
#admission-consent a { color: #ffe1a4; text-underline-offset: .2em; }
.entrance-settings { margin: .5rem 0 0; font-size: .9rem; }
.entrance-settings a, .settings-page a { color: #ffe1a4; text-underline-offset: .2em; }
.settings-page { max-width: 46rem; line-height: 1.65; }
#admission-status:not(:empty) { margin: .65rem 0 0; color: #ffd5bb; }
#admission-status:empty { margin: 0; }
#admission-policies { max-width: 46rem; margin: 1.4rem auto 0; padding: 1.25rem; line-height: 1.7; }
#admission-policies h2 { margin-top: 0; }
#checkout { margin-block: .75rem 1.25rem; }
#checkout button { margin: .25rem .35rem .25rem 0; }
#regular { margin-top: 1rem; border-top: 1px solid #936342; padding-block: .75rem; }
#regular summary { cursor: pointer; color: #ffd991; }
#memory-note dt { color: #ffd991; }
#memory-note dd { margin-inline-start: 0; margin-bottom: .6rem; overflow-wrap: anywhere; }
.memory-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
@media (max-width: 740px) {
  body[data-host="onee"] .entrance-art { background-image: linear-gradient(0deg, #321238, transparent 32%), url('/onee/counter.png'); }
  .entrance { display: block; min-height: auto; }
  .entrance-art {
    position: static;
    height: clamp(10rem, 38vw, 15rem);
    background: linear-gradient(0deg, #321310, transparent 32%),
      url('/counter.png') right 13% / 200% auto no-repeat;
  }
  .entrance-sign { width: 100%; padding: .7rem 1.15rem 1.25rem; }
  #shop-title { font-size: clamp(1.8rem, 8.5vw, 3rem); white-space: normal; }
  #shop-title span { font-size: .48em; }
  .entrance-greeting { margin: .65rem 0 1.25rem; }
  .entrance-entry { max-width: none; }
}
@media (max-width: 640px) {
  main { width: calc(100% - 1rem); margin: .65rem auto; }
  .art { aspect-ratio: 672 / 330; overflow: hidden; background: none; }
  .art canvas { inset: auto; left: -148.81%; top: -10%; width: 248.81%; height: auto; }
  .art::before { content: ''; position: absolute; inset: 0; background: url('/counter.png') right 15% / 248.81% auto no-repeat; }
  .art:has(canvas[data-ready])::before { display: none; }
  .conversation { position: static; height: clamp(16rem, 45dvh, 30rem); background: #391313; padding: .75rem; }
  body[data-host="onee"] .art { aspect-ratio: 672 / 330; background: none; }
  body[data-host="onee"] .art canvas { left: -100%; top: -8%; width: 200%; }
  body[data-host="onee"] .art::before { background-image: url('/onee/counter.png'); background-size: 200% auto; }
  body[data-host="onee"] .conversation { background: #351237; }
}

body[data-host="rumi-2000"] {background:#2d1029;color:#fff3f7;}
body[data-host="rumi-2000"] #interior {--scene-ratio:1.7768;}
body[data-host="rumi-2000"] .art {background-image:url('/rumi-2000/counter.png');}
body[data-host="rumi-2000"] .conversation {inset:16% 48% 43% 7%;}
body[data-host="rumi-2000"] .conversation strong {color:#ffd1eb;}
body[data-host="rumi-2000"] .entrance-art {background-image:linear-gradient(90deg,#350b2ff5,#350b2fe0 36%,#350b2f66 55%,transparent 72%),url('/rumi-2000/counter.png');}
@media(max-width:640px){body[data-host="rumi-2000"] .art {background:none;}body[data-host="rumi-2000"] .art::before {background-image:url('/rumi-2000/counter.png');}body[data-host="rumi-2000"] .conversation {background:#4b163d;}body[data-host="rumi-2000"] .entrance-art {background-image:linear-gradient(0deg,#321310,transparent 32%),url('/rumi-2000/counter.png');}}

body[data-host="grandma"] {background:#28150d;color:#fff3dd;}
body[data-host="grandma"] .art {background-image:url('/grandma/counter.png');}
body[data-host="grandma"] .conversation {inset:15% 45% 45% 7%;color:#482716;}
body[data-host="grandma"] .conversation .idle,body[data-host="grandma"] .conversation .guest {color:#482716;}
body[data-host="grandma"] .conversation strong {color:#7a361c;}
body[data-host="grandma"] .entrance-art {background-image:linear-gradient(90deg,#28120af0,#28120ae0 36%,#28120a70 55%,transparent 72%),url('/grandma/counter.png');}
body[data-host="grandma"] #shop-title {font-size:clamp(2rem,4vw,3.2rem);}
@media(max-width:640px){body[data-host="grandma"] .art{background:none;}body[data-host="grandma"] .art::before{background-image:url('/grandma/counter.png');}body[data-host="grandma"] .conversation{background:#f8e5c4;}body[data-host="grandma"] .entrance-art{background-image:linear-gradient(0deg,#321310,transparent 32%),url('/grandma/counter.png');}}

/* One portrait transform for the complete animated canvas and its still-image
   fallback. Host variables allow framing changes without touching eye/mouth data. */
@media (max-width: 640px) {
  body[data-host] {
    --portrait-image: url('/counter.png');
    --portrait-ratio: 1672 / 941;
    --portrait-width: 240%;
    --portrait-left: -135%;
    --portrait-top: 0px;
    --portrait-frame-ratio: 7 / 5;
  }
  body[data-host="onee"] { --portrait-image: url('/onee/counter.png'); --portrait-ratio: 1448 / 1086; }
  body[data-host="rumi-2000"] { --portrait-image: url('/rumi-2000/counter.png'); }
  body[data-host="grandma"] { --portrait-image: url('/grandma/counter.png'); }
  body[data-host] .art, body[data-host] .entrance-art {
    position: relative;
    height: auto;
    aspect-ratio: var(--portrait-frame-ratio);
    overflow: hidden;
    background: none;
  }
  body[data-host] .art canvas, body[data-host] .art::before, body[data-host] .entrance-art::before {
    position: absolute;
    inset: auto;
    left: var(--portrait-left);
    top: var(--portrait-top);
    width: var(--portrait-width);
    height: auto;
  }
  body[data-host] .art::before, body[data-host] .entrance-art::before {
    content: '';
    aspect-ratio: var(--portrait-ratio);
    background: var(--portrait-image) center / 100% 100% no-repeat;
  }
  body[data-host] .art:has(canvas[data-ready])::before { display: none; }
  body[data-host] .conversation { position: static; inset: auto; }
}

body[data-host="reiko-1985"] {background:#291016;color:#fff1df;}
body[data-host="reiko-1985"] .art {background-image:url('/reiko-1985/counter.png');}
body[data-host="reiko-1985"] .conversation {inset:18% 46% 42% 9%;}
body[data-host="reiko-1985"] .conversation strong {color:#f0cd88;}
body[data-host="reiko-1985"] .entrance-art {background-image:linear-gradient(90deg,#2c0d18f5,#2c0d18df 36%,#2c0d1870 55%,transparent 72%),url('/reiko-1985/counter.png');}
@media(max-width:640px){body[data-host="reiko-1985"]{--portrait-image:url('/reiko-1985/counter.png');}body[data-host="reiko-1985"] .art,body[data-host="reiko-1985"] .entrance-art{background:none;}body[data-host="reiko-1985"] .conversation{background:#401426;}}

body[data-host="butler"]{background:#171023;color:#fff1df;}
body[data-host="butler"] .art{background-image:url('/butler/counter.png');}
body[data-host="butler"] .conversation{inset:18% 43% 42% 10%;}
body[data-host="butler"] .conversation strong{color:#dbc5f0;}
body[data-host="butler"] .entrance-art{background-image:linear-gradient(90deg,#190c2bf5,#190c2bdf 36%,#190c2b70 55%,transparent 72%),url('/butler/counter.png');}
@media(max-width:640px){body[data-host="butler"]{--portrait-image:url('/butler/counter.png');--portrait-left:-112%;}body[data-host="butler"] .art,body[data-host="butler"] .entrance-art{background:none;}body[data-host="butler"] .conversation{background:#2c183e;}}
