*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

html {
  background: var(--color-bg);
}

/* hidden phải thắng display:grid / flex của author stylesheet. */
[hidden] {
  display: none !important;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(900px 500px at -20% 110%, rgba(16, 185, 129, 0.12), transparent 50%),
    var(--color-bg);
  min-height: 100dvh;
  max-width: 100%;
}

img,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app {
  width: 100%;
  max-width: var(--app-max);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 20px 32px;
  position: relative;
  animation: page-in 0.28s ease;
}

.app--frame {
  padding-bottom: 24px;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app,
  .quiz-option,
  .btn {
    animation: none !important;
    transition: none !important;
  }
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 40;
  background: var(--color-accent);
  color: #042f1e;
  padding: 8px 12px;
  border-radius: var(--radius-8);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
