/* Yagyo — the night parade runner. Spectral indigo night: violet dark, ghost
   teal for the yokai, warm lantern gold for anything that helps you. A fifth
   look, distinct from the pixel arcade, the glossy glass, the ink night and
   the woodblock dusk. */

:root {
  --yg-ink: #0b0918;
  --yg-deep: #141031;
  --yg-panel: #191339;
  --yg-line: #35295e;
  --yg-teal: #7df2d8;
  --yg-gold: #ffb84d;
  --yg-paper: #f0e9db;
  --yg-red: #ff5c6a;
}

body { background: var(--yg-ink); }

.yg-stage { background: var(--yg-ink); touch-action: none; }
.yg-stage canvas { display: block; width: 100%; height: 100%; background: var(--yg-ink); }

.yg-hud[hidden], .yg-screen[hidden], .yg-touch[hidden], .yg-keys[hidden],
.yg-record[hidden], .yg-initials[hidden], .yg-ofuda[hidden] { display: none !important; }

/* ---- HUD ---- */
.yg-hud {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none; z-index: 2;
  font-family: "DotGothic16", monospace;
}
.yg-panel {
  background: rgba(11, 9, 24, .72);
  border: 1px solid var(--yg-line);
  border-radius: 8px; padding: 5px 10px;
  display: flex; flex-direction: column; gap: 1px;
  color: var(--yg-paper);
}
.yg-right { align-items: flex-end; }
.yg-dist b { font-size: 22px; color: var(--yg-teal); }
.yg-dist i { font-style: normal; font-size: 12px; opacity: .8; margin-left: 2px; }
.yg-gate { font-size: 11px; color: var(--yg-gold); letter-spacing: .08em; }
.yg-lbl { font-size: 10px; letter-spacing: .18em; opacity: .7; }
.yg-score { font-size: 18px; letter-spacing: .06em; }
.yg-ofuda { font-size: 14px; }

/* ---- toast ---- */
.yg-toast {
  position: absolute; left: 50%; top: 26%;
  transform: translate(-50%, -50%);
  font-family: "DotGothic16", monospace; font-size: 18px;
  color: var(--yg-gold); text-shadow: 0 0 14px rgba(255, 184, 77, .5);
  opacity: 0; transition: opacity .18s; pointer-events: none; z-index: 3;
}
.yg-toast[data-show="true"] { opacity: 1; }

/* ---- screens ---- */
.yg-screen {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .8rem; text-align: center;
  padding: 1.2rem; overflow-y: auto;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(53, 41, 94, .55), transparent 60%),
    rgba(11, 9, 24, .93);
  color: var(--yg-paper);
  font-family: "DotGothic16", monospace;
}
.yg-screen p { max-width: 34ch; line-height: 1.55; font-size: 14px; opacity: .92; }

.yg-logo { display: flex; flex-direction: column; gap: .15rem; }
.yg-logo span {
  font-family: "Shippori Mincho", serif; font-weight: 800; font-size: 64px;
  line-height: 1; color: var(--yg-teal);
  text-shadow: 0 0 26px rgba(125, 242, 216, .45);
}
.yg-logo em {
  font-style: normal; font-size: 13px; letter-spacing: .55em;
  padding-left: .55em; opacity: .8;
}
.yg-logo.yg-small span { font-size: 40px; color: var(--yg-red); text-shadow: 0 0 22px rgba(255, 92, 106, .4); }

.yg-keys { display: flex; flex-direction: column; gap: .3rem; font-size: 12px; opacity: .85; }
.yg-keys kbd {
  font-family: inherit; border: 1px solid var(--yg-line); border-bottom-width: 3px;
  border-radius: 5px; padding: 1px 7px; background: var(--yg-panel);
}
.yg-keys i { font-style: normal; }

.yg-btn-gold {
  background: var(--yg-gold); color: #2a1c05; border: 0;
  font-weight: 700;
}

/* ---- over stats ---- */
.yg-stats { display: flex; gap: 1.4rem; }
.yg-stat { display: flex; flex-direction: column; }
.yg-stat b { font-size: 26px; color: var(--yg-teal); }
.yg-stat span { font-size: 10px; letter-spacing: .14em; opacity: .7; }
.yg-signoff { font-size: 13px; opacity: .8; }
.yg-record { color: var(--yg-gold); font-size: 13px; letter-spacing: .1em; }

.yg-initials { display: flex; flex-direction: column; gap: .45rem; align-items: center; }
.yg-initials label { font-size: 12px; letter-spacing: .08em; color: var(--yg-gold); }
.yg-initials input {
  width: 6ch; text-align: center; font-family: "DotGothic16", monospace;
  font-size: 24px; letter-spacing: .3em; text-transform: uppercase;
  background: var(--yg-panel); color: var(--yg-paper);
  border: 1px solid var(--yg-line); border-radius: 8px; padding: .3rem .2rem .3rem .5rem;
}

/* ---- leaderboard ---- */
.yg-board { width: min(300px, 92%); font-size: 12px; }
.yg-board h3 {
  font-size: 10px; letter-spacing: .22em; opacity: .65; margin: .6rem 0 .35rem;
}
.yg-row {
  display: grid; grid-template-columns: 2ch 5ch 1fr 6ch; gap: .5ch;
  padding: 2px 6px; border-radius: 5px; text-align: left;
}
.yg-row .r { opacity: .55; }
.yg-row .n { letter-spacing: .18em; }
.yg-row .m { text-align: right; opacity: .7; }
.yg-row .s { text-align: right; color: var(--yg-teal); }
.yg-row.me { background: rgba(255, 184, 77, .14); }
.yg-row.me .s { color: var(--yg-gold); }
.yg-empty-row { opacity: .55; padding: 4px 6px; }

/* ---- touch ---- */
.yg-touch { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.yg-tbtn {
  position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 108px; height: 78px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: "DotGothic16", monospace; font-size: 15px; letter-spacing: .12em;
  border: 1px solid var(--yg-line);
  background: rgba(11, 9, 24, .5); color: var(--yg-paper);
  opacity: .85;
}
.yg-tslide { left: 14px; color: var(--yg-teal); }
.yg-tjump { right: 14px; width: 132px; height: 92px; color: var(--yg-gold);
  border-color: rgba(255, 184, 77, .45); }
.yg-tbtn.on { background: rgba(255, 184, 77, .25); }

@media (max-width: 480px) {
  .yg-logo span { font-size: 52px; }
}
