/* ASHEN CROWN — Styles */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;900&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  background: #050403;
  overflow: hidden;
  font-family: 'Cinzel', Georgia, serif;
  color: #d8c8a8;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(255, 110, 20, 0.10), transparent 60%),
    radial-gradient(ellipse at 50% 50%, #0d0a07 0%, #050403 70%);
}

#wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  box-shadow: 0 0 90px rgba(255, 130, 30, 0.10), 0 0 30px rgba(0, 0, 0, 0.9);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  background: #0a0806;
  cursor: crosshair;
}

/* ---------- Loading screen ---------- */
#loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: radial-gradient(ellipse at 50% 60%, #14100a 0%, #050403 75%);
  transition: opacity 0.55s ease;
}

#loading.hidden { opacity: 0; pointer-events: none; }

#loading .title {
  font-size: clamp(32px, 7vw, 84px);
  font-weight: 900;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, #ffe8b0 0%, #e0a848 50%, #8a5a18 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(255, 150, 40, 0.35);
}

#loading .sub {
  font-size: clamp(11px, 1.6vw, 16px);
  letter-spacing: 0.42em;
  color: rgba(190, 160, 120, 0.75);
  text-transform: uppercase;
}

#loading .bar {
  width: min(340px, 60vw);
  height: 3px;
  background: rgba(120, 95, 60, 0.28);
  overflow: hidden;
  position: relative;
}

#loading .bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, #ffb040, transparent);
  animation: sweep 1.5s ease-in-out infinite;
}

@keyframes sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

#loading .hint {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(150, 130, 100, 0.55);
  text-align: center;
  line-height: 2;
  max-width: 520px;
  padding: 0 20px;
}

#loading .hint b { color: rgba(220, 190, 140, 0.85); font-weight: 600; }

/* ---------- Scanline / grain overlay ---------- */
#wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.10) 0px,
    rgba(0, 0, 0, 0.10) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
  z-index: 10;
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  #loading .hint { font-size: 10px; }
}
