/* ══════════════════════════════════════════════════════════════════════
   LOCK PICKING TEST STYLESHEET (style.css)
   Conforming to ReflexBench Assessment Development Specification
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --test-accent: #f59e0b;
  --test-accent-soft: rgba(245, 158, 11, 0.12);
  --test-accent-border: rgba(245, 158, 11, 0.28);
  --arena-bg: #0e131d;
  --arena-border: rgba(245, 158, 11, 0.20);
}

/* ── Fullscreen Fit-to-Screen Arena during Active Gameplay ── */
body:has(#panelTask.active) {
  overflow: hidden !important;
}

body:has(#panelTask.active) header.panda-header,
body:has(#panelTask.active) .panda-nav,
body:has(#panelTask.active) footer.panda-footer,
body:has(#panelTask.active) .t-ambient-glow,
body:has(#panelTask.active) .t-seo-container,
body:has(#panelTask.active) .t-nav {
  display: none !important;
}

body:has(#panelTask.active) .t-shell {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body:has(#panelTask.active) .t-card {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #0e131d !important;
  box-shadow: none !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
}

body:has(#panelTask.active) #panelTask {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

body:has(#panelTask.active) .lock-arena {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

/* ── Dedicated Lock Inspection Station ── */
.lock-arena {
  position: relative;
  width: 100%;
  min-height: 500px;
  height: 65vh;
  max-height: 720px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #111827 45%, #090d15 100%);
  border: 1px solid var(--arena-border);
  border-radius: 16px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.05);
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}

#webgl-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Success Glow Flash */
.lock-success-glow {
  animation: lockFlash 0.38s ease-out;
}

@keyframes lockFlash {
  0% { filter: brightness(1.6) drop-shadow(0 0 50px rgba(0, 255, 136, 0.8)); }
  100% { filter: brightness(1); }
}

/* ── Standard Minimalist Top Bar ── */
.top-header {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

.hub-pill {
  pointer-events: auto;
  text-decoration: none;
  color: var(--color-on-surface-variant, #94a3b8);
  background: var(--color-surface, rgba(15, 23, 42, 0.75));
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-family: var(--font-b, 'Lexend', sans-serif);
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.hub-pill:hover {
  color: var(--color-on-background, #ffffff);
  border-color: var(--test-accent, #f59e0b);
  background: var(--color-surface-dim, rgba(245, 158, 11, 0.1));
}

.round-pill.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface, rgba(15, 23, 42, 0.75));
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  padding: 5px 16px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-on-background, #f1f5f9);
  backdrop-filter: blur(8px);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--test-accent, #f59e0b);
  box-shadow: 0 0 8px var(--test-accent, #f59e0b);
  animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.restart-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  background: var(--color-surface, rgba(15, 23, 42, 0.75));
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  padding: 5px 14px;
  color: var(--color-on-surface-variant, #94a3b8);
  font-size: 0.82rem;
  font-family: var(--font-b, 'Lexend', sans-serif);
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.restart-pill:hover {
  color: var(--color-on-background, #ffffff);
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--color-surface-dim, rgba(255, 255, 255, 0.08));
}

/* ── Tactile Durability HUD Overlay ── */
.lp-hud-overlay {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.lp-durability-container {
  width: 100%;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 9px 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.lp-durability-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.lp-durability-title {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.70rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lp-durability-pct {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.82rem;
  font-weight: 800;
  color: #10b981;
}

.lp-durability-pct.warning { color: #f59e0b; }
.lp-durability-pct.danger { color: #ef4444; }

.lp-durability-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.lp-durability-fill {
  height: 100%;
  background: #10b981;
  border-radius: 999px;
  transition: width 0.08s linear, background-color 0.2s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.lp-durability-fill.warning {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.lp-durability-fill.danger {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
}

/* Tension Alert Badge */
.lp-tension-alert {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.65);
  border-radius: 8px;
  padding: 6px 14px;
  color: #fca5a5;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: tensionRattle 0.12s infinite alternate;
}

.lp-tension-alert.active {
  display: inline-flex;
}

@keyframes tensionRattle {
  0% { transform: translate(-2px, 0); }
  100% { transform: translate(2px, 0); }
}

/* Floating Feedback Text */
.floating-text {
  position: fixed;
  transform: translate(-50%, -50%);
  font-family: var(--font-h, 'Manrope', sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  pointer-events: none;
  z-index: 9999;
  letter-spacing: 0.04em;
  animation: floatUp 0.8s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, -30%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(1.15); }
}

/* ══════════════════════════════════════════════════════════════════════
   AUTHENTIC 3D ROTATING LOCK PREVIEW BOX ("How It Works")
   ══════════════════════════════════════════════════════════════════════ */
.lp-preview-box {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 190px;
  margin: 18px auto 12px;
  background: radial-gradient(circle at 50% 50%, #151d2a 0%, #0b0f17 100%);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.35);
}

.lp-preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Sweet Spot Cracked Badge */
.lp-prev-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.lp-prev-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.lp-preview-caption {
  font-size: 0.82rem;
  color: var(--color-on-surface-variant);
  line-height: 1.55;
  text-align: center;
  max-width: 520px;
  margin: 0 auto 20px;
}

/* ══════════════════════════════════════════════════════════════════════
   PERFORMANCE BRACKET HIGHLIGHT (.rt-range-row.active)
   ══════════════════════════════════════════════════════════════════════ */
.rt-range-row.active {
  opacity: 1 !important;
  transform: scale(1.02) !important;
  border-width: 1.5px !important;
  font-weight: 700 !important;
}

.rt-range-row.active.elite {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25) !important;
}
.rt-range-row.active.elite .rt-range-dot {
  background: #10b981 !important;
  box-shadow: 0 0 10px #10b981 !important;
  opacity: 1 !important;
  transform: scale(1.3) !important;
}
.rt-range-row.active.elite .rt-range-val {
  color: #10b981 !important;
  font-weight: 700 !important;
}

.rt-range-row.active.fast {
  background: rgba(14, 165, 233, 0.16) !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25) !important;
}
.rt-range-row.active.fast .rt-range-dot {
  background: #0ea5e9 !important;
  box-shadow: 0 0 10px #0ea5e9 !important;
  opacity: 1 !important;
  transform: scale(1.3) !important;
}
.rt-range-row.active.fast .rt-range-val {
  color: #0ea5e9 !important;
  font-weight: 700 !important;
}

.rt-range-row.active.avg {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25) !important;
}
.rt-range-row.active.avg .rt-range-dot {
  background: #f59e0b !important;
  box-shadow: 0 0 10px #f59e0b !important;
  opacity: 1 !important;
  transform: scale(1.3) !important;
}
.rt-range-row.active.avg .rt-range-val {
  color: #f59e0b !important;
  font-weight: 700 !important;
}

.rt-range-row.active.slow {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25) !important;
}
.rt-range-row.active.slow .rt-range-dot {
  background: #ef4444 !important;
  box-shadow: 0 0 10px #ef4444 !important;
  opacity: 1 !important;
  transform: scale(1.3) !important;
}
.rt-range-row.active.slow .rt-range-val {
  color: #ef4444 !important;
  font-weight: 700 !important;
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE VIEWPORT OPTIMIZATIONS (Strictly Scoped to Mobile Screen Widths)
   ══════════════════════════════════════════════════════════════════════ */
.lp-mobile-controls {
  display: none;
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  body:has(#panelTask.active) .t-shell,
  body:has(#panelTask.active) .t-card,
  body:has(#panelTask.active) #panelTask {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .top-header {
    top: max(12px, env(safe-area-inset-top, 12px)) !important;
    left: 12px !important;
    right: 12px !important;
  }

  .lp-mobile-controls {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 360px;
    z-index: 25;
    pointer-events: auto;
  }

  .lp-slider-row {
    background: rgba(13, 19, 31, 0.88);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    padding: 8px 14px 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
  }

  .lp-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }

  .lp-slider-title {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .lp-slider-angle {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    font-weight: 800;
    color: #f59e0b;
    letter-spacing: 0.04em;
  }

  .lp-slider-track-wrap {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
  }

  .lp-slider-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
  }

  .lp-slider-center-tick {
    position: absolute;
    left: 50%;
    top: -3px;
    width: 2px;
    height: 12px;
    background: rgba(245, 158, 11, 0.6);
    transform: translateX(-50%);
    border-radius: 1px;
  }

  .lp-slider-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f59e0b;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.8), 0 2px 6px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: transform 0.06s ease;
  }

  .lp-slider-track-wrap:active .lp-slider-thumb {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 18px rgba(245, 158, 11, 1);
  }

  .lp-touch-tension-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 12px;
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: rgba(245, 158, 11, 0.2);
    border: 1.5px solid rgba(245, 158, 11, 0.6);
    color: #fbbf24;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.25);
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.12s ease;
  }

  .lp-touch-tension-btn:active,
  .lp-touch-tension-btn.active {
    background: rgba(245, 158, 11, 0.55) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.7) !important;
    transform: scale(0.97) !important;
  }

  .lp-hud-overlay {
    bottom: max(148px, calc(env(safe-area-inset-bottom, 0px) + 140px)) !important;
  }
}

