* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #111;
  color: #eee;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 20px;
}

h1 {
  margin: 0;
  font-size: 1.4rem;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.95rem;
  background: #1a1a1a;
  padding: 10px 16px;
  border-radius: 8px;
}

#controls input[type="number"] {
  width: 50px;
}

#hud {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 1.1rem;
}

#stage {
  position: relative;
  width: min(92vw, 1400px);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

#fullscreen-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 900;
}

/* 伪全屏：只是让画布撑满视口，不调用浏览器原生全屏 API，
   这样 penalty 弹窗这类页面级浮层才不会被挡住 */
body.page-fullscreen h1,
body.page-fullscreen #controls,
body.page-fullscreen #hud {
  display: none;
}

body.page-fullscreen #stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  z-index: 500;
}

.figure {
  position: absolute;
  aspect-ratio: 100 / 160;
  cursor: inherit;
  mix-blend-mode: soft-light;
  opacity: 0.92;
  filter: drop-shadow(2px 6px 4px rgba(0, 0, 0, 0.35));
}

.figure .person-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.figure.found {
  mix-blend-mode: normal;
  opacity: 1;
  filter: drop-shadow(0 0 10px #4ade80) drop-shadow(0 0 4px #4ade80);
}

.figure.found .person-svg circle,
.figure.found .person-svg line {
  stroke: #4ade80 !important;
}
.figure.found .person-svg circle {
  fill: #4ade80 !important;
}

@keyframes hint-flash {
  0%, 100% { filter: drop-shadow(2px 6px 4px rgba(0, 0, 0, 0.35)); }
  50% { filter: drop-shadow(0 0 14px #facc15) drop-shadow(0 0 8px #facc15); }
}

.figure.hint-flash {
  animation: hint-flash 0.5s ease-in-out 20;
}

.figure.hint-flash .person-svg circle,
.figure.hint-flash .person-svg line {
  stroke: #ef4444 !important;
}
.figure.hint-flash .person-svg circle {
  fill: #ef4444 !important;
}

#hint-cost {
  font-size: 0.85rem;
  color: #eee;
}

#win-message {
  font-size: 1.3rem;
  font-weight: bold;
  color: #4ade80;
}

.hidden {
  display: none;
}

#penalty-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#penalty-overlay.hidden {
  display: none;
}

#penalty-box {
  background: #1e1e1e;
  border: 2px solid #f87171;
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  max-width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

#penalty-text {
  font-size: 1.4rem;
  font-weight: bold;
  margin: 0 0 20px;
  color: #f87171;
}

button {
  padding: 8px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #4ade80;
  color: #111;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background: #6ee7a0;
}
