:root {
  color-scheme: dark;
  --night: #081820;
  --ink: #0d232a;
  --milk: #fff8de;
  --brass: #d3b77c;
  --line: rgba(222, 193, 132, .36);
  --book: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif CJK JP", "MS PMincho", serif;
  --ui: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; background: var(--night); color: var(--milk); font-family: var(--ui); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, canvas:focus-visible { outline: 3px solid #fff7b8; outline-offset: 3px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

.title-page { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100svh; overflow: hidden; background: #112a33; }
.cover-art, .cover-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cover-art { background: #102832 url("title.webp") center 46% / cover no-repeat; }
.cover-shade { background: linear-gradient(90deg, rgba(3,15,22,.86) 0%, rgba(4,19,27,.72) 19%, rgba(7,22,28,.30) 41%, transparent 66%), linear-gradient(0deg, rgba(3,14,19,.67), transparent 22%, transparent 83%, rgba(3,15,18,.32)); }
.title-bar { position: absolute; top: max(27px, var(--site-header-inset, env(safe-area-inset-top, 0px))); left: max(4.5%, env(safe-area-inset-left)); right: max(4.5%, env(safe-area-inset-right)); display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "publisher navigation sound"; align-items: center; gap: clamp(12px, 2.4vw, 34px); z-index: 2; }
.publisher { grid-area: publisher; display: inline-flex; align-items: center; gap: 10px; color: var(--milk); text-decoration: none; white-space: nowrap; font: 600 1.18rem/1.1 var(--book); letter-spacing: .19em; text-shadow: 0 1px 9px #001317; }
.publisher small { margin-top: 6px; display: block; font: 500 .58rem/1 Georgia, serif; letter-spacing: .18em; color: #f0ddb0; }
.publisher .imprint-mark { display: block; flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.title-bar .sound-switch { grid-area: sound; justify-self: end; }
.title-navigation { grid-area: navigation; display: flex; align-items: center; gap: 8px; }
.title-nav-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 12px; border: 1px solid #d3b77ca3; border-radius: 3px; background: #091c26ed; color: var(--milk); font: 600 .875rem/1.3 var(--ui); white-space: nowrap; text-decoration: none; }
.title-nav-link:hover { border-color: #eed398; background: #18343d; color: #fff0c4; }
.publisher:focus-visible, .title-nav-link:focus-visible { outline: 2px solid #ffe3a4; outline-offset: 3px; }
.sound-switch, .menu-switch { min-height: 42px; padding: 7px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: rgba(7,23,31,.75); font-size: .85rem; font-weight: 550; letter-spacing: .04em; border-radius: 30px; }
.sound-switch:hover, .menu-switch:hover { background: #19343b; border-color: #c5ab75; }
.sound-switch::before { content: ""; width: 16px; height: 15px; display: block; background: #e7d7aa; clip-path: polygon(0 35%,26% 35%,59% 5%,59% 94%,26% 66%,0 66%); }
.sound-switch::after { content: "×"; order: -1; position: absolute; line-height: 1; color: #ead9ac; font-size: .75rem; left: 24px; top: 50%; transform: translateY(-48%); }
.sound-switch { position: relative; }
.sound-switch[aria-pressed="true"]::after { content: ""; width: 5px; height: 10px; border-right: 1px solid #eed8a1; border-radius: 50%; left: 23px; }
.title-content { padding: 142px 0 120px; margin-left: 9.3%; width: max-content; max-width: 60%; text-align: left; }
.title-type { color: #f1dca7; font-size: .78rem; letter-spacing: .34em; display: flex; align-items: center; gap: 12px; font-weight: 650; margin-bottom: 1.6rem; }
.title-type i { width: 28px; height: 1px; background: #c7a76a; position: relative; }
.title-type i::before { content: ""; width: 4px; height: 4px; background: #e3bd78; position: absolute; left: 0; top: -1.5px; transform: rotate(45deg); }
.title-type i:last-child::before { right: 0; left: auto; }
h1 { font-family: var(--book); font-weight: 600; color: #fff8e2; line-height: 1.18; margin: 0; text-shadow: 0 2px 4px #142020, 0 5px 34px #152323; }
.title-name, .title-bell { display: block; }
.title-name { font-size: clamp(2rem, 3.5vw, 3.8rem); letter-spacing: .12em; }
.title-join, .title-no { font-size: .59em; font-weight: 500; }
.title-join { display: inline-block; margin-left: .08em; color: #e9d7aa; }
.title-bell { font-size: clamp(4.1rem, 7.3vw, 8.6rem); letter-spacing: .015em; margin: .02em 0 0 -.055em; }
.title-no { margin: 0 .045em; }
.title-ornament { display: flex; align-items: center; gap: 7px; height: 18px; margin: 14px 0 9px 1px; width: min(100%, 338px); color: #d9b97b; }
.title-ornament i { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(226,198,138,.18), #e3bb77); }
.title-ornament i:last-child { transform: rotate(180deg); }
.title-ornament span { width: 4px; height: 4px; border: 1px solid currentColor; transform: rotate(45deg); }
.title-ornament b { position: relative; height: 14px; width: 14px; border: 1px solid currentColor; border-radius: 50%; }
.title-ornament b::before { position: absolute; content: ""; width: 3px; height: 4px; border: solid currentColor; border-width: 0 0 1px 1px; top: 2px; left: 6px; }
.title-pitch { margin: 0; color: #ffefd0; font: 500 clamp(.94rem, 1.35vw, 1.14rem)/1.8 var(--book); letter-spacing: .1em; text-shadow: 0 1px 9px #061017; }
.title-actions { margin-top: 2.6rem; display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; }
.title-button { min-height: 50px; width: 208px; padding: 12px 20px; position: relative; font: 650 1.02rem var(--book); letter-spacing: .13em; background: linear-gradient(115deg, #f3deab, #dac28a 72%, #cfb279); color: #26332e; border: 1px solid #f3da9e; border-radius: 3px; outline: 1px solid rgba(241,215,152,.6); outline-offset: 3px; box-shadow: 0 6px 24px #05121870; transition: filter .16s, transform .16s; }
.title-button::before, .title-button::after { content: ""; position: absolute; width: 4px; height: 4px; background: #807345; top: calc(50% - 2px); transform: rotate(45deg); }
.title-button::before { left: 13px; }
.title-button::after { right: 13px; }
.title-button:hover { filter: brightness(1.1); }
.title-button:active { transform: translateY(1px); }
#continueBtn:not([hidden]) ~ #startBtn { background: #102930db; border-color: #9b8b69; color: #ede0bd; width: 150px; font-size: .9rem; outline: 0; }
#continueBtn:not([hidden]) ~ #startBtn::before, #continueBtn:not([hidden]) ~ #startBtn::after { display: none; }
.title-spine { position: absolute; left: 4.5%; right: 4.5%; bottom: max(27px,env(safe-area-inset-bottom)); height: 1px; background: linear-gradient(90deg,#ddc69580,transparent 45%, transparent 55%,#ddc69580); }
.title-spine::before, .title-spine::after { content: ""; width: 5px; height: 5px; background: #d5bc81; position: absolute; top: -2px; transform: rotate(45deg); }
.title-spine::after { right: 0; }

.game-page { min-height: 100vh; min-height: 100svh; display: grid; align-content: center; padding: max(24px,var(--site-header-inset, env(safe-area-inset-top, 0px))) max(4vw,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(4vw,env(safe-area-inset-left)); background: radial-gradient(ellipse at 22% 35%,#203d41 0%,transparent 63%), radial-gradient(ellipse at 85% 85%,#192c32 0%,#07161d 70%); }
.game-wrap { width: min(1080px,100%); margin: auto; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.place, .game-tools { display: flex; align-items: center; }
.place { gap: 13px; }
.game-tools { gap: 8px; }
.place h2 { font: 600 clamp(1.25rem, 2.3vw, 2rem)/1.35 var(--book); letter-spacing: .11em; margin: 0; }
.compass-mark { display: block; width: 26px; height: 26px; border: 1px solid #c5a86a; border-radius: 50%; position: relative; }
.compass-mark::before { content: ""; position: absolute; inset: 1px 7px; background: linear-gradient(#ebd5a2 0 50%,#9e8b66 50%); clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); transform: rotate(37deg); }
.menu-switch { border-radius: 5px; }
.menu-switch::before { content: ""; width: 13px; height: 15px; border: 1px solid #e9d5a1; border-radius: 1px 3px 3px 1px; box-shadow: inset 2px 0 #554c36; }
.play-grid { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(228px, .83fr); gap: clamp(20px, 3vw, 42px); align-items: center; }
.field-column, .control-column { min-width: 0; }
.field-column { align-self: start; }
.map-frame { position: relative; padding: 5px; background: linear-gradient(135deg,#c6a574,#2d403c 15%,#817451 50%,#263631 80%,#bd9c65); box-shadow: 0 8px 30px #001217a1; }
#mapCanvas { background: #173438; width: 100%; height: auto; display: block; aspect-ratio: 4/3; image-rendering: pixelated; touch-action: manipulation; cursor: crosshair; }
.map-inlay { position: absolute; inset: 2px; border: 1px solid #d1b27d66; pointer-events: none; }
.map-hint { line-height: 1.45; font-size: .87rem; letter-spacing: .025em; color: #d7d8c4; margin: 9px 1px 0; }
.hero-panel { display: flex; align-items: center; gap: 13px; padding: 15px 0 19px; border: solid var(--line); border-width: 1px 0; }
.cameo { flex: 0 0 42px; height: 50px; position: relative; display: grid; place-items: center; }
.cameo::before { content: ""; height: 34px; width: 34px; border-radius: 50%; background: repeating-conic-gradient(from -1deg,#ebd297 0 1deg,transparent 2deg 29deg), radial-gradient(circle at 40% 40%,#3c6564,#11282b); border: 2px solid #c5a36b; box-shadow: 0 0 0 2px #3e4c43,0 0 0 3px #a58c5a; }
.cameo::after { content: ""; position: absolute; width: 23px; height: 23px; border-radius: 50%; background: #264746; }
.cameo i { position: absolute; z-index: 1; width: 2px; height: 10px; background: #f2deac; top: 17px; left: 21px; transform: rotate(22deg); transform-origin: bottom; }
.cameo i::after { content: ""; position: absolute; right: 0; bottom: 0; width: 8px; height: 2px; background: #f2deac; transform: rotate(20deg); transform-origin: right center; }
.vitals { flex: 1; min-width: 0; }
.name-row, .hp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.name-row strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 1.12rem var(--book); letter-spacing:.05em; }
.name-row #heroLevel { flex:none; white-space:nowrap; }
#heroLevel { color: #e4cf9b; font: 600 .82rem Georgia, var(--ui); }
.hp-row { padding: 7px 0 3px; font: 550 .78rem var(--ui); letter-spacing: .06em; color: #c0d1c6; }
.hp-track { height: 5px; background: #050f12; border-radius: 3px; overflow: hidden; }
#hpFill { width: 100%; height: 100%; background: linear-gradient(90deg,#427469,#93c9a1); transition: width .25s; }
.objective-panel { margin: 24px 0; }
.objective-label, .modal-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 .78rem/1.4 var(--ui); letter-spacing: .13em; color: #e5c993; }
.objective-label i { width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg); }
#objective { font: 500 1.06rem/1.75 var(--book); margin: 6px 0 0; }
.controls { display: flex; align-items: center; justify-content: space-around; gap: 16px; }
.direction-pad { display: grid; grid-template-columns: repeat(3, 43px); grid-template-rows: repeat(3,40px); flex: none; position: relative; user-select: none; -webkit-user-select: none; }
.direction-pad button, .pad-center { border: 1px solid #778479; background: linear-gradient(155deg,#395455,#253c40); }
.direction-pad button { position: relative; display: grid; place-items: center; padding: 0; touch-action: none; }
.direction-pad button::before { content: ""; background: #ead9aa; width: 12px; height: 8px; clip-path: polygon(50% 0,100% 100%,0 100%); }
.direction-pad button:active, .direction-pad button:hover { background: #45605d; }
[data-dir="up"] { grid-area: 1/2; border-radius: 7px 7px 0 0; }
[data-dir="left"] { grid-area: 2/1; border-radius: 7px 0 0 7px; }
[data-dir="left"]::before { transform: rotate(-90deg); }
[data-dir="right"] { grid-area: 2/3; border-radius: 0 7px 7px 0; }
[data-dir="right"]::before { transform: rotate(90deg); }
[data-dir="down"] { grid-area: 3/2; border-radius: 0 0 7px 7px; }
[data-dir="down"]::before { transform: rotate(180deg); }
.direction-pad .pad-center { grid-area: 2/2; border: 0; background: radial-gradient(circle,#d0c296 0 2px,transparent 3px),#2d4445; }
.interact-btn { min-height: 54px; min-width: 90px; max-width: 150px; padding: 9px 12px; border: 1px solid #cfb480; border-radius: 5px; background: linear-gradient(150deg,#394e48,#263c39); box-shadow: inset 0 0 0 3px #263a38, inset 0 0 0 4px #827b59; font: 600 1rem/1.4 var(--book); letter-spacing: .04em; }
.interact-btn:hover { background: #40564a; }
.interact-btn:disabled { opacity: .58; }

.modal-overlay, .battle-overlay { position: fixed; inset: 0; z-index: 10; overflow: auto; }
.modal-overlay { display: grid; place-items: center; padding: max(20px,var(--site-top-inset, env(safe-area-inset-top, 0px))) max(18px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); background: #021118bd; backdrop-filter: blur(3px); }
.story-window { position: relative; width: min(100%,480px); padding: clamp(22px,4vw,39px); background: linear-gradient(140deg,#1d373d,#12292e 50%,#10252c); border: 1px solid #c1aa78; outline: 1px solid #8a795580; outline-offset: -5px; box-shadow: 0 12px 70px #0008; }
.story-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.story-heading .sound-switch { flex: none; min-height: 44px; font-size: .8rem; }
.audio-reader-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.modal-eyebrow:empty { display: none; }
.story-window h2 { margin: .3rem 0 .8rem; font: 600 clamp(1.45rem,3.7vw,2.1rem)/1.5 var(--book); letter-spacing: .05em; }
#modalText { font: 500 1.03rem/1.9 var(--book); white-space: pre-line; color: #f0e9d6; overflow-wrap: anywhere; }
.modal-actions { display: grid; gap: 9px; margin-top: 23px; }
.modal-actions button { border: 1px solid #98896c; border-radius: 3px; padding: 10px 14px; color: #f4ead0; background: #273c3e; min-height: 44px; font: 600 .97rem/1.5 var(--ui); }
.modal-actions button.primary, .modal-actions button:only-child { background: #dac190; border-color: #eed4a1; color: #1e302e; }
.modal-actions button:hover { filter: brightness(1.14); }
.modal-overlay.ending { background: linear-gradient(#10262079, #102028b3), url("title.webp") center / cover; }
.battle-overlay { z-index: 8; background: #0c1c24; }

@media (max-width: 780px) {
  .game-page { align-content: start; padding: max(12px,var(--site-header-inset, env(safe-area-inset-top, 0px))) max(14px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  .game-wrap { width: min(100%, 580px); }
  .game-heading { margin-bottom: 9px; padding-bottom: 9px; }
  .game-tools .sound-switch, .game-tools .menu-switch { min-height: 40px; }
  .game-tools .menu-switch { padding: 5px 10px; }
  .play-grid { display: block; }
  .map-frame { padding: 4px; }
  .map-hint { margin: 5px 1px 10px; }
  .control-column { display: grid; grid-template-columns: minmax(130px,.93fr) minmax(0,1.25fr); gap: 10px 14px; }
  .hero-panel { gap: 7px; padding: 6px 0; }
  .cameo { display: none; }
  .objective-panel { margin: 0; align-self: center; }
  #objective { font-size: .96rem; line-height: 1.45; margin: 3px 0 0; }
  .controls { grid-column: 1/-1; gap: 20px; justify-content: center; }
  .direction-pad { grid-template-columns: repeat(3,46px); grid-template-rows: repeat(3,41px); }
  .interact-btn { width: 114px; }
}
@media (max-width: 670px) and (orientation: portrait) {
  .title-page { justify-content: flex-end; }
  .cover-art { background-position: 77% top; background-size: auto 83%; }
  .cover-shade { background: linear-gradient(180deg, #07172140,transparent 14%,transparent 37%,#07182163 51%,#071821eb 73%,#071821 95%); }
  .title-bar { left: max(16px,env(safe-area-inset-left)); right: max(16px,env(safe-area-inset-right)); top: max(18px,var(--site-header-inset, env(safe-area-inset-top, 0px))); grid-template-columns: 1fr auto; grid-template-areas: "publisher sound" "navigation navigation"; gap: 8px; }
  .publisher { justify-self: start; font-size: 1rem; gap: 8px; }
  .publisher .imprint-mark { width: 46px; height: 46px; }
  .sound-switch { background: #0c232ddc; }
  .title-content { margin: clamp(280px,43svh,600px) auto 0; padding: 0 16px max(60px,calc(38px + env(safe-area-inset-bottom))); width: 100%; max-width: 100%; text-align: center; }
  .title-type { justify-content: center; margin-bottom: 13px; font-size: .74rem; letter-spacing: .29em; }
  .title-name { font-size: clamp(2rem,8.4vw,3.8rem); }
  .title-bell { font-size: clamp(3.8rem,15.4vw,6.8rem); line-height: 1.15; margin-left: 0; }
  .title-ornament { width: 208px; margin: 9px auto 5px; }
  .title-pitch { font-size: .95rem; line-height: 1.6; letter-spacing: .06em; }
  .title-actions { justify-content: center; gap: 10px; margin-top: 22px; }
  #continueBtn:not([hidden]), #continueBtn:not([hidden]) ~ #startBtn { flex: 0 1 43%; max-width: 180px; }
  .title-spine { bottom: max(22px,env(safe-area-inset-bottom)); left: 17px; right: 17px; }
}
@media (min-width: 781px) and (max-height: 700px) {
  .game-wrap { width: min(100%, 880px); }
  .game-page { padding-top: max(12px, var(--site-header-inset, env(safe-area-inset-top, 0px))); padding-bottom: 12px; }
}
@media (max-width: 380px) {
  .title-bar { grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; }
  .title-bar .publisher { gap: 6px; min-height: 44px; letter-spacing: .09em; }
  .title-bar .publisher .imprint-mark { width: 36px; height: 36px; }
  .title-bar .publisher small { font-size: .55rem; letter-spacing: .07em; }
  .title-bar .sound-switch { min-height: 44px; padding-inline: 8px; gap: 5px; letter-spacing: 0; }
  .title-bar .sound-switch::after { left: 18px; }
  .game-tools { gap: 4px; }
  .place { gap: 7px; }
  .compass-mark { width: 21px; height: 21px; }
  .game-heading h2 { letter-spacing: .035em; }
  .control-column { grid-template-columns: minmax(114px,.85fr) minmax(0,1.35fr); gap: 8px 10px; }
  .direction-pad { grid-template-columns: repeat(3,43px); grid-template-rows: repeat(3,39px); }
  .map-hint { font-size: .82rem; }
}
@media (orientation: landscape) and (max-height: 530px) {
  .title-content { padding: 75px 0 40px; }
  .title-name { font-size: 1.9rem; }
  .title-bell { font-size: 3.8rem; }
  .title-type, .title-ornament { margin-bottom: 4px; }
  .title-ornament { margin-top: 5px; }
  .title-actions { margin-top: 14px; }
  .title-bar { top: max(10px,var(--site-header-inset, env(safe-area-inset-top, 0px))); }
  .title-spine { bottom: 12px; }
  .game-wrap { max-width: 800px; }
  .game-page { padding-top: max(8px, var(--site-header-inset, env(safe-area-inset-top, 0px))); padding-bottom: 8px; }
  .game-heading { margin-bottom: 6px; padding-bottom: 5px; }
  .play-grid { display: grid; grid-template-columns: minmax(0,auto) minmax(195px,1fr); gap: 20px; }
  .field-column { max-width: min(56vw, calc((100svh - 95px)*1.333)); }
  .control-column { display: block; }
  .objective-panel { margin: 9px 0; }
  .hero-panel { padding: 3px 0 7px; }
  .controls { gap: 8px; }
  .direction-pad { grid-template-columns: repeat(3,36px); grid-template-rows: repeat(3,32px); }
  .interact-btn { min-width: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .title-button, #hpFill { transition: none; }
}

.sound-switch, .menu-switch, .game-tools .sound-switch, .game-tools .menu-switch { min-height: 44px; white-space: nowrap; }
.resume-meta { margin: 14px 0 0; max-width: 36em; font: 500 .86rem/1.6 var(--ui); color: #f2e8ce; text-shadow: 0 1px 8px #08191f; }
.save-status { display: flex; align-items: baseline; justify-content: flex-end; gap: .6em; margin: 12px 0 0; font: 500 .8rem/1.5 var(--ui); letter-spacing: .035em; color: #c4d3c6; }
.save-status:empty { display: none; }
.save-status::before { content: ""; align-self: center; width: .45em; height: .45em; flex: none; background: #b6cdb0; transform: rotate(45deg); }
.modal-overlay { display: flex; overscroll-behavior: contain; }
.story-window { flex: none; margin: auto; }
.story-window :is(p, ul, ol):last-child { margin-bottom: 0; }
#saveCode { display: block; width: 100%; min-height: 7em; max-height: 30vh; padding: 11px 13px; margin: 12px 0 0; font: 1rem/1.5 ui-monospace, Menlo, monospace; letter-spacing: .02em; color: #f4efd7; background: #091e23; border: 1px solid #a79167; border-radius: 4px; resize: vertical; }
#saveCode:focus-visible { outline: 2px solid #f3d695; outline-offset: 1px; }
.clue-list { list-style: none; padding: 0; margin: 12px 0; font-family: var(--ui); line-height: 1.55; white-space: normal; }
.clue-list li { padding: 9px 5px 9px 15px; font-size: .94rem; border-top: 1px solid #dbbc8036; position: relative; }
.clue-list li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: 5px; height: 5px; border: 1px solid #c5aa77; transform: rotate(45deg); }
.clue-list strong { font-family: var(--book); color: #ffe3ab; }

.tuning .story-window { background: radial-gradient(ellipse at 50% 0,#3b4d46,transparent 70%), linear-gradient(155deg,#1a3033,#10252d); }
.bell-register { margin: 14px 0 6px; padding: 9px 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; border-block: 1px solid #c6a77479; background: linear-gradient(90deg,transparent,#081f25bb,transparent); }
.bell-register > * { display: grid; place-items: center; min-height: 36px; position: relative; font: 600 1rem/1.25 var(--book); color: #ded4b6; border: 1px solid #718077; border-radius: 3px; background: #182e30; }
.bell-register > :empty::before { content: ""; width: 7px; height: 7px; border: 1px solid #9e9e80; transform: rotate(45deg); }
.bell-register > :is(.filled,[data-filled="true"]) { color: #ffe39c; background: #354a3f; border-color: #d2b574; box-shadow: inset 0 0 9px #eedb9d18; }
.tuning .modal-actions { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.tuning .modal-actions button:not([data-bell]) { grid-column: 1/-1; }
.tuning .modal-actions button[data-bell] { --bell-size: 23px; grid-column: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 75px; padding: 9px 3px; font: 600 .97rem/1.3 var(--book); color: #fff1c8; background: linear-gradient(140deg,#5a5b44,#3e4e46 57%,#313e3a); border: 1px solid #c3ab73; border-radius: 4px 4px 11px 11px; box-shadow: inset 0 1px #ecdfa33b, inset 0 -4px #0f262a66; }
.tuning .modal-actions button[data-bell]::before { content: ""; width: var(--bell-size); height: 22px; background: linear-gradient(90deg,#b89959,#f3dfa6 36%,#c4a260 68%,#e3cb8b); clip-path: polygon(44% 4%,56% 4%,60% 15%,71% 21%,78% 32%,84% 61%,92% 72%,100% 78%,100% 83%,0 83%,0 78%,9% 71%,16% 60%,23% 32%,31% 21%,40% 15%); }
.tuning .modal-actions button[data-bell]:nth-child(2) { --bell-size: 20px; }
.tuning .modal-actions button[data-bell]:nth-child(3) { --bell-size: 17px; }
.tuning .modal-actions button[data-bell]:active { transform: translateY(2px); background: #656b4e; }

@media (max-width: 780px) {
  .save-status { grid-column: 1/-1; margin: -3px 0 0; }
  .direction-pad { grid-template-columns: repeat(3,45px); grid-template-rows: repeat(3,44px); }
}
@media (max-width: 440px) and (orientation: portrait) {
  .sound-switch, .game-tools .menu-switch { font-size: .8rem; }
  .resume-meta { margin-top: 12px; font-size: .8rem; }
  .game-heading { gap: 5px; }
  .game-heading .place { gap: 7px; }
  .game-tools { gap: 4px; }
  .game-tools .sound-switch { padding-right: 10px; }
}
@media (max-width: 370px) {
  .game-heading .compass-mark { display: none; }
}

.transfer-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin: 8px 0 -8px; padding: 4px 4px; min-height: 44px; border: 0; background: transparent; color: #f1deaf; font: 500 .86rem/1.4 var(--ui); letter-spacing: .045em; text-shadow: 0 1px 8px #07171d; text-decoration: underline; text-decoration-color: #e7cc8366; text-underline-offset: 4px; }
.transfer-link::before { content: ""; height: 12px; width: 9px; background: #d5bb82; clip-path: polygon(0 0,100% 0,100% 100%,50% 72%,0 100%); }
.transfer-link:hover { color: #fff3ce; text-decoration-color: currentColor; }
.legacy-rpg-save { margin-top: .5rem; color: #e0d6bb; font: 500 .85rem/1.5 var(--ui); }
.legacy-rpg-save summary { width: fit-content; padding: .65rem .2rem; cursor: pointer; }
.legacy-rpg-save .transfer-link { margin: 0; }
@media (max-width: 780px) {
  .legacy-rpg-save summary { margin-inline: auto; }
}

.music-room{display:grid;gap:5px;min-width:0;white-space:normal}
.music-room p{margin:1px 0;font:400 .88rem/1.55 var(--ui,system-ui);color:#ded6be}
.music-room p.music-room-status{margin:9px 0 0;color:#f3e8cb;min-height:1.5em}
