/* Smart City Camp — neon-on-dark theme */
:root {
  --bg: #070b14; --panel: #0d1526; --panel-2: #132038;
  --ink: #e8f0ff; --muted: #8fa3c8;
  --neon: #00e5ff; --gold: #ffd166; --ok: #3ddc84; --danger: #ff5470;
  --grid-line: #12203a;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, var(--grid-line) 0, var(--grid-line) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, var(--grid-line) 0, var(--grid-line) 1px, transparent 1px, transparent 40px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5; min-height: 100vh;
}
h1, h2, h3 { font-family: "Segoe UI", system-ui, sans-serif; letter-spacing: 0.5px; text-shadow: 0 0 12px rgba(0, 229, 255, 0.25); }
a { color: var(--neon); }
.hidden { display: none !important; }

.top-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel);
  border-bottom: 2px solid var(--neon);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
  position: sticky; top: 0; z-index: 10;
}
.top-bar .spacer { flex: 1; }
.stars { color: var(--gold); font-weight: bold; }
#statBar { color: var(--ink); font-weight: 600; }
.sync-dot { margin-left: 6px; }

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

.card {
  background: var(--panel); border: 1px solid var(--grid-line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.04), 0 4px 20px rgba(0, 0, 0, 0.35);
}

.btn {
  display: inline-block; cursor: pointer; border: none; border-radius: 8px;
  padding: 10px 18px; font-size: 1rem; font-weight: 600;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--grid-line);
}
.btn:hover { filter: brightness(1.25); border-color: var(--neon); }
.btn-gold {
  background: var(--gold); color: #1a1405; border: 1px solid var(--gold);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.55);
}
.btn-gold:hover { box-shadow: 0 0 22px rgba(255, 209, 102, 0.85); filter: brightness(1.08); }
.btn-danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > * { min-width: 0; }

/* Day map tiles */
.day-map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.day-map > * { min-width: 0; }
.day-tile {
  background: var(--panel-2); border: 2px solid var(--grid-line); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.day-tile:hover { border-color: var(--neon); box-shadow: 0 0 14px rgba(0, 229, 255, 0.35); }
.day-tile .big { font-size: 2rem; }
.day-tile.done-day { border-color: var(--ok); box-shadow: 0 0 14px rgba(61, 220, 132, 0.35); }
.day-tile.locked { opacity: 0.55; border-style: dashed; }

/* Phases + missions */
.phase-pill {
  display: inline-block; border-radius: 999px; padding: 4px 14px; margin-right: 8px;
  background: var(--panel-2); font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--grid-line);
}
.phase-pill.active { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.phase-pill.locked { opacity: 0.45; }
.mission {
  border-left: 4px solid var(--neon); background: var(--panel-2);
  border-radius: 8px; padding: 12px; margin: 10px 0;
}
.mission.done { border-left-color: var(--ok); opacity: 0.85; }
.mission .mission-stars { color: var(--gold); }
.hint-box { background: #1a2a12; border: 1px dashed var(--gold); padding: 8px 12px; border-radius: 8px; margin-top: 8px; }

.badge-chip {
  display: inline-block; background: var(--panel-2); border: 1px solid var(--gold);
  border-radius: 999px; padding: 4px 12px; margin: 2px; font-size: 0.95rem;
}

/* Modal (rank-up / unlock / celebrate) */
.modal-back {
  position: fixed; inset: 0; background: rgba(2, 6, 16, 0.8);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--panel); border: 2px solid var(--neon); border-radius: var(--radius);
  padding: 28px; max-width: 420px; text-align: center; animation: pop 0.35s ease;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

input[type=text], input[type=color], textarea, select {
  background: #0a0f1c; color: var(--ink); border: 1px solid var(--grid-line);
  border-radius: 8px; padding: 10px; font-size: 1rem; width: 100%;
}
input[type=text]:focus, textarea:focus, select:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 8px rgba(0, 229, 255, 0.4); }
input[type=color] { padding: 4px; height: 44px; cursor: pointer; }
textarea.code { font-family: Consolas, monospace; font-size: 0.95rem; background: #05070d; }

/* ---------- Enroll / Restore / Wizard (index.html) ---------- */
.tip { color: var(--muted); font-size: 0.9rem; }

.wizard-step { display: block; }
.step-dots { text-align: center; margin-bottom: 12px; color: var(--muted); }
.step-dots .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px; background: var(--grid-line); }
.step-dots .dot.active { background: var(--neon); box-shadow: 0 0 8px rgba(0, 229, 255, 0.7); }

.color-row { display: flex; gap: 16px; flex-wrap: wrap; }
.color-row label { flex: 1; min-width: 140px; }
.color-row label span { display: block; margin-bottom: 6px; color: var(--muted); }

.mascot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mascot-btn {
  font-size: 2rem; background: var(--panel-2); border: 2px solid var(--grid-line);
  border-radius: var(--radius); padding: 14px 0; cursor: pointer; color: var(--ink);
}
.mascot-btn:hover { border-color: var(--neon); }
.mascot-btn.selected { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 209, 102, 0.55); }

.energy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.energy-card {
  background: var(--panel-2); border: 2px solid var(--grid-line); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer; color: var(--ink);
}
.energy-card .big { font-size: 2rem; display: block; margin-bottom: 6px; }
.energy-card:hover { border-color: var(--neon); }
.energy-card.selected { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 209, 102, 0.55); }

.wizard-nav { display: flex; justify-content: space-between; margin-top: 16px; }

/* City ID card */
.id-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.flag-swatch {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  border: 2px solid var(--grid-line); box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
}
.id-info { flex: 1; min-width: 180px; }
.id-info h2 { margin: 0 0 4px; }

/* News feed */
.news-item { border-left: 4px solid var(--neon); background: var(--panel-2); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.news-time { color: var(--muted); font-size: 0.85rem; float: right; }
.news-empty { color: var(--muted); }

@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
  .day-map { grid-template-columns: repeat(2, 1fr); }
  .mascot-grid { grid-template-columns: repeat(4, 1fr); }
  .energy-grid { grid-template-columns: 1fr; }
  .id-card { flex-direction: column; text-align: center; }
}
