:root {
  --bg: #10142a;
  --ink: #e8ebf2;
  --muted: #adb3c6;
  --line: #454c66;
  --panel: #1a1c24;
  --accent: #ffd23f;
  --hot: #f27d1e;
  --cool: #80f2ff;
  --tb: 0px;          /* set from the measured visible area in shell.html (vh / svh were wrong on iPhone Chrome) */
  --amix-orient-bg: rgba(16, 20, 42, .96);
}
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #000; color: var(--ink);
  touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
canvas { image-rendering: pixelated; }

/* ---------- boot screen (same 3:5 rectangle the game will use) */
#pyxel-boot { position: fixed; inset: 0 0 var(--tb) 0; z-index: 999; cursor: pointer; background: transparent; }
#boot-screen {
  position: absolute; left: 50%; top: 50%;
  width: min(var(--vw, 100vw), calc(var(--vh, 100vh) * .6)); height: min(var(--vh, 100vh), calc(var(--vw, 100vw) * 1.66667));
  transform: translate(-50%, -50%);
  overflow: hidden; box-sizing: border-box;
  background:
    linear-gradient(180deg, #10142a 0%, #18287e 46%, #7b3cca 60%, #262b44 61%, #10142a 100%);
  font-family: 'DotGothic16', monospace; text-align: center;
  animation: crt-on .7s cubic-bezier(.2, .7, .3, 1) both;
  container-type: size;
}
@keyframes crt-on {
  0% { transform: translate(-50%, -50%) scale(0, .004); filter: brightness(12); }
  40% { transform: translate(-50%, -50%) scale(1, .004); filter: brightness(8); }
  85% { transform: translate(-50%, -50%) scale(1, 1); filter: brightness(1.6); }
  100% { transform: translate(-50%, -50%) scale(1, 1); filter: brightness(1); }
}
#boot-shots, #boot-shots img, #boot-shade { position: absolute; inset: 0; }
#boot-shots img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0; }
#boot-shots img.on { opacity: 1; }
#boot-screen.cut #boot-shots { animation: cut .22s steps(2) 1; }
@keyframes cut { 0% { filter: brightness(2.2) saturate(.4); transform: translateX(1.5%); } 100% { filter: none; transform: none; } }
#boot-shade {
  background: linear-gradient(180deg, rgba(10,10,20,.82) 0%, rgba(10,10,20,.55) 30%, rgba(10,10,20,0) 46%, rgba(10,10,20,0) 54%, rgba(10,10,20,.9) 69%, rgba(10,10,20,.93) 92%, rgba(10,10,20,.88) 100%);   /* darker under INSERT COIN / TAP TO START so the stills' own text does not show through */
}
#boot-screen.coin #boot-shots { filter: brightness(.55); transition: filter .4s; }
#boot-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }
#boot-logo { position: absolute; left: 0; top: 2%; width: 100%; height: auto; image-rendering: pixelated; }
#boot-sub { position: absolute; left: 0; right: 0; top: 30%; margin: 0; font-size: 4.6cqw; color: #adb3c6; text-shadow: 0 .5cqw 0 #000; }
#boot-coin { position: absolute; left: 0; right: 0; top: 76%; margin: 0; font-size: 6cqw; color: #ffd23f; animation: blink 1.06s steps(1) infinite; text-shadow: 0 .6cqw 0 #000; }
#boot-press { position: absolute; left: 0; right: 0; top: 84%; margin: 0; font-size: 4.6cqw; color: #80f2ff; text-shadow: 0 .5cqw 0 #000; }
#boot-press.go { top: 78%; font-size: 6cqw; color: #ffd23f; animation: blink .8s steps(1) infinite; }
#boot-press .sp { display: none; }
html.touch #boot-press .sp { display: inline; }
html.touch #boot-press .pc { display: none; }
#boot-load { position: absolute; left: 0; right: 0; top: 77%; margin: 0; font-size: 6cqw; color: #ffd23f; text-shadow: 0 .6cqw 0 #000; animation: blink .32s steps(1) infinite; }
#boot-load i { display: block; width: 26cqw; height: 1.4cqw; margin: 3cqw auto 0; background: linear-gradient(90deg, #ffd23f 0 30%, #454c66 30% 100%); background-size: 200% 100%; animation: sweep .9s ease-in-out infinite alternate; }
#boot-err { position: absolute; left: 0; right: 0; top: 77%; margin: 0; font-size: 5cqw; color: #d8283c; line-height: 1.5; }
#boot-credit { position: absolute; right: 4cqw; bottom: 3cqw; margin: 0; font-size: 3.6cqw; color: #737a94; }
html.touch #boot-credit { bottom: calc(3cqw + 34px); }   /* the footer sits along the bottom on phones */
#boot-glass {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 8%, rgba(255,255,255,.07), transparent 45%),
    radial-gradient(ellipse at 50% 45%, transparent 62%, rgba(0,0,0,.5) 100%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 2px, transparent 2px 4px);
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
html.pyxel-boot-wait #site-footer { z-index: 1001; }
html.pyxel-boot-wait .modal { z-index: 1002; }

