:root {
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d2b28;
  background: #17211f;
  font-synthesis: none;
  --accent: #6f4c2f;
  --accent-soft: #f1e5d8;
  --category-background: url("images/bg-quote.webp");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background: #17211f;
}

body[data-category="quote"] {
  --accent: #6f4c2f;
  --accent-soft: #f1e5d8;
  --category-background: url("images/bg-quote.webp");
}

body[data-category="english"] {
  --accent: #315f7a;
  --accent-soft: #dfedf4;
  --category-background: url("images/bg-english.webp");
}

body[data-category="bible"] {
  --accent: #6c5a2f;
  --accent-soft: #f2ead4;
  --category-background: url("images/bg-bible.webp");
}

body[data-category="quiz"] {
  --accent: #315f68;
  --accent-soft: #dceeee;
  --category-background: url("images/bg-quiz.webp");
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--category-background);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: scale(1.015);
  transition: background-image .32s ease;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 18, 20, .16) 0%, rgba(10, 18, 20, .05) 28%, rgba(10, 18, 20, .26) 100%),
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.14), transparent 56%);
  pointer-events: none;
}

button { font: inherit; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 30px;
}

.topbar,
.intro {
  border: 1px solid rgba(255,255,255,.44);
  background: rgba(255,255,255,.66);
  box-shadow: 0 12px 32px rgba(17, 28, 27, .10);
  -webkit-backdrop-filter: blur(15px) saturate(1.1);
  backdrop-filter: blur(15px) saturate(1.1);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 20px;
}

.eyebrow {
  margin: 0 0 3px;
  color: #53635e;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
}

h1 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -.04em;
}

.intro {
  margin: 14px 0 14px;
  padding: 15px 16px;
  border-radius: 20px;
}

.intro h2 {
  margin: 0 0 7px;
  font-size: 1.3rem;
  letter-spacing: -.03em;
}

.intro p,
footer p {
  margin: 0;
  color: #52615d;
  line-height: 1.6;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.category {
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 11px 6px;
  color: #394945;
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 20px rgba(20, 32, 30, .08);
  -webkit-backdrop-filter: blur(11px);
  backdrop-filter: blur(11px);
  cursor: pointer;
}

.category.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.content-card {
  min-height: 330px;
  padding: 26px 24px;
  border: 1px solid rgba(255,255,255,.70);
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 22px 55px rgba(20, 31, 29, .18);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
  display: flex;
  flex-direction: column;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: .83rem;
  font-weight: 800;
}

.counter {
  color: #7d8985;
  font-size: .82rem;
}

.content-card h2 {
  margin: 38px 0 16px;
  font-size: clamp(1.55rem, 7vw, 2.2rem);
  line-height: 1.27;
  letter-spacing: -.045em;
  word-break: keep-all;
}

.card-body {
  margin: 0;
  color: #42514d;
  font-size: 1.03rem;
  line-height: 1.75;
  white-space: pre-line;
}

.card-meta {
  margin: auto 0 0;
  padding-top: 24px;
  color: #727e7a;
  font-size: .88rem;
}

.quiz-area { margin-top: 20px; }
.quiz-options { display: grid; gap: 9px; }

.quiz-option {
  width: 100%;
  border: 1px solid #d8ddd9;
  border-radius: 14px;
  padding: 13px 14px;
  text-align: left;
  color: #31433e;
  background: #fafbf9;
  cursor: pointer;
}

.quiz-option.correct {
  border-color: #3d796b;
  background: #e4f2ec;
}

.quiz-option.wrong {
  border-color: #b76868;
  background: #f7e8e8;
}

.quiz-result {
  min-height: 24px;
  margin: 12px 2px 0;
  color: #42514d;
  font-weight: 700;
}

.actions {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 16px;
  padding: 15px 14px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(20, 31, 29, .15);
}

.secondary-button,
.ghost-button {
  border: 1px solid rgba(255,255,255,.78);
  color: #344a43;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-weight: 700;
}

.ghost-button {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .82rem;
}

.streak {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 2px 0;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 16px;
  color: #43534e;
  background: rgba(255,255,255,.70);
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
}

.streak strong { color: var(--accent); }

footer {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(255,255,255,.46);
  border-radius: 16px;
  background: rgba(255,255,255,.64);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: .78rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 36px);
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 38, 34, .94);
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 390px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .content-card { min-height: 350px; }
}

@media (min-width: 720px) {
  body::before { background-position: center 42%; }
}
