:root {
  --bone: #f1eee8;
  --ash: #bdb8b0;
  --blood: #e0141e;
  --ghost: #cfe2ff;
  --paper: #e9dcc0;
  --ink: #000;
}
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--bone); overflow: hidden;
  font: 22px/1.45 Consolas, 'Cascadia Mono', monospace; }
canvas#screen { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }
#reach { position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.7) 72%, #000 100%); }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud[hidden] { display: none; }
#cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2px solid rgba(241,238,232,.75);
  border-radius: 50%; box-shadow: 0 0 6px #000; }
#cross::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--bone); border-radius: 50%; }
#cross.hot { border-color: var(--blood); }
body.yokai #cross.hot { border-color: var(--ghost); }
#lamp { position: absolute; left: 50%; top: calc(50% + 34px); width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #2a1010; opacity: 0; }
#lamp.show { opacity: 1; }
#lamp.beat { background: var(--bone); box-shadow: 0 0 16px var(--bone); }
#lane { position: absolute; left: 50%; bottom: 11vh; width: 46vw; height: 84px; transform: translateX(-50%); }
#approach { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 3px solid var(--blood); border-radius: 50%; opacity: 0; }
body.yokai #approach { border-color: var(--ghost); }
#candles { position: absolute; left: 3vw; bottom: 4vh; display: flex; gap: 14px; font-size: 40px; }
#candles span { color: #ffb070; text-shadow: 0 0 12px #ff8a3a; }
#candles span.out { color: #2c2a28; text-shadow: none; }
#combo { position: absolute; right: 3vw; bottom: 4vh; text-align: right; padding: 8px 16px; background: rgba(0,0,0,.5); border: 2px solid #2b2b2b; border-radius: 10px; }
#combonum { display: block; font-size: 52px; font-weight: bold; color: var(--bone); line-height: 1; }
#combo small { font-size: 18px; color: var(--ash); }
#score { position: absolute; right: 3vw; top: 3vh; font-size: 28px; color: var(--bone); text-shadow: 0 0 6px #000; }
#nowplaying { position: absolute; left: 3vw; top: 3vh; font-size: 20px; color: var(--ash); opacity: .75; text-shadow: 0 0 6px #000; }

#callout { position: absolute; left: 0; right: 0; top: 60vh; text-align: center; font-size: 34px; font-weight: bold;
  letter-spacing: 3px; opacity: 0; transition: opacity .25s; text-shadow: 0 0 10px #000, 0 0 2px #000; }
#callout.show { opacity: 1; transition: none; }
#callout.perfect { color: var(--blood); }
body.yokai #callout.perfect { color: var(--ghost); }
#callout.good { color: var(--bone); }
#callout.miss { color: var(--ash); }
#callout.bad { color: var(--blood); }

#debug { position: absolute; left: 16px; top: 60px; font-size: 18px; color: #ccc; background: rgba(0,0,0,.6); padding: 6px 10px; white-space: pre; }
#debug[hidden] { display: none; }

#card, #end { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; overflow-y: auto;
  text-align: center; background: rgba(0,0,0,.74); padding: 16px; }
#card[hidden], #end[hidden] { display: none; }
/* Letter-spaced text gets the same space added on its left, so it centres
   (letter-spacing also trails the last letter, which pushes it off centre). */
#card .panel { display: flex; flex-direction: column; align-items: center; width: min(1040px, 92vw); padding: 36px 48px 28px;
  background: rgba(0,0,0,.62); border: 1px solid #2a2725; border-radius: 14px; box-shadow: 0 10px 60px rgba(0,0,0,.7); }
#card .artist { margin: 0; font-size: 28px; letter-spacing: 10px; padding-left: 10px; color: var(--ash); text-transform: uppercase; }
#card h1 { margin: 2px 0 6px; font-size: clamp(72px, 12vh, 160px); letter-spacing: 14px; padding-left: 14px; color: var(--blood); line-height: 1.05; }
#card .game { margin: 0 0 26px; font-size: 20px; letter-spacing: 6px; padding-left: 6px; color: var(--ash); }
#card .how { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; font-size: 23px; color: var(--bone); }
#card .how li { line-height: 1.4; }
#card .how b { color: var(--blood); font-weight: normal; }
body.yokai #card .how b { color: var(--ghost); }
.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 8px; font-size: 18px; color: var(--ash); }
.keys span { border: 1px solid #3a3733; border-radius: 6px; padding: 4px 12px; }
.keys b { color: var(--bone); margin-right: 6px; }
#songnote { margin: 4px 0 0; font-size: 17px; color: #8d8880; }
#modes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; margin: 18px 0 10px; }
@media (max-width: 760px) { #modes { grid-template-columns: 1fr; } }
.mode { font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 24px; border-radius: 10px; }
.mode b { font-size: 34px; letter-spacing: 6px; padding-left: 6px; }
.mode span { font-size: 18px; }
.mode[data-mode="hellraiser"] { background: #1a0d0e; color: var(--bone); border: 2px solid var(--blood); }
.mode[data-mode="hellraiser"] b { color: var(--blood); }
.mode[data-mode="yokai"] { background: #1c1812; color: var(--paper); border: 2px solid var(--ghost); }
.mode[data-mode="yokai"] b { color: var(--ghost); }
.mode:hover { filter: brightness(1.35); }
#end h2 { margin: 0 0 12px; font-size: clamp(56px, 10vh, 130px); letter-spacing: 8px; padding-left: 8px; }
#end h2.saved { color: var(--bone); }
#end h2.taken { color: var(--blood); }
#endstats { font-size: 24px; color: var(--bone); white-space: pre-line; }

.credit { margin-top: 20px; padding: 16px 0 0; width: 100%; border-top: 1px solid #3a3733; }
.credit .music { margin: 0 0 12px; font-size: 21px; color: var(--ash); }
.credit .music b { color: var(--bone); }
.credit .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; }
.credit a { font-size: 19px; color: var(--bone); text-decoration: none; border: 1px solid #5c5852; border-radius: 6px; padding: 8px 16px; }
.credit a:hover { border-color: var(--blood); color: var(--blood); }
