:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  --bg: #0b0f1f;
  --card: #121a2f;
  --primary: #4cc9f0;
  --primary-dark: #3a9fc0;
  --accent: #43f5a0;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #28344a;
  --shadow: 0 12px 30px rgba(2, 6, 23, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top, rgba(76, 201, 240, 0.12), transparent 55%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(76, 201, 240, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 201, 240, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.4;
  z-index: -1;
}

main {
  flex: 1;
  padding: 24px;
}

.site-header {
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(120deg, rgba(18, 26, 47, 0.95), rgba(11, 15, 31, 0.98));
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.ghost {
  background: transparent;
  border: 1px solid rgba(76, 201, 240, 0.45);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: border 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(67, 245, 160, 0.35);
}

.title-block h1 {
  font-size: 1.8rem;
}

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

.helper-text {
  margin-top: 8px;
  color: var(--muted);
  min-height: 20px;
}

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

.scoreboard div {
  background: rgba(76, 201, 240, 0.12);
  padding: 8px 12px;
  border-radius: 10px;
  min-width: 110px;
  text-align: center;
  border: 1px solid rgba(76, 201, 240, 0.25);
}

.scoreboard .label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.screen {
  display: none;
  gap: 24px;
}

.screen.active {
  display: flex;
  flex-wrap: wrap;
  animation: screenFade 0.45s ease;
}

.panel {
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(76, 201, 240, 0.15);
  flex: 1 1 320px;
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(67, 245, 160, 0.08), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}

.primary {
  margin-top: 16px;
  background: var(--primary);
  color: #04121f;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(76, 201, 240, 0.2);
}

.primary:disabled {
  background: rgba(76, 201, 240, 0.35);
  color: rgba(4, 18, 31, 0.7);
  cursor: not-allowed;
  box-shadow: none;
}

.primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

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

.card {
  border: 2px solid transparent;
  padding: 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card.selected {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(67, 245, 160, 0.25);
}

.card-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(76, 201, 240, 0.3);
  background: rgba(76, 201, 240, 0.08);
  color: var(--primary);
}

.card svg,
.incident-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.card h4 {
  font-size: 1rem;
}

.card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(67, 245, 160, 0.18);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.network-panel {
  max-width: 340px;
}

.selected-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-list li {
  background: rgba(76, 201, 240, 0.12);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid rgba(76, 201, 240, 0.2);
}

.incident-card {
  background: rgba(251, 146, 60, 0.12);
  border-left: 6px solid #fb923c;
  padding: 20px;
  border-radius: 12px;
  margin: 16px 0;
  display: grid;
  gap: 12px;
}

.incident-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.incident-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(251, 146, 60, 0.18);
  border: 1px solid rgba(251, 146, 60, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fdba74;
  animation: glowPulse 2.4s ease-in-out infinite;
}

.prompt {
  margin-bottom: 16px;
  font-weight: 600;
}

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

.option-btn {
  border: 2px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.option-btn.selected {
  border-color: var(--primary);
  background: rgba(76, 201, 240, 0.2);
  box-shadow: 0 0 12px rgba(76, 201, 240, 0.25);
}

.feedback-content {
  display: grid;
  gap: 16px;
}

.feedback-box {
  padding: 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border-left: 6px solid var(--accent);
}

.feedback-box strong {
  color: var(--accent);
}

.feedback-box.correct {
  border-left-color: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.2);
}

.feedback-box.incorrect {
  border-left-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.feedback-box.correct strong {
  color: #22c55e;
}

.feedback-box.incorrect strong {
  color: #ef4444;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.feedback-box.incorrect .status-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.summary {
  margin: 16px 0;
  display: grid;
  gap: 12px;
}

.summary h3 {
  margin-bottom: 6px;
}

.reflection {
  background: rgba(76, 201, 240, 0.12);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(76, 201, 240, 0.2);
}

.site-footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .scoreboard {
    width: 100%;
    justify-content: space-between;
  }
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(251, 146, 60, 0.1);
  }
  50% {
    box-shadow: 0 0 18px rgba(251, 146, 60, 0.4);
  }
}

@keyframes screenFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
