/* CrustBust — "Kit 01": béton, asphalte, terre ; pochoir de chantier + signalétique. */
:root {
  --asphalt: #161614; --char: #1F1F1D; --line: #3E3D39; --dim: #A8A49A;
  --concrete: #CDC9BF; --concrete-2: #A9A59B; --ink: #161614; --text: #ECE8DF;
  --earth: #8E4419; --earth-dark: #5E2C10; --cream: #FFF6EC; --signal: #EE7B30; --sage: #A7B5A0;
  --stencil: 'Big Shoulders Stencil Display', 'Arial Narrow', sans-serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: Barlow, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--char); color: var(--text); font: 15px/1.4 var(--body); }
#globe { position: absolute; inset: 0; }
.cesium-viewer-bottom { display: none; } /* attributions affichées dans la barre d'état */
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lbl { font: 600 13px var(--cond); letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--dim); }
.grow { flex: 1; }
.signal { color: var(--signal); }
.only-mobile { display: none; }
body.explore .dig-only, body.dig .explore-only { display: none !important; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* Boutons */
.earth { border: 0; background: var(--earth); color: var(--cream); font: 900 22px var(--stencil); letter-spacing: .04em; }
.earth:hover:not(:disabled) { background: #A2501E; }
.light { border: 0; background: var(--concrete); color: var(--ink); font: 700 14px var(--cond); letter-spacing: .08em; }
.ghost { border: 1px solid var(--line); background: transparent; color: var(--text); font: 700 14px var(--cond); letter-spacing: .08em; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line); font: 700 14px var(--cond); letter-spacing: .08em; }
.chip::before { content: ''; width: 8px; height: 8px; background: currentColor; }
.chip.free { color: #8FD18A; } .chip.mine { color: var(--signal); } .chip.locked { color: #FF8F70; }

/* Logo à rayures */
.stripes { display: inline-flex; flex-direction: column; gap: 3px; width: 40px; }
.stripes i { height: 5px; background: var(--ink); transform: skewX(-35deg); }
.stripes i:nth-child(3) { width: 70%; } .stripes i:nth-child(4) { width: 42%; background: var(--earth); }
.stripes.light i { background: #F2EEE5; } .stripes.light i:nth-child(4) { background: var(--signal); }

/* ---------- En-tête ---------- */
#top { position: fixed; left: 0; right: 0; top: 0; height: 72px; padding-left: 20px; display: flex; align-items: center; gap: 18px; background: var(--concrete); color: var(--ink); border-bottom: 3px solid var(--ink); z-index: 20; }
#top::before, #top::after { content: ''; position: absolute; bottom: 10px; width: 12px; height: 12px; background: var(--signal); }
#top::before { left: 0; } #top::after { right: 0; }
.logo { display: flex; align-items: center; gap: 10px; font: 900 32px/1 var(--stencil); letter-spacing: .02em; }
#nav { display: flex; align-self: stretch; }
#nav button { display: flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; background: transparent; color: var(--ink); font: 700 15px var(--cond); letter-spacing: .08em; }
#nav button[aria-current="page"] { background: var(--ink); color: var(--text); box-shadow: inset 0 -4px 0 var(--signal); }
#nav button:hover:not([aria-current="page"]) { background: rgba(22, 22, 20, .08); }
.count { padding: 0 5px; background: var(--earth); color: var(--cream); font-size: 12px; }
/* Recherche : champ qui s'élargit au focus, suggestions pendant la frappe. */
#search { position: relative; flex: 0 1 340px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 14px; background: #F2EEE5; border: 2px solid var(--ink); transition: flex-basis .2s ease, box-shadow .2s ease; }
#search:focus-within { flex-basis: 470px; box-shadow: 4px 4px 0 var(--earth); }
#search .lens { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2.4; flex: 0 0 auto; }
#q { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font: 500 16px var(--body); color: var(--ink); }
#q::placeholder { color: #6E6A61; }
#search:focus-within :focus-visible { outline: none; }
#qclear { width: 30px; height: 30px; flex: 0 0 auto; border: 0; background: transparent; color: var(--ink); font-size: 14px; }
#qclear:hover { background: var(--concrete); }
#search .spin { display: none; width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid var(--concrete-2); border-top-color: var(--earth); border-radius: 50%; animation: spin .7s linear infinite; }
#search.busy .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
kbd { font: 700 12px var(--cond); padding: 0 5px; border: 1px solid var(--ink); }
#search:focus-within kbd { display: none; }
#results { position: absolute; left: -2px; right: -2px; top: calc(100% + 6px); min-width: 420px; margin: 0; padding: 0; list-style: none; background: #F2EEE5; border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(22, 22, 20, .35); max-height: 62vh; overflow: auto; z-index: 40; }
#results li[role="option"] { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #DCD8CE; color: var(--ink); }
#results li[role="option"]:last-child { border-bottom: 0; }
#results li svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--earth); stroke-width: 1.8; }
#results .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#results .txt b { font: 700 18px/1.15 var(--cond); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results .txt small { font-size: 13px; color: #5E5A52; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results mark { background: none; color: var(--earth); box-shadow: inset 0 -2px 0 var(--earth); }
#results .kind { flex: 0 0 auto; font: 700 11px var(--cond); letter-spacing: .1em; padding: 2px 6px; border: 1px solid currentColor; white-space: nowrap; }
#results li[aria-selected="true"] { background: var(--ink); color: var(--text); }
#results li[aria-selected="true"] small { color: var(--dim); }
#results li[aria-selected="true"] svg { stroke: var(--signal); }
#results li[aria-selected="true"] mark { color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); }
#results .rhead, #results .rnote { padding: 10px 14px 6px; font: 700 12px var(--cond); letter-spacing: .14em; color: #5E5A52; }
#results .rnote { padding: 12px 14px; letter-spacing: .04em; font-size: 14px; }
.res { margin-left: auto; display: flex; align-self: stretch; }
.res > * { display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-left: 2px solid var(--ink); }
#energy .lbl { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
#esegs { display: flex; gap: 3px; margin-top: 4px; }
#esegs i { width: 8px; height: 12px; transform: skewX(-20deg); background: var(--concrete-2); }
#esegs i.on { background: var(--earth); }
.credits b { font: 900 28px/1 var(--stencil); }
.pass-btn { flex-direction: row !important; align-items: center !important; gap: 10px; border: 0; border-left: 0 !important; background: var(--earth); color: var(--cream); font: 700 15px var(--cond); letter-spacing: .08em; }
.pass-btn svg { width: 18px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pass-btn.issued { background: var(--ink); color: var(--signal); }

/* ---------- Fil d'Ariane + réservation ---------- */
#crumb { position: fixed; left: 0; right: 0; top: 75px; height: 48px; padding: 0 20px; display: flex; align-items: center; gap: 14px; background: var(--asphalt); border-bottom: 1px solid var(--line); z-index: 15; }
#crumb button { height: 34px; padding: 0 12px; }
#back { border: 1px solid var(--line); background: transparent; color: var(--text); font: 700 14px var(--cond); letter-spacing: .06em; }
#crumbpath { font: 600 14px var(--cond); letter-spacing: .08em; }
#crumbplot { font: 900 24px var(--stencil); letter-spacing: .02em; }
#reservePanel { position: fixed; right: 120px; top: 128px; width: 340px; padding: 16px; background: var(--concrete); color: var(--ink); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 12px; z-index: 25; }
#reservePanel h3 { margin: 0; font: 900 24px var(--stencil); }
#rstate { font-size: 14px; }
#durations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#durations button { min-height: 58px; border: 2px solid var(--ink); background: transparent; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#durations button b { font: 900 24px var(--stencil); }
#durations button span { font: 600 13px var(--cond); }
#durations button[aria-checked="true"] { background: var(--ink); color: var(--text); }
.big { height: 48px; font-size: 20px; }
.note { margin: 0; font: 600 12px var(--cond); letter-spacing: .1em; color: #4A4740; }

/* ---------- Outils de carte ---------- */
/* Commandes de carte en bas à droite de la carte (à gauche du panneau droit), légende en haut à gauche. */
#maptools { position: fixed; right: 20px; bottom: 56px; display: flex; flex-direction: column; z-index: 10; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
#maptools button { width: 48px; height: 48px; border: 0; border-bottom: 1px solid var(--line); background: var(--asphalt); color: var(--text); font: 400 22px var(--body); display: flex; align-items: center; justify-content: center; }
#maptools button:last-child { border-bottom: 0; }
#maptools button:hover { background: #2A2A27; }
#maptools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
#legend { position: fixed; left: 20px; top: 92px; z-index: 10; }
.legend { width: 220px; padding: 12px; background: var(--asphalt); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend > div { display: flex; align-items: center; gap: 10px; }
.legend .lbl { color: var(--dim); }
.sw { width: 14px; height: 14px; flex: 0 0 auto; }
.sw.site { background: var(--earth); }
.sw.rsv { border: 2px solid var(--earth); background: repeating-linear-gradient(45deg, var(--earth) 0 3px, transparent 3px 6px); }
.sw.sel { border: 3px solid var(--signal); }
.sw.bld { background: var(--concrete); }

/* ---------- Panneau droit ---------- */
#side { position: fixed; right: 20px; top: 92px; bottom: 216px; width: 360px; display: flex; flex-direction: column; gap: 12px; overflow: auto; z-index: 10; }
body.dig #side { display: none; }
body.dig.drawer-open #side { display: flex; top: 140px; bottom: 236px; z-index: 18; }
body.drawer-open #inspector { display: none; }
#drawer { background: var(--concrete); color: var(--ink); display: flex; flex-direction: column; min-height: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 2px solid var(--ink); }
.drawer-head h2 { margin: 0; font: 900 28px var(--stencil); }
.drawer-head button { width: 40px; height: 40px; border: 2px solid var(--ink); background: transparent; color: var(--ink); }
#drawerBody { overflow: auto; }
.sect { padding: 10px 16px 4px; font: 700 13px var(--cond); letter-spacing: .12em; color: #4A4740; }
.row-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 16px; border-bottom: 1px solid var(--concrete-2); width: 100%; border-left: 0; border-right: 0; border-top: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; }
button.row-item:hover { background: rgba(22, 22, 20, .07); }
.row-item .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-item .t b { font-size: 15px; }
.row-item .t small { font-size: 13px; color: #4A4740; }
.row-item .v { font: 700 15px var(--cond); color: #6E3412; white-space: nowrap; }
.row-item .sq { width: 10px; height: 10px; background: var(--earth); flex: 0 0 auto; }
.row-item .act { height: 40px; padding: 0 12px; border: 0; background: var(--earth); color: var(--cream); font: 700 14px var(--cond); letter-spacing: .06em; white-space: nowrap; }
.row-item .act.own { background: var(--ink); color: var(--signal); }
.row-item .act:disabled { background: var(--concrete-2); color: #4A4740; opacity: 1; }
.empty { padding: 16px; font-size: 14px; color: #4A4740; }

/* Inspecteur = badge orange */
.badge-holder { position: relative; padding: 10px; background: var(--asphalt); border-radius: 14px; }
.screw { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #8C887E; }
.screw::before, .screw::after { content: ''; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; background: #2A2A27; }
.screw::after { transform: rotate(90deg); }
.screw.tl { left: 8px; top: 8px; } .screw.br { right: 8px; bottom: 8px; }
.plot-card { position: relative; padding: 18px; background: var(--signal); color: var(--ink); border-radius: 6px; clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 44px, 100% 100%, 0 100%); display: flex; flex-direction: column; gap: 12px; }
.plot-card::after { content: ''; position: absolute; right: 0; top: 0; width: 44px; height: 44px; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(22, 22, 20, .9) 6px 7px); -webkit-mask: linear-gradient(225deg, transparent 50%, #000 50%, #000 62%, transparent 62%); mask: linear-gradient(225deg, transparent 50%, #000 50%, #000 62%, transparent 62%); }
.plot-card .tag { display: flex; align-items: center; gap: 8px; font: 700 13px var(--cond); letter-spacing: .1em; }
.plot-card .tag b { padding: 2px 6px; background: var(--ink); color: var(--signal); }
.plot-card h2 { margin: 0; font: 900 38px/1 var(--stencil); letter-spacing: .02em; }
.plot-card .coords { font: 600 14px var(--cond); letter-spacing: .06em; }
.strata { display: flex; height: 16px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.facts > div { padding: 8px 0 8px 10px; display: flex; flex-direction: column; }
.facts > div:first-child { padding-left: 0; }
.facts > div + div { border-left: 2px solid var(--ink); }
.facts b { font: 900 26px/1 var(--stencil); }
.plot-card .earth { height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 26px; }
.plot-card .earth svg, #digBtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.plot-card .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.plot-card .pair button { height: 44px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 700 14px var(--cond); letter-spacing: .06em; }
.nearby { background: var(--concrete); color: var(--ink); }
.nearby-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 2px solid var(--ink); }
.nearby-head b { font: 900 22px var(--stencil); }
.live { display: flex; align-items: center; gap: 6px; font: 700 13px var(--cond); letter-spacing: .1em; }
.live::before { content: ''; width: 8px; height: 8px; background: var(--signal); }
.hint-card { padding: 18px; background: var(--asphalt); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.hint-card b { font: 900 30px/1 var(--stencil); }

/* ---------- État du chantier ---------- */
#sitestatus { position: fixed; left: 20px; top: 140px; width: 300px; display: flex; flex-direction: column; gap: 10px; z-index: 10; }
#sitestatus .depth { padding: 16px; background: var(--earth); color: var(--cream); clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%); }
#depthBig { font: 900 140px/0.9 var(--stencil); }
#sitestatus .row { display: flex; justify-content: space-between; margin-top: 10px; }
.bar { margin-top: 5px; height: 8px; background: var(--earth-dark); }
.bar i { display: block; height: 100%; background: var(--cream); width: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--concrete); color: var(--ink); }
.stats > div { padding: 10px 12px; display: flex; flex-direction: column; }
.stats > div + div { border-left: 2px solid var(--ink); }
.stats .lbl { font-size: 12px; }
.stats b { font: 900 28px/1 var(--stencil); }
.who { padding: 12px 14px; background: var(--asphalt); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.who .lbl { color: var(--dim); }
.who div div { display: flex; justify-content: space-between; }
.who span.n { font: 700 15px var(--cond); color: #D9A27A; }

/* ---------- Carotte ---------- */
#core { position: fixed; right: 20px; top: 140px; bottom: 236px; width: 260px; background: var(--asphalt); border: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; }
.core-head { height: 44px; flex: 0 0 auto; padding: 0 14px; background: var(--concrete); color: var(--ink); display: flex; align-items: center; justify-content: space-between; }
.core-head > span:first-child { font: 900 24px var(--stencil); letter-spacing: .04em; }
#coreCol { position: relative; flex: 1; margin: 16px 14px; min-height: 120px; }
.core-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.core-foot > div { padding: 10px 14px; display: flex; flex-direction: column; }
.core-foot > div + div { border-left: 1px solid var(--line); }
.core-foot .lbl { color: var(--dim); font-size: 12px; }
.core-foot b { font: 800 20px var(--stencil); white-space: nowrap; }
.ruler { position: absolute; left: 0; top: 0; bottom: 0; width: 18px; border-right: 2px solid #8C887E; background: repeating-linear-gradient(to bottom, #8C887E 0 1px, transparent 1px 8px) right top / 8px 100% no-repeat; }
.tick { position: absolute; left: 0; width: 18px; border-top: 2px solid var(--text); }
.band { position: absolute; left: 26px; width: 46px; background-image: repeating-linear-gradient(160deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 7px); box-shadow: inset -8px 0 0 rgba(0, 0, 0, .18), inset 6px 0 0 rgba(255, 255, 255, .12); }
.blabel { position: absolute; left: 84px; right: 0; display: flex; justify-content: space-between; align-items: baseline; line-height: 16px; }
.blabel b { font: 700 13px var(--cond); letter-spacing: .06em; }
.blabel span { font: 500 12px var(--cond); color: var(--dim); }
.unexplored { position: absolute; left: 26px; width: 46px; bottom: 0; background: repeating-linear-gradient(45deg, rgba(22, 22, 20, .72) 0 4px, rgba(22, 22, 20, .4) 4px 8px); }
.you-line { position: absolute; left: -6px; right: 0; border-top: 3px solid var(--signal); }
.you-tag { position: absolute; left: 0; padding: 2px 7px; background: var(--signal); color: var(--ink); font: 700 13px var(--cond); letter-spacing: .08em; }

/* ---------- Résultats ---------- */
#toasts { position: fixed; left: 50%; top: 92px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; max-width: min(560px, 92vw); }
body.dig #toasts { top: 140px; }
#toasts div { padding: 8px 14px; background: var(--asphalt); border: 1px solid var(--line); font: 600 15px var(--cond); letter-spacing: .04em; animation: fade 5s forwards; }
#toasts .find { background: var(--signal); color: var(--ink); border-color: var(--signal); }
#toasts .err { border-color: #FF8F70; color: #FFD2C6; }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Poste de creusage ---------- */
#station { position: fixed; left: 0; right: 0; bottom: 40px; height: 176px; padding: 0 20px 14px; background: var(--asphalt); border-top: 3px solid var(--concrete); display: flex; flex-direction: column; gap: 10px; z-index: 12; }
#toolstrip { height: 40px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); font: 600 14px var(--cond); letter-spacing: .06em; white-space: nowrap; overflow: hidden; }
#toolstrip .name { font: 900 24px var(--stencil); color: var(--signal); }
#toolstrip .pill { padding: 2px 8px; background: #2A2A27; }
#toolstrip .keys { margin-left: auto; color: var(--dim); }
#toolstrip .keys b { color: var(--text); }
.station-row { flex: 1; display: flex; gap: 14px; min-height: 0; }
#tools { display: flex; gap: 6px; }
.tool { width: 92px; padding: 7px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border: 0; background: var(--concrete); color: var(--ink); font: 700 13px var(--cond); letter-spacing: .04em; }
.tool .top { display: flex; justify-content: space-between; width: 100%; font-size: 12px; }
.tool svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tool[aria-pressed="true"] { background: var(--signal); }
.tool.locked { background: transparent; border: 1.5px dashed #5A5852; color: #8C887E; }
#digBtn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 40px; clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); user-select: none; touch-action: none; }
#digBtn svg { width: 26px; height: 26px; }
#digBtn.active { background: #B35A22; }
#cam { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; }
#cam button { border: 1px solid var(--line); background: transparent; color: var(--text); font: 700 13px var(--cond); }
#cam .wide { grid-column: span 2; border: 0; color: var(--ink); }
#crosshair { position: fixed; left: 50%; top: calc(50% - 40px); width: 34px; height: 34px; margin: -17px 0 0 -17px; pointer-events: none; z-index: 5; display: none; }
body.dig #crosshair { display: block; }
#crosshair::before, #crosshair::after { content: ''; position: absolute; background: var(--signal); }
#crosshair::before { left: 16px; top: 0; width: 2px; height: 34px; } #crosshair::after { top: 16px; left: 0; height: 2px; width: 34px; }

/* ---------- Barre d'état ---------- */
#status { position: fixed; left: 0; right: 0; bottom: 0; height: 40px; padding: 0 20px; display: flex; align-items: center; gap: 22px; background: var(--asphalt); border-top: 1px solid var(--line); font: 600 13px var(--cond); letter-spacing: .06em; color: var(--dim); z-index: 12; white-space: nowrap; overflow: hidden; }
#hint { color: var(--text); }
#hint kbd { border-color: var(--concrete); background: var(--concrete); color: var(--ink); }
.attr a { color: var(--dim); }

/* ---------- Pass de chantier ---------- */
#pass { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--sage); color: var(--ink); overflow: auto; }
#pass::backdrop { background: rgba(0, 0, 0, .4); }
.pass-page { position: relative; max-width: 1240px; margin: 0 auto; padding: 48px 32px 40px; }
.pass-page::before, .pass-page::after { content: ''; position: fixed; width: 30px; height: 30px; border: 0 solid #2A2A27; }
.pass-page::before { left: 40px; top: 40px; border-right-width: 2px; border-bottom-width: 2px; }
.pass-page::after { right: 40px; bottom: 40px; border-left-width: 2px; border-top-width: 2px; }
.pass-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.pass-top .lbl { letter-spacing: .16em; }
.pass-top h1 { margin: 4px 0; font: 900 92px/0.9 var(--stencil); }
.pass-top p { margin: 0; max-width: 560px; font-size: 18px; }
.pass-tabs { display: flex; gap: 10px; }
#passTabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--ink); width: 420px; }
#passTabs button { height: 54px; border: 0; background: transparent; color: var(--ink); font: 700 18px var(--cond); letter-spacing: .1em; }
#pass .square { width: 58px; height: 58px; font-size: 22px; }
#passTabs button[aria-selected="true"] { background: var(--ink); color: var(--signal); }
.square { width: 48px; height: 48px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font-size: 18px; }
.pass-close { position: fixed; top: 22px; right: 22px; z-index: 3; background: #F2EEE5; }
.pass-close:hover { background: var(--ink); color: var(--signal); }
.alt-login { margin-top: 22px; padding-top: 20px; border-top: 2px solid var(--ink); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.alt-login .or { font: 900 28px var(--stencil); }
.alt-login small { font-size: 15px; color: #2F3A2C; }
#googleBtn { min-height: 44px; }
.clip { position: relative; height: 70px; }
.clip::before { content: ''; position: absolute; left: 50%; top: -48px; width: 70px; height: 110px; margin-left: -35px; background: var(--signal); }
.clip i { position: absolute; left: 50%; bottom: -20px; width: 136px; height: 42px; margin-left: -68px; border-radius: 8px; background: #2A2A27; }
.clip i::after { content: ''; position: absolute; left: 38px; top: 15px; width: 60px; height: 12px; border-radius: 6px; background: var(--sage); }
.card { border-radius: 24px; overflow: hidden; background: #F2EEE5; box-shadow: 0 30px 60px rgba(30, 40, 28, .35); }
.card-band { min-height: 100px; padding: 14px 34px 14px 64px; display: flex; align-items: center; gap: 18px; background: var(--ink); color: #F2EEE5; flex-wrap: wrap; }
.card-band .stripes { width: 52px; gap: 4px; }
.card-band .stripes i { height: 7px; }
.brand { display: flex; flex-direction: column; }
.brand b { font: 900 44px/1 var(--stencil); }
.brand span, .kind span { font: 600 15px var(--cond); letter-spacing: .14em; color: #B8B4AA; }
.kind { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; }
.kind b { font: 900 56px/1 var(--stencil); color: var(--signal); letter-spacing: .04em; }
.card-body { display: flex; min-height: 460px; }
.hazard { width: 36px; flex: 0 0 auto; background: repeating-linear-gradient(-45deg, var(--signal) 0 18px, var(--ink) 18px 36px); }
.photo-col { width: 250px; flex: 0 0 auto; padding: 28px 0 20px 30px; display: flex; flex-direction: column; gap: 14px; }
.photo { width: 214px; height: 250px; background: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.photo svg { width: 104px; height: 104px; fill: none; stroke: var(--signal); stroke-width: 1.5; }
.photo span { font: 600 15px var(--cond); letter-spacing: .14em; color: #B8B4AA; }
#patches { display: grid; grid-template-columns: repeat(4, 48px); gap: 7px; }
#patches button { width: 48px; height: 48px; padding: 0; border: 2px solid var(--ink); background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: center; }
#patches button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
#patches button[aria-checked="true"] { background: var(--ink); color: var(--signal); }
.fields { flex: 1; min-width: 0; padding: 28px 32px 22px; display: flex; flex-direction: column; gap: 22px; }
.fields label, #tradeBox { display: flex; flex-direction: column; font: 700 16px var(--cond); letter-spacing: .14em; color: #4A4740; }
.fields input { width: 100%; padding: 0; border: 0; border-bottom: 2px dashed var(--ink); background: transparent; outline: none; color: var(--ink); }
.fields input:focus { border-bottom-style: solid; border-bottom-color: var(--earth); }
.fields input::placeholder { color: rgba(22, 22, 20, .38); }
#passName { height: 80px; font: 900 68px var(--stencil); letter-spacing: .02em; text-transform: uppercase; }
#passCode { height: 60px; font: 700 32px var(--body); letter-spacing: .3em; }
.fields small { font: 500 15px var(--body); letter-spacing: 0; margin-top: 4px; color: #4A4740; }
#trade { font: 700 36px var(--cond); letter-spacing: .02em; color: var(--ink); }
.level-col { width: 250px; flex: 0 0 auto; display: flex; flex-direction: column; }
.level { flex: 1; background: var(--earth); color: var(--cream); padding: 22px; display: flex; flex-direction: column; }
.level .lbl { font-size: 15px; }
.level b { font: 900 150px/0.9 var(--stencil); }
.level span:not(.lbl) { font: 700 20px var(--cond); letter-spacing: .06em; }
.level small { margin-top: auto; font: 500 16px var(--cond); letter-spacing: .06em; line-height: 1.35; }
.barcode { padding: 14px 20px; display: flex; flex-direction: column; gap: 5px; }
#barcode { display: flex; height: 46px; gap: 2px; align-items: stretch; }
#barcode i { background: var(--ink); }
.barcode b { font: 700 17px var(--cond); letter-spacing: .14em; }
.barcode small { font: 700 14px var(--cond); letter-spacing: .1em; color: #6E3412; }
.card-foot { min-height: 54px; padding: 8px 34px 8px 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--signal); font: 700 17px var(--cond); letter-spacing: .14em; }
.pass-actions { margin-top: 28px; display: flex; gap: 18px; align-items: stretch; }
#passSteps { flex: 1; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#passSteps li { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-top: 4px solid var(--ink); }
#passSteps .m { width: 38px; height: 38px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); font: 700 18px var(--cond); }
#passSteps .m.ok { background: var(--ink); color: var(--signal); }
#passSteps b { display: block; font: 700 20px var(--cond); letter-spacing: .04em; }
#passSteps small { font-size: 15px; color: #2F3A2C; }
#passSubmit { width: 320px; min-height: 76px; font-size: 36px; }
.pass-note { font-size: 16px; }
#pass .err { font-size: 17px; }
#passSubmit:disabled { background: #7A8A73; color: #DDE4D8; opacity: 1; }
.err { color: #7A1E0A; font-weight: 700; min-height: 1.2em; margin: 12px 0 0; }
.pass-note { font-size: 14px; color: #2F3A2C; }
body.issued .photo-col #patches { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  #top { height: auto; min-height: 60px; flex-wrap: wrap; padding: 8px 12px; gap: 10px; }
  .logo { font-size: 26px; }
  #menu { width: 44px; height: 44px; border: 2px solid var(--ink); background: transparent; color: var(--ink); align-items: center; justify-content: center; font-size: 20px; }
  #nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--concrete); border-bottom: 3px solid var(--ink); }
  #nav.open { display: flex; }
  #nav button { height: 48px; }
  .res { order: 3; width: 100%; margin-left: 0; border-top: 2px solid var(--ink); }
  .res > * { padding: 6px 10px; }
  .res > *:first-child { border-left: 0; flex: 1; }
  #esegs i { flex: 1; width: auto; }
  #search, #search:focus-within { order: 4; flex: 1 1 100%; }
  #results { min-width: 0; }
  .credits b { font-size: 22px; }
  #crumb { top: auto; position: fixed; bottom: 270px; height: 44px; padding: 0 10px; gap: 8px; }
  #crumbpath, #copylink { display: none; }
  #crumbplot { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #reservePanel { left: 10px; right: 10px; width: auto; top: auto; bottom: 320px; }
  #legend { display: none !important; }
  #maptools { right: 10px; bottom: auto; top: 150px; }
  #side { left: 10px; right: 10px; width: auto; top: auto; bottom: 50px; max-height: 55vh; }
  body.dig.drawer-open #side { top: auto; bottom: 50px; max-height: 60vh; }
  #core { display: none !important; }
  #sitestatus { top: 150px; left: 10px; width: 180px; }
  #sitestatus .stats, #sitestatus .who { display: none; }
  #depthBig { font-size: 72px; }
  #station { height: 220px; padding: 0 10px 10px; }
  #toolstrip .keys { display: none; }
  .station-row { flex-wrap: wrap; }
  #tools { width: 100%; overflow-x: auto; }
  .tool { flex: 0 0 76px; width: 76px; height: 70px; }
  #digBtn { font-size: 30px; min-height: 64px; }
  #cam { grid-template-columns: repeat(2, 48px); }
  #cam #orbit, #cam #free, #cam .wide { display: none; }
  #status .attr, #alt { display: none; }
  body.dig #toasts { top: 160px; }
  .pass-top h1 { font-size: 48px; }
  #passTabs { width: 100%; }
  .pass-tabs { width: 100%; }
  #passName { font-size: 44px; height: 60px; }
  .level b { font-size: 80px !important; }
  .photo-col { width: 100%; }
  .card-body { flex-wrap: wrap; }
  .hazard { width: 100%; height: 16px; background: repeating-linear-gradient(-45deg, var(--signal) 0 10px, var(--ink) 10px 20px); }
  .photo-col { width: 100%; flex-direction: row; align-items: flex-end; padding: 16px; }
  .photo { width: 110px; height: 120px; }
  .level-col { width: 100%; flex-direction: row; }
  .level b { font-size: 64px; }
  .pass-actions { flex-direction: column; }
  #passSteps { grid-template-columns: 1fr; }
  #passSubmit { width: 100%; min-height: 60px; }
  .card-band { padding-left: 20px; }
}

/* ---------- Missions, équipe, marché, collection ---------- */
.signal-count { background: var(--signal); color: var(--ink); }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg button { min-height: 40px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 700 13px var(--cond); letter-spacing: .06em; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--signal); }
.prog { height: 8px; background: var(--concrete-2); margin-top: 6px; }
.prog i { display: block; height: 100%; background: var(--earth); }
.mission { padding: 12px 16px; border-bottom: 1px solid var(--concrete-2); display: flex; flex-direction: column; gap: 4px; }
.mission .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mission b { font: 900 22px/1 var(--stencil); }
.mission .act { height: 40px; padding: 0 14px; border: 0; background: var(--earth); color: var(--cream); font: 700 14px var(--cond); letter-spacing: .06em; }
.mission .act.ok { background: var(--ink); color: var(--signal); }
.mission .act:disabled { background: var(--concrete-2); color: #4A4740; opacity: 1; }
.periods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px 16px 4px; border: 2px solid var(--ink); }
.periods button { height: 40px; border: 0; background: transparent; color: var(--ink); font: 700 13px var(--cond); letter-spacing: .06em; }
.periods button[aria-pressed="true"] { background: var(--ink); color: var(--signal); }
.periods .count { margin-left: 4px; }
.trophies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px 16px 16px; }
.trophy { padding: 10px; border: 2px solid var(--concrete-2); background: #E3E0D8; display: flex; flex-direction: column; gap: 3px; font-size: 12px; opacity: .7; }
.trophy b { font: 700 16px/1.1 var(--cond); letter-spacing: .02em; }
.trophy .tier { font: 700 11px var(--cond); letter-spacing: .12em; }
.trophy.on { opacity: 1; border-color: var(--ink); background: #F2EEE5; }
.trophy.on .tier { color: var(--earth); }
.trophy.bronze.on { box-shadow: inset 6px 0 0 #A0602F; }
.trophy.silver.on { box-shadow: inset 6px 0 0 #9C9A93; }
.trophy.gold.on { box-shadow: inset 6px 0 0 #E0A21C; }
.trophy.legend.on { box-shadow: inset 6px 0 0 var(--signal); background: var(--ink); color: var(--text); }
.form { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--concrete-2); }
.form input { height: 44px; padding: 0 10px; border: 2px solid var(--ink); background: #F2EEE5; font: 600 16px var(--body); color: var(--ink); }
.form .act, .row-item .act.ghost-act { height: 44px; border: 0; background: var(--earth); color: var(--cream); font: 700 14px var(--cond); letter-spacing: .06em; }
.crew-card { margin: 12px 16px; padding: 14px; background: var(--ink); color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.crew-card b { font: 900 34px/1 var(--stencil); }
.crew-card .code { font: 700 18px var(--cond); letter-spacing: .3em; color: var(--signal); }
.price-in { width: 92px; height: 40px; padding: 0 8px; border: 2px solid var(--ink); background: #F2EEE5; font: 600 14px var(--body); }
.museum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px 16px 16px; }
.museum div { min-height: 78px; padding: 8px; background: #E3E0D8; border: 1px solid var(--concrete-2); display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; }
.museum b { font: 700 14px/1.1 var(--cond); }
.museum .r { color: #6E3412; font-weight: 700; }
@media (max-width: 1520px) {
  #nav button { padding: 0 10px; font-size: 14px; }
  #search { flex-basis: 200px; min-width: 150px; }
  .res > * { padding: 0 12px; }
  #accountText { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .logo { font-size: 26px; }
}
@media (max-width: 1240px) and (min-width: 901px) { #efull { display: none; } #search { flex-basis: 140px; } }
/* Écrans moyens : la navigation passe dans le menu ☰ pour laisser la place à la recherche. */
@media (max-width: 1320px) and (min-width: 901px) {
  .only-mobile { display: inline-flex; }
  #menu { width: 44px; height: 44px; border: 2px solid var(--ink); background: transparent; color: var(--ink); align-items: center; justify-content: center; font-size: 20px; }
  #nav { display: none; position: absolute; left: 0; top: 100%; width: 240px; flex-direction: column; background: var(--concrete); border: 3px solid var(--ink); border-top: 0; }
  #nav.open { display: flex; }
  #nav button { height: 48px; justify-content: space-between; }
  #search { flex: 1 1 260px; }
  #search:focus-within { flex-basis: 360px; }
}