/* ---------- touch controls */
#pad { position: fixed; inset: 0; z-index: 15; pointer-events: none; display: none; }
html.touch #pad.active { display: block; }
#stick {
  position: absolute; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(26px + env(safe-area-inset-bottom, 0px) + var(--tb));
  width: 128px; height: 128px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,28,36,.35) 0 55%, rgba(26,28,36,.6) 56% 100%);
  border: 2px solid rgba(173,179,198,.45);
  pointer-events: auto; touch-action: none;
}
#knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #737a94, #343846); border: 2px solid #adb3c6; box-sizing: border-box;
}
#btns {
  position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px) + var(--tb));
  width: 156px; height: 150px; pointer-events: none;
}
.pb {
  position: absolute; width: 66px; height: 66px; border-radius: 50%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  font: 20px/1 'DotGothic16', monospace; color: #fff;
  background: rgba(26,28,36,.55); border: 3px solid rgba(232,235,242,.55);
  pointer-events: auto; touch-action: none;
}
.pb.small { width: 54px; height: 54px; font-size: 12px; }
.pb.on { background: rgba(255,210,63,.6); border-color: #ffd23f; color: #1a1c24; }
#b-l { left: 0; top: 0; border-color: rgba(128,242,255,.7); }
#b-r { right: 0; top: 22px; border-color: rgba(242,125,30,.8); }
#b-dash { left: 8px; bottom: 0; }
#b-jump { right: 12px; bottom: -6px; }
/* top right, just under the HP bars (the HUD ends at about 11 % of the game screen). It used to sit
   at the bottom centre between the stick and DASH and got tapped by mistake (2026-11-08). The game
   screen is the 3:5 box centred in the visible area: --gw / --gh below are its size. */
#pad { --gw: min(var(--vw, 100vw), calc(var(--vh, 100vh) * .6)); --gh: min(var(--vh, 100vh), calc(var(--vw, 100vw) * 1.66667)); }
#b-pause {
  position: absolute;
  right: calc((var(--vw, 100vw) - var(--gw)) / 2 + 8px);
  top: calc((var(--vh, 100vh) - var(--gh)) / 2 + var(--gh) * .125);
  width: 44px; height: 36px; border-radius: 8px; pointer-events: auto; touch-action: manipulation;
  font: 16px/1 'DotGothic16', monospace; color: #e8ebf2; background: rgba(26,28,36,.6); border: 2px solid rgba(173,179,198,.5);
}

