:root {
  --bg: #FFC800;
  --text: #050505a0;
  --card: #ffffff;
  --border: #d9e2ec;
  --star-gold: #e1c800;
  --panel-bg: #ffffff;
  --panel-radius: 12px;
  --h1-size: clamp(1.8rem, 3vw, 2.4rem);
  --h2-size: clamp(1.25rem, 2.1vw, 1.6rem);
  --h3-size: clamp(1.05rem, 1.5vw, 1.2rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Superclarendon", "Bookman Old Style", "URW Bookman", serif;
  background: var(--bg);
  color: var(--text);
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  line-height: 1.1;
  color: #1f2937;
}

h1 {
  font-size: var(--h1-size);
  color: #19197d;
}

h2 {
  font-size: var(--h2-size);
  color: #19197d;
}

h3 {
  font-size: var(--h3-size);
}

p {
  margin: 0 0 0.75rem;
}

.site-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #FFC800;
}

.menu-button {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.menu-button::-webkit-details-marker {
  display: none;
}

.menu-icon {
  width: 22px;
  height: 22px;
}

.menu {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
}

.menu .menu-button {
  position: static;
  list-style: none;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 120px;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.menu-item {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font-size: 0.82rem;
}

.menu-item:hover {
  background: #f0f4f8;
}

.menu-item[aria-current="page"] {
  background: #f0f4f8;
  font-weight: 700;
}

.user-panel {
  position: absolute;
  top: 0.6rem;
  right: 3.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 28px;
  padding: 0 0.2rem;
  border: 0;
  border-radius: 0;
  text-decoration: none;
  background: transparent;
}

.user-icon {
  width: 14px;
  height: 14px;
}

.user-name {
  font-size: 0.72rem;
  color: #52606d;
  white-space: nowrap;
}

.site-logo {
  height: 36px;
  object-fit: contain;
}

.container {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: center;
}

.card,
.login-modal,
.start-page,
.category-card,
.admin-total-card,
.admin-chart-card,
.admin-category-panel,
.stats-shell,
.stats-category-card,
.stats-panel,
.result-card {
  background: var(--panel-bg);
  border-radius: var(--panel-radius);
}

.admin-page .container {
  max-width: 1240px;
  margin: 1.2rem auto 2rem;
  text-align: left;
}

.admin-shell {
  padding: 1rem 1.1rem 1.25rem;
}

.admin-section {
  display: grid;
  gap: 0.8rem;
}

.admin-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.admin-section-title {
  margin: 0;
  color: #1f2937;
}

.admin-questions-top-row {
  display: grid;
  grid-template-columns: 12ch minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
  width: 100%;
}

.admin-questions-second-row {
  display: grid;
  grid-template-columns: minmax(24ch, 1fr) 12ch 12ch 12ch;
  gap: 1rem;
  align-items: end;
  width: 100%;
}

.admin-questions-third-row {
  display: grid;
  grid-template-columns: minmax(24ch, 1fr) 12ch 12ch 12ch;
  gap: 1rem;
  align-items: end;
  width: 100%;
}

.admin-questions-options-panel {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.admin-questions-bottom-row {
  display: grid;
  grid-template-columns: minmax(24ch, 1fr) minmax(32ch, 1fr);
  gap: 1rem;
  width: 100%;
  align-items: start;
}

.admin-questions-meta-column {
  display: grid;
  grid-template-rows: auto auto;
  gap: 1rem;
  align-items: start;
}

.admin-questions-date-row {
  display: grid;
  grid-template-columns: 12ch minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
}

.admin-questions-option-link {
  display: block;
  padding: 0.12rem 0;
  color: #1d4ed8;
  text-decoration: underline;
  word-break: break-word;
}

.admin-questions-option-link + .admin-questions-option-link {
  margin-top: 0.18rem;
}

.admin-questions-field {
  display: grid;
  gap: 0.28rem;
}

.admin-questions-field-search {
  justify-self: end;
  align-self: end;
  justify-items: start;
}

.admin-questions-field-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #4b5563;
}

.admin-questions-field-input {
  min-height: 2.2rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
}

.admin-questions-field-input-id {
  width: 12ch;
}

.admin-questions-field-input-search {
  width: 320px;
}

.admin-questions-field-input-question {
  width: 100%;
}

.admin-questions-field-input-small {
  width: 12ch;
}

.admin-questions-field-input-date {
  width: 12ch;
}

.admin-questions-field-input:focus {
  border-color: #19197d;
  outline: 2px solid rgba(25, 25, 125, 0.2);
  outline-offset: 1px;
}

.admin-questions-field-input[readonly] {
  background: #f3f4f6;
  color: #6b7280;
}

.admin-questions-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-questions-actions .home-button {
  margin-top: 0.25rem;
}

.admin-totals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.admin-total-card {
  border: 1px solid #e5e7eb;
  padding: 0.8rem 0.9rem;
}

.admin-total-label {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.admin-total-value {
  margin: 0.4rem 0 0;
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 800;
  color: #111827;
}

.admin-chart-card {
  position: relative;
  border: 1px solid #e5e7eb;
  padding: 0.8rem 0.9rem;
  min-height: 210px;
}

.admin-chart-canvas {
  width: 100%;
  height: 190px;
}

.admin-chart-empty {
  margin: 0;
  color: #6b7280;
  text-align: center;
  padding-top: 4.1rem;
}

.admin-category-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-category-panel {
  border: 1px solid #e5e7eb;
  padding: 0.65rem 0.75rem 0.75rem;
  min-height: 140px;
}

.admin-category-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-category-panel-icon {
  width: 22px;
  height: 22px;
}

.admin-category-panel-title {
  margin: 0;
  font-size: 1rem;
  color: #1f2937;
}

.admin-category-panel-body {
  min-height: 88px;
  margin-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.45rem;
}

.admin-level-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  height: 72px;
  margin: 0 0 0.5rem;
  padding: 0 0 0.35rem;
  border-bottom: 1px solid #eef2f7;
}

.admin-level-chart-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 0.15rem;
}

.admin-level-chart-bar {
  display: block;
  width: 100%;
  max-width: 24px;
  background: linear-gradient(180deg, #3b3bb7 0%, #19197d 100%);
  border-radius: 4px 4px 2px 2px;
}

.admin-level-chart-bar.is-low {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
}

.admin-level-chart-label {
  font-size: 0.66rem;
  line-height: 1;
  color: #6b7280;
}

.admin-category-metrics {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.6rem;
  row-gap: 0.22rem;
}

.admin-category-metrics dt {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
}

.admin-category-metrics dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #111827;
  text-align: right;
}

.site-footer {
  margin: 1.2rem 0 0.6rem;
  text-align: center;
  font-size: 0.68rem;
  color: #6b7280;
}


.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(25, 25, 125, 0.08);
}

