/* HNS — chowany. Prototyp UI. */

:root {
  --ink: #e8eefc;
  --ink-dim: #9aa8c8;
  --night: #070b18;
  --panel: rgba(10, 15, 32, 0.72);
  --panel-line: rgba(150, 180, 255, 0.16);
  --warm: #ffd89b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  background: var(--night);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── HUD ──────────────────────────────────────────────────── */

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.hud-top,
.hud-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hud-bottom { align-items: flex-end; }

.badge {
  pointer-events: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 10px 2px rgba(255, 216, 155, 0.7);
  align-self: center;
}

.badge-name {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 14px;
}

.badge-sub {
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

.hud-actions {
  pointer-events: auto;
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
  user-select: none;
}

.btn:hover { background: rgba(24, 34, 66, 0.85); border-color: rgba(150, 180, 255, 0.34); }
.btn:active { transform: translateY(1px); }
.btn.off { color: var(--ink-dim); opacity: 0.6; }
.btn-ico { font-size: 14px; line-height: 1; }

.hint {
  pointer-events: none;
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-dim);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.6s ease;
}

.hint b { color: var(--ink); font-weight: 600; }
.hint.faded { opacity: 0.25; }

.debug {
  pointer-events: none;
  padding: 7px 11px;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-dim);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  white-space: pre;
}

/* ── Loader ───────────────────────────────────────────────── */

#loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #131b36 0%, var(--night) 70%);
  transition: opacity 0.5s ease;
  z-index: 10;
}

#loader.done { opacity: 0; pointer-events: none; }

.loader-inner { text-align: center; width: min(320px, 78vw); }

.loader-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--warm);
  text-shadow: 0 0 30px rgba(255, 216, 155, 0.35);
}

.loader-sub {
  margin: 6px 0 20px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.loader-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(150, 180, 255, 0.14);
  overflow: hidden;
}

.loader-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb865, var(--warm));
  transition: width 0.2s ease;
}

.loader-msg {
  margin-top: 12px;
  min-height: 1.2em;
  font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #ff8f8f;
}

@media (max-width: 620px) {
  .btn-txt { display: none; }
  .badge-sub { display: none; }
  .hint { font-size: 11px; }
}
