/* Plane GO — thème « jeu vidéo » (fond bleu nuit, accents néon) */
:root {
  --bg: #0a0f1e; --bar: #0e1528; --card: #141c33; --card-2: #1a2440; --line: #2c3a5e;
  --text: #e8eef9; --dim: #93a3c4; --cyan: #00e5ff; --amber: #ffc23d; --green: #5cffc8; --red: #ff4d5e; --civil: #5e7194;
  --r-common: #b7c3d9; --r-uncommon: #5cf08a; --r-rare: #3db8ff; --r-epic: #d96bff; --r-legendary: #ffb13d;
  --radius: 16px; --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--cyan); }
h1, h2, h3, .cond { font-family: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif; font-stretch: condensed; }

/* ---------- Structure ---------- */
#app { display: flex; flex-direction: column; height: 100dvh; max-width: 680px; margin: 0 auto; }
.hud {
  display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 14px 10px;
  background: var(--bar); cursor: pointer; flex: none;
}
.hud .who { flex: 1; min-width: 0; }
.hud .name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .lvl { color: var(--cyan); font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--card-2); border: 2px solid var(--cyan); flex: none; }
.avatar.sm { width: 36px; height: 36px; border-width: 1px; border-color: var(--line); }
.avatar.lg { width: 104px; height: 104px; }
.xpbar { height: 7px; background: #24304f; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.xpbar > i { display: block; height: 100%; background: var(--amber); border-radius: 4px; transition: width .4s; }
.xpbar.cyan > i { background: var(--cyan); }
.chip { border: 1.5px solid var(--amber); background: rgba(255, 194, 61, .15); color: var(--amber); border-radius: 20px;
  padding: 3px 10px; font-weight: 700; white-space: nowrap; font-family: "Roboto Condensed", system-ui, sans-serif; }
main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px 44px; }
.tabbar {
  display: flex; background: var(--bar); flex: none; padding-bottom: var(--safe-b);
  border-top: 1px solid #172142;
}
.tab { flex: 1; min-width: 0; height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--dim); cursor: pointer; position: relative; padding: 0 1px; }
.tab .e { font-size: 19px; opacity: .6; line-height: 1.2; }
.tab .l { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.on { color: var(--cyan); font-weight: 700; }
.tab.on .e { opacity: 1; font-size: 22px; }
.tab.on::before { content: ""; position: absolute; top: 4px; width: 28px; height: 3px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.tab .l { font-size: 11px; }

/* Bouton central du Scanner : rond surélevé, détouré dans la barre */
.tabbar { position: relative; overflow: visible; z-index: 5; }
.tab.center { justify-content: flex-end; padding-bottom: 7px; overflow: visible; }
.tab.center::before { display: none; }
.tab.center .fab {
  position: absolute; left: 50%; top: -30px; transform: translateX(-50%);
  width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: #00222b;
  background: radial-gradient(circle at 34% 28%, #8ff6ff 0%, #22e6ff 38%, #00a9c4 78%, #007e93 100%);
  border: 5px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .55), 0 8px 22px rgba(0, 229, 255, .35), inset 0 -4px 10px rgba(0, 60, 80, .35);
  transition: transform .15s, box-shadow .2s;
}
.tab.center .fab svg { width: 44px; height: 44px; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .45)); }
.tab.center .l { color: var(--cyan); font-weight: 800; letter-spacing: .02em; }
.tab.center:active .fab { transform: translateX(-50%) scale(.94); }
.tab.center.on .fab { box-shadow: 0 0 0 2.5px var(--cyan), 0 0 26px rgba(0, 229, 255, .75), inset 0 -4px 10px rgba(0, 60, 80, .35); }
.tab.center.live .fab::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--cyan);
  animation: ping 1.8s ease-out infinite; pointer-events: none;
}
@keyframes ping { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tab.center.live .fab::after { animation: none; opacity: .6; } }


/* ---------- Éléments ---------- */
.title { font-family: "Roboto Condensed", system-ui, sans-serif; font-weight: 800; letter-spacing: .02em; color: var(--cyan);
  font-size: 22px; margin: 0 0 4px; }
.section { color: var(--cyan); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 20px 0 6px; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.mt { margin-top: 10px; } .mt2 { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); border: 2px solid transparent; overflow: hidden; }
.card.pad { padding: 14px; }
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; letter-spacing: .02em; cursor: pointer;
  background: var(--card-2); color: var(--text); min-height: 44px; }