.login-modal {
  width: min(420px, 100%);
}

.login-title {
  margin: 0 0 0.85rem;
  color: #19197d;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.auth-switch-button {
  padding: 0.65rem 0.75rem;
  border: 1px solid #d7dce4;
  border-radius: 999px;
  background: #f8fafc;
  color: #52606d;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-switch-button.is-active {
  border-color: #19197d;
  background: #19197d;
  color: #fff;
}

.login-copy {
  margin: -0.3rem 0 0.85rem;
  color: #52606d;
  font-size: 0.92rem;
}

.login-form {
  display: grid;
  gap: 0.55rem;
}

.login-label {
  font-size: 0.85rem;
  color: #52606d;
  text-align: left;
}

.login-input {
  width: 100%;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
}

.login-submit {
  margin-top: 0.35rem;
  padding: 0.65rem 0.8rem;
  color: #fff;
  background: #19197d;
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-status {
  min-height: 1.2rem;
  margin: 0.1rem 0 0;
  color: #52606d;
  font-size: 0.85rem;
}

.login-status.is-error {
  color: #b42318;
}

.login-status.is-success {
  color: #166534;
}

.card {
  border: 1px solid var(--border);
  padding: 1rem;
}

.about-page .container {
  max-width: 760px;
}

.about-page .card {
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}

.about-page h1 {
  margin: 0 0 0.3rem;
}

.about-page h3 {
  margin: 0.9rem 0 0.25rem;
}

.about-page em {
  display: block;
  margin: 0 0 0.7rem;
  font-size: 0.9rem;
  color: #52606d;
}

.about-page p {
  margin: 0;
}

.about-inline-stars {
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--star-gold);
  line-height: 1;
}