/* ---------- dialogs */
.dlg {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(8, 9, 20, .78);
  -webkit-user-select: text; user-select: text; touch-action: manipulation;
}
.dlg-panel {
  width: 100%; max-width: 420px; box-sizing: border-box; padding: 20px 20px 16px;
  background: #1a1c24; border: 2px solid #454c66; border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.5);
  font: 14px/1.75 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; color: #e8ebf2;
}
.dlg-panel h2 { margin: 0 0 10px; font: 18px/1.3 'DotGothic16', monospace; color: #ffd23f; letter-spacing: .06em; }
.dlg-body { display: none; }
.dlg[data-kind="share"] .dlg-body[data-kind="share"],
.dlg[data-kind="enter"] .dlg-body[data-kind="enter"],
.dlg[data-kind="name"] .dlg-body[data-kind="name"] { display: block; }
.dlg-code {
  margin: 4px 0 12px; padding: 10px 8px; text-align: center; letter-spacing: .08em;
  font: 22px/1.3 'DotGothic16', monospace; color: #80f2ff; background: #10142a; border: 1px solid #454c66; border-radius: 6px;
  -webkit-user-select: all; user-select: all; word-break: break-all;
}
.dlg-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.dlg-row input {
  flex: 1 1 180px; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 10px;
  font: 18px/1.2 'DotGothic16', monospace; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: #10142a; border: 2px solid #737a94; border-radius: 6px;
}
.dlg-row input:focus { outline: none; border-color: #ffd23f; }
.dlg button {
  min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 14px/1.2 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", sans-serif;
  color: #e8ebf2; background: #262b44; border: 1px solid #737a94;
}
.dlg button:focus-visible { outline: 3px solid #80f2ff; outline-offset: 2px; }
.dlg button.main { background: #ffd23f; color: #1a1c24; border-color: #ffd23f; font-weight: 700; }
.dlg-note { margin: 6px 0; color: #adb3c6; font-size: 13px; }
.dlg-err { margin: 4px 0; color: #ff9fca; font-size: 13px; }
.dlg-toast { min-height: 1.4em; margin: 6px 0 0; color: #95dd3e; font-size: 13px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg-import { margin-top: 12px; color: #adb3c6; font-size: 13px; }
.dlg-import summary { cursor: pointer; padding: 6px 0; }

/* ---------- footer, modals (same as the other AMIX Pyxel games) */
#site-footer {
  display: flex; flex-wrap: wrap; row-gap: 6px; max-width: calc(100% - 44px);
  position: fixed; left: 10px; bottom: calc(8px + env(safe-area-inset-bottom, 0px) + var(--tb)); z-index: 20;
  font: 11px/1 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: #8f96b3; background: rgba(12, 14, 30, .78); padding: 6px 12px; border-radius: 999px;
  letter-spacing: .02em; white-space: nowrap;
}
#site-footer .footer-group { white-space: nowrap; }
#site-footer a { color: #c9cfe8; text-decoration: none; padding: 4px 2px; }
#site-footer a:hover { color: #ffd23f; }
#site-footer .sep { margin: 0 6px; color: #4a5070; }
.modal {
  display: none; position: fixed; inset: 0; z-index: 30; background: rgba(8, 9, 20, .72);
  align-items: center; justify-content: center; padding: 20px; -webkit-user-select: text; user-select: text;
  touch-action: pan-y pinch-zoom;
}
.modal-panel {
  background: #232742; color: #dde1f2; max-width: 460px; width: 100%; max-height: calc(var(--vh, 100vh) * .78); overflow-y: auto;
  border-radius: 12px; border: 1px solid #3c4266; padding: 22px 24px 18px;
  font: 13px/1.85 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.modal-panel h2 { margin: 0 0 12px; font-size: 15px; color: #ffd23f; letter-spacing: .06em; }
.modal-panel h3 { margin: 16px 0 4px; font-size: 13px; color: #80f2ff; }
.modal-panel p { margin: 6px 0; }
.modal-panel a { color: #a9c1ff; }
.modal-panel a.powered-by { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin: 2px 0 12px; padding: 10px 18px 12px; background: #eeeeee; border-radius: 6px; text-decoration: none; }
.modal-panel a.powered-by span { font: 10px/1 "SF Mono", Menlo, Consolas, monospace; letter-spacing: .24em; color: #2b335f; }
.modal-panel a.powered-by img { display: block; width: 152px; height: 64px; image-rendering: pixelated; }
.modal-panel pre.license-text {
  white-space: pre-wrap; font: 11px/1.7 "SF Mono", Menlo, Consolas, monospace; color: #b9bfd8;
  background: #1b1e35; border: 1px solid #3c4266; border-radius: 8px; padding: 12px 14px; margin: 8px 0;
}
.modal-close {
  display: block; margin: 16px auto 0; padding: 9px 28px; min-height: 44px;
  font: 13px -apple-system, BlinkMacSystemFont, sans-serif; color: #1a1c24; background: #ffd23f;
  border: 0; border-radius: 999px; cursor: pointer; touch-action: manipulation;
}
.kw { color: #ffd23f; }

/* ---------- key guide in the right margin (PC, wide windows only) */
#side-guide {
  position: fixed; left: calc(75% + 15vh - 120px); top: 50%; transform: translateY(-50%);
  z-index: 12; pointer-events: none; box-sizing: border-box; width: 240px; padding: 14px 16px 12px;
  background: #000; border: 2px solid #454c66; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 3px #262b44;
  font: 13px/1.4 'DotGothic16', monospace; color: #eee;
}
#side-guide .sg-head { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid #262b44; font-size: 11px; letter-spacing: .22em; color: #f27d1e; }
#side-guide ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
#side-guide li { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; }
#side-guide .keys { display: flex; gap: 3px; justify-content: flex-end; flex-wrap: wrap; }
#side-guide kbd {
  display: inline-block; min-width: 18px; padding: 2px 5px 1px; box-sizing: border-box;
  font: 11px/1.3 'DotGothic16', monospace; text-align: center; color: #ffd23f;
  background: #262b44; border: 1px solid #454c66; box-shadow: 0 2px 0 #000;
}
#side-guide li small { display: block; font-size: 10px; color: #a3a3a3; }
html.touch #side-guide { display: none !important; }
/* before the game starts the guide is shown dimmed, like the hangar walls */
html.pyxel-boot-wait #side-guide { opacity: .55; }
#side-guide { transition: opacity .8s; }

/* ---------- hangar wall in the PC margins (js/deco.js). Clicks pass through. */
canvas.side-deco { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; image-rendering: pixelated; transition: filter .8s; }
canvas.side-deco.dim { filter: brightness(.42); }
html.touch canvas.side-deco { display: none !important; }

/* ---------- online room (bottom sheet over the game; the game shows both robots above it) */
.ol { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tb)); transform: translateX(-50%);
  width: min(var(--vw, 100vw), calc(var(--vh, 100vh) * .6), 460px); z-index: 35; padding: 0 10px 10px; box-sizing: border-box;
  -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.ol-panel { background: rgba(14,20,48,.96); border: 2px solid #ffe13a; box-shadow: 0 -6px 30px rgba(0,0,0,.5); padding: 10px 14px 8px;
  font: 14px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; color: #e8ebf2; max-height: calc(var(--vh, 100vh) * .62); overflow-y: auto; }
.ol-panel h2 { margin: 0 0 8px; font: 18px/1 'DotGothic16', monospace; color: #ffe13a; letter-spacing: .1em; }
.ol-panel ul { margin: 6px 0; padding-left: 1.2em; font-size: 13px; color: #c4cce6; }
.ol-panel p { margin: 6px 0; }
.ol-sub { font-size: 12px; color: #a8b2d6; margin: 10px 0 2px !important; }
.ol-code { flex: 1 1 auto; font: 30px/1.1 'DotGothic16', monospace; letter-spacing: .24em; color: #8af6ff; margin: 0 !important; }
.ol-note { font-size: 12px; color: #a8b2d6; }
.ol-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; align-items: center; }
.ol-foot { justify-content: space-between; margin-top: 10px; }
.ol button { min-height: 44px; padding: 8px 14px; border-radius: 6px; cursor: pointer; font: 14px/1.2 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", sans-serif;
  color: #e8ebf2; background: #262b44; border: 1px solid #737a94; touch-action: manipulation; }
.ol button.main { background: #ffe13a; color: #1a1c24; border-color: #ffe13a; font-weight: 700; }
.ol button.wide { flex: 1 1 100%; }
.ol button.on { background: #2f6bff; border-color: #8af6ff; color: #fff; }
.ol button.link { background: none; border: 0; color: #8af6ff; text-decoration: underline; padding: 8px 0; }
.ol button:disabled { opacity: .45; cursor: default; }
.ol button:focus-visible { outline: 3px solid #8af6ff; outline-offset: 2px; }
.ol input[type=text] { flex: 1 1 140px; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 10px; font: 20px/1.2 'DotGothic16', monospace;
  letter-spacing: .2em; text-transform: uppercase; color: #fff; background: #10142a; border: 2px solid #737a94; border-radius: 6px; }
.ol-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
.ol-check input { width: 22px; height: 22px; }
.ol-status { min-height: 1.5em; margin: 8px 0 0 !important; font-size: 13px; color: #95dd3e; }
.ol-status.wait { color: #ffe13a; }
/* short phones: tighter spacing so the host's lobby panel stays below the robots' name strip
   (it covered the rival's name at 393x657). Buttons keep their 44px height. */
@media (max-height: 760px) {
  .ol-panel { padding: 8px 12px 6px; }
  .ol-panel h2 { margin-bottom: 4px; font-size: 16px; }
  .ol-sub { margin: 4px 0 0 !important; }
  .ol-row { margin: 4px 0; }
  .ol-code { font-size: 26px; }
  .ol-note { margin: 2px 0 !important; font-size: 11px; line-height: 1.5; }
  .ol-foot { margin-top: 4px; }
  .ol-status { margin-top: 2px !important; min-height: 1.2em; }
}

/* ライセンスの曲の一覧 */
.modal-panel .credit-list { margin: 6px 0 10px; padding: 0; list-style: none; }
.modal-panel .credit-list li { margin: 0 0 8px; line-height: 1.6; }
.modal-panel .credit-list b { font-weight: 700; }
