:root {
  --bg: #050711;
  --card-bg: #0d1020;
  --border-soft: rgba(255, 255, 255, 0.08);
  --text-main: #f5f5f7;
  --text-muted: #a0a3b5;
  --accent: #44ffd2;
  --accent-strong: #00f5ff;
  --danger: #ff5c7a;
  --success: #7bff8b;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --transition-fast: 0.18s ease;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #141a33 0, #050711 55%, #02020a 100%);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.app-shell {
  width: 100%;
  max-width: 960px;
  background: linear-gradient(145deg, rgba(68, 255, 210, 0.03), rgba(0, 245, 255, 0.04));
  border-radius: 24px;
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.app-header {
  text-align: center;
  margin-bottom: 18px;
}

.app-header h1 {
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.app-main {
  display: grid;
  gap: 16px;
}

@media (min-width: 800px) {
  .app-main {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "stats quest"
      "log  log";
  }

  .stats-card {
    grid-area: stats;
  }

  .quest-card {
    grid-area: quest;
  }

  .log-card {
    grid-area: log;
  }
}

.card,
.stats-card,
.quest-card,
.log-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
}

.stats-card h2,
.quest-card h2,
.log-card h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.value {
  font-size: 1.1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.status-pill.completed {
  background: rgba(123, 255, 139, 0.12);
  color: var(--success);
}

.progress-block {
  margin-top: 16px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(68, 255, 210, 0.1),
    var(--accent),
    var(--accent-strong)
  );
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.6);
  transition: width var(--transition-fast);
}

.quest-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 10px;
}

.quest-list {
  margin: 0 0 14px 18px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-main);
}

.quest-list li {
  margin-bottom: 4px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(68, 255, 210, 0.6);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.2), rgba(5, 7, 17, 1));
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.3), rgba(5, 7, 17, 1));
  box-shadow: 0 10px 25px rgba(0, 245, 255, 0.25);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 245, 255, 0.2);
}

.primary-btn:disabled {
  cursor: default;
  opacity: 0.55;
  border-color: rgba(160, 163, 181, 0.9);
  box-shadow: none;
}

.feedback-text {
  margin-top: 10px;
  font-size: 0.85rem;
  min-height: 1.1em;
  color: var(--text-muted);
}

.feedback-text.success {
  color: var(--success);
}

.feedback-text.info {
  color: var(--accent);
}

.feedback-text.error {
  color: var(--danger);
}

.state-debug {
  margin: 0;
  padding: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  border-radius: 10px;
  background: #050712;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  max-height: 180px;
  overflow: auto;
}

.app-footer {
  text-align: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
