:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #1f2937;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top, #ffffff, #eef2ff 40%, #f6f7fb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at top left, rgba(99,102,241,0.14) 0%, transparent 35%),
    radial-gradient(circle at bottom right, rgba(16,185,129,0.12) 0%, transparent 30%);
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #e0e7ff;
  font-size: 1.5rem;
}

.app-label {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.app-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  color: #4b5563;
}

.score-box {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.95rem;
  color: #374151;
}

.score-box strong {
  font-size: 1.35rem;
}

.app-shell {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem 1rem 2rem;
  margin: 0 auto;
}

.phase-text {
  margin: 0 0 1rem;
  color: #4b5563;
  font-size: 1rem;
}

.challenge-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.challenge-card,
.active-card {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
  padding: 1.5rem;
}

.challenge-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}

.challenge-card h3,
.active-card h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  line-height: 1.2;
}

.challenge-card p,
.active-card p {
  margin: 0 0 1.5rem;
  color: #4b5563;
  line-height: 1.7;
  flex: 1;
}

.challenge-card button,
.action-row button {
  width: 100%;
  min-height: 3.6rem;
  border: none;
  border-radius: 1.1rem;
  padding: 0.95rem 1.2rem;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.challenge-card button:hover,
.action-row button:hover {
  transform: translateY(-1px);
}

.primary {
  background: #4338ca;
  color: #ffffff;
  box-shadow: 0 14px 25px rgba(67, 56, 202, 0.18);
}

.secondary {
  background: #eef2ff;
  color: #4338ca;
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.active-card {
  max-width: 700px;
  margin: 0 auto;
}

.active-label {
  display: inline-flex;
  padding: 0.45rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 0.85rem;
  font-weight: 700;
}

.hidden {
  display: none;
}

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .score-box {
    align-items: center;
  }
}
