* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f7f3ee;
  --card: #ffffff;
  --text: #2b2a2a;
  --muted: #6b6b6b;
  --accent: #7c9c6c;
  --accent-2: #92b6ff;
  --border: #e7e1d8;
  --shadow: 0 14px 30px rgba(62, 50, 36, 0.08);
}

html, body {
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #f7f3ee 0%, #f2efe9 100%);
  color: var(--text);
}

body {
  overflow: hidden;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 18px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-btn {
  white-space: nowrap;
  font-weight: 600;
}

.app-title {
  font-size: 1.7rem;
  font-weight: 800;
}

.app-subtitle {
  color: var(--muted);
}

.screen {
  display: none;
  flex: 1;
  overflow: hidden;
}

.screen.active {
  display: block;
}

.screen-menu.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-list {
  display: grid;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.quiz-card-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f6f2ed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.quiz-card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.quiz-card-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.quiz-card-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.quiz-card-badge {
  margin-left: auto;
  font-size: 0.85rem;
  color: #3c7d39;
  font-weight: 700;
}

.primary-btn,
.ghost-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #96b985);
  color: #fff;
  box-shadow: 0 10px 20px rgba(124, 156, 108, 0.25);
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.trust-block {
  margin-top: 14px;
  background: #fff6e7;
  border: 1px solid #f1dcc4;
  color: #8b6c49;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
}

.main-start-btn {
  margin-top: 10px;
}

.screen-detail.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.detail-card {
  width: min(560px, 100%);
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.detail-desc {
  color: var(--muted);
}

.detail-meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.screen-quiz.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.quiz-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
}

.quiz-timer {
  min-width: 80px;
  text-align: right;
  color: var(--accent);
  font-weight: 700;
}

.quiz-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 700;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.option-btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8f9ff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.option-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 42, 68, 0.1);
}

.screen-result.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
}

.result-card {
  width: min(560px, 100%);
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-title {
  font-size: 1.35rem;
  font-weight: 800;
}

.result-desc {
  color: var(--muted);
}

.result-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-label {
  font-weight: 700;
}

.result-list {
  padding-left: 18px;
  color: var(--text);
}

.result-reco {
  background: #f3f0ff;
  border-radius: 12px;
  padding: 12px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .app {
    padding: 14px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .quiz-card {
    padding: 16px;
  }

  .quiz-question {
    font-size: 1.05rem;
  }

  .quiz-icon {
    width: 34px;
    height: 34px;
  }
}
