/* Dead pixel test. Hero, content sections, cards and FAQ come from
   tool_page.css; the control panels, the fullscreen stage and the test
   surfaces are here. */

/* The star field behind the hero is a positioned image, so the panels need
   their own stacking context or it swallows every click. */
.dpx {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto 56px auto;
  padding: 0 16px;
}

.dpx-panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.dpx-panel-title {
  margin: 0 0 6px 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.dpx-hint {
  margin: 0 0 14px 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 22px;
}

.dpx-label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
}

.dpx-start-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.dpx-field {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.dpx-select,
.dpx-number {
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
}

.dpx-select option {
  color: #111;
}

.dpx-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 21px;
  cursor: pointer;
}

.dpx-check--spaced {
  margin-top: 16px;
}

.dpx-hint--footnote {
  margin-top: 12px;
  margin-bottom: 0;
}

.dpx-check input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #6e00ff;
}

.dpx-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* -------------------------------------------------------- colour swatches */

.dpx-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.dpx-swatch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.dpx-swatch:hover {
  border-color: rgba(110, 0, 255, 0.75);
  transform: translateY(-2px);
}

.dpx-swatch span {
  padding: 0 6px 10px 6px;
}

.dpx-swatch-chip {
  height: 52px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.12);
}

/* ------------------------------------------------------------- facts grid */

.dpx-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.dpx-fact {
  padding: 12px 14px;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
}

.dpx-fact dt {
  margin: 0 0 4px 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 500;
}

.dpx-fact dd {
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ fixer panel */

.dpx-warning {
  display: flex;
  gap: 12px;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 176, 32, 0.5);
  background: rgba(255, 176, 32, 0.1);
}

.dpx-warning i {
  flex: 0 0 auto;
  color: #ffb020;
  font-size: 22px;
  line-height: 26px;
}

.dpx-warning-body h3 {
  margin: 0 0 6px 0;
  color: #ffd27a;
  font-size: 15px;
  font-weight: 600;
}

.dpx-warning-body p {
  margin: 0 0 8px 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 22px;
}

.dpx-warning-body p:last-child {
  margin-bottom: 0;
}

.tp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ------------------------------------------------------------- keys table */

.dpx-keys {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 18px;
  margin-top: 12px;
}

.dpx-key {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 24px;
}

.dpx-key kbd {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 0.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  text-align: center;
}

/* ----------------------------------------------------------------- stage */

body.dpx-locked {
  overflow: hidden;
}

.dpx-stage {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #000;
  outline: none;
}

.dpx-stage[hidden] {
  display: none;
}

.dpx-stage.is-idle {
  cursor: none;
}

.dpx-stage .dpx-surface {
  position: absolute;
  inset: 0;
}

.dpx-surface {
  background: #000;
}

.dpx-stage[data-mode="fix"] .dpx-surface {
  display: none;
}

.dpx-surface[data-screen="black"] { background: #000; }
.dpx-surface[data-screen="white"] { background: #fff; }
.dpx-surface[data-screen="red"] { background: #f00; }
.dpx-surface[data-screen="green"] { background: #0f0; }
.dpx-surface[data-screen="blue"] { background: #00f; }
.dpx-surface[data-screen="cyan"] { background: #0ff; }
.dpx-surface[data-screen="magenta"] { background: #f0f; }
.dpx-surface[data-screen="yellow"] { background: #ff0; }
.dpx-surface[data-screen="gray25"] { background: #404040; }
.dpx-surface[data-screen="gray50"] { background: #808080; }
.dpx-surface[data-screen="gray75"] { background: #bfbfbf; }

.dpx-surface[data-screen="grayscale"] {
  background: linear-gradient(to right, #000 0%, #fff 100%);
}

.dpx-surface[data-screen="spectrum"] {
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

/* Sixteen equal steps from black to white: banding on a panel that cannot
   resolve them shows up as a step that looks the same as its neighbour. */
.dpx-surface[data-screen="steps"] {
  background: linear-gradient(
    to right,
    #000 0 6.25%, #111 6.25% 12.5%, #222 12.5% 18.75%, #333 18.75% 25%,
    #444 25% 31.25%, #555 31.25% 37.5%, #666 37.5% 43.75%, #777 43.75% 50%,
    #888 50% 56.25%, #999 56.25% 62.5%, #aaa 62.5% 68.75%, #bbb 68.75% 75%,
    #ccc 75% 81.25%, #ddd 81.25% 87.5%, #eee 87.5% 93.75%, #fff 93.75% 100%
  );
}

.dpx-surface[data-screen="bars"] {
  background: linear-gradient(
    to right,
    #fff 0 12.5%, #ff0 12.5% 25%, #0ff 25% 37.5%, #0f0 37.5% 50%,
    #f0f 50% 62.5%, #f00 62.5% 75%, #00f 75% 87.5%, #000 87.5% 100%
  );
}

.dpx-surface[data-screen="grid"] {
  background-color: #000;
  background-image:
    repeating-linear-gradient(to right, rgba(255, 255, 255, 0.85) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 0 1px, transparent 1px 64px);
}

/* One-pixel checkerboard. A sharp panel at its native resolution shows an
   even grey; a scaled or blurry one shows moire or a soft wash. */
.dpx-surface[data-screen="sharpness"] {
  background-color: #000;
  background-image: repeating-conic-gradient(#fff 0% 25%, #000 0% 50%);
  background-size: 2px 2px;
}

.dpx-surface[data-screen="geometry"] {
  background-color: #000;
  background-image: repeating-radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.9) 0 1px,
    transparent 1px 48px
  );
}

/* ------------------------------------------------------------------- HUD */

.dpx-hud {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 12, 16, 0.82);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  transition: opacity 0.35s ease;
}

.dpx-hud.is-idle {
  opacity: 0;
  pointer-events: none;
}

.dpx-hud.is-hidden {
  display: none;
}

.dpx-hud:hover {
  opacity: 1;
}

.dpx-hud-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
}

.dpx-hud-name {
  font-size: 15px;
  font-weight: 600;
}

.dpx-hud-hint {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 17px;
}

.dpx-hud-position,
.dpx-hud-timer {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.dpx-hud-timer {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.dpx-hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dpx-hud-btn {
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 0.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.dpx-hud-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.dpx-hud-btn--exit {
  border-color: rgba(255, 90, 90, 0.6);
  background: rgba(255, 90, 90, 0.18);
}

.dpx-stage[data-mode="test"] .dpx-fix-only,
.dpx-stage[data-mode="fix"] .dpx-test-only {
  display: none;
}

.dpx-note {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(12, 12, 16, 0.85);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 19px;
  text-align: center;
}

/* ----------------------------------------------------------- fixer box */

.dpx-box {
  position: absolute;
  left: 0;
  top: 0;
  width: 320px;
  height: 320px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
  cursor: move;
  touch-action: none;
}

.dpx-stage[data-mode="test"] .dpx-box {
  display: none;
}

.dpx-box canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dpx-box-handle {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 2px solid rgba(0, 0, 0, 0.65);
  background: #fff;
  cursor: nwse-resize;
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 767px) {
  .dpx {
    padding: 0 12px;
  }

  .dpx-panel {
    padding: 16px;
  }

  .dpx-field {
    min-width: 100%;
  }

  .dpx-hud {
    left: 12px;
    right: 12px;
    bottom: 14px;
    max-width: none;
    transform: none;
    justify-content: space-between;
  }

  .dpx-hud-meta {
    min-width: 100%;
  }

  .dpx-swatches {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }
}
