#cheat-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  font-family: var(--f-label);
  color: var(--bone);
}

#cheat-badge {
  position: absolute;
  top: calc(56px + var(--sat));
  left: var(--gl);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  transition: opacity .18s ease;
}
#cheat-root.is-idle #cheat-badge {
  opacity: 0;
  visibility: hidden;
}
#cheat-badge span {
  padding: 5px 8px 4px;
  border: 1px solid rgba(255, 179, 71, .45);
  background: rgba(255, 179, 71, .12);
  color: var(--signal);
  font: 600 10px/1 var(--f-label);
  letter-spacing: .16em;
  margin-left: -.16em;
  box-shadow: 0 0 2px rgba(0, 0, 0, .6);
}

#jm3-god-btn {
  letter-spacing: .12em;
  padding-left: 18px;
  padding-right: 18px;
}
#jm3-god-btn.armed {
  border-color: rgba(255, 179, 71, .7);
  background: rgba(255, 179, 71, .12);
  color: var(--signal);
}
#jm3-god-btn.armed:hover {
  border-color: var(--signal);
  background: rgba(255, 179, 71, .2);
}
#jm3-god-btn:focus-visible {
  outline-color: var(--signal);
}
@media (max-width: 760px) {
  #jm3-god-btn {
    flex: 1 1 0;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 13px;
    letter-spacing: .04em;
  }
}

#cheat-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 10, .74);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility 0s linear .18s;
  outline: none;
}
#cheat-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .18s ease, visibility 0s;
}

.cp-card {
  width: min(430px, 100%);
  max-height: 100%;
  overflow: auto;
  padding:15px;
  border: 1px solid var(--line);
  background: var(--plate-solid);
  transform: translateY(6px);
  transition: transform .18s ease;
}

#cheat-panel.open .cp-card { transform: none; }

.cp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cp-eyebrow {
  margin: 0;
  font: 600 10px/1 var(--f-mono);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--steel);
}
.cp-title {
  margin: 9px 0 0;
  font: 900 26px/1.1 var(--f-display);
  letter-spacing: .06em;
  color: var(--bone);
}
.cp-x {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  background: none;
  color: var(--bone-dim);
  font: 400 13px/1 var(--f-label);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: color .16s ease, border-color .16s ease;
}
.cp-x:hover { color: var(--alarm); border-color: rgba(255, 90, 64, .6); }

.cp-headtxt { min-width: 0; }
.cp-acts {
  display: flex;
  flex: none;
  gap: 8px;
}
.cp-live {
  display: none;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
}

.lv-cell {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 13px 14px;
}
.lv-cell + .lv-cell { border-left: 1px solid var(--line); }

.lv-k {
  font: 600 9px/1 var(--f-label);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--steel);
}
.lv-bar {
  display: block;
  height: 4px;
  overflow: hidden;
  background: rgba(232, 228, 218, .14);
}
.lv-bar b {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  background: var(--bone);
  transition: width .18s linear;
}
.lv-bar--ammo b { background: var(--signal); }
.lv-bar--res b { background: var(--steel); }

.lv-n {
  font: 500 12px/1 var(--f-mono);
  letter-spacing: .04em;
  color: var(--bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lv-state {
  font: 600 13px/1 var(--f-label);
  letter-spacing: .1em;
  color: var(--signal);
}

#cheat-panel.wide {
  padding: 0;
  background: rgba(6, 8, 10, .93);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

#cheat-panel.wide .cp-card {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  padding: clamp(28px, 7vh, 84px) clamp(18px, 4vw, 64px) clamp(20px, 3.2vw, 44px);
  border-left-width: 3px;
  box-shadow: none;
  transform: none;
}

#cheat-panel.wide .cp-title { font-size: clamp(26px, 3.2vw, 44px); }

#cheat-panel.wide .cp-head,
#cheat-panel.wide .cp-rows,
#cheat-panel.wide .cp-live { max-width: 1040px; width: 100%; }

#cheat-panel.wide .cp-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 28px;
}
#cheat-panel.wide .cp-row { padding: 18px 16px; }
#cheat-panel.wide .cp-name { font-size: 17px; }

#cheat-panel.wide .cp-live {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}
#cheat-panel.wide .lv-cell { padding: 15px 16px; }
#cheat-panel.wide .cp-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1040px;
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 720px) {
  #cheat-panel.wide .cp-live { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #cheat-panel.wide .lv-cell:nth-child(n+3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

.cp-rows {
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 12px 13px;
  margin: 0;
  border: 1px solid var(--line);
  background: rgba(232, 228, 218, .03);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .16s ease, background .16s ease;
}
.cp-row:hover {
  border-color: rgba(255, 179, 71, .5);
  background: rgba(255, 179, 71, .07);
}
.cp-row[aria-pressed="true"] {
  border-color: rgba(255, 179, 71, .75);
  background: rgba(255, 179, 71, .12);
}
.cp-row:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
.cp-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 600 15px/1 var(--f-label);
  letter-spacing: .08em;
}
.cp-name em {
  font: 400 11px/1.35 var(--f-label);
  font-style: normal;
  letter-spacing: .04em;
  color: rgba(232, 228, 218, .55);
}

.cp-sw {
  position: relative;
  flex: none;
  width: 42px;
  height: 22px;
  border: 1.5px solid var(--bone-faint);
  border-radius: 999px;
  transition: border-color .16s ease, background .16s ease;
}
.cp-sw i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(232, 228, 218, .5);
  transition: transform .16s ease, background .16s ease;
}
.cp-row[aria-pressed="true"] .cp-sw {
  border-color: var(--signal);
  background: rgba(255, 179, 71, .18);
}
.cp-row[aria-pressed="true"] .cp-sw i {
  transform: translateX(19px);
  background: var(--signal);
}

.cp-quick {
  display: none;
  gap: 8px;
  margin-top: 10px;
}
.cp-q {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(232, 228, 218, .03);
  color: var(--bone);
  font: 600 13px/1 var(--f-label);
  letter-spacing: .06em;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .16s ease, background .16s ease;
}
.cp-q em {
  font: 400 10px/1 var(--f-mono);
  font-style: normal;
  letter-spacing: .04em;
  color: var(--steel);
}
.cp-q:hover {
  border-color: rgba(255, 179, 71, .5);
  background: rgba(255, 179, 71, .07);
}
.cp-q:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

#cheat-toast {
  position: absolute;
  left: 50%;
  bottom: calc(9% + var(--sab));
  transform: translate(-50%, 6px);
  padding: 9px 14px 8px;
  border-left: 2px solid var(--signal);
  background: var(--plate-solid);
  color: var(--bone);
  font: 600 12px/1 var(--f-label);
  letter-spacing: .14em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55);
}
#cheat-toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

#cheat-panel.wide ~ #cheat-toast {
  bottom: calc(18% + var(--sab));
}

@media (hover: none) and (pointer: coarse) {
  #cheat-panel { padding: 16px; }
  .cp-title { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  #cheat-panel,
  .cp-card,
  .cp-row,
  .cp-sw,
  .cp-sw i,
  .lv-bar b,
  #cheat-toast { transition-duration: .01ms; }
}
