:root {
  --vw-fg: #f4f4f5;
  --vw-fg-dim: #a1a1aa;
  --vw-accent: #8b5cf6;
  --vw-accent-2: #06b6d4;
  --vw-danger: #f87171;
  --vw-border: rgba(255, 255, 255, 0.08);
  --vw-card: rgba(255, 255, 255, 0.04);
  --vw-radius: 14px;
  --vw-radius-sm: 8px;
  --vw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --vw-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--vw-font);
  color: var(--vw-fg);
  background: #0a0a0c;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 16px 64px;
  overflow-x: hidden;
}

body.is-home {
  justify-content: safe center;
  padding-top: 16px;
  padding-bottom: 16px;
  min-height: 100vh;
}

a { color: var(--vw-fg); }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--vw-border);
  background: var(--vw-card);
  color: var(--vw-fg);
  padding: 12px 20px;
  border-radius: var(--vw-radius-sm);
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

button:hover { background: rgba(255, 255, 255, 0.08); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--vw-accent); outline-offset: 2px; }

input[type="text"] {
  font: inherit;
  width: 100%;
  background: var(--vw-card);
  border: 1px solid var(--vw-border);
  color: var(--vw-fg);
  padding: 14px 16px;
  border-radius: var(--vw-radius-sm);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--vw-accent);
}

input[type="text"].shake {
  animation: vw-shake 360ms cubic-bezier(.36,.07,.19,.97) both;
  border-color: var(--vw-danger);
}

@keyframes vw-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.vw-logo {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 600;
  font-size: 56px;
  letter-spacing: 0.02em;
  text-decoration: none;
  margin-bottom: 40px;
}

.vw-logo-mark {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  display: inline-block;
  object-fit: cover;
}

.vw-card {
  width: 100%;
  max-width: 760px;
  background: var(--vw-card);
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius);
  padding: 24px;
  backdrop-filter: blur(6px);
}

.vw-stack { display: flex; flex-direction: column; gap: 16px; }
.vw-row { display: flex; gap: 12px; flex-wrap: wrap; }
.vw-row > * { flex: 1 1 0; min-width: 180px; }
.vw-row-center { justify-content: center; }
.vw-row-center > * { flex: 0 0 auto; min-width: 0; }
.vw-row-stack-center { flex-direction: column; align-items: center; gap: 6px; }

.vw-blurb {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--vw-fg-dim);
  text-align: center;
}

.vw-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  width: 100%;
  color: var(--vw-fg);
}

.vw-section-title--dim {
  color: var(--vw-fg-dim);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}

.vw-input-wrap { position: relative; }
.vw-input-error {
  color: var(--vw-danger);
  font-size: 13px;
  min-height: 18px;
  opacity: 0;
  transition: opacity 120ms ease;
}
.vw-input-error.is-visible { opacity: 1; }

.vw-btn-primary {
  background: linear-gradient(135deg, var(--vw-accent), var(--vw-accent-2));
  border: none;
  color: #fff;
  font-weight: 600;
}
.vw-btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--vw-accent), var(--vw-accent-2)); }

.vw-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.vw-theme-card {
  position: relative;
  display: block;
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  background: var(--vw-card);
  user-select: none;
}
.vw-theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.vw-theme-card .vw-swatch {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--vw-border);
}
.vw-theme-card .vw-theme-name { font-size: 14px; font-weight: 500; }
.vw-theme-card:has(input:checked) { border-color: var(--vw-accent); }

.vw-ads {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin-top: 24px;
}
.vw-ad-slot {
  min-height: 90px;
  background: var(--vw-card);
  border: 1px dashed var(--vw-border);
  border-radius: var(--vw-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vw-fg-dim);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 16px;
  position: relative;
  flex-direction: column;
  gap: 8px;
}

.vw-ad-slot .vw-ad-ins {
  display: block;
  width: 100%;
}

/* When the <ins> has been filled with an iframe (real ad served),
   hide the fallback text and remove the slot's dashed border. */
.vw-ad-slot:has(.adsbygoogle iframe) {
  border-style: solid;
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
}

.vw-ad-slot:has(.adsbygoogle iframe) .vw-ad-fallback-text {
  display: none;
}

.vw-ad-slot .vw-ad-fallback-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
  text-align: center;
}

.vw-footer {
  margin-top: 32px;
  font-size: 12px;
  color: var(--vw-fg-dim);
}

@media (max-width: 640px) {
  .vw-theme-grid { grid-template-columns: 1fr; }
  .vw-ads { grid-template-columns: 1fr; }
  .vw-row { flex-direction: column; }
  .vw-video-wrap { border-radius: 0; }
}

.vw-viewer {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}

body.is-viewer {
  padding: 0;
  justify-content: center;
}

html.vw-route-viewer body > *:not(.vw-viewer) { display: none !important; }

.vw-video-wrap {
  width: min(80vw, calc(90vh * 16 / 9));
  height: min(calc(80vw * 9 / 16), 90vh);
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

#youtube-player,
#youtube-player iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.vw-copy-status {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--vw-fg-dim);
  min-height: 20px;
}
.vw-copy-status.is-success { color: #34d399; }
.vw-copy-status.is-error   { color: var(--vw-danger); }
