/*
 * Night Parade's page. The canvas fills it; the HUD sits at the edges; the
 * screens and cards are dark lacquer panels with a gold edge, in pal's type
 * for words and the pack's pixel font (NP) for numbers and titles. Sized to
 * work in pal's 720 by 390 panel and to grow with a bigger window.
 */
@font-face { font-family: "NP"; src: url("./assets/font/normal.ttf"); }
:root {
  --ink: #f2efe6; --dim: #aaa4b8; --faint: #6f6a80; --gold: #ffd166; --red: #ff5a5a; --blue: #9fd8ff; --green: #7ee08a;
  --panel: rgba(20, 17, 30, 0.94); --panel2: rgba(34, 29, 48, 0.96); --edge: #4a3f63; --edge-hi: #8a78b8;
  --ui: var(--pal-font-ui, -apple-system, system-ui, sans-serif);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #0d0f16; }
body { font: 13px/1.35 var(--ui); color: var(--ink); user-select: none; -webkit-user-select: none; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
[hidden] { display: none !important; }
.px { image-rendering: pixelated; }
.np { font-family: "NP", monospace; letter-spacing: 0.02em; }
kbd { display: inline-block; min-width: 17px; padding: 0 4px; border-radius: 4px; text-align: center; font: 600 10px/16px var(--ui); background: #0e0c16; color: var(--ink); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.4), 0 0 0 1px var(--edge); }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0 0 auto 0; pointer-events: none; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,0.6); }
#xp { position: relative; height: 8px; background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06); }
#xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3e8fe0, #9fd8ff); box-shadow: 0 0 8px rgba(159, 216, 255, 0.6); transition: width 120ms linear; }
#lv { color: var(--blue); }
.row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: 5px 8px 0; }
#kit { display: grid; grid-template-columns: repeat(6, 20px); gap: 2px; }
.slot { position: relative; width: 20px; height: 20px; border-radius: 4px; overflow: hidden; background: rgba(0,0,0,0.45); box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
.slot img { width: 20px; height: 20px; display: block; }
.slot b { position: absolute; right: 1px; bottom: 0; font: 8px/8px "NP", monospace; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.slot.evo { box-shadow: 0 0 0 1px var(--gold), 0 0 6px rgba(255, 209, 102, 0.7); }
.slot.empty { background: rgba(0,0,0,0.25); box-shadow: 0 0 0 1px rgba(255,255,255,0.05); }
#clock { text-align: center; line-height: 1; }
#clock b { display: block; font: 18px "NP", monospace; letter-spacing: 0.04em; }
#act { font-size: 9px; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }
#stats { justify-self: end; display: flex; gap: 10px; font: 11px "NP", monospace; }
#stats span { display: inline-flex; align-items: center; gap: 3px; }
#stats img { width: 12px; height: 12px; }
#bossbar { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); width: min(460px, 76vw); display: flex; gap: 8px; align-items: center; text-shadow: 0 1px 2px #000; }
#bossbar img { width: 30px; height: 30px; border-radius: 6px; box-shadow: 0 0 0 1px var(--red); background: #000; }
#bossbar > div { flex: 1; }
#bossbar span { font: 10px "NP", monospace; letter-spacing: 0.08em; color: #ffd6d0; }
#bossbar .bar { height: 7px; margin-top: 2px; border-radius: 3px; background: rgba(0, 0, 0, 0.6); overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.5); }
#bossbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, #a01e2e, #ff5a5a); transition: width 150ms linear; }

/* ---- banners ---- */
/* Banners stack in a column under the clock, so events that land together never overlap; the act's title has the middle of the screen to itself. */
#banners { position: fixed; left: 0; right: 0; top: 11%; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.banner { text-align: center; white-space: nowrap; animation: banner 2.8s ease forwards; text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 1px 2px #000; }
.banner b { display: block; font-family: "NP", monospace; font-weight: normal; }
.banner span { display: block; font-size: 11px; color: var(--dim); margin-top: 2px; }
.banner.act { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); animation-name: bannerMid; } .banner.act b { font-size: 26px; color: #efe6ff; letter-spacing: 0.06em; }
.banner.act span { letter-spacing: 0.3em; text-transform: uppercase; font-size: 10px; }
.banner.event b { font-size: 16px; color: #ffe0b8; }
.banner.good b { font-size: 15px; color: var(--gold); }
.banner.info b { font-size: 13px; color: var(--ink); }
.banner.boss { order: -1; display: flex; gap: 10px; align-items: center; padding: 8px 14px 8px 8px; border-radius: 10px; background: linear-gradient(90deg, rgba(90, 10, 20, 0.85), rgba(40, 6, 12, 0.6)); box-shadow: 0 0 0 1px rgba(255,90,90,0.5); animation: bossin 3.4s ease forwards; }
.banner.boss img { width: 38px; height: 38px; border-radius: 6px; box-shadow: 0 0 0 1px var(--red); }
.banner.boss b { font-size: 17px; color: #ffd6d0; text-align: left; }
.banner.boss span { text-align: left; color: #e8b0a8; }
@keyframes banner { 0% { opacity: 0; transform: translateY(8px) scale(1.05); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bannerMid { 0% { opacity: 0; transform: translate(-50%, 8px) scale(1.05); } 12% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bossin { 0% { opacity: 0; transform: translateX(-40px); } 12% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(30px); } }

/* ---- screens and cards ---- */
#ui { position: fixed; inset: 0; display: grid; place-items: center; padding: 10px; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui.dim { background: radial-gradient(ellipse at center, rgba(8, 6, 16, 0.55), rgba(8, 6, 16, 0.85)); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); }
.panel { width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 14px 16px; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--edge), 0 0 0 3px rgba(0,0,0,0.5), 0 18px 50px rgba(0,0,0,0.6); scrollbar-width: thin; }
.panel.wide { width: min(720px, 100%); }
.panel h1 { margin: 0; font: 24px "NP", monospace; font-weight: normal; letter-spacing: 0.04em; }
.panel h2 { margin: 0 0 8px; font: 15px "NP", monospace; font-weight: normal; letter-spacing: 0.04em; color: var(--gold); display: flex; align-items: baseline; gap: 8px; }
.panel h2 small { font: 11px var(--ui); color: var(--dim); }
.panel p { margin: 4px 0 0; color: var(--dim); }
.keys { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11px; color: var(--dim); }
.keys span { white-space: nowrap; }
.list { display: flex; flex-direction: column; gap: 4px; }
.opt { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px 7px 7px; border-radius: 9px; background: var(--panel2); box-shadow: 0 0 0 1px rgba(255,255,255,0.05); cursor: pointer; }
.opt.sel { box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255, 209, 102, 0.25); background: linear-gradient(90deg, rgba(255, 209, 102, 0.12), var(--panel2)); }
.opt.off { opacity: 0.5; }
.opt .ico { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #0e0c16; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(255,255,255,0.08); }
.opt .ico img { width: 44px; height: 44px; }
.opt .ico.evo { box-shadow: 0 0 0 1px var(--gold), 0 0 10px rgba(255, 209, 102, 0.5); }
.opt .name { font-weight: 650; font-size: 13.5px; }
.opt .tag { font: 10px "NP", monospace; color: var(--blue); margin-left: 6px; }
.opt .tag.new { color: var(--gold); }
.opt .what { color: var(--dim); font-size: 12px; margin-top: 1px; }
.opt .hint { font-size: 11px; color: var(--faint); margin-top: 2px; }
.opt .hint.pair { color: var(--gold); }
.opt .side { text-align: right; font-size: 11px; color: var(--dim); }
.pips { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.pips i { width: 5px; height: 5px; border-radius: 1px; background: rgba(255,255,255,0.14); }
.pips i.on { background: var(--gold); }
.tools { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tool { font-size: 11px; color: var(--dim); padding: 3px 8px; border-radius: 6px; background: var(--panel2); box-shadow: 0 0 0 1px rgba(255,255,255,0.06); }
.tool.none { opacity: 0.4; }

/* title */
.title { text-align: center; width: min(420px, 100%); background: transparent; box-shadow: none; }
.title .logo { font: 34px "NP", monospace; letter-spacing: 0.06em; color: #fff4e0; text-shadow: 0 0 20px rgba(255, 120, 80, 0.55), 0 2px 0 #7a1020, 0 3px 12px #000; }
.title .jp { font-size: 12px; letter-spacing: 0.5em; color: #e8a0a0; margin-top: 2px; text-shadow: 0 1px 4px #000; }
.title .tag { color: #d8d0e8; margin-top: 6px; text-shadow: 0 1px 4px #000; font-size: 12px; }
.menu { margin: 16px auto 0; display: flex; flex-direction: column; gap: 4px; width: 210px; }
.menu .item { padding: 6px 12px; border-radius: 8px; font: 14px "NP", monospace; letter-spacing: 0.04em; background: rgba(20, 17, 30, 0.7); box-shadow: 0 0 0 1px var(--edge); cursor: pointer; }
.menu .item.sel { color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255, 209, 102, 0.3); background: rgba(40, 30, 20, 0.85); }
.title .purse { margin-top: 10px; font: 11px "NP", monospace; color: var(--gold); text-shadow: 0 1px 3px #000; }

/* heroes */
.heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hero { padding: 8px; border-radius: 10px; background: var(--panel2); box-shadow: 0 0 0 1px rgba(255,255,255,0.05); cursor: pointer; display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; }
.hero.sel { box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255, 209, 102, 0.25); }
.hero img.face { width: 40px; height: 40px; border-radius: 6px; background: #0e0c16; }
.hero.locked img.face { filter: brightness(0) opacity(0.5); }
.hero .n { font-weight: 650; } .hero .t { font-size: 11px; color: var(--dim); }
.detail { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--panel2); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.detail .trait b { color: var(--gold); font-weight: 650; }
.detail .w { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--dim); }
.detail .w img { width: 28px; height: 28px; border-radius: 5px; }
.omen { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--dim); }
.omen b { font: 13px "NP", monospace; color: var(--red); }

/* shrine */
.shrine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.offering { padding: 6px; border-radius: 9px; background: var(--panel2); display: grid; grid-template-columns: 30px 1fr; gap: 6px; align-items: center; cursor: pointer; box-shadow: 0 0 0 1px rgba(255,255,255,0.05); }
.offering.sel { box-shadow: 0 0 0 1px var(--gold); }
.offering img { width: 30px; height: 30px; border-radius: 5px; }
.offering .n { font-size: 12px; font-weight: 600; }
.offering .c { font: 10px "NP", monospace; color: var(--gold); }
.offering .c.max { color: var(--green); } .offering .c.poor { color: var(--faint); }
.shrine-detail { margin-top: 8px; font-size: 12px; color: var(--dim); min-height: 18px; }

/* codex */
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tabs span { padding: 3px 9px; border-radius: 6px; font-size: 12px; color: var(--dim); background: var(--panel2); }
.tabs span.on { color: var(--ink); box-shadow: 0 0 0 1px var(--gold); }
.codex { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; }
.entry { display: grid; grid-template-columns: 30px 1fr; gap: 6px; align-items: center; padding: 5px; border-radius: 8px; background: var(--panel2); font-size: 11.5px; }
.entry img { width: 30px; height: 30px; border-radius: 5px; }
.entry.unseen { opacity: 0.4; }
.entry.unseen img { filter: brightness(0); }
.entry small { display: block; color: var(--dim); font-size: 10.5px; }
.entry canvas { width: 30px; height: 30px; }

/* settings */
.setting { display: grid; grid-template-columns: 1fr 150px; align-items: center; padding: 7px 10px; border-radius: 8px; background: var(--panel2); margin-bottom: 4px; }
.setting.sel { box-shadow: 0 0 0 1px var(--gold); }
.meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--gold); }

/* chest */
.chest { text-align: center; }
.chest .box { width: 64px; height: 56px; margin: 4px auto 6px; background-size: 128px 56px; background-position: 0 0; image-rendering: pixelated; animation: shakebox 0.5s ease-in-out infinite; }
.chest.open .box { background-position: -64px 0; animation: none; filter: drop-shadow(0 0 14px rgba(255, 209, 102, 0.8)); }
.prizes { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; min-height: 96px; }
.prize { width: 96px; text-align: center; animation: pop 0.35s cubic-bezier(.2, 1.6, .5, 1) both; }
.prize .ico { width: 48px; height: 48px; margin: 0 auto; border-radius: 9px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); background: #0e0c16; }
.prize .ico img { width: 48px; height: 48px; }
.prize.evo .ico { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(255, 209, 102, 0.8); }
.prize .n { font-size: 11.5px; font-weight: 650; margin-top: 4px; }
.prize .d { font-size: 10.5px; color: var(--dim); }
.prize.spin .ico img { animation: blur 0.1s linear infinite; }
@keyframes shakebox { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.4) translateY(10px); } 100% { opacity: 1; transform: none; } }
@keyframes blur { 50% { filter: blur(1px) brightness(1.4); } }

/* pause and results */
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; }
.build { display: flex; flex-direction: column; gap: 3px; }
.brow { display: grid; grid-template-columns: 22px 1fr auto; gap: 7px; align-items: center; font-size: 12px; }
.brow img { width: 22px; height: 22px; border-radius: 4px; }
.brow .v { font: 10px "NP", monospace; color: var(--dim); }
.brow .bar { grid-column: 2 / 4; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); margin-top: -2px; }
.brow .bar i { display: block; height: 100%; background: var(--gold); border-radius: 2px; }
.statlist { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; font-size: 11.5px; color: var(--dim); }
.statlist b { font: 11px "NP", monospace; color: var(--ink); text-align: right; font-weight: normal; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0; }
.facts div { padding: 7px 4px; border-radius: 8px; background: var(--panel2); text-align: center; }
.facts b { display: block; font: 16px "NP", monospace; font-weight: normal; }
.facts span { font-size: 10.5px; color: var(--dim); }
.standing { margin: 0 0 6px; font-size: 11px; color: var(--dim); }
.standing:empty { display: none; }
.standing a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.gold-note { margin: 0 0 8px; font-size: 11px; color: var(--dim); }
.gold-note b { color: var(--gold); font-weight: normal; }
.menu .afford { color: var(--gold); }
.unlocks { margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: linear-gradient(90deg, rgba(255, 209, 102, 0.15), transparent); box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.4); }
.unlocks b { color: var(--gold); font: 12px "NP", monospace; font-weight: normal; }
.unlocks div { font-size: 12px; margin-top: 2px; }
.dawn h1 { color: #ffe6b8; text-shadow: 0 0 18px rgba(255, 180, 90, 0.6); }
.dead h1 { color: #ffc6c6; }

@media (max-height: 420px) {
  .panel { padding: 10px 12px; }
  .opt { padding: 5px 8px 5px 5px; }
  .opt .ico, .opt .ico img { width: 36px; height: 36px; }
  .opt { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .title .logo { font-size: 28px; }
  .menu { margin-top: 10px; }
}

/* The pack's pixel font reads best in capitals, and its space is narrow. */
.np, .panel h1, .panel h2, .menu .item, .title .logo, .banner b, #clock b, #lv, #stats, #bossbar span, .opt .tag, .facts b, .offering .c, .slot b, .title .purse, .unlocks b, .brow .v, .statlist b {
  text-transform: uppercase; word-spacing: 0.35em;
}
.panel h2 small { text-transform: none; word-spacing: normal; }
.title::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgba(8, 6, 16, 0.72) 0%, rgba(8, 6, 16, 0.35) 45%, rgba(8, 6, 16, 0.7) 100%); pointer-events: none; }

/* the hero screen's start button, the chest prize level, the ` performance overlay */
.go-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.go { font: 13px "NP", monospace; text-transform: uppercase; word-spacing: 0.35em; padding: 7px 14px; border: 0; border-radius: 8px; cursor: pointer; color: #1a1208; background: linear-gradient(180deg, #ffe08a, #ffc94a); box-shadow: 0 0 0 1px #a8781a, 0 0 14px rgba(255, 209, 102, 0.35); }
.go:hover { filter: brightness(1.08); }
.prize { width: 120px; }
.prize .lv { font: 9px "NP", monospace; color: var(--blue); text-transform: uppercase; }
#perf { position: fixed; left: 6px; bottom: 6px; margin: 0; padding: 4px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.7); color: #b8f0b8; font: 10px/1.35 ui-monospace, Menlo, monospace; pointer-events: none; z-index: 9; }
