@font-face {
  font-family: BagNoto;
  src: url('assets/NotoSansCJKtc-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: BagHand;
  src: url('assets/BagHand.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
:root { color-scheme: light; font-family: BagNoto, sans-serif; font-weight: 700; color: #172f4b; background: #172330; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { display: grid; place-items: center; }
[hidden] { display: none !important; }
#stage { position: relative; outline: none; flex: none; overflow: hidden; background: #f6f1e7; --scale: 1; }
canvas { display: block; width: 100%; height: 100%; }
button, input, select { font: inherit; }
button { color: #172f4b; background: #f6f1e7; border: 3px solid #172f4b; border-radius: 8px; padding: 16px 28px; cursor: pointer; white-space: nowrap; }
button:hover { background: #e6e2d8; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 5px solid #2c63ac; outline-offset: 5px; }
button.primary { background: #f6f1e7; color: #172f4b; }
button.primary:hover { background: #e6e2d8; }
button span { font-size: .66em; margin-left: 15px; opacity: .8; }
.translation { display: block; font-size: .62em; line-height: 1.2; margin-top: 4px; opacity: .85; }
#ready-controls { position: absolute; display: flex; flex-wrap: wrap; gap: 20px; width: 750px; transform: scale(var(--scale)); transform-origin: top left; font-size: 34px; }
#ready-controls { left: calc(120px * var(--scale)); top: calc(720px * var(--scale)); }
#ready-controls button { padding: 10px 28px; }
#ready-controls .text-button { padding: 0; font-size: 24px; }
#start { min-width: 284px; }
#start span { display: inline-block; margin: 0 10px 0 0; border: 2px solid #172f4b; border-radius: 3px; padding: 0 9px; opacity: 1; vertical-align: 3px; }
.text-button { border: 0; padding: 2px 0; font-size: 26px; width: 100%; text-align: left; background: none; }
.text-button:hover { background: none; text-decoration: underline; }
#intro-controls { position: absolute; left: calc(100px * var(--scale)); top: calc(950px * var(--scale)); width: 1000px; display: flex; align-items: center; gap: 35px; font-size: 32px; transform: scale(var(--scale)); transform-origin: top left; }
#intro-controls a { color: #172f4b; font-size: 23px; text-underline-offset: 6px; white-space: nowrap; flex-shrink: 0; }
#intro-controls button:disabled { opacity: .35; cursor: default; }
#intro-progress { font-size: 26px; white-space: nowrap; }
.message { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #f6f1e7; padding: 3%; font-family: system-ui, sans-serif; }
.message h1 { font-size: clamp(20px, 5vw, 86px); margin: 0 0 20px; }
.message p { font-size: clamp(14px, 2.2vw, 32px); }
.message button { font-size: clamp(14px, 2vw, 28px); }
.settings { position: absolute; inset: 5%; z-index: 5; display: grid; place-items: center; background: rgba(246,241,231,.97); border: 3px solid #172f4b; overflow: auto; }
.settings form { width: min(750px, 80%); font-size: clamp(13px, 1.8vw, 28px); padding: 20px; }
.settings h2 { font-size: 1.4em; margin: 0 0 .7em; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: .6em; }
.settings input, .settings select { border: 2px solid #172f4b; border-radius: 4px; padding: 8px; width: 55%; background: white; color: #172f4b; }
.settings p { font-size: .72em; }
.settings button { font-size: .85em; margin-right: 15px; padding: 8px 18px; }
.pause-controls { position: absolute; left: 50%; top: calc(720px * var(--scale)); transform: translate(-50%, -50%) scale(var(--scale)); display: flex; gap: 24px; font-size: 38px; }
.notice { position: absolute; left: 5%; bottom: 4%; max-width: 90%; margin: 0; padding: .6em 1em; background: #172f4b; color: #f6f1e7; font-size: clamp(14px, 1.8vw, 28px); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