.about-back-row {
  margin-top: 1rem;
  text-align: center;
}

.about-back-button {
  margin-top: 0;
}

.category-panel {
  margin-bottom: 1rem;
}

.category-heading {
  margin: 0 0 0.75rem;
}

.category-rules-link {
  display: inline-block;
  margin: -0.35rem 0 0.7rem;
  font-size: 0.78rem;
  color: #52606d;
  text-decoration: underline;
}

.category-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
}

.category-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  column-gap: 0.7rem;
  row-gap: 0;
  align-items: center;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  text-align: left;
}

.category-card-link {
  text-decoration: none;
}

.category-card-icon {
  width: 22px;
  height: 22px;
  grid-column: 1;
  grid-row: 1;
}

.category-card-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.category-card-name-wrap {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.category-card-count {
  font-size: 0.56rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.category-level-line {
  display: block;
  font-size: 0.68rem;
  color: #6b7280;
}

.category-stars {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--star-gold);
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.category-total-score {
  color: #111827;
  font-weight: 700;
  font-size: 0.95rem;
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  min-width: 2.7rem;
  text-align: right;
}

.category-coming-soon {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  margin-top: 0;
  font-size: 0.68rem;
  color: #9ca3af;
}

.category-stats {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: #7b8794;
}

.category-meta-empty {
  visibility: hidden;
}

.category-card.is-active {
  border-color: #19197d;
}

.category-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.start-page {
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
}

.start-category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: var(--text);
}

.start-category-card .category-card-icon {
  width: 56px;
  height: 56px;
}

.start-category-card .category-card-name {
  font-size: 1.5rem;
}

.start-page .start-button {
  margin-top: 1.6rem;
}

.start-page .category-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 220px);
  gap: 0.55rem;
  border-top: 0;
  padding-top: 0;
}

.start-page .category-level-line {
  font-size: 1rem;
  text-align: center;
}

.start-page .category-stars {
  font-size: 1.45rem;
  color: var(--star-gold);
  letter-spacing: 0.08em;
}

.start-page .category-stats {
  font-size: 0.98rem;
}

.start-level-history {
  max-width: 520px;
  margin: 1rem auto 0;
}

.start-level-history-chart-wrap {
  position: relative;
  height: 96px;
}

.start-level-history-chart {
  width: 100%;
  height: 100%;
}

.start-level-history-empty {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
}

.start-stat-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.start-stat-line .result-score-label,
.start-stat-line .result-score-field {
  margin: 0;
}

.start-level-field::after {
  content: "";
}

.start-button {
  display: inline-block;
  margin: 0.8rem 0 1rem;
  padding: 1.05rem 2.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #fff;
  background: #19197d;
  border-radius: 999px;
}

.stats-shell {
  padding: 1.4rem;
  border: 1px solid #e6d17d;
  box-shadow: 0 18px 44px rgba(80, 60, 0, 0.12);
  text-align: left;
}

.stats-page-intro {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.stats-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #836400;
}

.stats-title {
  margin: 0;
  line-height: 0.95;
  color: #19197d;
}

.stats-copy {
  max-width: 40rem;
  margin: 0;
  color: #5b6470;
  font-size: 1rem;
}

.stats-feedback {
  min-height: 1.5rem;
  margin-bottom: 1rem;
  color: #5b6470;
  font-size: 0.95rem;
}

.stats-feedback.is-alert {
  color: #7c2d12;
}

.stats-grid {
  display: grid;
  gap: 1rem;
}

.stats-category-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid #eadfae;
  box-shadow: 0 14px 34px rgba(98, 76, 0, 0.08);
}

.stats-category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #19197d, #ffd43b);
}

.stats-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.stats-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.stats-card-icon-wrap {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9df 0%, #ffe99c 100%);
  box-shadow: inset 0 0 0 1px rgba(131, 100, 0, 0.12);
  flex-shrink: 0;
}

.stats-card-icon {
  width: 28px;
  height: 28px;
}

.stats-card-title-block {
  min-width: 0;
}

.stats-card-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #836400;
}

.stats-card-name {
  margin: 0;
  color: #111827;
}

.stats-card-subtitle {
  margin: 0.18rem 0 0;
  color: #5b6470;
  font-size: 0.92rem;
}

