/* Interactive Profile Experience overlay (plain CSS, no framework) */

html.pe-open, html.pe-open body { overflow: hidden; }

.pe-root {
  --pe-cyan: #38bdf8;
  --pe-indigo: #818cf8;
  --pe-text: #e2e8f0;
  --pe-muted: #94a3b8;
  --pe-panel: rgba(15, 23, 42, 0.8);
  --pe-border: rgba(148, 163, 184, 0.28);
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  color: var(--pe-text);
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.pe-root *, .pe-root *::before, .pe-root *::after { box-sizing: border-box; }
.pe-root .pe-hidden, .pe-root.pe-hidden { display: none !important; }
.pe-root button { font: inherit; color: inherit; cursor: pointer; }

.pe-layer { position: absolute; inset: 0; }
.pe-css3d { z-index: 0; pointer-events: none; overflow: hidden; }
.pe-canvas { z-index: 1; width: 100%; height: 100%; display: block; touch-action: none; }

.pe-panel {
  background: var(--pe-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pe-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.pe-accent { color: var(--pe-cyan); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.pe-muted { color: var(--pe-muted); }

/* Reticle */
.pe-reticle { z-index: 2; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.pe-reticle-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--pe-cyan);
  background: rgba(56, 189, 248, 0.2);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  transition: transform .15s, background-color .15s, border-color .15s;
}
.pe-reticle-dot.pe-active { background: var(--pe-cyan); border-color: #fff; transform: scale(1.25); }

/* Desktop HUD */
.pe-hud {
  position: absolute;
  top: 24px; left: 24px; right: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.pe-hud-info {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #cbd5e1;
}
.pe-hud-controls { display: contents; }
.pe-hud-controls kbd {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
  font-family: inherit;
}
.pe-gamepad-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(2, 44, 34, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-size: 11px;
}
.pe-btn-small {
  pointer-events: auto;
  padding: 8px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color .2s;
}
.pe-btn-small:hover, .pe-btn-small:focus-visible { border-color: var(--pe-cyan); }
@media (max-width: 639px) {
  .pe-hud { display: none; }
}

/* Interaction prompt */
.pe-prompt {
  position: absolute;
  bottom: 64px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 10px 20px;
  border-color: rgba(56, 189, 248, 0.6);
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  pointer-events: none;
}
.pe-prompt kbd {
  display: inline-block;
  margin: 0 4px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--pe-cyan);
  color: #000;
  font-weight: 900;
  font-family: inherit;
}

/* Start / loading card */
.pe-start {
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  text-align: center;
}
.pe-card {
  max-width: 460px;
  width: 100%;
  padding: 32px;
  border-radius: 24px;
  border-color: rgba(56, 189, 248, 0.4);
}
.pe-card > * + * { margin-top: 16px; }
.pe-card h3 { margin: 0; font-size: 24px; font-weight: 700; color: #fff; }
.pe-card p { margin: 0; color: #cbd5e1; font-size: 13px; }
.pe-card-icon {
  width: 64px; height: 64px;
  margin: 0 auto;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: rgba(8, 47, 73, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.5);
}
.pe-controls-box {
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid #1e293b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #7dd3fc;
}
.pe-btn-primary {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--pe-cyan), #6366f1);
  color: #000 !important;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: transform .15s;
}
.pe-btn-primary:hover, .pe-btn-primary:focus-visible { transform: scale(1.02); }
.pe-btn-link {
  display: inline-block;
  background: none;
  border: 0;
  padding: 4px;
  color: var(--pe-muted) !important;
  font-size: 12px;
  text-decoration: underline;
}
.pe-btn-link:hover { color: #fff !important; }

/* Placard */
.pe-placard-wrap {
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: text;
  -webkit-user-select: text;
}
.pe-placard { position: relative; max-width: 580px; text-align: left; }
.pe-placard-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 0 32px 12px 0;
  border-bottom: 1px solid #1e293b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
.pe-placard p { font-size: 14px; line-height: 1.6; }
.pe-placard-text p + p { margin-top: 10px; }
.pe-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  font-size: 18px;
  line-height: 1;
}
.pe-tech { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-tech span {
  padding: 4px 10px;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #67e8f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.pe-btn-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pe-btn-secondary:hover { background: #334155; }

/* Mobile virtual controls */
.pe-mobile { z-index: 4; pointer-events: none; }
.pe-mobile-top {
  position: absolute;
  top: 16px; left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pe-touch-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #67e8f9;
}
.pe-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pe-cyan);
  animation: pe-pulse 1.6s ease-in-out infinite;
}
@keyframes pe-pulse { 50% { opacity: .35; } }

.pe-stick-zone {
  width: 128px; height: 128px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
  touch-action: none;
}
.pe-stick-left { position: absolute; bottom: 24px; left: 24px; }
.pe-stick-base {
  position: relative;
  width: 112px; height: 112px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.4);
  background: rgba(2, 6, 23, 0.6);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}
.pe-stick-look { border-color: rgba(129, 140, 248, 0.4); box-shadow: 0 0 20px rgba(129, 140, 248, 0.2); }
.pe-tick { position: absolute; background: rgba(56, 189, 248, 0.5); border-radius: 4px; }
.pe-stick-look .pe-tick { background: rgba(129, 140, 248, 0.5); }
.pe-tick.pe-t { top: 6px; width: 4px; height: 8px; }
.pe-tick.pe-b { bottom: 6px; width: 4px; height: 8px; }
.pe-tick.pe-l { left: 6px; width: 8px; height: 4px; }
.pe-tick.pe-r { right: 6px; width: 8px; height: 4px; }
.pe-stick-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--pe-muted);
  pointer-events: none;
}
.pe-stick-knob {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pe-cyan), #0284c7);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform 75ms;
  pointer-events: none;
}
.pe-stick-look .pe-stick-knob { background: linear-gradient(135deg, var(--pe-indigo), #9333ea); box-shadow: 0 4px 12px rgba(129, 140, 248, 0.5); }
.pe-stick-knob div { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.8); }

.pe-right-cluster {
  position: absolute;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  pointer-events: none;
}
.pe-interact {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  color: var(--pe-muted) !important;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .6;
  transition: all .2s;
}
.pe-interact span:first-child { font-size: 16px; }
.pe-interact.pe-ready {
  opacity: 1;
  background: linear-gradient(90deg, #06b6d4, var(--pe-cyan));
  border-color: #67e8f9;
  color: #000 !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.7);
  transform: scale(1.05);
}

/* Toast */
.pe-toast {
  position: absolute;
  bottom: 24px; left: 50%;
  z-index: 9;
  transform: translate(-50%, 12px);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.pe-toast.pe-toast-show { opacity: 1; transform: translate(-50%, 0); }
