html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #cfe3f5;
  font-family: "Sarabun", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

[hidden] { display: none !important; }

#app, #app canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#btnMode, #btnQuality {
  position: fixed;
  top: 10px;
  z-index: 5;
  padding: 8px 14px;
  border: 0;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
}
#btnMode { left: 50%; transform: translateX(-50%); }
#btnQuality { right: 10px; }

#debug {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 5;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #7CFC7C;
  font: 12px/1.4 Consolas, monospace;
  white-space: pre;
  pointer-events: none;
}

#watermark {
  position: fixed;
  right: 10px;
  bottom: 8px;
  z-index: 5;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#joy {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 5;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
  touch-action: none;
}
#joyKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4ecdf;
  color: #3a2a1c;
}
#loading .card {
  width: min(86vw, 420px);
  text-align: center;
}
#loading h1 {
  margin: 14px 0 4px;
  font-size: 38px;
}
#loading .badge {
  display: inline-block;
  padding: 6px 22px;
  background: #c62828;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  border-radius: 6px;
  letter-spacing: 1px;
}
#loading .date {
  margin-bottom: 16px;
  font-size: 16px;
  color: #6b5846;
}
#loading p {
  margin: 4px 0;
  font-size: 16px;
}
#bar {
  margin: 22px auto 18px;
  height: 8px;
  background: #d9cbb6;
  border-radius: 4px;
  overflow: hidden;
}
#barFill {
  width: 10%;
  height: 100%;
  background: #b5532e;
  transition: width 0.4s ease;
}
#btnEnter {
  padding: 14px 34px;
  border: 0;
  border-radius: 28px;
  background: #b5532e;
  color: #fff;
  font-size: 20px;
}
