/* GéoDam — charte inspirée du site de la CIGB/ICOLD : marine #111a4c, bleu #5e70d0, orange #ee813c, vert #76b861, gris clairs. Thème clair. */
:root {
  color-scheme: light;
  --navy: #111a4c; --brand: #5365bd; --brand-dark: #4a5bb8; --accent: #ee813c; --accent-dark: #b4540f; --green: #76b861; --green-ink: #3f7d2c;
  --bg: #f3f3f3; --panel: #fff; --ink: #1e2430; --muted: #566070; --line: #e3e6ee; --r: 16px; --shadow: 0 6px 24px rgba(17, 26, 76, .09);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; touch-action: manipulation; }
body { padding-bottom: env(safe-area-inset-bottom); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--navy); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }
.demo-banner { background: var(--brand); color: #fff; text-align: center; font-weight: 700; font-size: .9rem; padding: 6px 12px; }

/* ---------- en-tête ---------- */
.top { background: linear-gradient(135deg, var(--navy), #1b2a73); color: #fff; border-bottom: 4px solid var(--brand); padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 14px; max-width: min(1680px, 100%); margin: 0 auto; padding: 8px 16px; min-height: 58px; }
.logo { font-size: 1.55rem; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: -.02em; }
.logo b { color: var(--accent); }
#nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
#nav a { color: #dfe3f8; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; white-space: nowrap; }
#nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
#nav a.on { background: #fff; color: var(--navy); }
.tools { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; gap: 4px; }
.top button.ghost { color: #fff; border-color: rgba(255,255,255,.5); padding: 4px 11px; min-height: 34px; font-size: .85rem; border-radius: 999px; }
.top button.ghost[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--navy); }
main { max-width: min(1680px, 100%); margin: 0 auto; padding: 16px 16px 28px; outline: none; }
footer { max-width: min(1680px, 100%); margin: 0 auto; padding: 8px 16px 28px; color: var(--muted); font-size: .82rem; }
footer a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: 1.9rem; letter-spacing: -.02em; } h2.sec { font-size: 1.35rem; margin-top: 28px; }
.lead { color: var(--muted); max-width: 62ch; margin-top: 0; }
.small { font-size: .85rem; } .muted { color: var(--muted); } .err { color: var(--accent-dark); font-weight: 700; }
a.btnlink { display: inline-block; padding: 10px 16px; border-radius: 999px; border: 2px solid var(--brand); color: var(--brand-dark); font-weight: 700; text-decoration: none; }
a.btnlink:hover { background: var(--brand); color: #fff; }

/* ---------- boutons ---------- */
button { font: inherit; cursor: pointer; border-radius: 999px; padding: 11px 20px; min-height: 44px; border: 2px solid var(--brand); background: var(--brand); color: #fff; font-weight: 700; transition: transform .12s, box-shadow .12s, background .12s; }
button:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(94,112,208,.35); }
button:active:not(:disabled) { transform: translateY(0) scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--brand-dark); }
button.ghost:hover:not(:disabled) { background: rgba(94,112,208,.1); box-shadow: none; }
button.accent { background: var(--green); border-color: var(--green); color: #12301a; }
button.accent:hover:not(:disabled) { background: #89c675; box-shadow: 0 4px 12px rgba(118,184,97,.45); }
button.tab { background: #fff; color: var(--muted); border-color: var(--line); padding: 9px 16px; }
button.tab[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
button.tab.good { background: #e6f4e1; border-color: var(--green); color: var(--green-ink); } button.tab.bad { background: #fde8dc; border-color: var(--accent); color: var(--accent-dark); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; } .row.center { justify-content: center; }

/* ---------- hero ---------- */
.hero { margin: 0 -16px; background: radial-gradient(1200px 400px at 85% -10%, #3a4cc0 0%, transparent 60%), linear-gradient(135deg, #111a4c 0%, #26358f 100%); color: #fff; border-radius: 0 0 28px 28px; overflow: hidden; }
.hero-in { max-width: min(1680px, 100%); margin: 0 auto; padding: 28px 16px 8px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 .3em; }
.kicker { color: #aebcff; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; margin: 0 0 6px; }
.hero-sub { color: #dfe3f8; font-size: 1.1rem; max-width: 46ch; }
.cta-main { background: var(--accent); border-color: var(--accent); color: var(--navy); font-size: 1.05rem; padding: 13px 26px; box-shadow: 0 6px 18px rgba(238,129,60,.45); }
.cta-main:hover:not(:disabled) { background: #f6a068; }
.cta-sec { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.cta-sec:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.chips { list-style: none; display: flex; gap: 6px 22px; flex-wrap: wrap; padding: 0; margin: 14px 0 12px; color: #dfe3f8; }
.chips li { background: none; border: 0; border-radius: 0; padding: 0; font-size: .85rem; }
.chips b { color: inherit; font-size: inherit; font-weight: 600; }
.hero-art { width: 100%; height: auto; max-height: 300px; align-self: end; }

/* ---------- panneaux, accueil ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 18px; align-items: start; }
.scope { border-left: 5px solid var(--brand); } .scope label { display: block; }
.profile .lvl { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; } .lvl-n { background: var(--navy); color: #fff; border-radius: 999px; padding: 2px 12px; font-size: .8rem; font-weight: 800; }
.xpbar { height: 12px; background: #e9ecf8; border-radius: 99px; overflow: hidden; margin: 8px 0 4px; } .xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--green)); border-radius: 99px; transition: width 1s; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #eef0f8; font-size: 1.25rem; filter: grayscale(1); opacity: .45; }
.badge.on { background: linear-gradient(135deg, #eef1fc, #d9e0ff); filter: none; opacity: 1; box-shadow: 0 2px 8px rgba(94,112,208,.35); } .badge i { font-style: normal; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 12px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; position: relative; overflow: hidden; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(17,26,76,.16); }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--c, var(--brand)); }
.c-map { --c: var(--brand); } .c-hilo { --c: #2f3f9c; } .c-daily { --c: var(--green); } .c-mission { --c: var(--accent); }
.card .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: color-mix(in srgb, var(--c) 15%, white); }
.card h3 { margin: 4px 0 0; } .card p { margin: 0; color: var(--muted); flex: 1; }
.card button { background: var(--c); border-color: var(--c); }
.card.c-daily button, .card.c-mission button { color: var(--navy); }
table.lb { width: 100%; border-collapse: collapse; } .table-wrap { overflow-x: auto; }
table.lb th { background: var(--navy); color: #fff; } table.lb th:first-child { border-radius: 10px 0 0 0; } table.lb th:last-child { border-radius: 0 10px 0 0; }
table.lb td, table.lb th { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.lb td.num, table.lb th.num { text-align: right; font-variant-numeric: tabular-nums; } table.lb tr.me td { background: #eef1fc; font-weight: 800; }
input[type=text], input[type=search] { font: inherit; font-size: 16px; padding: 10px 14px; min-height: 46px; border-radius: 999px; border: 2px solid #cfd5ea; background: #fff; color: var(--ink); min-width: 0; flex: 1; width: 100%; }
input:focus { border-color: var(--brand); }
.notice { background: #eef1fc; border-left: 5px solid var(--brand); padding: 10px 14px; margin: 10px 0; border-radius: 10px; font-size: .92rem; }

/* ---------- jeu ---------- */
.hud { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 800; color: var(--navy); margin: 0 0 8px; align-items: center; }
.game { display: grid; gap: 14px; grid-template-columns: 340px 1fr; align-items: start; }
#map { height: min(66vh, 600px); min-height: 320px; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 0; }
.clue h2 { font-size: 1.3rem; }
.clue dl, dl.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; }
.clue dt, dl.kv dt { color: var(--muted); } .clue dd, dl.kv dd { margin: 0; font-weight: 700; }
.clue dd.new, .cluelist li.new { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: #dfe6ff; box-shadow: 0 0 0 6px #dfe6ff; } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }
.hintbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.hintbar button { padding: 8px 16px; min-height: 40px; }
.result { margin-top: 12px; } .result .pts, .pts-line { color: var(--green-ink); font-weight: 800; }
.pts-line { font-size: 2rem; line-height: 1.1; margin: 4px 0; } .react { font-size: 1.5rem; font-weight: 800; }
.pop { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); } @keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fact { background: #eef1fc; border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: .92rem; } .fact p { margin: 2px 0; }
.end { text-align: center; } .end h2 { font-size: 1.6rem; }
.bigscore { font-size: 3.4rem; font-weight: 900; color: var(--navy); line-height: 1; margin: 10px 0 4px; } .bigscore small { font-size: 1rem; color: var(--muted); margin-left: 6px; }
.rankline { color: var(--muted); margin: 0 0 6px; } .xp { display: inline-block; background: #e6f4e1; border-radius: 999px; padding: 3px 14px; font-weight: 800; color: var(--green-ink); }
.recap { list-style: none; padding: 0; margin: 10px auto; max-width: 460px; text-align: left; }
.recap li { display: grid; grid-template-columns: 1fr auto 70px; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); } .recap em { font-style: normal; text-align: right; font-weight: 800; color: var(--green-ink); }
.comm { text-align: left; background: #eef1fc; border-radius: 12px; padding: 10px 14px; margin: 10px 0; } .comm ul { margin: 6px 0; padding-left: 18px; }
.end .row, .end form { justify-content: center; } .inline-h { margin-top: 16px; }
.attempts, .cluelist { list-style: none; padding: 0; margin: 8px 0; } .cluelist { padding-left: 0; list-style: decimal inside; }
.attempts li, .cluelist li { padding: 6px 4px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; border-radius: 6px; }
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vs-card { text-align: center; padding: 26px 12px; } .vs-card .big { font-size: 2.6rem; font-weight: 900; color: var(--brand); } .vs-card .big.good { color: var(--green-ink); } .vs-card .big.bad { color: var(--accent-dark); }
.flash-ok { animation: okglow .9s; } @keyframes okglow { 0% { box-shadow: 0 0 0 0 rgba(118,184,97,.8); } 100% { box-shadow: 0 0 0 26px rgba(118,184,97,0); } }
.shake { animation: shake .5s; } @keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.stat-q { color: var(--navy); margin: 10px 0 16px; text-align: center; font-size: 1.15rem; font-weight: 800; }
.dam-pin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #0008, 0 3px 8px #0006; }
.dam-pin.drop { animation: drop .35s cubic-bezier(.3, 1.6, .5, 1); } @keyframes drop { from { transform: translateY(-26px) scale(.6); opacity: 0; } }
.dam-pin.pulse { animation: pulse 1.4s infinite; } @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(118,184,97,.8), 0 0 0 1px #0008; } 100% { box-shadow: 0 0 0 22px rgba(118,184,97,0), 0 0 0 1px #0008; } }
.pill { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: .78rem; font-weight: 800; background: #e9ecf8; color: var(--brand-dark); }
.pill.ok { background: #e1f3dc; color: var(--green-ink); } .pill.part { background: #dfe6ff; color: var(--navy); } .pill.no { background: #eceef3; color: var(--muted); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
#toasts { position: fixed; top: 70px; right: 12px; z-index: 70; display: grid; gap: 8px; max-width: min(340px, 92vw); }
.toast { background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 700; box-shadow: var(--shadow); animation: slide .35s ease-out; } .toast.good { background: linear-gradient(135deg, var(--green), #a3d48f); color: #12301a; }
.toast.out { opacity: 0; transform: translateX(30px); transition: .4s; } @keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---------- pages ---------- */
.page > .panel { margin-bottom: 14px; } .h2 { font-size: 1.3rem; }
.bigsearch { border-radius: 14px !important; }
.results { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.hit { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.hit:hover:not(:disabled) { background: #eef1fc; } .hit span { grid-column: 1; color: var(--muted); font-weight: 400; } .hit em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; color: var(--brand-dark); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpis > div { background: linear-gradient(135deg, #eef1fc, #fff); border-radius: 14px; padding: 12px 16px; border: 1px solid var(--line); }
.kpis b { display: block; font-size: 1.9rem; color: var(--navy); line-height: 1.1; } .kpis span { color: var(--muted); font-size: .9rem; } .kpis.small b { font-size: 1.4rem; }
.bar { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 70px; gap: 10px; align-items: center; margin: 5px 0; font-size: .92rem; }
.bar .bt { height: 12px; background: #e9ecf8; border-radius: 99px; overflow: hidden; } .bar .bt i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #8d9bea); border-radius: 99px; } .bar .bt.low i { background: linear-gradient(90deg, var(--accent), #f6a068); }
.bar .bv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; } .bar .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.why { list-style: none; padding: 0; margin: 0; } ul.why li { margin-bottom: 8px; } ul.why small { color: var(--muted); display: block; margin: -2px 0 0 0; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #eef1fc; border-radius: 14px; padding: 14px 18px; margin: 16px 0; border-left: 5px solid var(--brand); }
.mprog h3 { margin: 0 0 8px; } .two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart { width: 100%; height: auto; } .chart rect { fill: var(--brand); } .chart rect:hover { fill: var(--navy); } .chart text { font-size: 10px; fill: var(--muted); }
dl.terms > div { padding: 10px 0; border-bottom: 1px solid var(--line); } dl.terms dt { font-weight: 800; color: var(--navy); } dl.terms dt small { font-weight: 400; color: var(--muted); margin-left: 6px; } dl.terms dd { margin: 2px 0 0; }
.quiz .qdef { font-size: 1.1rem; font-style: italic; } .opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
ul.brief { list-style: none; padding: 0; margin: 0; } ul.brief li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; } ul.brief .pill { flex: none; min-width: 92px; text-align: center; margin-top: 2px; } ul.brief small { color: var(--muted); }
dialog.sheet { border: none; border-radius: 22px; padding: 22px; width: min(640px, 94vw); max-height: 92vh; box-shadow: 0 30px 80px rgba(17,26,76,.4); }
dialog.sheet::backdrop { background: rgba(17,26,76,.6); backdrop-filter: blur(3px); }
dialog.sheet .close { position: absolute; top: 12px; right: 12px; min-height: 36px; width: 36px; padding: 0; background: #eef1fc; color: var(--navy); border-color: transparent; }
.sheet-map { height: 220px; border-radius: 14px; margin-top: 12px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; } .hero-art { max-height: 200px; order: -1; }
  .grid2, .game, .two { grid-template-columns: 1fr; }
  #map { height: 52dvh; min-height: 280px; }
  .actions { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 22%); padding: 10px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
  .actions button { flex: 1; }
  .top-in { flex-wrap: wrap; gap: 6px 10px; } #nav { order: 3; flex-basis: 100%; } .tools { margin-left: auto; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; } main { padding: 12px; } .hero { margin: 0 -12px; }
  .versus { gap: 8px; } .vs-card { padding: 16px 6px; } .vs-card h3 { font-size: .95rem; } .vs-card .big { font-size: 1.8rem; }
  .bar { grid-template-columns: 90px 1fr 56px; } .bigscore { font-size: 2.6rem; } #toasts { top: 112px; }
}
.leaflet-container { font: inherit; }
.leaflet-control-zoom a, .leaflet-control-layers-toggle { width: 38px !important; height: 38px !important; line-height: 38px !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* interrupteur « mode sécurisé » et accès rapide aux modes */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider { width: 40px; height: 22px; border-radius: 99px; background: #c9cfe6; position: relative; transition: background .15s; flex: none; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0004; transition: transform .15s; }
.switch input:checked + .slider { background: var(--green); } .switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--accent); outline-offset: 2px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 4px; }
.quick .muted { color: #c9d0f5; font-size: .9rem; } .quick .cta-sec { padding: 8px 16px; min-height: 40px; font-size: .92rem; }
.country-h + .lead + .row + .quick .muted { color: var(--muted); } .country-h + .lead + .row + .quick .cta-sec { color: var(--navy); border-color: var(--navy); }

/* ---------- plein écran : on exploite toute la largeur et toute la hauteur du navigateur ---------- */
@media (min-width: 861px) {
  main { padding-inline: clamp(16px, 2.5vw, 48px); }
  .top-in { padding-inline: clamp(16px, 2.5vw, 48px); } .hero-in { padding-inline: clamp(16px, 2.5vw, 48px); }
  .hero { margin-inline: calc(-1 * clamp(16px, 2.5vw, 48px)); }
  .cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  body.playing main { max-width: none; padding: 8px clamp(12px, 1.6vw, 28px) 12px; }
  body.playing .top-in { max-width: none; }
  body.playing footer { display: none; }
  body.playing .game { grid-template-columns: minmax(300px, 24vw) 1fr; gap: 12px; }
  body.playing #map { height: calc(100dvh - 250px); min-height: 360px; }
  body.playing #side { max-height: calc(100dvh - 190px); overflow: auto; padding-right: 4px; }
  body.playing .hud { margin-bottom: 6px; }
  body.playing .game .small { margin: 4px 0; }
  body.playing .game .actions { margin-top: 6px; }
  body.playing #end { max-width: 860px; margin-inline: auto; }
  body.playing .versus { max-width: 1100px; margin-inline: auto; }
  body.playing .vs-card { padding: clamp(24px, 6vh, 60px) 16px; } body.playing .vs-card h3 { font-size: 1.3rem; } body.playing .vs-card .big { font-size: clamp(2.6rem, 6vw, 4.6rem); }
  body.playing .stat-q { font-size: 1.4rem; margin-top: 4vh; }
}
@media (min-width: 1500px) { html { font-size: 17px; } }

/* drapeaux */
.flag { width: 28px; height: 21px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(17,26,76,.2); vertical-align: -4px; margin-right: 6px; }
.flag.big { width: 56px; height: 42px; margin: 0; border-radius: 5px; box-shadow: 0 3px 10px rgba(17,26,76,.3); animation: flagin .6s cubic-bezier(.2, 1.4, .4, 1); transform-origin: left center; }
@keyframes flagin { from { transform: scale(.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.where { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; margin: 6px 0 4px; line-height: 1.2; } .where.center { justify-content: center; text-align: left; font-size: 1.1rem; }
.vs-card .flag { margin-right: 6px; }

/* sélecteur de zone en cours de partie, règles repliables */
.hud-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.zone select { font: inherit; font-size: .9rem; font-weight: 700; padding: 6px 14px; min-height: 36px; border-radius: 999px; border: 2px solid #cfd5ea; background: #fff; color: var(--navy); max-width: 220px; cursor: pointer; }
.zone select:focus-visible { border-color: var(--brand); }
.rules summary { font-weight: 800; color: var(--navy); cursor: pointer; } .rules ol { margin: 8px 0 0; padding-left: 20px; } .rules li { margin: 4px 0; font-size: .92rem; }

/* mode photo, logo ICOLD */
.photo-frame { position: relative; border-radius: 12px; overflow: hidden; background: #dfe4f5; aspect-ratio: 4 / 3; margin-bottom: 10px; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame .broken-msg { display: none; position: absolute; inset: 0; place-items: center; color: var(--muted); font-weight: 700; }
.photo-frame.broken .broken-msg { display: grid; } .photo-frame.broken img { display: none; }
.credit { font-size: .75rem; color: var(--muted); margin: 6px 0 0; } .credit a { color: var(--brand-dark); }
.clue.photo dl { margin-top: 6px; }
@media (min-width: 861px) { .game.photo, body.playing .game.photo { grid-template-columns: minmax(340px, 36vw) 1fr; } }
.foot-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; } .foot-row p { margin: 0; } .foot-row img { display: block; border-radius: 50%; }
.icold-row { display: flex; align-items: center; gap: 16px; } .icold-row p { margin: 0; } .logo-icold { border-radius: 50%; flex: none; box-shadow: 0 2px 10px rgba(17,26,76,.2); } .logo-icold.sm { width: 56px; height: 56px; }

/* barrage du jour : cartes d'indices (débloqués / verrouillés) */
ol.cluelist { list-style: none; padding: 0; margin: 8px 0 0; }
.clue-card { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: #eef1fc; margin: 6px 0; border-bottom: none !important; }
.clue-card .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.clue-card.locked { background: #f3f4f8; opacity: .75; } .clue-card.locked .num { background: #c9cfe6; font-size: .7rem; }
.clue-photo { display: block; width: 100%; max-width: 360px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin-top: 6px; }

/* accueil « vendeur » : un seul hero (jouer, défis, zone), profil sur une ligne */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0 12px; max-width: 760px; }
.tile { display: flex; align-items: center; gap: 12px; text-align: left; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.28); color: #fff; border-radius: 18px; padding: 12px 16px; min-height: 66px; backdrop-filter: blur(4px); }
.tile:hover:not(:disabled) { background: rgba(255,255,255,.2); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.tile .ti { font-size: 1.8rem; line-height: 1; } .tile b { display: block; font-size: 1rem; } .tile small { color: #c9d0f5; font-weight: 400; font-size: .82rem; }
.zonepill { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 3px 6px 3px 16px; max-width: 560px; margin: 8px 0 2px; }
.zonepill input { background: transparent; border: none; color: #fff; padding: 8px 4px; min-height: 40px; border-radius: 0; }
.zonepill input::placeholder { color: #c9d0f5; } .zonepill input:focus { outline: none; }
.zonepill:focus-within { background: rgba(255,255,255,.2); border-color: #fff; }
.zonepill .ghost { color: #fff; border-color: rgba(255,255,255,.5); white-space: nowrap; padding: 6px 14px; min-height: 36px; font-size: .85rem; }
.hint { margin: 2px 0 0 14px; color: #c9d0f5; min-height: 1.2em; } .hint.err { color: #ffd2b3; }
.flagart { display: grid; place-items: center; padding: 10px 0 24px; } .flag.xl { width: min(300px, 70%); height: auto; aspect-ratio: 4 / 3; margin: 0; border-radius: 16px; box-shadow: 0 22px 50px rgba(0,0,0,.4); transform: rotate(-4deg); animation: flagin .7s cubic-bezier(.2, 1.4, .4, 1); }
.globe { font-size: 9rem; line-height: 1; filter: drop-shadow(0 14px 24px rgba(0,0,0,.4)); }
.profile.strip { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: 14px; padding: 10px 16px; }
.profile.strip .xpbar { flex: 1 1 160px; min-width: 140px; margin: 0; } .profile.strip .badges { margin: 0; gap: 6px; } .profile.strip .badge { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 10px; }
.profile.strip small { white-space: nowrap; }
.hero { margin-bottom: 0; }
@media (max-width: 860px) { .flag.xl { width: 160px; } .globe { font-size: 5rem; } .flagart { padding: 6px 0 0; order: -1; } }

/* photos de solution / de repli */
.reveal-photo { margin: 10px 0 0; position: relative; } .reveal-photo img { width: 100%; border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #dfe4f5; }
.reveal-photo figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; } .reveal-photo figcaption a { color: var(--brand-dark); }
.reveal-photo .broken-msg { display: none; } .reveal-photo.broken img { display: none; } .reveal-photo.broken .broken-msg { display: block; padding: 18px; text-align: center; color: var(--muted); background: #eef1fc; border-radius: 12px; }

/* niveaux de la carte */
.levels { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.lvlpill { display: grid; gap: 0; text-align: left; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.28); color: #fff; border-radius: 16px; padding: 7px 14px; min-height: 0; font-weight: 400; }
.lvlpill b { font-size: .98rem; } .lvlpill small { color: #c9d0f5; font-size: .76rem; }
.lvlpill:hover:not(:disabled) { background: rgba(255,255,255,.2); transform: none; box-shadow: none; }
.lvlpill.on { background: #fff; border-color: #fff; color: var(--navy); box-shadow: 0 6px 18px rgba(0,0,0,.25); } .lvlpill.on small { color: var(--muted); } .lvlpill:disabled { opacity: .4; }
.lvltabs { margin-top: -4px; } .lvltabs .tab { padding: 6px 14px; min-height: 36px; font-size: .88rem; }

/* Touch controls, readable layouts and learning journeys. */
button, .file-button, summary, .zone select { min-height: 44px; }
button, input, select, textarea { font-size: 1rem; }
*, *::before, *::after { box-sizing: border-box; }
main { overflow-wrap: anywhere; }
.map-crosshair { position:absolute; left:50%; top:50%; width:24px; height:24px; border:2px solid #111a4c; border-radius:50%; transform:translate(-50%,-50%); z-index:500; pointer-events:none; box-shadow:0 0 0 2px #fff; }
.map-crosshair::before,.map-crosshair::after { content:""; position:absolute; background:#111a4c; }
.map-crosshair::before { width:32px; height:2px; left:-6px; top:9px; }
.map-crosshair::after { height:32px; width:2px; top:-6px; left:9px; }
.coordinates { margin-top:12px; padding:12px; }
.coordinates label,.evidence label { display:grid; gap:4px; flex:1; min-width:120px; }
.coordinates input,.evidence input,.evidence textarea { width:100%; min-height:44px; }
.evidence { margin-top:12px; display:grid; gap:12px; min-width:0; }
.evidence textarea { min-height:88px; font:inherit; }
.evidence legend { font-weight:700; }
.journeys { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px; }
.learning .row { flex-wrap:wrap; }
.learning details { margin:12px 0; }
.file-button { border:1px solid var(--brand); color:var(--navy); border-radius:10px; padding:8px 12px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.file-button input { width:min(220px,100%); min-width:0; }
.connection { padding:10px 16px; background:#fff3d6; color:#473700; }
.connection[hidden] { display:none; }
.clue-toggle { display:none; }
.profile.strip small { white-space:normal; }
.leaflet-control-zoom a,.leaflet-control-layers-toggle { width:44px!important;height:44px!important;line-height:44px!important; }
dialog.sheet .close { width:44px; min-height:44px; }
dialog.sheet { overflow:auto; max-width:calc(100vw - 24px); }
[role="tabpanel"]:focus-visible { outline:3px solid var(--brand); }
@media(max-width:860px){
  .clue-toggle { display:block; width:100%; grid-column:1/-1; }
  #side.mobile-collapsed { display:none; }
  .game>div { min-width:0; }
  .actions { flex-wrap:wrap; }
  .actions button { min-width:100px; }
  #map { min-height:240px; height:48dvh; }
  .hud { flex-wrap:wrap; }
  .coordinates .row { flex-wrap:wrap; }
  .learning { padding:14px; }
  .top-in,.tools { min-width:0; }
}
@media(max-height:500px) and (orientation:landscape){
  .top { position:relative; }
  #map { height:65dvh;min-height:200px; }
}


/* Reservoir storage and a controlled downstream release, independent of electricity generation. */
.hero-art.dam-diagram { overflow:visible;max-height:320px; }
.dam-label { fill:#edf3ff; paint-order:stroke;stroke:#111a4c;stroke-width:3px;stroke-linejoin:round;font:600 13px/1.2 "Segoe UI",system-ui,sans-serif; }
.dam-label.dam-dark { fill:#243461;stroke:#eef0f8;stroke-width:3px; }
.dam-caption { fill:#edf3ff; font:700 12px/1.2 "Segoe UI",system-ui,sans-serif; }
.dam-flow { animation:dam-current 2.4s linear infinite; }
@keyframes dam-current { to { stroke-dashoffset:-42; } }
@media (prefers-reduced-motion:reduce) { .dam-flow { animation:none!important; } }

/* Landing: gameplay, game modes and database. */
.landing-hero { margin: 0; border-radius: 24px; }
.landing-hero .hero-in { max-width: 1200px; padding: clamp(28px, 4vw, 56px); gap: 64px; grid-template-columns: 1.1fr 1fr; align-items: center; }
.landing-hero h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); letter-spacing: -.04em; }
.landing-hero .hero-sub { max-width: 42ch; margin: 20px 0 28px; }
.landing-db-link { display: inline-block; margin: 16px 0 24px; color: #fff; text-underline-offset: 5px; }
.play-options { max-width: 560px; }
.play-options summary { color: #dfe3f8; font-size: .9rem; cursor: pointer; }
.landing-hero .lvlpill { flex: 1; padding: 8px 10px; }
.gameplay-explainer { padding: 28px; border: 1px solid #ffffff26; border-radius: 20px; background: #ffffff08; }
.gameplay-explainer ol { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 24px; }
.gameplay-explainer li { display: flex; gap: 18px; }
.gameplay-explainer li > span { color: #ffab73; font-weight: 700; font-size: 1.1rem; }
.gameplay-explainer h2 { color: #fff; font-size: 1.15rem; margin: 0 0 6px; }
.gameplay-explainer p { margin: 0; color: #dfe3f8; font-size: .95rem; }
.landing-games, .landing-database { max-width: 1200px; margin: 48px auto; }
.landing-heading { margin-bottom: 24px; }
.landing-heading .kicker, .landing-database .kicker { color: var(--brand-dark); }
.landing-heading h2, .landing-database h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.game-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.game-card { display: flex; flex-direction: column; align-items: flex-start; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.game-number { color: var(--brand-dark); font-size: .85rem; font-weight: 700; margin-bottom: 20px; }
.game-card h3 { font-size: 1.3rem; }
.game-card p { color: var(--muted); margin: 8px 0 24px; flex: 1; }
.game-card button { text-align: left; }
.landing-intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.landing-intro p { color: var(--muted); margin: 0; }
.landing-database { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; padding: 36px; background: #e9edf8; border-radius: 20px; }
.landing-database p { color: var(--muted); max-width: 58ch; }
.database-stats { display: grid; gap: 20px; margin: 0; align-content: center; border-left: 1px solid #cbd2e7; padding-left: 36px; }
.database-stats dt { font-size: 2rem; line-height: 1.1; font-weight: 800; color: var(--navy); }
.database-stats dd { margin: 4px 0 0; color: var(--muted); }
.landing-section { max-width: 1200px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 0 24px; }
.landing-section > summary { padding: 18px 0; cursor: pointer; color: var(--navy); font-weight: 600; }
.landing-section[open] { padding-bottom: 24px; }
.landing-section .panel { box-shadow: none; }
.landing-section .learning { margin-top: 16px; }
@media(max-width: 860px) { .landing-hero .hero-in { grid-template-columns: 1fr; gap: 28px; } .game-cards { grid-template-columns: 1fr; } .landing-database { grid-template-columns: 1fr; gap: 28px; } .database-stats { grid-template-columns: repeat(3, 1fr); border-left: 0; padding: 24px 0 0; border-top: 1px solid #cbd2e7; } }
@media(max-width: 480px) { .landing-hero .hero-in { padding: 28px 20px; } .gameplay-explainer { padding: 20px; } .landing-games, .landing-database { margin-block: 32px; } .landing-database { padding: 24px; } .database-stats { grid-template-columns: 1fr; } .landing-section { padding-inline: 16px; } }
