:root {
  color-scheme: dark;
  --ink: #fff;
  --muted: rgba(255, 255, 255, 0.78);
  --btn: #f4f6fa;
  --btn-ink: #0b1a33;
  --accent: #c4122e;
  --ok: #8ee6a4;
  --bad: #ffb4b4;
  --focus: #9ec1ff;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--ink);
  background: #0a1220;
}

.bg, .veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg {
  background-color: #0a1220;
  background-image: url("/agf/background.jpg");
  background-image: image-set(url("/agf/background.webp") type("image/webp"), url("/agf/background.jpg") type("image/jpeg"));
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
}

.veil {
  background:
    linear-gradient(180deg, rgba(6, 10, 18, 0.72) 0%, rgba(6, 10, 18, 0.42) 38%, rgba(6, 10, 18, 0.55) 70%, rgba(6, 10, 18, 0.82) 100%);
}

main {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.logo {
  display: block;
  width: auto;
  height: 7.25rem;
  max-width: 42vw;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.45));
}

h1 {
  margin: 1rem 0 1.5rem;
  text-align: center;
  font-size: clamp(1.45rem, 6.4vw, 2rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
  max-width: 16ch;
}

.actions {
  width: min(22rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

button {
  appearance: none;
  width: 100%;
  min-height: 4.25rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 1rem;
  background: var(--btn);
  color: var(--btn-ink);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

button .sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6a7382;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  button { transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease; }
  button:not(:disabled):active { transform: scale(0.98); }
}

.feedback {
  min-height: 1.5rem;
  margin: 1.1rem 0 0;
  text-align: center;
  font-weight: 650;
  font-size: 1.05rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

.footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
}

.footer a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 1rem;
  color: var(--muted);
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.footer .powered {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}

.footer .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.footer a:hover .brand { text-decoration: underline; text-underline-offset: 3px; }

.footer a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

.footer .brand-icon {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  margin: 0;
  vertical-align: middle;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.footer .brand-text {
  display: block;
  line-height: 1.35rem;
}