.stats-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #fff6cf;
  color: #6d5300;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.stats-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.stats-metric {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  background: #fff9e3;
  border: 1px solid #f2e4ab;
}

.stats-metric-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c6a16;
}

.stats-metric-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: #19197d;
  line-height: 1;
}

.stats-metric-note {
  font-size: 0.85rem;
  color: #5b6470;
}

.stats-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 0.9rem;
}

.stats-panel {
  padding: 0.95rem;
  border: 1px solid #f1e7be;
}

.stats-panel-title {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
}

.stats-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.stats-panel-copy {
  margin: -0.35rem 0 0;
  color: #5b6470;
  font-size: 0.86rem;
}

.stats-chart-panel {
  padding-bottom: 1.15rem;
}

.stats-chart-wrap {
  position: relative;
  height: 320px;
  padding: 0.8rem 0.65rem 0.2rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf4 0%, #fff5cf 100%);
}

.stats-chart-canvas {
  width: 100%;
  height: 100%;
}

.stats-recent-list,
.stats-level-list {
  display: grid;
  gap: 0.65rem;
}

.stats-recent-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  background: #fff8db;
}

.stats-recent-score {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #19197d;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.stats-recent-label {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: #1f2937;
}

.stats-recent-meta {
  margin: 0.12rem 0 0;
  font-size: 0.78rem;
  color: #5b6470;
}

.stats-recent-trend {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #836400;
}

.stats-level-item {
  display: grid;
  gap: 0.35rem;
}

.stats-level-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.stats-level-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1f2937;
}

.stats-level-value {
  font-size: 0.82rem;
  color: #5b6470;
}

.stats-level-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4e9b7;
}

.stats-level-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #19197d 0%, #3a3af5 48%, #ffd43b 100%);
}

.stats-empty,
.stats-locked,
.stats-error {
  padding: 1rem;
  border-radius: 16px;
  background: #fff8db;
  color: #5b4d18;
}

.stats-error {
  background: #fff1eb;
  color: #8a3412;
}

.stats-empty,
.stats-locked p,
.stats-error p {
  margin: 0;
}

.stats-card-action {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: #19197d;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.leaderboard-shell {
  position: relative;
}

.leaderboard-shell .stats-category-card {
  padding: 0.4rem 0;
  border: 0;
  box-shadow: none;
}

.leaderboard-shell .stats-category-card::before {
  display: none;
}

.leaderboard-shell .stats-card-icon-wrap {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.leaderboard-shell .stats-panel,
.leaderboard-shell .leaderboard-list-card {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.leaderboard-card {
  gap: 1.1rem;
}

.leaderboard-list-card {
  padding: 1rem;
}

.leaderboard-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.leaderboard-panel {
  display: grid;
  gap: 0.75rem;
}

.leaderboard-panel-wide {
  grid-column: 1 / -1;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.leaderboard-section-label {
  margin: 0.12rem 0 0.02rem;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7280;
}

.leaderboard-player-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.08rem 0.08rem;
}

.leaderboard-player-row.is-me {
  background: rgba(25, 25, 125, 0.1);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(25, 25, 125, 0.22);
}

.leaderboard-player-row.is-me .leaderboard-player-email {
  font-size: 0.9rem;
  font-weight: 800;
}

.leaderboard-rank-badge {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #6d5300;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.leaderboard-rank-badge--1 {
  background: transparent;
  color: #6d5300;
}

.leaderboard-rank-badge--2 {
  background: transparent;
  color: #6d5300;
}

.leaderboard-rank-badge--3 {
  background: transparent;
  color: #6d5300;
}

.leaderboard-player-email {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.leaderboard-player-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: #19197d;
  white-space: nowrap;
  line-height: 1;
}

.leaderboard-empty {
  padding: 1rem;
  border-radius: 16px;
  background: #fff8db;
  color: #5b4d18;
}

.leaderboard-separator {
  padding: 0.2rem 0;
  text-align: center;
  font-size: 1.8rem;
  line-height: 1;
  color: #836400;
  letter-spacing: 0.18em;
}

.quiz-card {
  text-align: center;
}

.quiz-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 0.75rem;
}

.category-logo {
  width: 28px;
  height: 28px;
  justify-self: start;
}

.quiz-level {
  margin: 0;
  justify-self: end;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--star-gold);
}

