* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  background: #100807;
  color: #f2e6b6;
  font-family: "Palatino Linotype", Palatino, "Times New Roman", serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#app {
  position: relative;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
#view {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  cursor: crosshair;
}
#overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel {
  display: none;
  pointer-events: auto;
  width: min(520px, 92vw);
  max-height: 92vh;
  overflow: auto;
  padding: 28px 28px 22px;
  background: linear-gradient(180deg, rgba(28,12,10,0.92), rgba(12,6,6,0.94));
  border: 2px solid #8a6a32;
  box-shadow: 0 0 0 1px #3a2010, 0 18px 40px rgba(0,0,0,0.55);
  text-align: center;
}
.panel.show { display: block; }
.panel.slim { width: min(380px, 90vw); }
.title-art {
  display: none;
}
.logo {
  font-size: 42px;
  letter-spacing: 0.18em;
  color: #e8d9a0;
  text-shadow: 0 2px 0 #3a2010, 0 0 18px rgba(180,40,20,0.45);
  font-weight: 700;
}
.sub {
  margin: 6px 0 22px;
  color: #b09060;
  letter-spacing: 0.12em;
  font-size: 13px;
}
.menu { display: flex; flex-direction: column; gap: 8px; }
button {
  font-family: inherit;
  font-size: 18px;
  padding: 10px 14px;
  color: #f2e6b6;
  background: #3a1c14;
  border: 1px solid #8a6a32;
  cursor: pointer;
}
button:hover, button:focus { background: #5a2a18; outline: none; }
button.primary { background: #6a2418; font-size: 20px; }
button.ghost { background: transparent; margin-top: 10px; }
.ver { margin-top: 16px; color: #6a5840; font-size: 12px; letter-spacing: 0.08em; }
h1 { font-size: 26px; margin-bottom: 14px; color: #e8d9a0; letter-spacing: 0.06em; }
h2 { font-size: 16px; color: #d4b43a; margin: 8px 0; }
p { line-height: 1.45; margin: 8px 0; color: #d8c8a0; text-align: left; }
ul { text-align: left; line-height: 1.7; color: #d8c8a0; padding-left: 8px; list-style: none; }
.cols { display: flex; gap: 18px; text-align: left; }
.cols > div { flex: 1; }
kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 5px;
  border: 1px solid #8a6a32;
  background: #2a1810;
  font-family: monospace;
  font-size: 12px;
  text-align: center;
}
.chk, .rng {
  display: block;
  text-align: left;
  margin: 12px 0;
  color: #d8c8a0;
  font-size: 18px;
}
.rng input { width: 100%; margin-top: 6px; }
.set-label {
  text-align: left;
  margin: 16px 0 8px;
  color: #d8c8a0;
  font-size: 16px;
}
.lang-row, .diff-row {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
}
.lang-row button, .diff-row button { flex: 1; font-size: 16px; padding: 8px 10px; }
button.on {
  background: #6a2418;
  border-color: #d4b43a;
}
.diff-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.diff-list button { text-align: left; padding: 12px 14px; }
.diff-list button b { display: block; font-size: 18px; color: #e8d9a0; }
.diff-list button span {
  display: block;
  font-size: 13px;
  color: #b09060;
  font-weight: normal;
  margin-top: 4px;
}
.diff-list button.on { background: #5a2418; }
#score-list { text-align: left; margin: 10px 0 16px; }
#score-list li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #3a2a18; }
.stat { display: flex; justify-content: space-between; margin: 6px 0; font-family: monospace; }
.stat.big { font-size: 20px; color: #e8d9a0; margin-top: 12px; }
.stat b { color: #f2e6b6; }

#touch {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
#touch.on { display: block; }
#stick {
  position: absolute;
  left: 24px; bottom: 78px;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(232,217,160,0.35);
  background: rgba(0,0,0,0.25);
  pointer-events: none;
}
#stick-knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(232,217,160,0.55);
  pointer-events: none;
}
#touch button {
  pointer-events: auto;
  position: absolute;
  width: 74px; height: 74px;
  border-radius: 50%;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(58,28,20,0.7);
}
#btn-fire { right: 22px; bottom: 88px; width: 92px; height: 92px; background: rgba(140,40,28,0.75); font-size: 14px; }
#btn-use { right: 118px; bottom: 88px; }
#btn-weap { right: 22px; bottom: 196px; width: 58px; height: 58px; }
#btn-map { right: 88px; bottom: 196px; width: 58px; height: 58px; }
#btn-tpause { right: 18px; top: 14px; width: 44px; height: 44px; }

@media (max-width: 720px) {
  .logo { font-size: 28px; letter-spacing: 0.12em; }
  .cols { flex-direction: column; gap: 8px; }
  .panel { padding: 18px 16px 14px; }
}
