/* ============================================================
   PATH OF LUMEN — ui.css
   Panels, buttons, HUD, modals, how-to, settings, toasts
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  min-width: 220px;
  padding: 14px 26px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(180deg, #241950, #140d34);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  touch-action: manipulation;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn:hover,
.btn:focus-visible {
  border-color: rgba(80, 224, 255, 0.6);
  box-shadow: var(--glow-cyan), 0 6px 18px rgba(0, 0, 0, 0.35);
  outline: none;
}
.btn:active {
  transform: translateY(2px) scale(0.98);
}
.btn--primary {
  background: linear-gradient(180deg, #9f8aff, #6b53d8);
  border-color: rgba(120, 224, 255, 0.7);
  color: #fff;
  box-shadow: 0 6px 24px rgba(27, 134, 232, 0.45);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  box-shadow: 0 6px 30px rgba(53, 200, 255, 0.7);
}
.btn--danger {
  background: linear-gradient(180deg, #5a2233, #3c1622);
  border-color: rgba(255, 91, 106, 0.4);
  color: #ffd2d8;
}
.btn--danger:hover,
.btn--danger:focus-visible {
  border-color: rgba(255, 91, 106, 0.8);
  box-shadow: 0 0 18px rgba(255, 91, 106, 0.35);
}
.btn--toggle {
  min-width: 84px;
  text-align: center;
}
.btn--toggle.on {
  background: linear-gradient(180deg, #2dd08a, #1a9f6b);
  border-color: rgba(105, 240, 174, 0.6);
  color: #03231a;
}
.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, rgba(27, 18, 62, 0.96), rgba(10, 7, 27, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 38px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  width: min(560px, 90vw);
  max-height: 88dvh;
  overflow-y: auto;
}
.panel-title {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 900;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 22px;
  background: linear-gradient(180deg, #fff, var(--cyan-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.panel-title.success {
  background: linear-gradient(180deg, #fff, var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.panel-title.danger {
  background: linear-gradient(180deg, #fff, var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.panel-foot {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

/* ---------- Main menu ---------- */
#screen-menu {
  background:
    radial-gradient(90% 70% at 50% 0%, #1a2148 0%, var(--bg-0) 70%);
}
.menu-panel {
  position: relative;
  z-index: 2;
  text-align: center;
}
.menu-title {
  margin-bottom: 6px;
}
.menu-subtitle {
  letter-spacing: 4px;
  font-size: 12px;
  color: var(--ink-dim);
  margin-bottom: 30px;
}
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.menu-deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  animation: drift ease-in-out infinite;
}
.orb--big {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(80, 224, 255, 0.28), transparent 65%);
  top: -80px;
  left: -120px;
  animation-duration: 9s;
}
.orb--small {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(155, 123, 255, 0.3), transparent 65%);
  bottom: -60px;
  right: -90px;
  animation-duration: 12s;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.08); }
}

/* ---------- How to play ---------- */
.howto-body {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}
.howto-body h3 {
  color: var(--cyan-soft);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 16px 0 6px;
}
.howto-body h3:first-child { margin-top: 0; }
.howto-body p, .howto-body li {
  color: #c6cde9;
}
.howto-body ul {
  padding-left: 20px;
}
.howto-body li { margin: 3px 0; }
.howto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 6px;
}
.control-key {
  display: inline-block;
  background: #1b1242;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 700;
  color: var(--cyan-soft);
}

/* ---------- Settings ---------- */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-of-type { border-bottom: none; }
.setting-label {
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 14px;
  color: #d4dcf5;
}
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 6px;
  border-radius: 999px;
  background: #24185a;
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--cyan));
  box-shadow: var(--glow-cyan);
  cursor: pointer;
}
.range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--cyan));
  box-shadow: var(--glow-cyan);
  cursor: pointer;
}
.settings-extra {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 0;
  z-index: 15;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-left, .hud-right, .hud-center {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hud-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(18, 11, 43, 0.78);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.hud-btn:hover, .hud-btn:focus-visible {
  border-color: rgba(80, 224, 255, 0.6);
  box-shadow: var(--glow-cyan);
  outline: none;
}
.hud-level {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 15px;
  background: rgba(18, 11, 43, 0.78);
  border: 1px solid var(--line);
  padding: 9px 13px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.hud-level span { color: var(--cyan-soft); }
.hud-center {
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hud-lumen {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--amber);
  background: rgba(18, 11, 43, 0.78);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.25);
  backdrop-filter: blur(6px);
}
.hud-lumen span { color: #fff; }
.hud-progress-ring {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-dim);
  background: rgba(18, 11, 43, 0.78);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
#hud-collected { color: var(--cyan-soft); font-weight: 800; }
#hud-total { color: var(--ink-dim); }
.hud-timer {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  background: rgba(18, 11, 43, 0.78);
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

/* ---------- Modals ---------- */
.modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 14, 0.72);
  backdrop-filter: blur(4px);
  z-index: 40;
  animation: fade-in 0.25s ease;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-panel {
  text-align: center;
  animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop-in {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.complete-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 14px 0 20px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.stat-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--cyan-soft);
}
.confirm-text {
  color: #c6cde9;
  text-align: center;
  margin: 4px 0 18px;
}

/* ---------- Path controls: one row of round chevron buttons ----------
   Hidden entirely on large screens (see responsive.css); shown only
   on small / touch devices. Each arrow sits inside a circular button;
   the disc lights up while pressed. */
.direction-hint {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  z-index: 30;
  pointer-events: none;
}
.dh-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1px solid rgba(123, 231, 255, 0.32);
  background: rgba(13, 17, 42, 0.55);
  color: rgba(168, 240, 255, 0.72);
  box-shadow:
    inset 0 0 14px rgba(38, 66, 140, 0.45),
    0 2px 10px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.14s ease, transform 0.12s ease, background 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.dh-btn svg {
  width: 28px;
  height: 28px;
  display: block;
  overflow: visible;
  transition: filter 0.14s ease, transform 0.12s ease;
}
.dh-btn svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dh-btn.active-dir {
  color: rgba(194, 246, 255, 0.9);
  border-color: rgba(123, 231, 255, 0.55);
}
.dh-btn:active,
.dh-btn.pressed {
  color: #ffffff;
  background: rgba(28, 62, 128, 0.72);
  border-color: rgba(123, 231, 255, 0.85);
  transform: scale(1.07);
  box-shadow:
    0 0 14px rgba(123, 231, 255, 0.55),
    0 0 26px rgba(123, 231, 255, 0.28);
}
.dh-btn:active svg,
.dh-btn.pressed svg {
  filter: drop-shadow(0 0 8px rgba(123, 231, 255, 0.95))
    drop-shadow(0 0 14px rgba(123, 231, 255, 0.5));
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 26px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 19, 44, 0.92);
  border: 1px solid var(--line);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  z-index: 60;
  box-shadow: var(--glow-cyan);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
