html, body { margin: 0; height: 100%; background: #0b0710; overflow: hidden; }
#app {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #0b0710;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
#playArea { width: 100%; flex: none; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#controlsDock {
  box-sizing: border-box; flex: none; width: 100%; padding: 9px max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(180deg, #261c31, #15101d); color: #f7f1e8;
  border-top: 2px solid #9e7955; box-shadow: 0 -5px 20px #0005;
  font: 14px/1.5 "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
}
#controlsDock[hidden], .touch-mode #controlsDock, .touch-mode .guide-setting { display: none; }
.view-options { display: flex; justify-content: center; gap: .6em; margin: .8em 0 .3em; flex-wrap: wrap; }
.view-options .sub { font-size: .85em; padding: .35em .9em; }
.audio-options { margin: .45em 0; font-size: .85em; }
.audio-options summary { cursor: pointer; color: #6e2336; text-align: center; }
.audio-sliders { display: flex; flex-wrap: wrap; justify-content: center; gap: .6em 1.3em; margin: .7em 0; font-size: .85em; }
.audio-sliders label { display: flex; align-items: center; gap: .5em; }
.audio-sliders input { width: 8em; accent-color: #a12c43; touch-action: pan-x; }
.audio-sliders output { min-width: 2.8em; text-align: right; }
#audioStatus { color: #7a1a2e; font-size: .8em; text-align: center; }
.dock-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 5px; color: #f7db9b; font-size: 11px; letter-spacing: .04em; }
.dock-heading strong { font-size: 12px; }
#controlMode { border: 1px solid #8b7154; border-radius: 4px; padding: 0 5px; color: #fff2d4; }
.stage-name { margin-left: auto; color: #f7db9b; }
.stage-name small { color: #dfc8b7; margin-left: 5px; font-size: 11px; }
.dock-pause { color: #ded2e2; }
.key-row { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.key-row + .key-row { margin-top: 5px; }
.player-tag { min-width: 23px; font-weight: bold; color: #ffb5b7; }
.key-row.p2 .player-tag { color: #9fd9ff; }
.key-group { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.key-group .key-label { margin-right: 3px; color: #f7f1e8; }
kbd { font: 700 12px/1.4 "Yu Gothic UI", monospace; min-width: 15px; text-align: center; display: inline-block; padding: 0 4px; border: 1px solid #887a91; border-bottom: 2px solid #b4a4b8; border-radius: 4px; color: #fff; background: #3b3047; }
.key-alt { color: #bcb0c5; font-size: 10px; }
#controlMoves { display: flex; flex-wrap: wrap; gap: 2px 17px; margin-top: 6px; color: #e0d4e4; font-size: 12px; }
#controlMoves b { color: #f7db9b; font-weight: 600; }
#controlMoves span { white-space: nowrap; }
@media (max-width: 950px) {
  #controlsDock { padding-top: 6px; padding-bottom: max(7px, env(safe-area-inset-bottom)); font-size: 12px; }
  .dock-heading { margin-bottom: 3px; }
  .key-row { gap: 3px 10px; }
  kbd { font-size: 11px; min-width: 12px; padding: 0 3px; }
  #controlMoves { font-size: 11px; gap: 2px 10px; margin-top: 4px; }
}
@media (pointer: coarse) and (orientation: landscape) {
  #controlsDock { font-size: 11px; }
  .dock-heading { font-size: 10px; }
  .dock-heading strong { font-size: 11px; }
  .dock-pause, .stage-name small { display: none; }
}
#stage {
  position: relative; overflow: hidden; box-sizing: border-box;
  font-size: calc(16px * var(--s, 1));
  font-family: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
}
#screen { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#titleScreen { z-index: 4; background: #100b18; }
#titleArt { position: absolute; inset: 0; width: 100%; height: 96%; object-fit: contain; pointer-events: none; }
#titleScreen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 70%, #080510aa); }
.title-actions { position: absolute; z-index: 1; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); bottom: max(1.5%, env(safe-area-inset-bottom)); text-align: center; }
.home-modes { display: flex; justify-content: center; align-items: center; gap: clamp(7px, 1.2vw, 18px); }
.title-actions .big { min-height: 44px; font-size: clamp(16px, 1.4em, 22px); padding: .45em 1.3em; border: 2px solid #ffdf8a; border-radius: 6px; background: linear-gradient(#b42b3c, #671424); box-shadow: 0 3px 0 #260a16, 0 0 22px #120719; white-space: nowrap; }
.title-actions .sub { min-height: 44px; border-color: #dfc5a1; border-radius: 6px; background: #161022dd; color: #fff3db; font-size: clamp(14px, 1em, 18px); padding: .5em .9em; white-space: nowrap; }
.home-summary { color: #fff3db; font-size: max(10px, .7em); margin: .5em 0 0; text-shadow: 0 2px 3px #000; }
.touch-mode .local-versus { display: none; }
@media (max-height: 360px) { .title-actions .big { padding: .35em .9em; font-size: 16px; } .home-summary { display: none; } }
#titleStatus { font-size: max(11px, .75em); margin: .4em 0 0; color: #fff0cd; text-shadow: 0 2px 3px #000; }
#titleStatus:empty { display: none; }

.ov {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 6, 16, .45);
}
.ov[hidden], #touch[hidden], #bar[hidden], #rotate[hidden] { display: none; }
.card {
  box-sizing: border-box; width: 40em; max-width: 96%; max-height: 94%; overflow: auto;
  background: rgba(255, 250, 242, .97); color: #2a1a22;
  border-radius: 1em; padding: 1em 1.5em; box-shadow: 0 .5em 2em rgba(0, 0, 0, .55);
}
.card.small { width: 26em; text-align: center; }
.action-card { display: flex; flex-direction: column; overflow: hidden; }
.action-card h2 { flex: none; margin: .25em 0 .5em; }
.card-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.card-actions { flex: none; flex-wrap: wrap; }
.touch-mode .action-card { font-size: 14px; padding: 12px; }
.touch-mode .action-card button { box-sizing: border-box; min-height: 44px; min-width: 44px; font-size: 14px; }
.touch-mode .action-card .big { font-size: 18px; }
.touch-mode .action-card .view-options, .touch-mode .action-card .audio-sliders { font-size: 14px; margin: .35em 0; }
.touch-mode .action-card .audio-sliders label { min-height: 44px; }
.touch-mode .action-card input[type="range"] { min-height: 44px; }
.super-note { font-size: max(13px, .85em); line-height: 1.5; margin: .6em 0; color: #5a3a46; }
.menu-card { display: flex; flex-direction: column; overflow: hidden; width: 48em; font-size: max(13px, 1em); }
.menu-card h1 { flex: none; font-size: 1.5em; margin-bottom: .5em; }
.menu-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; padding: .15em .3em .3em 0; }
.menu-actions { flex: none; padding-top: .65em; margin-top: .5em; border-top: 1px solid #dbc5ba; }
.fighter-info { font-size: .85em; line-height: 1.5; margin: .3em 0 .15em; white-space: pre-line; }
.touch-mode .menu-card { font-size: 14px; }
.touch-mode .menu-card .grid { grid-template-columns: 4.7em minmax(0,1fr); gap: .6em; }
.touch-mode .menu-card .opts button { min-height: 40px; }
.touch-mode .menu-card .opts.roster button { font-size: .9em; }
.touch-mode .menu-actions button { min-height: 44px; }
h1 { margin: 0 0 .6em; font-size: 1.7em; color: #9e1f36; letter-spacing: .04em; }
.tag { font-size: .5em; vertical-align: middle; background: #2a1a22; color: #fff; border-radius: 1em; padding: .15em .7em; }
.grid { display: grid; grid-template-columns: 6.5em 1fr; gap: .45em .8em; align-items: center; }
.lbl { font-weight: 700; color: #5a3a46; }
.opts button {
  font: inherit; font-size: 1em; padding: .35em .9em; margin: 0 .35em .2em 0; cursor: pointer;
  border-radius: 2em; border: 2px solid #b8324a; background: #fff; color: #9e1f36;
}
.opts button.on { background: #b8324a; color: #fff; }
.opts.roster { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: .3em; }
.opts.roster button { font-size: .82em; margin: 0; padding: .35em .12em; border-radius: .5em; }
.opts.stages button { font-size: .83em; padding: .35em .65em; }
@media (max-width:600px) { .opts.roster { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.row-start { display: flex; gap: .8em; justify-content: center; align-items: center; margin-top: .9em; }
.menu-actions { gap: .55em; }
.menu-actions .sub { padding-left: .7em; padding-right: .7em; white-space: nowrap; }
.big {
  font: inherit; font-size: 1.35em; font-weight: 700; padding: .45em 2em; cursor: pointer;
  border-radius: 2em; border: 0; background: linear-gradient(#d23a52, #9e1f36); color: #fff;
  box-shadow: 0 .2em 0 #5e0f1f;
}
.sub {
  font: inherit; font-size: 1em; padding: .45em 1.2em; cursor: pointer;
  border-radius: 2em; border: 2px solid #5a3a46; background: #fff; color: #3a2430;
}
.help { margin-top: .8em; font-size: .86em; line-height: 1.6; color: #3a2430; }
.card { touch-action: pan-y; overscroll-behavior: contain; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible { outline: 3px solid #2a65b7; outline-offset: 3px; }
#artStatus { margin: .7em 0 0; text-align: center; font-size: .85em; }
.credit { margin: .6em 0 0; font-size: .7em; line-height: 1.5; color: #5a3a46; }
.help table { border-collapse: collapse; width: 100%; }
.help td { padding: .1em .5em; border-bottom: 1px solid #ead9d0; vertical-align: top; }
.help td:first-child { white-space: nowrap; font-weight: 700; color: #7a1a2e; }
#rtext { font-size: 1.8em; font-weight: 700; color: #9e1f36; margin: .2em 0 .2em; }
#rsub { margin: 0 0 .4em; color: #3a2430; }

/* スマホの画面ボタン */
#touch { position: absolute; inset: 0; pointer-events: none; }
#tpad {
  position: absolute; left: max(2.5%, env(safe-area-inset-left)); bottom: max(4%, env(safe-area-inset-bottom)); width: max(124px, 9.5em); height: max(124px, 9.5em);
  border-radius: 50%; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .35);
  pointer-events: auto; touch-action: none;
}
#tknob {
  position: absolute; left: 50%; top: 50%; width: 40%; height: 40%; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(255, 255, 255, .45);
}
#tbtns {
  position: absolute; right: max(2.5%, env(safe-area-inset-right)); bottom: max(4%, env(safe-area-inset-bottom)); pointer-events: auto;
  display: grid; grid-template-columns: repeat(2, max(62px, 4.7em)); gap: max(10px, .7em);
}
.tb {
  width: 100%; aspect-ratio: 1; border-radius: 50%; padding: 0;
  border: 2px solid rgba(255, 255, 255, .6); background: rgba(158, 31, 54, .62); color: #fff;
  font: inherit; font-weight: 700; font-size: max(16px, 1.2em); touch-action: none;
}
.tb.sp { font-size: max(13px, .95em); background: rgba(120, 70, 10, .7); }
.tb.on { background: rgba(255, 214, 90, .9); color: #3a1a00; }

#bar { position: absolute; left: 50%; bottom: 1%; transform: translateX(-50%); display: flex; gap: .4em; }
.touch-mode #bar { bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 8px)); gap: 4px; }
.touch-mode #bar button { min-width: 44px; min-height: 44px; }
#bar button {
  font: inherit; font-size: max(14px, .9em); width: 2.4em; height: 2.4em; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .35); color: #fff;
}
#bar button.wide { width: auto; min-width: 4.3em; padding: 0 .65em; border-radius: 1.3em; font-size: max(12px, .8em); }

#rotate {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: #1a0f18; color: #fff; font-size: 22px; text-align: center;
}
