html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101114;
  color: #f7f3ec;
  font-family: "Segoe UI", system-ui, sans-serif;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  padding: 12px 22px;
  background: #e9d28a;
  color: #181512;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

#game,
#scene {
  width: 100%;
  height: 100%;
}

#scene {
  display: block;
}

#hud {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 18px;
  align-items: center;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

#status {
  min-width: 144px;
  font-size: 24px;
  font-weight: 800;
}

#leftHud {
  min-width: 220px;
}

#cameraHint {
  display: none;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

#cameraHint.visible {
  display: block;
}

#timer {
  display: none;
}

#settings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  pointer-events: auto;
}

#settings label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 4px 10px;
  background: rgba(17, 18, 24, 0.58);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

#settings input {
  width: 16px;
  height: 16px;
  accent-color: #e9d28a;
}

#settings select {
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 4px;
  background: rgba(6, 7, 10, 0.72);
  color: #f7f3ec;
  font: inherit;
  font-size: 12px;
}

.hud-button {
  min-height: 32px;
  border-color: rgba(255, 255, 255, 0.34);
  padding: 4px 12px;
  background: rgba(233, 210, 138, 0.92);
  font-size: 13px;
}

.debug-control {
  display: none !important;
}

#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 11, 11, 0.44);
  pointer-events: none;
}

#overlay.hidden {
  display: none;
}

#overlay.result {
  align-items: start;
  background: rgba(12, 11, 11, 0.74);
  padding-top: 76px;
  box-sizing: border-box;
}

.panel {
  width: max-content;
  max-width: calc(100vw - 36px);
  border: 1px solid rgba(245, 220, 142, 0.5);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 236, 180, 0.1), rgba(22, 20, 19, 0.88) 34%),
    rgba(14, 13, 15, 0.88);
  box-shadow:
    0 0 34px rgba(233, 210, 138, 0.18),
    0 24px 70px rgba(0, 0, 0, 0.52);
  text-align: center;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

#overlay.result .panel {
  background: rgba(22, 20, 19, 0.95);
}

.panel h1 {
  margin: 0 0 26px;
  color: #fff8dc;
  font-family: "Meiryo UI", "Meiryo", "Segoe UI", sans-serif;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(255, 245, 180, 0.65),
    0 4px 18px rgba(0, 0, 0, 0.8);
}

.panel p {
  min-height: 28px;
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  #hud {
    grid-template-columns: 1fr auto;
  }

  #settings {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
