:root {
  color-scheme: light;
  --bg: #fbe9d0;
  --card: #fff7ec;
  --accent: #e64833;
  --accent-soft: #90aead;
  --text: #244855;
  --muted: #6b5b52;
  --border: #d8c6b1;
  --success: #2e7d32;
  --danger: #b33b2f;
  --shadow: 0 18px 40px rgba(36, 72, 85, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  background: radial-gradient(circle at top left, #fbe9d0 0%, #f2dcc2 50%, #f0d5b4 100%);
  color: var(--text);
}

.app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  margin: 0 0 8px;
  color: var(--muted);
}

.title {
  margin: 0 0 8px;
  font-size: 34px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.status__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c2b9b1;
}

.status__name {
  padding-left: 8px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.question-headline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  width: fit-content;
}

.badge--soft {
  background: #f4ede4;
  color: var(--muted);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel .card + .card {
  margin-top: 16px;
}

h2 {
  margin: 0 0 16px;
}

h3 {
  margin: 0 0 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  font-size: 13px;
  color: var(--muted);
}

input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
}

textarea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  resize: vertical;
}

select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  background: white;
}

button {
  padding: 10px 14px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button.secondary {
  background: var(--accent-soft);
  color: var(--text);
}

button.selected {
  background: var(--success);
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(42, 34, 29, 0.12);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pill {
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 600;
  text-align: center;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ef;
  border: 1px solid #ead8ca;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.list li .meta {
  display: inline-flex;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.options {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.open-answer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.answers {
  margin-top: 16px;
}

.answers h3 {
  margin: 0 0 10px;
}

.grading {
  position: relative;
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #fff4da;
  border: 1px solid #f1d6a6;
  color: #7a5a22;
  text-align: center;
  font-weight: 600;
}

.code-block {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbf7f2;
  font-size: 13px;
  overflow-x: auto;
}

.landing {
  background: radial-gradient(circle at top left, #fff8f1 0%, #f1e4d7 50%, #efe2d6 100%);
}

.landing-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.landing-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  align-items: center;
  margin-bottom: 48px;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.brand__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 16px;
  min-width: 140px;
  box-shadow: var(--shadow);
}

.stat__value {
  font-size: 20px;
  font-weight: 700;
  display: block;
}

.stat__label {
  color: var(--muted);
  font-size: 13px;
}

.landing-hero__content {
  display: grid;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand__logo {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 30px rgba(178, 75, 63, 0.3);
}

.landing-hero__card .feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.cta--ghost {
  background: var(--accent-soft);
  color: var(--text);
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(42, 34, 29, 0.12);
}

.note {
  color: var(--muted);
  font-size: 14px;
}

.landing-section {
  margin-bottom: 40px;
}

.landing-grid .card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
}

.landing-grid .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(36, 72, 85, 0.12);
}

.feature-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.feature-list h4 {
  margin: 0 0 6px;
}

.store-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.landing-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: center;
}

.callout {
  padding: 20px;
  border-radius: 20px;
  background: #fff7ef;
  border: 1px solid #ead8ca;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.landing-footer {
  margin-top: 40px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(25, 18, 14, 0.4);
  padding: 24px;
  z-index: 20;
}

.modal__card {
  width: min(420px, 90vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

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

.modal__close {
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 22px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
}

.admin-sidebar__brand .title {
  font-size: 22px;
}

.admin-nav__section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 4px;
}

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: #f9f4ee;
  border: 1px solid transparent;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.admin-nav__icon {
  width: 18px;
  height: 18px;
  color: #8b6b5a;
}

.admin-nav__link:hover {
  border-color: #eadbcc;
  box-shadow: 0 10px 20px rgba(90, 60, 40, 0.08);
  transform: translateY(-1px);
}

.admin-nav__link--active {
  background: var(--accent-soft);
  border-color: #e2c9b7;
  font-weight: 600;
}

.admin-nav__link--active .admin-nav__icon {
  color: #7c4b35;
}

.admin-content {
  padding: 24px 24px 64px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: #fffaf4;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  margin: 4px 0 6px;
}

.generation-log {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbf7f2;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
}

.field__inline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.field__inline textarea {
  flex: 1;
}

.link-button {
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.category-details {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbf7f2;
  font-size: 13px;
}

.details-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.details-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(32, 26, 22, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.modal--open {
  opacity: 1;
  pointer-events: auto;
}

.modal__content {
  width: min(720px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}

.admin-logout {
  margin-top: auto;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 236, 224, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.overlay__card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-width: 280px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-table tr:nth-child(even) td {
  background: #fbf7f2;
}

.admin-table__cell-main {
  font-weight: 600;
}

.admin-table__cell-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.icon-button {
  border: none;
  background: #f3e6d9;
  color: #7c4b35;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  background: #ead6c5;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.results {
  display: grid;
  gap: 16px;
}

.result-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.result-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  text-align: center;
}

.status-badge--green {
  background: #d7f5df;
  color: #1e6b36;
}

.status-badge--yellow {
  background: #fff2c7;
  color: #7a5a22;
}

.status-badge--red {
  background: #fde1de;
  color: #a13a31;
}

.status-badge--gray {
  background: #efe9e2;
  color: #6b5b52;
}

.media {
  margin: 12px 0 16px;
}

.media img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.info {
  margin-top: 12px;
  color: var(--muted);
}

.host-controls {
  display: flex;
  gap: 8px;
}

.feedback {
  margin-top: 12px;
  font-weight: 600;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .app__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .title {
    font-size: 28px;
  }
}
