/* IWAL — themed background, centered phrase, footer, highlights */
:root{
  --fade-ms: 900;
  --ui-bg: rgba(0,0,0,.35);
  --ui-border: rgba(255,255,255,.18);
  --ui-blur: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

/* Background layers */
#bg-stars, #bg-nebula {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
#bg-nebula { mix-blend-mode: screen; opacity: .85; }

/* Theme select UI */
#ui {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 8px 10px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  backdrop-filter: blur(var(--ui-blur)) saturate(120%);
  z-index: 20;
}
#themeSelect {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
}
#themeSelect:focus { box-shadow: 0 0 0 2px rgba(255,255,255,.25) inset; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,1px,1px);
}

/* Phrase display */
#phrase-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: min(92vw, 1200px);
  z-index: 10;
}
#phrase {
  font-size: clamp(28px, 8vw, 140px);
  line-height: 1.15;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.01em;
  opacity: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,.45),
               0 0 24px rgba(255,255,255,.06);
  transition: opacity var(--fade-ms)ms ease-in-out;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: manual;
}
#phrase .word { white-space: nowrap; }
#phrase .highlight { font-weight: 900; display: inline-block; }

/* Footer */
#footer {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 30;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(92vw, 560px);
  padding: 6px 10px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  backdrop-filter: blur(6px) saturate(120%);
}
#footer .footer-left { flex: 1; text-align: left; }
#footer .footer-right { flex: 1; text-align: right; }
#footer a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: 12px;
}
#footer a:hover { text-decoration: underline; }

/* Source note */
#sourceNote {
  position: fixed;
  left: 12px;
  bottom: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.75);
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 6px 10px;
  backdrop-filter: blur(6px) saturate(120%);
  z-index: 30;
}

/* Notice for local file fallback */
#notice {
  position: fixed;
  left: 12px;
  bottom: 56px;
  max-width: min(92vw, 700px);
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: 12px;
  color: #e6e6e6;
  backdrop-filter: blur(8px) saturate(120%);
  z-index: 30;
}

@media (prefers-reduced-motion: reduce) {
  #phrase { transition: none; }
}
