/* 炎龙 FLAMEWYRM — cinematic HUD */

:root {
  --ember: #ff5a12;
  --ember-hot: #ffcc77;
  --blood: #6b1208;
  --ink: #070304;
  --ash: #c4a07a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--ash);
  font-family: "Noto Serif SC", "Cinzel", serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

canvas#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

#vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 28%, rgba(0, 0, 0, 0.55) 78%, rgba(0, 0, 0, 0.88) 100%),
    linear-gradient(180deg, rgba(40, 6, 2, 0.25) 0%, transparent 18%, transparent 78%, rgba(20, 2, 0, 0.45) 100%);
}

#scan {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 3;
  opacity: 0.07;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.35) 3px
  );
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#hud {
  position: absolute;
  top: 4.5vh;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#hud.visible { opacity: 1; }

#score {
  font-family: Cinzel, serif;
  font-weight: 900;
  font-size: clamp(3.2rem, 8vw, 5.6rem);
  letter-spacing: 0.12em;
  line-height: 1;
  background: linear-gradient(180deg, #fff4d6 0%, #ff9a3a 55%, #ff3a00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 70, 0, 0.55));
}

#best {
  margin-top: 0.35rem;
  font-family: Cinzel, serif;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  color: #c08050;
  opacity: 0.8;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: auto;
  background: radial-gradient(ellipse at 50% 40%, rgba(50, 8, 2, 0.35) 0%, rgba(4, 1, 1, 0.55) 70%);
  opacity: 1;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mark {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
  box-shadow: 0 0 12px var(--ember);
  margin-bottom: 1.4rem;
}

.cn.cn {
  font-family: "Ma Shan Zheng", "Noto Serif SC", cursive;
  font-size: clamp(4.8rem, 16vw, 8.4rem);
  font-weight: 400;
  line-height: 0.95;
  background: linear-gradient(180deg, #fff1c8 10%, #ff6a1a 48%, #8b1200 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 50, 0, 0.55));
  animation: titlePulse 3.6s ease-in-out infinite;
}

.en {
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: clamp(1.05rem, 3.4vw, 1.55rem);
  letter-spacing: 0.62em;
  color: #e8b070;
  margin: 0.55rem 0 0 0.62em;
  text-shadow: 0 0 24px rgba(255, 80, 0, 0.45);
}

.sub {
  margin-top: 1.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  color: #b08060;
}

.hint {
  margin-top: 0.45rem;
  font-family: "Noto Serif SC", serif;
  font-size: 0.92rem;
  letter-spacing: 0.22em;
  color: #8a6048;
}

#play-btn {
  pointer-events: auto;
  margin-top: 2.4rem;
  font-family: Cinzel, "Noto Serif SC", serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #ffe4c0;
  background: linear-gradient(180deg, #5a1808 0%, #1a0504 100%);
  border: 1px solid #ff6a22;
  padding: 1.05rem 2.8rem;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(255, 70, 0, 0.28),
    inset 0 0 22px rgba(255, 60, 0, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
#play-btn:hover,
#play-btn:focus {
  outline: none;
  color: #fffaf0;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 48px rgba(255, 80, 0, 0.55),
    inset 0 0 28px rgba(255, 90, 0, 0.22);
}
#play-btn:active { transform: translateY(1px); }
#play-btn:disabled,
#play-btn:disabled:hover,
#play-btn:disabled:focus {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  color: #c8a080;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 16px rgba(255, 70, 0, 0.12);
}

#load-line {
  margin-top: 0.9rem;
  font-family: "Noto Serif SC", serif;
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  color: #ff8a40;
  text-shadow: 0 0 16px rgba(255, 80, 0, 0.45);
  min-height: 1.2em;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#load-line.ready {
  opacity: 0;
  visibility: hidden;
}

.credit {
  margin-top: 0.85rem;
  font-family: "Noto Serif SC", Cinzel, serif;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: #6a4030;
  opacity: 0.88;
}
.credit span { opacity: 0.7; }

.go-stats {
  margin-top: 1.5rem;
  font-family: Cinzel, serif;
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  color: #ffb070;
}
.go-stats strong {
  color: #ffe8c0;
  font-weight: 900;
}

#boot-error {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080203;
  color: #c07050;
  font-family: "Noto Serif SC", serif;
  letter-spacing: 0.12em;
  padding: 2rem;
  text-align: center;
}
#boot-error[hidden] {
  display: none !important;
}

@keyframes titlePulse {
  0%, 100% { filter: drop-shadow(0 0 22px rgba(255, 50, 0, 0.4)); }
  50% { filter: drop-shadow(0 0 42px rgba(255, 90, 0, 0.75)); }
}

@media (max-width: 640px) {
  .en { letter-spacing: 0.38em; }
  #play-btn { letter-spacing: 0.28em; padding: 0.95rem 1.8rem; }
}
