/* PS3 World - PS3 Error Codes (loaded after style.css) */

.ec-search {
  position: sticky;
  top: 72px;
  z-index: 5;
  margin: 8px 0 28px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.ec-box input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a849c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 16px 50% / 20px no-repeat;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.ec-box input:focus { border-color: var(--ps-blue-2); box-shadow: var(--ring); }

.ec-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.ec-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 10px 5px 13px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.ec-chip:hover { color: #fff; border-color: color-mix(in srgb, var(--ps-sky) 55%, transparent); }
.ec-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.ec-chip[aria-pressed="true"] {
  border-color: var(--ps-sky);
  background: color-mix(in srgb, var(--ps-sky) 16%, transparent);
  color: #fff;
}

.ec-chip-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ec-chip[aria-pressed="true"] .ec-chip-count { background: rgba(0, 0, 0, 0.25); color: #fff; }

.ec-status { min-height: 1.4em; margin: 12px 0 0; color: var(--text-3); font-size: 13px; }

.ec-fallback {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, #f5a524 40%, var(--border));
  border-radius: 12px;
  background: rgba(245, 165, 36, 0.08);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}
.ec-fallback p { margin: 0 0 6px; }
.ec-fallback p:last-child { margin: 0; }
.ec-fallback strong { color: var(--text); font-family: var(--font-mono); }

/* ---- List ---- */
.ec-sec { margin: 0 0 36px; }
.ec-sec[hidden], .ec[hidden] { display: none; }
.ec-sec h2 { margin: 0 0 14px; font-size: 22px; }

.ec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 14px;
}

.ec {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  scroll-margin-top: 220px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.ec.is-exact {
  border-color: var(--ps-sky);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ps-sky) 25%, transparent);
}

.ec h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
}

.ec-code {
  display: inline-block;
  margin: 0 10px 4px 0;
  padding: 3px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ps-sky) 14%, transparent);
  color: #9fcbff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.ec p { margin: 0 0 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.ec p:last-child { margin: 0; }
.ec-fix strong { color: #3ddc84; }
.ec .ec-fix > strong:first-child { margin-right: 2px; }
.ec-fix strong:not(:first-child) { color: var(--text); }

.ec-note { margin: 0 0 56px; color: var(--text-3); font-size: 14px; line-height: 1.6; }

@media (max-width: 860px) {
  .ec-search { top: 62px; padding: 14px; }
  .ec-box input { font-size: 16px; }
  .ec-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -14px; padding-right: 14px; scrollbar-width: none; }
  .ec-chips::-webkit-scrollbar { display: none; }
  .ec-chip { flex: none; }
}
@media (max-width: 860px) { .ec-search { position: static; } }

/* Isaac is taller than he is wide: size by height so he stays behind the hero */
.page-hero .page-char { width: auto; height: 640px; max-width: none; }
@media (max-width: 600px) { .page-hero .page-char { height: 440px; } }

.ec-sec-note { max-width: 72ch; margin: -4px 0 16px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.ec--syscon .ec-code { background: color-mix(in srgb, #f5a524 16%, transparent); color: #ffcf7a; }

/* Decoder tables: reading codes that aren't listed */
.ec-decode { margin: 8px 0 40px; scroll-margin-top: 220px; }
.ec-decode h2 { margin-bottom: 10px; }
.ec-decode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.ec-dc { padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); scroll-margin-top: 220px; }
.ec-dc h3 { margin: 0 0 8px; font-size: 17px; }
.ec-dc p { margin: 0 0 10px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.ec-dc p:last-child { margin-bottom: 0; }
.ec-dc code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: var(--text); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.92em; }
.ec-dc-fmt { display: flex; gap: 6px; font-size: 16px; }
.ec-dc-fmt code { padding: 4px 10px; color: var(--ps-cyan); font-weight: 700; }
.ec-dc table { width: 100%; margin: 0 0 10px; border-collapse: collapse; font-size: 14px; }
.ec-dc th, .ec-dc td { padding: 7px 0; border-top: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.5; }
.ec-dc tr:first-child th, .ec-dc tr:first-child td { border-top: 0; }
.ec-dc th { width: 1%; padding-right: 16px; color: var(--text); font-weight: 600; white-space: nowrap; }
.ec-dc td { color: var(--text-2); }
@media (max-width: 480px) { .ec-dc th { width: auto; white-space: normal; } }

/* 711 codes: let the browser skip laying out the ones off screen until you scroll to them */
.ec { content-visibility: auto; contain-intrinsic-size: auto 150px; }
