/*
 * Formerly linked Bootstrap 5.3.8 (bootstrap.min.css, ~232KB) only for the
 * four utility classes below. Inlining them here removes that whole
 * download — a meaningful chunk of the page's load weight on a kiosk that
 * may be on venue wifi.
 */
.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.alert {
  position: relative;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}
.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

:root {
  --navy: #052b60;
  --gold: #ffc600;
  --green: #8fc73e;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #071d3c;
  font-family: Arial, "PingFang TC", "Microsoft JhengHei", sans-serif;
}
html {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}
body {
  background: #052b60;
}
button,
img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
button {
  touch-action: manipulation;
}
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}
.puzzle-bg {
  --pz-knob-r: 49px;
  --pz-knob-rx: 64px;
  --pz-knob-ry: 49px;
  --pz-stroke: 11px;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.puzzle-bg svg {
  display: block;
  width: 100%;
  height: 100%;
}
.puzzle-bg .pz-seams {
  stroke: #fff;
  stroke-width: var(--pz-stroke);
  stroke-linecap: butt;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  visibility: hidden;
  pointer-events: none;
}
.screen.active {
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}
.logo,
.art,
.image-button img {
  height: auto;
  object-fit: contain;
}
.logo {
  position: absolute;
  left: 0;
  top: 0;
  height: 20vh;
}
.art {
  position: absolute;
}
.image-button {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  outline: none;
  transition: filter 0.15s;
  cursor: pointer;
}
.image-button img {
  width: 100%;
  display: block;
  height: 20vh;
  height: 20dvh;
}
.image-button:hover {
  filter: brightness(1.1);
}
.image-button:active {
  filter: brightness(0.95);
}
.image-button:focus,
.image-button:focus-visible {
  outline: none;
}
.image-button:disabled {
  opacity: 0.5;
  cursor: wait;
}
#home {
  background: url("../images/home.webp?v=20260916c-hln2-mu5gu8om") center center no-repeat;
  background-size: 100% auto;
}
#home .logo {
  left: 0;
    top: 0;
    width: 100%;
    right: 0;
    margin: 0 auto;
    height: 30dvh;
    height: 30vh;
}
.home-center {
  position: absolute;
  left: 50%;
  top: 22%;
  bottom: 3%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40%;
}
#home .mascot {
  position: relative;
  width: 100%;
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
  margin: 0;

    height: 50vh;
    height: 50dvh;
}
#entry-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: -8%;
  gap: 0.35vw;
}
#entry-form .employee {
  position: relative;
  left: auto;
  top: auto;
  width: 60%;
  height: 3.5vw;
}
#home-start {
  position: relative;
  left: auto;
  top: auto;
  width: 96%;
}
.employee {
  position: absolute;
  left: 37.76%;
  top: 75.926%;
  width: 24.479%;
  height: 6.852%;
  padding: 0 2%;
  gap: 1.04vw;
  border-radius: 50px;
  background: white;
  box-shadow: 0 0 0.73vw #fff8;
}
.employee img {
  width: 2.6vw;
  height: 2.6vw;
  object-fit: contain;
}
.employee input {
  min-width: 0;
  font-size: 1.15vw;
  padding: 0;
  color: #53575d;
  background: transparent;
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.employee input:focus,
.employee input:focus-visible {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.employee:focus-within {
  outline: 0.21vw solid var(--gold);
}
.rules-scatter {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.rules-scatter img {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w, 22%);
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}
.rules-scatter img:nth-child(1) {
  --x: 13%;
  --y: 34%;
  --w: 30%;
  --r: -28deg;
}
.rules-scatter img:nth-child(2) {
  --x: 30%;
  --y: 33%;
  --w: 28%;
  --r: 6deg;
}
.rules-scatter img:nth-child(3) {
  --x: 66%;
  --y: 33%;
  --w: 30%;
  --r: -28deg;
}
.rules-scatter img:nth-child(4) {
  --x: 85%;
  --y: 31%;
  --w: 28%;
  --r: 8deg;
}
.rules-scatter img:nth-child(5) {
  --x: 9%;
  --y: 56%;
  --w: 28%;
  --r: -4deg;
}
.rules-scatter img:nth-child(6) {
  --x: 21%;
  --y: 54%;
  --w: 26%;
  --r: -10deg;
}
.rules-scatter img:nth-child(7) {
  --x: 33%;
  --y: 61%;
  --w: 28%;
  --r: 18deg;
}
.rules-scatter img:nth-child(8) {
  --x: 11%;
  --y: 78%;
  --w: 28%;
  --r: -38deg;
}
.rules-scatter img:nth-child(9) {
  --x: 26%;
  --y: 81%;
  --w: 26%;
  --r: -18deg;
}
.rules-scatter img:nth-child(10) {
  --x: 40%;
  --y: 76%;
  --w: 26%;
  --r: 26deg;
}
.rules-scatter img:nth-child(11) {
  --x: 55%;
  --y: 58%;
  --w: 28%;
  --r: -16deg;
}
.rules-scatter img:nth-child(12) {
  --x: 70%;
  --y: 55%;
  --w: 26%;
  --r: 14deg;
}
.rules-scatter img:nth-child(13) {
  --x: 86%;
  --y: 53%;
  --w: 28%;
  --r: 8deg;
}
.rules-scatter img:nth-child(14) {
  --x: 68%;
  --y: 74%;
  --w: 28%;
  --r: 18deg;
}
.rules-scatter img:nth-child(15) {
  --x: 85%;
  --y: 75%;
  --w: 26%;
  --r: 10deg;
}
.rules-scatter img:nth-child(16) {
  --x: 53%;
  --y: 74%;
  --w: 28%;
  --r: -10deg;
}
.rules-dim,
.play-dim,
.dim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
#rules .logo,
#rules .loading {
  z-index: 2;
}
.rules-panel {
  position: absolute;
  left: 0;
  top: 16.204%;
  width: 100%;
  z-index: 2;
  margin: 0 auto;
  right: 0;
  max-width: 1000px;
}
#rules .rule-art {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  display: block;
}
#rules-start {
  position: absolute;
  left: 50%;
  top: 100%;
  bottom: auto;
  width: 49.07%;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.loading {
  position: absolute;
  top: 94.444%;
  width: 100%;
  text-align: center;
  color: white;
  font-size: 1.15vw;
}
.loading:empty {
  display: none;
}
#game-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  touch-action: none;
}
#game-canvas canvas {
  display: block;
  touch-action: none;
}
.play-cover,
.success-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.success-cover {
  z-index: 1;
}
#play .logo,
#play .timer,
#play .controls {
  z-index: 3;
}
.timer {
  --num: 5.73vw;
  --unit: 3.54vw;
  position: absolute;
  left: auto;
  right: 2.2%;
  top: 2.2%;
  height: auto;
  display: flex;
  align-items: center;
  gap: 0.55vw;
  color: #fbbe0c;
  pointer-events: none;
}
.timer img {
  width: auto;
  height: calc(var(--num) + var(--unit) * 0.98);
  object-fit: contain;
  flex-shrink: 0;
}
.timer div {
  text-align: center;
  font-size: var(--unit);
  line-height: 0.98;
}
.timer strong {
  font-size: var(--num);
  display: block;
  line-height: 1;
}
.timer.urgent {
  color: #fbbe0c;
}
.controls {
  position: absolute;
  bottom: 1.852%;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  font-size: 1.3vw;
  text-shadow: 0 2px 6px #000;
  pointer-events: none;
}
.result-message {
  left: 18.75%;
  top: 17.13%;
  width: 62.5%;
}
.result-art {
  left: 0;
  bottom: 0;
  width: 100%;
  right: 0;
  max-width: 1400px;
  margin: 0 auto;
  height: auto;
}
#fail .result-message {
  left: 0;
  bottom: 0;
  right: 0;
  margin: 0 auto;
  height: 40vh;
}
#success .logo,
#success .art,
#success-home,
#fail .logo,
#fail .art,
#fail-home {
  z-index: 2;
}
#fail-home {
  left: 0;
  top: 44.907%;
  width: 100%;
  z-index: 2;
  right: 0;
  margin: 0 auto;
}
#success-home {
  right: 0;
    top: 0;
    width: 18.229%;
    z-index: 2;
}
#error {
  position: absolute;
  bottom: 1.852%;
  left: 25%;
  width: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8vw;
  font-size: 1.25vw;
}
#error[hidden] {
  display: none !important;
}
#error-retry {
  flex: 0 0 auto;
  border: 0;
  border-radius: 0.5vw;
  padding: 0.4vw 0.9vw;
  color: #fff;
  background: #c51b27;
  font-size: 1vw;
  font-weight: 700;
  cursor: pointer;
}
.popup {
  border: 0;
  border-radius: 1.4vw;
  padding: 2.4vw 2.8vw 2vw;
  width: 36vw;
  max-width: 90%;
  text-align: center;
  color: var(--navy);
  background: #fff;
  box-shadow: 0 0 2.4vw rgba(255, 198, 0, 0.45);
}
.popup::backdrop {
  background: rgba(5, 43, 96, 0.55);
}
.popup p {
  margin: 0 0 1.6vw;
  font-size: 1.9vw;
  font-weight: 700;
  line-height: 1.35;
}
.popup p span {
  display: block;
  margin-top: 0.35vw;
  font-size: 1.25vw;
  font-weight: 600;
  color: #53575d;
}
.popup-ok {
  border: 0;
  border-radius: 4vw;
  padding: 0.65vw 2.6vw;
  background: linear-gradient(#e02428, #c01418);
  color: #fff;
  font-size: 1.35vw;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.2vw 0.6vw rgba(192, 20, 24, 0.35);
}
.popup-ok:hover {
  filter: brightness(1.08);
}
.popup-ok:focus-visible {
  outline: 0.21vw solid var(--gold);
  outline-offset: 0.21vw;
}
#play {
  background: transparent;
}
#success .result-message {
  left: 0;
  top: 11.111%;
  width: 100%;
  right: 0;
  max-width: 52.083%;
  margin: 0 auto;
  height: auto;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
