:root {
  --bg: #eef4fb;
  --bg-2: #f7faff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --ink: #132033;
  --ink-soft: #5b6778;
  --line: #d7e0ea;

  --brand: #2563eb;
  --brand-2: #7c3aed;
  --brand-3: #06b6d4;

  --success: #0f9f63;
  --success-soft: #eafaf2;

  --shadow-xl: 0 26px 60px rgba(17, 24, 39, 0.16);
  --shadow-lg: 0 18px 36px rgba(17, 24, 39, 0.10);
  --shadow-md: 0 10px 22px rgba(17, 24, 39, 0.08);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 28%),
    radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  min-height: 100vh;
  padding: 28px 18px 36px;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
}

/* =========================
   HERO / HEADER
========================= */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 30px 30px 24px;
  margin-bottom: 28px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.96) 0%, rgba(124, 58, 237, 0.95) 56%, rgba(6, 182, 212, 0.92) 100%);
  color: #fff;
  box-shadow: 0 24px 58px rgba(37, 99, 235, 0.22);
}

.hero::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  top: -110px;
  right: -70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  left: -50px;
  bottom: -110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.brand-wrap {
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  margin-bottom: 12px;
}

.hero-title {
  position: relative;
  z-index: 2;
  margin: 0 0 10px 0;
  max-width: 760px;
  font-size: 44px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.lang-box {
  position: relative;
  z-index: 2;
  text-align: right;
}

.lang-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 6px;
}

select {
  appearance: none;
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  outline: none;
  backdrop-filter: blur(10px);
}

select option {
  color: #111827;
}

.intro {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 0 18px 0;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

/* =========================
   SEARCH PANEL
========================= */

.search-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 14px;
  backdrop-filter: blur(12px);
}

.search-input-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.9;
}

.search-input {
  width: 100%;
  border: none;
  outline: none;
  border-radius: 14px;
  padding: 13px 14px 13px 42px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.search-input::placeholder {
  color: #7a8699;
  font-weight: 600;
}

.search-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  color: #fff;
  font-weight: 700;
}

.search-meta-label {
  font-size: 13px;
  opacity: 0.84;
}

.search-meta-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 14px;
  font-weight: 800;
}

/* =========================
   SECTION
========================= */

.launcher-section {
  margin-top: 6px;
}

.section-title {
  margin: 2px 2px 16px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

/* =========================
   GRID / TILES
========================= */

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 20px;
}

.quiz-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(215, 224, 234, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 250px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.quiz-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 42px rgba(17, 24, 39, 0.13);
  border-color: rgba(37, 99, 235, 0.18);
}

.quiz-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.quiz-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(15, 159, 99, 0.14);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.quiz-title-link {
  text-decoration: none;
  color: inherit;
}

.quiz-title-link:hover .quiz-title {
  color: var(--brand);
}

.quiz-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
  font-weight: 800;
  color: var(--ink);
  transition: color 0.18s ease;
}

.quiz-desc {
  color: var(--ink-soft);
  line-height: 1.75;
  font-size: 15px;
  min-height: 54px;
}

.quiz-meta {
  font-size: 13px;
  color: #667085;
  font-weight: 700;
}

.quiz-actions {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.3);
  filter: brightness(1.03);
}

.open-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.quiz-url {
  font-size: 12px;
  color: #7b8794;
  word-break: break-all;
}

/* =========================
   STATES
========================= */

.loading-box,
.empty-box,
.error-box {
  grid-column: 1 / -1;
  border-radius: 18px;
  padding: 20px 18px;
  box-shadow: var(--shadow-md);
  font-weight: 700;
}

.loading-box,
.empty-box {
  background: var(--panel-solid);
  border: 1px dashed #d0d9e5;
  color: var(--ink-soft);
}

.error-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

/* =========================
   FOOTER
========================= */

.footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-row-top {
  margin-bottom: 8px;
}

.footer-row-bottom {
  margin-bottom: 0;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.footer-logo {
  height: 30px;
  width: auto;
  display: block;
  opacity: 1;
}

.footer-site-link {
  color: #6b7280;
  font-size: 13px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.footer-site-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.footer-copy {
  color: var(--ink-soft);
  font-size: 14px;
}

.footer small,
#hubFooterSub {
  color: #8a94a6;
  font-size: 13px;
}

@media (max-width: 720px) {
  .footer-row {
    flex-wrap: wrap;
  }

  .footer-logo {
    height: 26px;
  }
}

@media (max-width: 720px) {
  .footer-row {
    flex-wrap: wrap;
  }

  .footer-logo {
    height: 26px;
  }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 920px) {
  .hero-title {
    font-size: 38px;
  }
}

@media (max-width: 720px) {
  body {
    padding: 18px 14px 30px;
  }

  .hero {
    border-radius: 24px;
    padding: 22px 18px 20px;
  }

  .lang-box {
    text-align: left;
  }

  .hero-title {
    font-size: 30px;
  }

  .intro {
    font-size: 15px;
  }

  .search-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search-meta {
    justify-content: space-between;
    padding: 0;
  }

  .section-title {
    font-size: 20px;
  }

  .quiz-card {
    min-height: unset;
    padding: 18px;
  }

  .quiz-title {
    font-size: 22px;
  }

  .quiz-desc {
    min-height: unset;
  }

  .quiz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .start-btn {
    justify-content: center;
  }

  .footer-row {
    flex-wrap: wrap;
  }

  .footer-logo {
    height: 26px;
  }
}