.quiz-progress {
  margin: 0;
  color: #52606d;
}

.quiz-question {
  min-height: 220px;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.quiz-options {
  display: grid;
  gap: 0.6rem;
  max-width: 560px;
  margin: 0 auto;
}

.quiz-option {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: center;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.quiz-option:hover {
  background: #f0f4f8;
}

.quiz-modal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.quiz-modal-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.quiz-modal {
  width: min(920px, 100%);
  padding: 2rem;
}

.quiz-question-text {
  margin: 0;
  width: 100%;
  padding: 2rem 1rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: #19197d;
}

.quiz-question-image {
  width: 100%;
  max-width: 640px;
  max-height: 200px;
  object-fit: contain;
}

.home-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.2rem;
  text-decoration: none;
  color: #fff;
  background: #19197d;
  border-radius: 8px;
  border: 1px solid transparent;
}

.home-button[aria-disabled="true"],
.home-button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.result-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.36), transparent 34%),
    linear-gradient(180deg, #ffd95c 0%, #ffc800 56%, #f0b800 100%);
}

.result-page .container {
  max-width: 560px;
}

.result-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem;
  border: 1px solid #e6d17d;
  box-shadow: 0 10px 24px rgba(80, 60, 0, 0.12);
}

.result-hero {
  display: grid;
  gap: 0.45rem;
  padding: 0.35rem 0 0.9rem;
  text-align: center;
}

.result-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #836400;
}

.result-score-value {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  line-height: 0.95;
  color: #19197d;
}

.result-subline {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #524400;
}

.result-summary {
  max-width: 34rem;
  margin: 0 auto;
  color: #475569;
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.result-strip-item {
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  padding: 0.75rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fff8db;
}

.result-strip-item.is-correct {
  border-color: #79d79b;
  background: #e8fff0;
}

.result-strip-item.is-wrong {
  border-color: #f0a58f;
  background: #fff0ed;
}

.result-strip-item.is-empty {
  border-color: #d1d5db;
  background: #f3f4f6;
}

.result-strip-number {
  font-size: 1.15rem;
  font-weight: 700;
  color: #19197d;
}

.result-strip-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.result-grid {
  display: grid;
  gap: 0.6rem;
  width: min(100%, 360px);
  margin: 0.9rem auto 0;
}

.result-topbar {
  grid-template-columns: auto 1fr auto;
  margin-bottom: 0.6rem;
}

.result-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  position: relative;
  padding-right: 1.35rem;
}

.result-line-answer {
  margin: 0;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
  word-break: break-word;
}

.result-line-answer-empty {
  color: #6b7280;
  font-style: italic;
  font-weight: 600;
}

.result-next-level {
  margin: 1rem 0 0;
  text-align: center;
}

.result-score {
  margin: 0.5rem 0 0;
  text-align: center;
}

.result-total-score {
  margin: 1rem 0 0;
  text-align: center;
}

.result-level-history {
  max-width: 520px;
  margin: 0.9rem auto 0;
}

.result-level-history-chart-wrap {
  position: relative;
  height: 96px;
}

.result-level-history-chart {
  width: 100%;
  height: 100%;
}

.result-level-history-empty {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
}

.result-score-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #52606d;
}

.start-score-label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.score-info-button {
  width: 0.95rem;
  height: 0.95rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid #9ca3af;
  border-radius: 999px;
  background: transparent;
  color: #6b7280;
  font-size: 0.66rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.score-info-button:hover {
  color: #19197d;
  border-color: #19197d;
}

.score-info-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.score-info-modal[hidden] {
  display: none !important;
}

.score-info-modal-card {
  width: min(340px, 100%);
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 0.75rem 0.85rem 0.8rem;
  display: grid;
  gap: 0.22rem;
  text-align: left;
  font-size: 0.78rem;
  color: #4b5563;
}

.score-info-modal-card table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.score-info-modal-card td {
  text-align: center;
  padding: 0.1rem 0.2rem;
}

.score-info-modal-card hr {
  border: 0;
  border-top: 1px solid #cbd5e1;
  margin: 0.12rem 0;
}

.score-info-close {
  position: absolute;
  top: 0.28rem;
  right: 0.35rem;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.result-score-field {
  margin: 0.35rem 0 0;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 800;
  color: #19197d;
}

.result-score-field::after {
  content: " p";
  font-size: 0.58em;
  font-weight: 700;
  color: #52606d;
}

.start-level-field.result-score-field::after {
  content: "";
}

.result-next-level-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #52606d;
}

.result-next-level-stars {
  margin-top: 0.35rem;
  text-align: center;
  justify-self: center;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--star-gold);
}