.btn.primary { background: var(--cyan); color: #00131a; }
.btn.amber { background: var(--amber); color: #1e1300; }
.btn.outline { background: none; border: 1.5px solid var(--line); color: var(--cyan); }
.btn.danger { background: none; color: var(--red); border: 1.5px solid rgba(255, 77, 94, .5); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; min-width: 0; background: none; border: 0; padding: 9px 4px; color: var(--dim); font-weight: 700; cursor: pointer; min-height: 42px;
  font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button.on { background: rgba(0, 229, 255, .14); color: var(--cyan); }
.input { width: 100%; background: var(--card-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; outline: none; }
.input:focus { border-color: var(--cyan); }
label.field { display: block; margin-top: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--dim); margin-bottom: 4px; }
input[type=range] { width: 100%; accent-color: var(--cyan); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; }
.switch input { width: 46px; height: 26px; accent-color: var(--cyan); }
.empty { text-align: center; color: var(--dim); padding: 28px 10px; white-space: pre-line; }
.badge { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #fff; background: var(--civil); }
.badge.mil { background: var(--red); }
.tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 8px; color: #0a0f1e; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--cyan); border-radius: 50%;
  animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.list > * + * { margin-top: 8px; }
img.cover { width: 100%; display: block; object-fit: cover; background: var(--card-2); }

/* ---------- Scanner ---------- */
.ac { padding: 12px 14px; cursor: pointer; }
.ac .t { font-weight: 700; }
.ac .appr { color: var(--green); font-weight: 700; font-size: 13px; white-space: pre-line; line-height: 1.45; }

/* Rose des vents du Scanner (tourne avec le téléphone quand la boussole est disponible) */
.compass-box { flex: none; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.compass { display: block; margin: 0 auto; }
.compass .dial { transition: transform .25s ease-out; transform-origin: 50px 50px; }
.compass .ring { fill: var(--card); stroke: var(--line); stroke-width: 2; }
.compass .tick { stroke: var(--dim); stroke-width: 1.5; }
.compass .lbl { font: 800 13px "Roboto Condensed", system-ui, sans-serif; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.compass .lbl.n { fill: var(--red); }
.compass .needle-n { fill: var(--red); }
.compass .needle-s { fill: var(--dim); }
.compass .target { fill: var(--cyan); stroke: var(--bg); stroke-width: 1; }
.compass .target-ring { fill: none; stroke: var(--cyan); stroke-width: 2.5; }
.compass .phone { fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linecap: round; }
.compass-cap { font-size: 11px; line-height: 1.3; color: var(--dim); margin-top: 2px; }
.compass-cap b { color: var(--cyan); }
.ac .appr.far { color: var(--civil); }
.ac-thumb { width: 96px; height: 70px; flex: none; object-fit: cover; border-radius: 10px; background: var(--card-2); margin-left: 6px; }

/* Feed global : photo de la semaine */
.week-intro { border-color: rgba(255, 194, 61, .55); background: linear-gradient(180deg, rgba(255, 194, 61, .10), var(--card)); }
.week-winner { margin-top: 10px; overflow: hidden; }
.week-winner img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.week-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; background: var(--card-2); }
.week-entry .rank { font: 800 16px "Roboto Condensed", system-ui, sans-serif; color: var(--amber); min-width: 30px; }
.gauge { flex: none; text-align: center; line-height: 1; }
.gauge svg { display: block; margin: 0 auto; }
.gauge-v { font: 800 14px "Roboto Condensed", system-ui, sans-serif; margin-top: -4px; }
.gauge-l { font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.vote-btn { border: 1.5px solid var(--cyan); background: rgba(0, 229, 255, .10); color: var(--cyan); border-radius: 12px;
  padding: 9px 16px; font-weight: 800; cursor: pointer; }
.vote-btn.on { border-color: var(--green); color: var(--green); background: rgba(92, 255, 200, .10); }
.vote-btn.mine, .vote-btn:disabled { opacity: .65; cursor: default; }

/* Badge de position : téléphone ou par défaut */
.loc-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 3px 10px; font: 700 12px system-ui, sans-serif;
  border: 1.5px solid var(--line); background: none; color: var(--dim); cursor: pointer; }
.loc-badge.phone { border-color: rgba(92, 255, 200, .5); color: var(--green); background: rgba(92, 255, 200, .08); }
.loc-badge.default { border-color: rgba(255, 194, 61, .6); color: var(--amber); background: rgba(255, 194, 61, .1); }

/* ---------- Catalogue (Collection) ---------- */
.cat-search { width: 100%; margin-top: 10px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); font-size: 15px; }
.cat-search:focus { outline: none; border-color: var(--cyan); }
.cat-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cat-chip { border: 1.5px solid var(--line); background: none; color: var(--dim); border-radius: 20px; padding: 6px 12px;
  font-weight: 700; font-size: 13px; cursor: pointer; }
.cat-chip.on { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 229, 255, .12); }
.cat-group { border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); margin-top: 8px; overflow: hidden; }
.cat-group > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 800;
  list-style: none; -webkit-tap-highlight-color: transparent; }
.cat-group > summary::-webkit-details-marker { display: none; }
.cat-group > summary::before { content: "▸"; color: var(--dim); transition: transform .15s; }
.cat-group[open] > summary::before { transform: rotate(90deg); }
.cat-body { padding: 0 8px 8px; }
.cat-row { display: flex; gap: 10px; padding: 8px; cursor: pointer; align-items: center; background: var(--card-2); }
.cat-ph { width: 64px; height: 64px; flex: none; border-radius: 10px; background: var(--bg); display: grid; place-items: center;
  font-size: 26px; position: relative; overflow: hidden; }
.cat-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-info { min-width: 0; flex: 1; }
.cat-info .nm { font-weight: 700; line-height: 1.25; }
.cat-info .sub { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-wiki { color: var(--cyan); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; padding: 4px 0; }

/* ---------- Grilles de photos ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { cursor: pointer; }
.tile .ph { position: relative; height: 140px; background: var(--card-2); }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .strip { height: 4px; }
.tile .nm { padding: 6px 8px 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .rr { padding: 0 8px 8px; font-size: 12px; font-weight: 700; }
.wiki-dot { position: absolute; top: 5px; right: 5px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff;
  background: #1a2440 center/cover no-repeat; display: grid; place-items: center; color: #fff; font: 700 16px Georgia, serif;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.wiki-dot.has-img { color: transparent; }

/* ---------- Hangar ---------- */
.hrow { display: flex; cursor: pointer; }
.hrow .ph { width: 112px; height: 112px; flex: none; position: relative; background: var(--card-2); display: grid; place-items: center; font-size: 38px; }
.hrow .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hrow .band { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font: 800 12px "Roboto Condensed", system-ui, sans-serif;
  padding: 3px 0; background: rgba(16, 24, 40, .85); }
.hrow .band.caught { color: var(--green); } .hrow .band.wiki { color: var(--cyan); }
.hrow .info { padding: 8px 12px; min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hrow .nm { font-weight: 700; }
.hrow .sub { font-size: 13px; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Feed ---------- */
.post .head { display: flex; gap: 10px; align-items: center; padding: 12px; }
.post .photo { width: 100%; max-height: 460px; object-fit: cover; display: block; background: var(--card-2); cursor: pointer; }
.post .tags { display: flex; gap: 8px; align-items: center; padding: 10px 12px 0; }
.post .det { padding: 6px 12px; font-size: 13px; color: var(--dim); }
.post .acts { display: flex; gap: 6px; padding: 4px 8px 10px; }
.post .acts button { background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.post .acts button.liked { color: var(--red); }

/* ---------- Quiz ---------- */
.quiz-photo { width: 100%; height: 230px; object-fit: cover; border-radius: var(--radius); background: var(--card-2); display: block; }
.opt { display: block; width: 100%; text-align: left; margin-top: 8px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 13px 14px; font-weight: 700; cursor: pointer; min-height: 48px; }
.opt.good { border-color: var(--green); color: var(--green); }
.opt.bad { border-color: var(--red); color: var(--red); }

/* ---------- Fenêtres ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(3, 6, 15, .72); display: flex; align-items: flex-end; justify-content: center; z-index: 50;
  animation: fade .15s; }
@media (min-width: 600px) { .modal-back { align-items: center; } }
.modal { background: var(--card); border-radius: 20px 20px 0 0; width: 100%; max-width: 520px; max-height: 88dvh; display: flex; flex-direction: column;
  padding: 18px 18px calc(12px + var(--safe-b)); animation: up .2s; }
@media (min-width: 600px) { .modal { border-radius: 20px; } }
.modal-title { margin: 0 0 8px; font-size: 20px; }
.modal-body { overflow-y: auto; white-space: pre-line; }
.modal-body p { margin: 0 0 8px; }
.modal-body img { max-width: 100%; border-radius: 12px; display: block; margin: 0 auto 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.modal-actions .btn { flex: 1 1 auto; }
.choice-list { display: flex; flex-direction: column; gap: 6px; white-space: normal; }
.choice { text-align: left; background: var(--card-2); border: 0; border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.choice span { display: block; font-weight: 700; }
.choice small { display: block; color: var(--dim); }
.check { display: flex; gap: 10px; align-items: center; padding: 9px 2px; cursor: pointer; white-space: normal; }
.check input { width: 20px; height: 20px; accent-color: var(--cyan); flex: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 18px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0;
  background: #222e4f; color: var(--text); padding: 10px 16px; border-radius: 12px; z-index: 60; transition: all .25s; max-width: 90vw;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Pages secondaires (fiche avion, commentaires, compte) ---------- */
.page-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.back { background: none; border: 0; color: var(--cyan); font-size: 24px; cursor: pointer; padding: 4px 8px 4px 0; min-height: 44px; }
.kv { white-space: pre-line; line-height: 1.6; }
.gate { text-align: center; padding: 40px 18px; }
.gate .big { font-size: 64px; }
.install { background: linear-gradient(135deg, rgba(0, 229, 255, .16), rgba(217, 107, 255, .14)); border: 1.5px solid rgba(0, 229, 255, .4); }
