* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; overflow: hidden; }
body {
  color: #d8d2c8;
  font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  user-select: none;
  -webkit-user-select: none;
}
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.35) 0%, rgba(0,0,0,.88) 70%, #000 100%);
  animation: fadein 1.2s ease both;
}
.screen.light {
  background: radial-gradient(ellipse at center, rgba(255,255,255,.96) 0%, rgba(230,232,225,.94) 100%);
  color: #1a1a1a;
}
.screen .inner { padding: 24px 16px; max-width: 560px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.sub { letter-spacing: .9em; padding-left: .9em; font-size: 13px; color: #8d857a; }
h1 {
  font-size: clamp(96px, 20vw, 190px); font-weight: 800; line-height: 1.05;
  color: #e9e2d6; letter-spacing: .08em; padding-left: .08em;
  text-shadow: 0 0 18px rgba(180, 10, 0, .75), 0 0 70px rgba(160, 0, 0, .55);
  animation: flicker 6s infinite;
}
h2 { font-size: clamp(54px, 10vw, 96px); font-weight: 800; letter-spacing: .14em; padding-left: .14em; }
h2.red { color: #b3120a; text-shadow: 0 0 30px rgba(200, 0, 0, .7); animation: shake .12s 6; }
.lead { margin: 18px 0 30px; font-size: 18px; line-height: 2; color: inherit; opacity: .85; }
@keyframes flicker {
  0%, 41%, 44%, 47%, 78%, 80%, 100% { opacity: 1; }
  42%, 46% { opacity: .35; }
  79% { opacity: .6; }
}
@keyframes shake {
  0% { transform: translate(0, 0); } 25% { transform: translate(-5px, 3px); }
  50% { transform: translate(4px, -3px); } 75% { transform: translate(-3px, -2px); }
  100% { transform: translate(0, 0); }
}

button {
  font: inherit; font-size: 20px; letter-spacing: .5em; padding: 14px 34px 14px calc(34px + .5em);
  color: #e9e2d6; background: rgba(20, 0, 0, .55);
  border: 1px solid rgba(190, 40, 30, .7); cursor: pointer;
  transition: background .25s, box-shadow .25s, color .25s;
}
button:hover, button:focus-visible {
  background: rgba(120, 8, 4, .8); color: #fff; outline: none;
  box-shadow: 0 0 28px rgba(200, 20, 10, .6);
}
.light button { color: #1a1a1a; background: rgba(255,255,255,.6); border-color: #555; }
.light button:hover { background: #1a1a1a; color: #fff; box-shadow: none; }

.howto { list-style: none; margin: 34px 0 14px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: #9b9388; }
.howto b { color: #d8d2c8; font-weight: 500; margin-right: 6px; letter-spacing: .1em; }
.hint { font-size: 13px; color: #7d766c; margin-top: 8px; }

#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#keys { position: absolute; left: 28px; bottom: 26px; display: flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: .3em; color: #a59c8e; }
#keys i {
  width: 12px; height: 12px; transform: rotate(45deg);
  border: 1px solid #8b7a45; opacity: .6; transition: all .5s;
}
#keys i.got { background: #f1c860; border-color: #ffe7a0; opacity: 1; box-shadow: 0 0 14px #f1c860; }
#stamina {
  position: absolute; left: 50%; bottom: 30px; width: 220px; height: 3px; margin-left: -110px;
  background: rgba(255,255,255,.12); opacity: 0; transition: opacity .5s;
}
#stamina.show { opacity: 1; }
#stamina-fill { height: 100%; width: 100%; background: #d8d2c8; transform-origin: left center; }
#stamina.low #stamina-fill { background: #c2251a; }
#message {
  position: absolute; left: 0; right: 0; top: 22%; text-align: center;
  font-size: 22px; letter-spacing: .4em; color: #e9e2d6; opacity: 0; transition: opacity .8s;
  text-shadow: 0 0 14px #000, 0 0 30px #000;
}
#message.show { opacity: .95; }

#loading { position: fixed; right: 18px; bottom: 14px; z-index: 20; font-size: 12px; color: #666; letter-spacing: .2em; }

#minimap { position: absolute; top: 50%; left: 50%; width: min(380px, 80vmin); height: min(380px, 80vmin); transform: translate(-50%, -50%); border-radius: 50%; opacity: 0; transition: opacity .25s; }
#minimap.show { opacity: 1; }
body.playing, body.playing * { cursor: none !important; }

#threat {
  position: absolute; top: 50%; left: 50%; width: 78vmin; height: 78vmin; border-radius: 50%;
  transform: translate(-50%, -50%); opacity: 0; transition: opacity .35s;
  background: conic-gradient(from -48deg, rgba(225,20,12,0) 0deg, rgba(225,20,12,.55) 28deg, rgba(240,30,18,.95) 48deg, rgba(225,20,12,.55) 68deg, rgba(225,20,12,0) 96deg, rgba(225,20,12,0) 360deg);
  -webkit-mask-image: radial-gradient(circle closest-side, transparent 64%, #000 80%, transparent 97%);
  mask-image: radial-gradient(circle closest-side, transparent 64%, #000 80%, transparent 97%);
  filter: blur(9px);
}