.result-row {
  position: relative;
  overflow: hidden;
  padding: 1rem 1rem 1.05rem;
  border: 1px solid #eadfae;
  border-radius: 18px;
  background: #fff;
  text-align: left;
}

.result-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: #94a3b8;
}

.result-row.is-correct::before {
  background: #22c55e;
}

.result-row.is-wrong::before {
  background: #ef4444;
}

.result-row.is-empty::before {
  background: #94a3b8;
}

.result-row.is-pending::before {
  background: #d97706;
}

.result-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.result-row-simple .result-row-answer {
  margin-top: 0;
}

.result-row-icon {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.result-line.is-correct .result-row-icon {
  color: #15803d;
}

.result-line.is-wrong .result-row-icon {
  color: #dc2626;
}

.result-report-link {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  color: #6b7280;
  opacity: 0.55;
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1;
}

.result-report-link:hover {
  opacity: 1;
  color: #19197d;
}

.report-textarea {
  resize: vertical;
  min-height: 6.5rem;
}

.result-row-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c6a16;
}

.result-row-status {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #f5f5f5;
  color: #374151;
  font-size: 0.76rem;
  font-weight: 700;
}

.result-row.is-correct .result-row-status {
  background: #dcfce7;
  color: #166534;
}

.result-row.is-wrong .result-row-status {
  background: #fee2e2;
  color: #991b1b;
}

.result-row.is-empty .result-row-status {
  background: #e5e7eb;
  color: #475569;
}

.result-row.is-pending .result-row-status {
  background: #fef3c7;
  color: #92400e;
}

.result-row-question {
  margin: 0;
  color: #111827;
  font-size: 1.12rem;
}

.result-row-image {
  width: 100%;
  max-height: 180px;
  margin: 0.85rem 0 0;
  padding: 0.65rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf2, #fff5cc);
  object-fit: contain;
}

.result-row-answer {
  margin-top: 0.9rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #fff7d4;
}

.result-row-answer-label {
  margin: 0 0 0.35rem;
  color: #6b7280;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-row-answer-value {
  margin: 0;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
  word-break: break-word;
}

.result-row-answer-value.is-empty {
  color: #6b7280;
  font-style: italic;
  font-weight: 600;
}

