:root {
  --bg: #0f0b1e;
  --bg-card: #1a1433;
  --accent: #b892ff;
  --accent-2: #ffd27f;
  --text: #f2eefc;
  --text-dim: #b8aed4;
  --border: #352a5c;
  --error: #ff8a8a;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top, #221a44 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; }
.tagline { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.15rem; }

nav.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; color: var(--text-dim); }
nav.site-nav a { color: var(--text-dim); text-decoration: none; }
nav.site-nav a:hover { color: var(--text); }

[data-i18n-switcher] {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

main { max-width: 640px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.card h1 { margin-top: 0; font-size: 1.5rem; }
.card p.desc { color: var(--text-dim); line-height: 1.5; }

label { display: block; font-size: 0.9rem; color: var(--text-dim); margin: 1rem 0 0.35rem; }

input[type="date"], input[type="email"], input[type="text"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #120d26;
  color: var(--text);
  font-size: 1rem;
}

input:focus { outline: 2px solid var(--accent); }

button.primary, a.primary {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7a5cff);
  color: #1a1433;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-sizing: border-box;
}

button.primary:hover, a.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }

button.link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  margin-top: 1rem;
}

.result-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent-2);
  text-align: center;
  margin: 0.5rem 0 1rem;
}

.hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.75rem; }
.error-text { color: var(--error); font-size: 0.85rem; margin-top: 0.4rem; min-height: 1em; }
.hidden { display: none !important; }

footer.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
}

.wide-main { max-width: 980px; }

.breadcrumb { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.lib-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.lib-card:hover { border-color: var(--accent); }
.lib-card .lib-card-title { font-weight: 600; margin-bottom: 0.25rem; }
.lib-card .lib-card-sub { font-size: 0.8rem; color: var(--text-dim); }

.category-section h2 { margin-top: 2.5rem; font-size: 1.2rem; }

.detail-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

.tag-pill {
  display: inline-block;
  background: #241c47;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin: 0 0.35rem 0.35rem 0;
}

fieldset.quiz-question {
  border: none;
  padding: 0;
  margin: 1.25rem 0;
}
fieldset.quiz-question legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding: 0;
}
label.quiz-option {
  display: block;
  margin: 0.4rem 0;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
label.quiz-option input { margin-right: 0.5rem; }

.orientation-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.5rem;
}

.section-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 2rem 0 0.75rem;
}
