/* ============ GoSeRetrouver — radar nocturne ============ */

:root {
  --bg: #0a0c08;
  --bg-card: #11140d;
  --bg-raised: #181c12;
  --ink: #eef3e2;
  --ink-dim: #9aa38a;
  --acid: #c8f542;
  --acid-soft: rgba(200, 245, 66, 0.14);
  --line: rgba(200, 245, 66, 0.18);
  --danger: #ff4d6d;
  --font-display: "Unbounded", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* grain */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

.mono { font-family: var(--font-mono); }

.view {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  animation: view-in 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ============ hero ============ */

.hero {
  position: relative;
  text-align: center;
  padding: 72px 0 48px;
}

.hero-kicker {
  font-family: var(--font-mono);
  color: var(--acid);
  letter-spacing: 0.5em;
  font-size: 13px;
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 7vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero-title span { color: var(--acid); }

.hero-sub {
  margin-top: 16px;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
}

/* radar décoratif */
.radar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.55;
}

.radar-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.radar-ring.r2 { inset: 18%; }
.radar-ring.r3 { inset: 36%; }

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 300deg, rgba(200, 245, 66, 0.22) 355deg, transparent 360deg);
  animation: sweep 4.5s linear infinite;
}

@keyframes sweep { to { transform: rotate(360deg); } }

.radar-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
  animation: dot-pulse 3s ease-in-out infinite;
}

.radar-dot.d1 { top: 22%; left: 64%; }
.radar-dot.d2 { top: 60%; left: 24%; animation-delay: 1s; }
.radar-dot.d3 { top: 74%; left: 70%; animation-delay: 2s; }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* ============ cards & forms ============ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  margin-top: 20px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 20px;
}

.card-title::before {
  content: "//";
  color: var(--acid);
  font-family: var(--font-mono);
  margin-right: 8px;
}

.field { display: block; margin-bottom: 20px; }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  margin-bottom: 8px;
}

.field-label em { text-transform: none; letter-spacing: 0; }

input[type="text"] {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px var(--acid-soft);
}

input[type="text"]::placeholder { color: #5a6250; }

.spot-inputs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.spot-input-row { display: flex; gap: 8px; }

.spot-input-row input { flex: 1; }

.spot-remove {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-dim);
  width: 46px;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.spot-remove:hover { color: var(--danger); border-color: var(--danger); }

/* ============ buttons ============ */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  border-radius: 12px;
  padding: 14px 22px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--acid);
  color: #0c0f06;
  width: 100%;
  box-shadow: 0 0 24px rgba(200, 245, 66, 0.18);
}

.btn-primary:hover { box-shadow: 0 0 36px rgba(200, 245, 66, 0.32); }

.btn-primary:disabled { opacity: 0.5; cursor: wait; }

.btn-ghost {
  background: none;
  border-color: var(--line);
  color: var(--acid);
  font-family: var(--font-body);
  font-weight: 500;
  padding: 10px 16px;
  width: auto;
}

.btn-ghost:hover { background: var(--acid-soft); }

.btn-small { padding: 8px 14px; font-size: 13px; }

.error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 12px;
  min-height: 1em;
}

/* ============ created panel ============ */

.created-card { text-align: center; border-color: var(--acid); }

.created-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--acid);
}

.created-name {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 8px 0 18px;
}

.created-code-wrap { margin-bottom: 18px; }

.created-code-label {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

.created-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.35em;
  color: var(--acid);
  text-shadow: 0 0 18px rgba(200, 245, 66, 0.45);
}

.created-qr {
  display: block;
  margin: 0 auto 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
  max-width: 220px;
  width: 100%;
  height: auto;
}

.share-row { display: flex; gap: 8px; margin-bottom: 14px; }

.share-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
}

.created-note {
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 14px 0 20px;
}

.footer {
  text-align: center;
  margin-top: 60px;
  color: #4a5240;
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ============ venue view ============ */

.venue-header { padding: 24px 0 8px; }

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--acid);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.2em;
}

.venue-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 32px);
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.venue-meta { color: var(--ink-dim); font-size: 13px; margin-top: 6px; }

.me-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.me-id { display: flex; align-items: center; gap: 10px; min-width: 0; }

.me-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 10px currentColor;
}

.me-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin: 30px 0 14px;
}

.section-title::before {
  content: "//";
  color: var(--acid);
  font-family: var(--font-mono);
  margin-right: 8px;
}

/* déclaration de position */
.spot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.spot-btn {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 18px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  overflow-wrap: anywhere;
}

.spot-btn:hover { border-color: var(--acid); }

.spot-btn:active { transform: scale(0.96); }

.spot-btn.active {
  background: var(--acid);
  border-color: var(--acid);
  color: #0c0f06;
  font-weight: 700;
  box-shadow: 0 0 22px rgba(200, 245, 66, 0.3);
}

.spot-btn .spot-here {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  margin-top: 6px;
  opacity: 0.7;
}

#btn-clear-pos { margin-top: 12px; }

/* la bande */
.crew-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--acid);
}

.crew-list { display: flex; flex-direction: column; gap: 10px; }

.crew-group { display: flex; flex-direction: column; gap: 8px; }

.crew-group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--acid);
  padding: 4px 2px;
}

.crew-group-label.unset { color: var(--ink-dim); }

.crew-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  animation: row-in 0.35s ease both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

.crew-row.me { border-color: var(--acid); }

.crew-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: #0c0f06;
}

.crew-info { flex: 1; min-width: 0; }

.crew-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  white-space: nowrap;
  text-align: right;
}

.crew-time strong { color: var(--ink); font-weight: 700; }

.crew-remove {
  flex: 0 0 auto;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: var(--ink-dim);
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.crew-remove:hover { color: var(--danger); border-color: var(--danger); }

.crew-empty {
  color: var(--ink-dim);
  text-align: center;
  padding: 30px 0;
  line-height: 1.7;
}

.venue-actions { margin-top: 34px; }

.invite-details summary { list-style: none; display: inline-block; }

.invite-details summary::-webkit-details-marker { display: none; }

.invite-body { margin-top: 16px; }

.add-spot-form { display: flex; gap: 8px; margin-top: 18px; align-items: center; }

.add-spot-form input { flex: 1; }

/* ============ 404 ============ */

.notfound { text-align: center; padding-top: 90px; }

.notfound-code {
  font-family: var(--font-display);
  font-size: 90px;
  color: var(--acid);
  opacity: 0.4;
}

.notfound h1 { font-family: var(--font-display); font-size: 22px; margin: 10px 0; }

.notfound p { color: var(--ink-dim); margin-bottom: 26px; }

.notfound .btn { width: auto; }

/* ============ toast ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--acid);
  color: #0c0f06;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 30px rgba(200, 245, 66, 0.35);
  z-index: 100;
  animation: toast-in 0.25s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .radar-sweep, .radar-dot { animation: none; }
  .view, .crew-row { animation: none; }
}
