/*
 * VP Domain Check styles.
 *
 * Portable: every colour falls back to a built-in violet when the host theme
 * does not define the Violet Pixels custom properties. Inside the theme the
 * tool follows both modes automatically, with a few [data-mode="1996"] rules
 * for the bevelled "system report" look. Mobile first.
 */
.vpdc, .vpdc-about {
  --c-bg: var(--bg, #12071F); --c-bg2: var(--bg2, #1E0F33); --c-line: var(--line, #3E2166);
  --c-fg: var(--fg, #F2E9FF); --c-fg2: var(--fg2, #B9A3D9); --c-accent: var(--accent, #B14CFF);
  --c-pass: var(--v3, #7F3FD6); --c-warn: var(--lilac, #C9B3E6); --c-fail: #D94BB0; --c-info: var(--v2, #3E2166);
  --c-radius: var(--radius, 10px);
}
[data-mode="1996"] .vpdc, [data-mode="1996"] .vpdc-about { --c-pass: var(--v2, #3E2166); --c-warn: var(--v3, #7F3FD6); --c-info: var(--lilac2, #B899DB); }

/* ---------- Form ---------- */
.vpdc-form { max-width: 720px; }
.vpdc-form label { display: block; font-size: .95rem; margin-bottom: 6px; }
.vpdc-row { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 560px) { .vpdc-row { flex-direction: row; } .vpdc-row input { flex: 1; } }
.vpdc-row input { width: 100%; padding: 14px 16px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-bg2); color: var(--c-fg); font: inherit; font-size: 1.05rem; }
.vpdc-row input:focus { border-color: var(--c-pass); }
.vpdc-row button { white-space: nowrap; }
/* A visible focus ring on everything the keyboard can reach, whatever the host theme does. */
.vpdc :is(a, button, summary, input):focus-visible, .vpdc-about :is(a, button):focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.vpdc-results:focus { outline: none; }
.vpdc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.vpdc-live { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; margin: 0; }
.vpdc-help { font-size: .9rem; color: var(--c-fg2); margin: 10px 0 0; }
.vpdc-error { color: var(--c-fg); border: 1px solid var(--c-fail); border-radius: 8px; padding: 10px 14px; margin: 12px 0 0; font-size: .95rem; }
[data-mode="1996"] .vpdc-row input { border: 3px solid var(--v2, #3E2166); border-right-color: var(--v5, #F2E9FF); border-bottom-color: var(--v5, #F2E9FF); background: #fff; border-radius: 0; }
[data-mode="1996"] .vpdc-error { border-width: 3px; border-radius: 0; }

/* ---------- Scanning ---------- */
.vpdc-scan { margin: 28px 0; }
.vpdc-pixels { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; max-width: 420px; }
.vpdc-pixels span { aspect-ratio: 1; background: var(--c-line); animation: vpdc-blink 1.2s steps(2) infinite; animation-delay: calc(var(--i) * 50ms); }
@keyframes vpdc-blink { 50% { background: var(--c-accent); } }
.vpdc-step { margin: 12px 0 0; color: var(--c-fg2); font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .vpdc-pixels span { animation: none; background: var(--c-accent); } }

/* ---------- Vi ---------- */
.vpdc-vi { width: 64px; height: 64px; display: block; overflow: visible; }
.vpdc-scan .vpdc-vi { margin-bottom: 14px; }
.vpdc-head .vpdc-vi { flex: 0 0 64px; }
.vpdc-vi.is-cheer { animation: vpdc-bounce 1s ease-in-out 3; }
@keyframes vpdc-bounce { 40% { transform: translateY(-14px); } 60% { transform: translateY(-4px); } 80% { transform: translateY(-9px); } }
.vpdc-vi.is-worried { animation: vpdc-shiver 3s ease-in-out infinite; }
@keyframes vpdc-shiver { 10%, 30% { transform: translateX(-2px); } 20%, 40% { transform: translateX(2px); } 50%, 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .vpdc-vi { animation: none !important; } }

/* ---------- Results ---------- */
.vpdc-results { margin-top: 32px; }
.vpdc-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.vpdc-head h2 { margin: 0 0 6px; font-size: 1.4rem; overflow-wrap: anywhere; }
.vpdc-head p { margin: 0; color: var(--c-fg2); font-size: .85rem; }
.vpdc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.vpdc-actions button { font-size: .9rem; }

/* Status: a pixel square in the status colour beside plain text, so the
   words carry the meaning and the colour only underlines it. */
.vpdc-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; white-space: nowrap; }
.vpdc-pixel { width: 12px; height: 12px; flex: none; background: var(--c-line); }
.is-available .vpdc-pixel { background: var(--c-pass); }
.is-premium .vpdc-pixel { background: var(--c-warn); }
.is-taken .vpdc-pixel { background: var(--c-info); }
.is-unknown .vpdc-pixel { background: var(--c-line); }

/* The typed domain's own card. */
.vpdc-exact { padding: 20px 24px; margin: 0 0 24px; background: var(--c-bg2); border: 1px solid var(--c-line); border-radius: var(--c-radius); }
.vpdc-exact.is-available, .vpdc-exact.is-premium { border-color: var(--c-pass); }
.vpdc-exact.is-urgent, .vpdc-exact.is-expired { border-color: var(--c-fail); }
.vpdc-exact .vpdc-domain { display: block; font-size: 1.5rem; font-weight: 500; overflow-wrap: anywhere; margin-bottom: 8px; }
.vpdc-exact p { margin: 10px 0 0; max-width: none; }
.vpdc-exact .vpdc-verdict { color: var(--c-fg); font-size: 1.05rem; }
.vpdc-exact .vpdc-actions { margin-top: 16px; }

/* The endings list. */
.vpdc-results h3 { margin: 0 0 12px; }
.vpdc-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; max-width: none; }
.vpdc-item { display: grid; grid-template-columns: 1fr; gap: 8px 16px; align-items: center; padding: 12px 16px; background: var(--c-bg2); border: 1px solid var(--c-line); border-radius: var(--c-radius); }
@media (min-width: 640px) { .vpdc-item { grid-template-columns: 1fr auto auto; } }
.vpdc-item .vpdc-domain { font-weight: 500; overflow-wrap: anywhere; }
.vpdc-item .vpdc-act { font-size: .9rem; }
.vpdc-item.is-available, .vpdc-item.is-premium { border-color: var(--c-pass); }

/* Registry record details, under a card or a row. */
.vpdc-details { grid-column: 1 / -1; font-size: .95rem; margin-top: 4px; }
.vpdc-details dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.vpdc-details dt { color: var(--c-fg2); }
.vpdc-details dd { margin: 0; overflow-wrap: anywhere; }
.vpdc-details .vpdc-verdict { margin: 0 0 10px; }
.vpdc-note { margin: 10px 0 0; color: var(--c-fg2); font-size: .9rem; max-width: none; }
.vpdc-small { font-size: .9rem; color: var(--c-fg2); max-width: 64ch; }

/* Call to action. */
.vpdc-cta { margin: 28px 0; padding: 24px; border: 1px solid var(--c-pass); border-radius: var(--c-radius); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.vpdc-cta div { max-width: 52ch; }
.vpdc-cta h3 { margin: 0 0 4px; }
.vpdc-cta p { margin: 0; }

/* 1996: bevels everywhere, no radii. */
[data-mode="1996"] .vpdc-exact, [data-mode="1996"] .vpdc-item { border: 3px solid var(--v5, #F2E9FF); border-right-color: var(--v2, #3E2166); border-bottom-color: var(--v2, #3E2166); background: var(--v5, #F2E9FF); border-radius: 0; }
[data-mode="1996"] .vpdc-cta { border: 3px solid var(--v2, #3E2166); border-radius: 0; background: var(--v5, #F2E9FF); }
[data-mode="1996"] .vpdc-pixels span { animation-timing-function: steps(1); }
