/* Klawu Vanguard Ray challenge theme.
 * Brand: KlawuKit "Deep Orange" (#fc8a08 light / #c86a00 dark), system font
 * stack, automatic light/dark via prefers-color-scheme. */

:root {
  color-scheme: light dark;

  --vr-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --vr-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --vr-brand-0: #fff4e1;
  --vr-brand-1: #ffe8cc;
  --vr-brand-2: #fed09b;
  --vr-brand-6: #fc8a08;
  --vr-brand-7: #e17800;
  --vr-brand-8: #c86a00;
  --vr-brand-9: #af5a00;

  --vr-bg: #f4f4f5;
  --vr-card: #ffffff;
  --vr-text: #1a1b1e;
  --vr-muted: #5c5f66;
  --vr-border: #e4e4e7;
  --vr-brand: var(--vr-brand-6);
  --vr-brand-ink: #7a4a00;
  --vr-brand-wash: var(--vr-brand-0);
  --vr-link: var(--vr-brand-7);
  --vr-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px -12px rgb(0 0 0 / 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --vr-bg: #141517;
    --vr-card: #1d1e22;
    --vr-text: #ececec;
    --vr-muted: #a6a7ab;
    --vr-border: #2e2f36;
    --vr-brand: var(--vr-brand-8);
    --vr-brand-ink: var(--vr-brand-2);
    --vr-brand-wash: rgb(200 106 0 / 0.16);
    --vr-link: #fca13a;
    --vr-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.55);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--vr-font);
  background: var(--vr-bg);
  color: var(--vr-text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--vr-brand-2);
}

/* Centered card holding the whole challenge. */
.vr-card {
  background: var(--vr-card);
  border: 1px solid var(--vr-border);
  border-radius: 1rem;
  box-shadow: var(--vr-shadow);
  width: min(30rem, 100%);
  padding: clamp(1.5rem, 4vw + 1rem, 2.5rem);
  margin: auto;
}

.vr-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}

.vr-brand svg {
  height: 1.75rem;
  width: auto;
  display: block;
}

.vr-product {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--vr-muted);
  border-left: 1px solid var(--vr-border);
  padding-left: 0.625rem;
  white-space: nowrap;
}

.vr-card h1 {
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  font-weight: 700;
}

/* Solver status line: spinner + live text. The JS rewrites only the text. */
.vr-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--vr-brand-wash);
  border: 1px solid var(--vr-border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin: 0 0 1rem;
}

.vr-status p {
  margin: 0;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.vr-spinner {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 3px solid var(--vr-border);
  border-top-color: var(--vr-brand);
}

@media (prefers-reduced-motion: no-preference) {
  .vr-spinner {
    animation: vr-spin 0.9s linear infinite;
  }
}

@keyframes vr-spin {
  to {
    transform: rotate(360deg);
  }
}

.vr-expl {
  color: var(--vr-muted);
  font-size: 0.9375rem;
  margin: 0 0 1rem;
}

/* Legacy progress bar hooks (kept for solver compatibility). */
#progress {
  display: none;
  width: 100%;
  height: 0.5rem;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 1rem;
  background: var(--vr-border);
}

.bar-inner {
  background-color: var(--vr-brand);
  height: 100%;
  width: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .bar-inner {
    transition: width 0.25s ease-in;
  }
}

pre {
  background: var(--vr-bg);
  border: 1px solid var(--vr-border);
  border-radius: 0.5rem;
  padding: 1em;
  font-family: var(--vr-mono);
  font-size: 0.8125rem;
  overflow-x: auto;
}

a,
a:active,
a:visited {
  color: var(--vr-link);
}

a:focus-visible {
  outline: 2px solid var(--vr-brand);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.vr-contact {
  font-size: 0.875rem;
  color: var(--vr-muted);
  margin: 0 0 1rem;
}

.vr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1.25rem;
  font-weight: 600;
}

.vr-ray {
  font-size: 0.8125rem;
  color: var(--vr-muted);
  margin: 0 0 1rem;
}

.vr-ray code {
  font-family: var(--vr-mono);
  font-size: 0.75rem;
  background: var(--vr-bg);
  border: 1px solid var(--vr-border);
  border-radius: 0.375rem;
  padding: 0.125rem 0.375rem;
  user-select: all;
}

.vr-footer {
  border-top: 1px solid var(--vr-border);
  padding-top: 1rem;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--vr-muted);
  text-align: center;
}

.vr-footer strong {
  color: var(--vr-text);
  font-weight: 700;
  letter-spacing: 0.04em;
}

noscript p {
  background: var(--vr-brand-wash);
  border: 1px solid var(--vr-border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
}

/* Small phones: full-bleed card, tighter type. */
@media (max-width: 30rem) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .vr-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
