:root {
  --bg0: #07111f;
  --bg1: #0d1f37;
  --panel: rgba(7, 18, 32, 0.86);
  --line: #1d4f85;
  --text: #d8ebff;
  --accent: #18f0c5;
  --danger: #ff4d5a;
  --warn: #ffbd3a;
  --tile-hidden: #16314e;
  --tile-revealed: #17497c;
  --tile-edge: #60a5d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Bahnschrift", "Exo 2", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 15%, rgba(0, 217, 255, 0.18), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(255, 77, 90, 0.13), transparent 30%),
    linear-gradient(145deg, var(--bg0), var(--bg1));
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.top-brand {
  text-align: center;
  margin-bottom: 12px;
}

.top-brand h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-brand p {
  margin: 2px 0 0;
  color: #90bddf;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fade-in 220ms ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.title-panel,
.centered {
  padding: 24px;
  text-align: center;
}

.tagline {
  margin: 0 0 16px;
  color: #90bddf;
}

.btn-column {
  display: grid;
  gap: 10px;
  max-width: 280px;
  margin: 16px auto 0;
}

.arcade-btn {
  border: 1px solid #3b8ec8;
  background: linear-gradient(180deg, #1f446a, #16314e);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 120ms ease, filter 120ms ease;
}

.arcade-btn:hover,
.arcade-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.14);
}

.arcade-btn.muted {
  opacity: 0.78;
}

.difficulty-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.difficulty-btn {
  border: 1px solid #3b8ec8;
  background: #102a45;
  color: #a0c8e8;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.difficulty-btn.selected {
  color: #052128;
  background: var(--accent);
  border-color: transparent;
}

.howto {
  margin-top: 14px;
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  background: rgba(8, 29, 49, 0.75);
}

.howto.hidden,
.hidden {
  display: none !important;
}

.hud {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.hud-item {
  background: rgba(14, 40, 67, 0.8);
  border: 1px solid #2f6b9b;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.hud-item span {
  display: block;
  font-size: 0.75rem;
  color: #a7cbe7;
}

.hud-item strong {
  font-size: 1.2rem;
}

.hud-item.wide {
  grid-column: span 2;
}

.meter-wrap {
  margin-top: 6px;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #0f2a44;
}

.meter {
  height: 100%;
  width: 100%;
  transition: width 200ms linear;
  background: linear-gradient(90deg, #26da73, #ffca3a, #ff4d5a);
}

.controls {
  margin-top: 10px;
  padding: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.grid {
  margin-top: 14px;
  display: grid;
  gap: 4px;
  justify-content: center;
  padding: 10px;
}

.tile {
  width: min(48px, calc((100vw - 70px) / 10));
  height: min(48px, calc((100vw - 70px) / 10));
  border-radius: 8px;
  border: 1px solid #3e7fb1;
  background: linear-gradient(160deg, #264f78, var(--tile-hidden));
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.tile.revealed {
  background: linear-gradient(160deg, #2a6ea8, var(--tile-revealed));
  border-color: var(--tile-edge);
}

.tile.infected-revealed {
  background: radial-gradient(circle at 40% 35%, #ff8c8c, #8c101e 75%);
  color: #ffe9ec;
}

.tile.quarantined::after {
  content: "!";
  color: #051722;
  background: var(--warn);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.tile.clue-1 { color: #9ed0ff; }
.tile.clue-2 { color: #7bf2e7; }
.tile.clue-3 { color: #f1e482; }
.tile.clue-4 { color: #ffbc7c; }
.tile.clue-5, .tile.clue-6, .tile.clue-7, .tile.clue-8 { color: #ff7f8c; }

.spread-alert {
  margin-top: 10px;
  text-align: center;
  color: #ffd3d7;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 0 14px rgba(255, 77, 90, 0.85);
  animation: pulse 500ms ease-in-out 2;
}

@keyframes pulse {
  0% { opacity: 0.15; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.01); }
  100% { opacity: 0.2; transform: scale(0.98); }
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.score-table th,
.score-table td {
  border-bottom: 1px solid #2e5b87;
  padding: 8px;
}

.score-table th {
  color: #91bddf;
}

.initial-slots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.initial-slot {
  width: 68px;
  height: 76px;
  border-radius: 12px;
  border: 1px solid #3f80b4;
  background: #143555;
  color: #ddf0ff;
  font-size: 2rem;
  font-weight: 900;
}

.initial-slot.active {
  border-color: #1cf0c8;
  box-shadow: 0 0 0 2px rgba(28, 240, 200, 0.35);
}

.subtle {
  color: #8fb8d8;
  font-size: 0.92rem;
}

@media (max-width: 720px) {
  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-item.wide {
    grid-column: span 2;
  }
}
.howto h3 {
  margin: 12px 0 6px;
  color: #bfe6ff;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.howto p {
  margin: 0 0 8px;
}

.howto ul {
  margin: 0 0 8px 18px;
  padding: 0;
}

.howto li {
  margin-bottom: 4px;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 14, 0.74);
  pointer-events: none;
}

.tutorial-card {
  position: relative;
  width: min(560px, calc(100vw - 28px));
  padding: 18px;
  text-align: left;
  z-index: 1;
  pointer-events: auto;
}

.tutorial-card h3 {
  margin: 2px 0 8px;
}

.tutorial-step {
  margin: 0;
  color: #8cc4e9;
  font-size: 0.9rem;
}

.tutorial-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.tutorial-highlight {
  position: relative;
  z-index: 1000;
  box-shadow: 0 0 0 3px rgba(24, 240, 197, 0.55), 0 0 24px rgba(24, 240, 197, 0.35);
  border-radius: 10px;
}

.tutorial-actions .arcade-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  transform: none;
}






.tutorial-status {
  margin: 6px 0 0;
  color: #b9d9f2;
  font-size: 0.92rem;
}

.tutorial-status.complete {
  color: #72f1c8;
}
