/*
 * Purple · Dev QA panel
 *
 * Floating dev-fab in the top-right corner. Click opens a right-side
 * sheet with scenario buttons (role, theme, home state, GO mission
 * state, week themes, tier upgrade, withdraw flow, ticket reset, nav).
 *
 * Hidden on screens narrower than 520px (production mobile) unless
 * the URL contains ?dev=1.
 */

.dev-fab {
  display: flex;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(60,60,72,.85);
  border: 0.5px solid rgba(255,255,255,.18);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  transition: transform .15s, background .15s;
}

.dev-fab:hover {
  background: rgba(80,80,92,.9);
  transform: scale(1.05);
}

.dev-fab:active {
  transform: scale(.92);
}

[data-theme="light"] .dev-fab {
  background: rgba(255,255,255,.95);
  color: #1a1a1f;
  border-color: rgba(0,0,0,.1);
}

@media (max-width: 520px) {
  .dev-fab {
    display: none;
  }
}

.dev-panel-bg {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 60px 16px 16px;
  opacity: 0;
  transition: opacity .25s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.dev-panel-bg.open {
  display: flex;
  opacity: 1;
}

.dev-panel {
  width: 280px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: #1c1c1f;
  color: #fff;
  border: 0.5px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 14px 16px 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  font-family: var(--f);
  transform: translateY(-10px);
  transition: transform .3s var(--ease);
}

.dev-panel-bg.open .dev-panel {
  transform: translateY(0);
}

[data-theme="light"] .dev-panel {
  background: #ffffff;
  color: #1a1a1f;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 24px 60px rgba(60,60,90,.18);
}

.dev-panel-h {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dev-panel-h .close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dev-panel-h .close:hover {
  background: rgba(255,255,255,.16);
}

[data-theme="light"] .dev-panel-h .close {
  background: rgba(0,0,0,.06);
}

[data-theme="light"] .dev-panel-h .close:hover {
  background: rgba(0,0,0,.1);
}

.dev-section {
  margin-bottom: 14px;
}

.dev-section:last-child {
  margin-bottom: 0;
}

.dev-section-l {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 6px;
}

[data-theme="light"] .dev-section-l {
  color: rgba(0,0,0,.5);
}

.dev-section-d {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.4);
  margin: -2px 0 8px;
  line-height: 1.4;
  letter-spacing: -.005em;
}

[data-theme="light"] .dev-section-d {
  color: rgba(0,0,0,.45);
}

.dev-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dev-btn {
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  border: 0.5px solid rgba(255,255,255,.1);
  color: inherit;
  font-size: 12px;
  font-weight: 520;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .1s, color .15s;
  letter-spacing: -.01em;
}

.dev-btn:hover {
  background: rgba(255,255,255,.12);
}

.dev-btn:active {
  transform: scale(.96);
}

.dev-btn.on {
  background: #bf99f7;
  color: #1a0533;
  border-color: transparent;
  font-weight: 700;
}

.dev-btn.danger {
  color: #ff7a7a;
  border-color: rgba(255,122,122,.25);
}

.dev-btn.danger:hover {
  background: rgba(255,122,122,.12);
}

.dev-btn.full {
  width: 100%;
  text-align: center;
  justify-content: center;
}

[data-theme="light"] .dev-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
}

[data-theme="light"] .dev-btn:hover {
  background: rgba(0,0,0,.08);
}

[data-theme="light"] .dev-btn.on {
  color: #fff;
  background: #7c3aed;
}
