/* Mode chip layout lives in styles.css (`.pdcModeChips*` / `.pdcSidebarColumn`). */

.pdcModeChooserIntro {
  margin: 0 0 10px;
  padding: 10px 12px 12px;
  border: 2px solid rgba(75, 248, 254, 0.45);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 14, 42, 0.94), rgba(8, 6, 22, 0.92));
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.pdcModeChooserIntro[hidden] {
  display: none !important;
}

.pdcModeChooserIntroText {
  margin: 0 0 10px;
  font-size: var(--fs-b-12);
  line-height: 1.5;
  color: rgba(246, 249, 255, 0.92);
}

.pdcModeChooserIntroText strong {
  color: rgba(255, 251, 128, 0.95);
  font-weight: 700;
}

.pdcModeChooserIntroDismiss {
  width: 100%;
  justify-content: center;
}

/* Skill modes — image buttons centred in column 1 with fixed gap. */
.pdcModeChipsBar {
  container-type: inline-size;
  container-name: pdcModeChipsBar;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pdcModeChipsLabel {
  text-align: center;
  width: 100%;
}

.pdcModeChipsRow {
  --pdc-mode-chip-scale: 1.25;
  --pdc-mode-chip-gap: calc(15px * var(--pdc-mode-chip-scale));
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--pdc-mode-chip-gap);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: unset;
  padding: 5px 0;
  box-sizing: border-box;
}

/* Narrow column (Fold cover, single-col dashboard): keep one row, shrink chips to fit. */
@container pdcModeChipsBar (max-width: 23.5rem) {
  .pdcModeChipsRow {
    --pdc-mode-chip-scale: 1;
    --pdc-mode-chip-gap: 6px;
    justify-content: space-between;
  }
}

@container pdcModeChipsBar (max-width: 17rem) {
  .pdcModeChipsRow {
    --pdc-mode-chip-scale: 0.88;
    --pdc-mode-chip-gap: 4px;
  }
}

@container pdcModeChipsBar (max-width: 13.5rem) {
  .pdcModeChipsRow {
    --pdc-mode-chip-scale: 0.76;
    --pdc-mode-chip-gap: 3px;
  }
}

/* Dashboard single-column grid (<980px): less space between mode buttons. */
@media (max-width: 980px) {
  main.grid.dashboard:not(.knowledgeMain) .pdcModeChipsRow {
    --pdc-mode-chip-gap: 8px;
  }

  @container pdcModeChipsBar (max-width: 23.5rem) {
    .pdcModeChipsRow {
      --pdc-mode-chip-gap: 5px;
    }
  }
}

/* Viewport fallback when container queries are unavailable or the bar is full-width narrow. */
@media (max-width: 400px) {
  main.grid.dashboard:not(.knowledgeMain) .pdcModeChipsRow {
    --pdc-mode-chip-scale: 0.92;
    --pdc-mode-chip-gap: 4px;
    justify-content: space-between;
  }
}

@media (max-width: 320px) {
  main.grid.dashboard:not(.knowledgeMain) .pdcModeChipsRow {
    --pdc-mode-chip-scale: 0.8;
    --pdc-mode-chip-gap: 3px;
  }
}

.pdcModeChipsRow .pdcModeChip--img {
  position: relative;
  display: block;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: min(
    calc(89px * var(--pdc-mode-chip-scale)),
    calc((100% - 2 * var(--pdc-mode-chip-gap)) / 3)
  );
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none !important;
  box-shadow: none !important;
  filter: none !important;
  animation: none !important;
  transform: none !important;
  text-decoration: none;
  line-height: 0;
  border-radius: 0;
  box-sizing: border-box;
  overflow: visible;
  isolation: isolate;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

@supports (width: 1cqi) {
  .pdcModeChipsRow .pdcModeChip--img {
    max-width: min(
      calc(89px * var(--pdc-mode-chip-scale)),
      calc((100cqi - 2 * var(--pdc-mode-chip-gap)) / 3)
    );
  }
}

.pdcModeChipsRow .pdcModeChip--img:hover,
.pdcModeChipsRow .pdcModeChip--img:focus-visible {
  background: none !important;
  box-shadow: none !important;
  filter: none !important;
  animation: none !important;
  transform: none !important;
}

.pdcModeChipsRow .pdcModeChip--img.activeGreen,
.pdcModeChipsRow .pdcModeChip--img.activeGreen:hover,
html.pdcWizardPage main.grid.dashboard .pdcModeChipsRow .pdcModeChip--img.activeGreen,
html.pdcWizardPage main.grid.dashboard .pdcModeChipsRow .pdcModeChip--img.activeGreen:hover {
  background: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.pdcModeChipsRow .pdcModeChip--img:focus-visible {
  outline: 2px solid rgba(255, 107, 203, 0.95);
  outline-offset: 3px;
}

.pdcModeChipsRow .pdcModeChip--img::before,
.pdcModeChipsRow .pdcModeChip--img::after {
  content: none !important;
  display: none !important;
}

/* Inner border colours from the pressed mode button artwork. */
.pdcModeChipsRow .pdcModeChip--img[data-pdc-mode="easy"] {
  --pdc-mode-glow-rgb: 255, 140, 40;
}

.pdcModeChipsRow .pdcModeChip--img[data-pdc-mode="normal"] {
  --pdc-mode-glow-rgb: 0, 232, 255;
}

.pdcModeChipsRow .pdcModeChip--img[data-pdc-mode="wizard"] {
  --pdc-mode-glow-rgb: 255, 45, 149;
}

/* Active mode — outer glow in full border colour (follows button shape, no centre wash). */
.pdcModeChipsRow .pdcModeChip--img.activeGreen {
  filter:
    drop-shadow(0 0 4px rgb(var(--pdc-mode-glow-rgb)))
    drop-shadow(0 0 10px rgb(var(--pdc-mode-glow-rgb))) !important;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes pdcModeChipGlowThrob {
    0%,
    100% {
      filter:
        drop-shadow(0 0 3px rgb(var(--pdc-mode-glow-rgb)))
        drop-shadow(0 0 8px rgb(var(--pdc-mode-glow-rgb))) !important;
    }
    50% {
      filter:
        drop-shadow(0 0 6px rgb(var(--pdc-mode-glow-rgb)))
        drop-shadow(0 0 14px rgb(var(--pdc-mode-glow-rgb)))
        drop-shadow(0 0 22px rgb(var(--pdc-mode-glow-rgb))) !important;
    }
  }

  .pdcModeChipsRow .pdcModeChip--img.activeGreen {
    animation: pdcModeChipGlowThrob 2.8s ease-in-out infinite !important;
  }
}

.pdcModeChipImg {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  pointer-events: none;
  user-select: none;
}

.pdcModeChipImg--pressed {
  display: none;
}

.pdcModeChip--img.activeGreen .pdcModeChipImg--static {
  display: none;
}

.pdcModeChip--img.activeGreen .pdcModeChipImg--pressed {
  display: block;
}