.result-empty {
  padding: 1.25rem;
  border: 1px dashed #d4c16d;
  border-radius: 16px;
  background: #fff9e1;
  color: #5b4d18;
  text-align: center;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.start-page .result-actions {
  flex-direction: column;
  align-items: center;
}

.start-page .result-actions .start-button {
  margin: 0;
  padding: 1.05rem 2.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.start-secondary-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  width: 100%;
}

.start-page .start-secondary-actions .home-button {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
}

.result-actions .home-button {
  flex: 0 1 170px;
  text-align: center;
}

.result-page .result-actions {
  flex-direction: column;
  align-items: center;
}

.result-page .result-actions .start-button {
  margin: 0;
  padding: 1.05rem 2.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.result-page .result-actions .start-secondary-actions {
  width: auto;
}

.result-page .result-actions .start-secondary-actions .home-button {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
}

.home-button-secondary {
  color: #19197d;
  background: transparent;
  border-color: #19197d;
}

.quiz-info {
  margin-top: 1rem;
  min-height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #52606d;
  font-size: 0.95rem;
}

.timer-value {
  display: inline-block;
  min-width: 1ch;
  font-weight: 700;
  color: #1f2933;
}

@media (max-width: 600px) {
  .container {
    margin: 1.25rem auto;
    padding: 0 0.75rem;
  }

  .card {
    padding: 0.85rem;
  }

  .admin-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .admin-questions-top-row {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .admin-questions-second-row {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .admin-questions-third-row {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .admin-questions-bottom-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-questions-date-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-questions-section .admin-section-header {
    justify-content: flex-start;
  }

  .admin-questions-field-search {
    justify-self: stretch;
    justify-items: stretch;
  }

  .admin-questions-field-input-search {
    width: 100%;
  }

  .admin-questions-field-input-question {
    width: 100%;
  }

  .admin-questions-actions {
    justify-content: stretch;
  }

  .admin-questions-actions .home-button {
    width: 100%;
  }

  .category-card {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    column-gap: 0.55rem;
    padding: 0.52rem 0.58rem;
  }

  .category-card-icon {
    width: 20px;
    height: 20px;
  }

  .category-card-name {
    font-size: 0.88rem;
  }

  .category-card-count {
    font-size: 0.52rem;
  }

  .category-stars {
    font-size: 0.74rem;
  }

  .category-total-score {
    font-size: 0.86rem;
    min-width: 2.4rem;
  }

  .category-coming-soon {
    font-size: 0.62rem;
  }

  .category-stats {
    font-size: 0.66rem;
  }

  .start-button {
    width: 100%;
    margin: 0.6rem 0 0.8rem;
    padding: 1rem 1rem;
    font-size: 1.2rem;
  }

  .user-panel {
    top: 0.6rem;
    right: 3.35rem;
    height: 28px;
    padding: 0 0.15rem;
  }

  .user-icon {
    width: 12px;
    height: 12px;
  }

  .user-name {
    font-size: 0.62rem;
  }

  .quiz-modal-wrap {
    padding: 0.6rem;
    align-items: stretch;
  }

  .quiz-modal {
    width: min(920px, 100%);
    padding: 1rem;
    align-self: center;
  }

  .quiz-topbar {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }

  .category-logo {
    width: 24px;
    height: 24px;
  }

  .quiz-progress {
    font-size: 0.95rem;
  }

  .quiz-level {
    font-size: 1.25rem;
  }

  .quiz-question {
    min-height: 170px;
    margin-bottom: 0.8rem;
  }

  .quiz-question-text {
    padding: 1rem 0.5rem;
    font-size: 1.35rem;
  }

  .quiz-question-image {
    max-height: 150px;
  }

  .quiz-options {
    gap: 0.5rem;
    max-width: 100%;
  }

  .quiz-option {
    padding: 0.72rem 0.75rem;
    font-size: 1rem;
  }

  .result-card {
    padding: 1rem;
  }

  .stats-shell {
    padding: 1rem;
  }

  .stats-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-card-badge {
    align-self: flex-start;
  }

  .stats-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .leaderboard-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .leaderboard-shell {
    padding: 0.45rem;
  }

  .leaderboard-shell .stats-page-intro {
    display: none;
  }

  .leaderboard-shell .stats-grid {
    gap: 0.3rem;
  }

  .leaderboard-list-card {
    padding: 0.35rem 0.25rem;
  }

  .leaderboard-list {
    gap: 0.14rem;
  }

  .leaderboard-section-label {
    margin: 0.12rem 0 0.02rem;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }

  .leaderboard-player-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.28rem;
    padding: 0.06rem 0;
    min-height: 1rem;
  }

  .leaderboard-player-row.is-me {
    border-radius: 4px;
  }

  .leaderboard-player-row.is-me .leaderboard-player-email {
    font-size: 0.8rem;
  }

  .leaderboard-rank-badge {
    font-size: 0.7rem;
    line-height: 1;
  }

  .leaderboard-player-email {
    font-size: 0.72rem;
    line-height: 1;
  }

  .leaderboard-player-score {
    grid-column: auto;
    padding-left: 0;
    font-size: 0.72rem;
    line-height: 1;
    justify-self: end;
  }

  .leaderboard-separator {
    padding: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }

  .leaderboard-shell .result-actions {
    margin-top: 0.45rem;
  }

  .leaderboard-shell .result-actions .home-button {
    flex: 0 0 auto;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
  }

  .stats-chart-wrap {
    height: 260px;
    padding: 0.65rem 0.35rem 0.1rem;
  }

  .stats-recent-item {
    grid-template-columns: auto 1fr;
  }

  .stats-recent-trend {
    grid-column: 1 / -1;
  }

  .result-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-row {
    padding: 0.95rem 0.9rem 1rem;
  }

  .result-row-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions .home-button {
    flex-basis: 100%;
  }
}

button,
.start-button,
.home-button {
  border-radius: 5px;
}
