/* Cinemap — Layout : bandeau-titre en haut, panneau latéral (liste / fiche / formulaire) à gauche, carte plein cadre à droite. Un seul thème, salle obscure. */
:root {
  --bg: #121016;
  --panel: #1b1820;
  --line: #2e2935;
  --ink: #ece6dc;
  --muted: #9a9199;
  --accent: #e9b949;      /* lumière du projecteur */
  --pin: #e0473c;         /* velours rouge */
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-body);
  display: grid; grid-template-rows: auto 1fr;
}
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.brand h1 {
  font: 800 30px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase;
  margin: 0; color: var(--accent);
}
.brand p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn {
  border: 1px solid var(--line); background: transparent; border-radius: 6px;
  padding: 8px 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: #1a1408; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #ff8d84; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

main { display: grid; grid-template-columns: 400px 1fr; min-height: 0; }
aside {
  border-right: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; min-height: 0;
}
.view { display: none; flex-direction: column; min-height: 0; flex: 1; }
.view.on { display: flex; }

.search { padding: 16px 16px 10px; display: grid; gap: 8px; }
.search input {
  width: 100%; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg);
}
.meta { font: 12px/1.4 var(--font-mono); color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.meta button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.status { margin: 0 16px 10px; padding: 10px 12px; border-radius: 6px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.status:empty { display: none; }

ol.list { list-style: none; margin: 0; padding: 0 8px 16px; overflow-y: auto; flex: 1; }
ol.list li button {
  width: 100%; text-align: left; background: none; border: 0; border-radius: 8px;
  padding: 10px; cursor: pointer; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start;
}
ol.list li button:hover, ol.list li button.hot { background: #241f2a; }
.year { font: 500 13px/1.6 var(--font-mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.film { font-weight: 600; display: block; }
.place { color: var(--muted); font-size: 13px; display: block; }

.detail { padding: 18px 20px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.back { justify-self: start; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.back:hover { color: var(--ink); }
.slate {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.slate .bar {
  height: 14px;
  background: repeating-linear-gradient(-45deg, var(--ink) 0 12px, var(--bg) 12px 24px);
}
.slate dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.slate dt, .slate dd { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.slate dt { font: 500 11px/1.9 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-right: 1px solid var(--line); }
.slate dd { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail h2 { font: 800 34px/1.05 var(--font-display); margin: 0; text-wrap: balance; letter-spacing: .01em; }
.detail h2 button { all: unset; cursor: pointer; }
.detail h2 button:hover { color: var(--accent); }
.detail .where { margin: 0; font-size: 17px; }
.detail .scene { margin: 0; color: var(--ink); max-width: 60ch; }
.detail .by { color: var(--muted); font-size: 13px; margin: 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { color: var(--accent); font-size: 14px; }

form { padding: 18px 20px; overflow-y: auto; flex: 1; display: grid; gap: 12px; align-content: start; }
form h2 { font: 800 26px/1 var(--font-display); margin: 0; text-transform: uppercase; letter-spacing: .04em; }
form .hint { margin: 0; color: var(--muted); font-size: 13px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field textarea {
  padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); width: 100%;
}
.field textarea { min-height: 80px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coords input { font-family: var(--font-mono); }
.err { color: #ff8d84; font-size: 13px; margin: 0; min-height: 1em; }
.actions { display: flex; gap: 8px; }

/* Photos : comparateur film / aujourd'hui */
.photos { display: grid; gap: 10px; }
.photos h3 { margin: 0; font: 600 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.compare {
  --x: 50%;
  position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.compare .top { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.compare .handle::after {
  content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #1a1408;
  display: grid; place-items: center; font-size: 15px; font-weight: 600;
}
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag {
  position: absolute; top: 8px; padding: 2px 8px; border-radius: 4px; pointer-events: none;
  font: 500 11px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .06em;
  background: rgba(18, 16, 22, .82); color: var(--ink);
}
.tag.l { left: 8px; } .tag.r { right: 8px; }
.empty-photo {
  aspect-ratio: 16 / 10; border: 1px dashed var(--line); border-radius: 8px;
  display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 16px;
}
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.thumbs button {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden;
  aspect-ratio: 1; background: var(--bg); cursor: pointer;
}
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .k {
  position: absolute; left: 0; right: 0; bottom: 0; font: 500 9px/1.6 var(--font-mono); text-transform: uppercase;
  background: rgba(18, 16, 22, .8); text-align: center;
}
.uploads { display: flex; flex-wrap: wrap; gap: 8px; }
.uploads label.btn { font-size: 13px; padding: 6px 10px; }
.uploads input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.uploads label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.small { font-size: 12px; color: var(--muted); margin: 0; }
.photo-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: #ff8d84; cursor: pointer; font-size: 12px; }
ol.list li button.has-thumb { grid-template-columns: 52px 1fr 56px; }
ol.list .lthumb { width: 56px; height: 40px; border-radius: 4px; object-fit: cover; display: block; background: var(--bg); }
.file-field input[type="file"] { font-size: 13px; color: var(--muted); }

/* Modération participative */
.hdr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
header { flex-wrap: wrap; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--pin); color: #fff; font: 600 12px/20px var(--font-mono); text-align: center; }
.notes { display: grid; gap: 10px; }
.notes h3, .mod h3 { margin: 0; font: 600 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cnote { border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; background: var(--bg); }
.cnote.validee { border-left-color: var(--accent); }
.cnote.retrait.validee { border-left-color: var(--pin); }
.cnote.rejetee, .cnote.annulee { opacity: .7; }
.cnote .head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { font: 500 11px/1.7 var(--font-mono); padding: 0 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.chip.st-validee { color: #1a1408; background: var(--accent); border-color: var(--accent); }
.chip.st-rejetee { color: var(--muted); }
.chip.st-en_attente { color: var(--ink); }
.chip.retrait { color: #ff8d84; border-color: #5a2a2a; }
.cnote .target { font-size: 13px; color: var(--muted); }
.cnote .target button { all: unset; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.cnote p.txt { margin: 0; overflow-wrap: anywhere; }
.meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; display: flex; }
.meter .up { background: var(--accent); }
.meter .down { background: #6b5f6e; }
.vote { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vote .btn { padding: 4px 10px; font-size: 13px; }
.vote .btn.on { border-color: var(--accent); color: var(--accent); }
.context { border: 1px solid var(--accent); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; }
.context b { font: 600 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.context p { margin: 0; }
.nform { display: grid; gap: 8px; padding: 0; overflow: visible; }
.nform select, .nform textarea { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); width: 100%; }
.nform textarea { min-height: 70px; resize: vertical; }
.mod { padding: 18px 20px; display: grid; gap: 16px; }
.mod h2 { font: 800 26px/1 var(--font-display); margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.rules { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.mod .group { display: grid; gap: 8px; }
.removed { display: grid; gap: 6px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; }
.removed .actions { flex-wrap: wrap; }

/* Contact */
.cform { display: grid; gap: 10px; }
.cform select, .cform textarea, .cform input { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); width: 100%; }
.cform textarea { min-height: 120px; resize: vertical; }
.ok { color: var(--accent); font-size: 14px; margin: 0; }
.msg { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; background: var(--bg); }
.msg.unread { border-left: 3px solid var(--accent); }
.msg .head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.msg .head b { color: var(--ink); }
.msg p.txt { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .actions { flex-wrap: wrap; align-items: center; }
.msg a { color: var(--accent); font-size: 13px; }

.mapwrap { position: relative; min-height: 0; background: #0e0c11; overflow: hidden; }
#map { position: absolute; inset: 0; }
.picking-on #map .maplibregl-canvas { cursor: crosshair; }
.maplibregl-popup-content { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font: 13px/1.4 var(--font-body); box-shadow: none; }
.maplibregl-popup-content b { display: block; }
.maplibregl-popup-content span { color: var(--muted); }
.maplibregl-popup-tip { display: none; }
.maplibregl-ctrl-attrib { background: rgba(18, 16, 22, .75) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); box-shadow: none !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(.9); }
.draft-pin { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--accent); background: rgba(233, 185, 73, .25); }
.zoom { position: absolute; right: 16px; top: 16px; display: grid; gap: 6px; }
.zoom button {
  width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-size: 18px; line-height: 1;
}
.tip {
  position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; font-size: 13px; max-width: 260px; display: none;
}
.tip b { display: block; }
.tip span { color: var(--muted); }
.banner {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  background: var(--accent); color: #1a1408; padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 14px;
  display: none; max-width: calc(100% - 120px); text-align: center;
}
.picking-on .banner { display: block; }

@media (max-width: 760px) {
  header { padding: 10px 16px; }
  .brand p { display: none; }
  main { grid-template-columns: 1fr; grid-template-rows: 52vh 1fr; }
  aside { border-right: 0; border-top: 1px solid var(--line); order: 2; }
  .mapwrap { order: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Comptes */
.user-chip { font-size: 13px; color: var(--muted); }
.auth { display: grid; gap: 10px; }
.auth .tabs { display: flex; gap: 6px; }
.auth .tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.auth input { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); width: 100%; }
.auth label { font-size: 13px; color: var(--muted); }
.geo { display: grid; gap: 6px; }
.geo .row2 { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.geo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 180px; overflow-y: auto; }
.geo li button { width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer; font-size: 13px; }
.geo li button:hover { background: #241f2a; }
.signin-cta { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font: inherit; }

/* Publicité et liens affiliés */
.ad { margin: 0 16px 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 4px; min-height: 0; }
.detail .ad { margin: 0; }
.ad-label { font: 500 10px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.affil { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.foot { margin: 0; padding: 8px 16px 12px; font-size: 12px; }
.foot a { color: var(--muted); }
