/* Les Argonautes — un jeu Ludolympe. La mer de nuit de l'Argo, couleurs de la série (nuit + or), police Lilita One. */
@font-face { font-family: 'Lilita One'; src: url(fonts/lilita-one.woff2) format('woff2'); font-display: swap; }
:root {
  --bg: #12182e; --bg2: #0a0e1f; --panel: #232b52; --edge: #0b0d1c; --ink: #f6f0e4; --ink2: #aab3d6;
  --gold: #ffc93c; --red: #ff4458; --green: #3ddc97; --orange: #ff8a3d;
  --boree: #5aa9ff; --notos: #ff6b5b; --euros: #f0a500; --zephyr: #5cd18c;
  --game: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
/* pas de zoom au double toucher : touch-action ne s'hérite pas, on le pose partout */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; color: var(--ink); font: 15px/1.4 var(--body); overflow: hidden; user-select: none; -webkit-user-select: none;
  background: radial-gradient(120% 70% at 50% 110%, #1c4a6e 0%, #15284a 35%, var(--bg) 70%), var(--bg2); }
#app { height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 7px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(12px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 6px) max(12px, env(safe-area-inset-left, 0px)); }

/* ---------- Bandeau du haut : jauges lisibles d'un coup d'œil ---------- */
.top { display: flex; align-items: center; gap: 8px; }
.top h1 { flex: 1; min-width: 0; margin: 0; font: 400 18px var(--game); color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.help { flex: none; width: 34px; height: 34px; border-radius: 50%; font: 400 18px var(--game); color: var(--edge); background: var(--gold);
  border: 3px solid var(--edge); box-shadow: 0 2px 0 var(--edge); cursor: pointer; }
.hud { display: flex; gap: 8px; }
.goal { position: relative; flex: 1; min-width: 0; height: 48px; border-radius: 16px; overflow: hidden; background: var(--panel); border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge); }
.gfill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #1c8f5e, #3ddc97); transition: width .4s; }
.gtext { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 400 24px var(--game); color: #fff; -webkit-text-stroke: 4px var(--edge); paint-order: stroke fill; }
.gtext small { font: 400 15px var(--game); -webkit-text-stroke: 3px var(--edge); }
.gtext .gico { font-size: 20px; -webkit-text-stroke: 0; }
.medal { flex: none; width: 80px; height: 48px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #fff1a8, #ffc93c 55%, #d18d0c); border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge); }
.medal small { font: 700 9.5px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--edge); opacity: .75; margin-bottom: -2px; }
.medal b { font: 400 24px/1 var(--game); color: var(--edge); }
.medal.big { background: radial-gradient(circle at 35% 30%, #ffd0a8, var(--orange) 55%, #c9541a); }
.pop { animation: pop .3s; } @keyframes pop { 50% { transform: scale(1.15); } }
.gauges { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.gauge { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; padding: 5px 9px 6px; border-radius: 14px;
  background: var(--panel); border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge); min-width: 0; overflow: hidden; }
.gauge .gico { grid-row: 1 / 3; font-size: 22px; line-height: 1; }
.gauge b { font: 400 22px/1 var(--game); color: #fff; font-variant-numeric: tabular-nums; }
.gauge small { font: 600 10px var(--body); text-transform: uppercase; color: var(--ink2); letter-spacing: .04em; }
.gauge .slots { grid-column: 1 / 3; display: flex; gap: 3px; height: 7px; margin-top: 4px; }
.gauge .slots i { flex: 1; border-radius: 3px; background: rgba(255, 255, 255, .1); }
.gauge .slots i.on { background: var(--green); }
.gauge[data-level="mid"] .slots i.on { background: var(--orange); }
.gauge[data-level="low"] { border-color: var(--red); animation: alarm 1s infinite; }
.gauge[data-level="low"] .slots i.on { background: var(--red); } .gauge[data-level="low"] b { color: var(--red); }
@keyframes alarm { 50% { box-shadow: 0 3px 0 var(--edge), 0 0 14px rgba(255, 68, 88, .6); } }

/* ---------- Contrats ---------- */
.contracts { display: flex; flex-direction: column; gap: 5px; }
.contract { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 12px; background: rgba(35, 43, 82, .9);
  border: 2px solid var(--edge); font: 400 15.5px var(--game); transition: background .3s; }
.contract .st { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--bg2); border: 2px solid var(--edge); }
.contract.ok { background: #1c6b4a; } .contract.ok .st { background: var(--green); color: var(--edge); }
.contract.ko { background: #6b1c2c; animation: shake .4s; } .contract.ko .st { background: var(--red); }
.contract .when { margin-left: auto; font: 600 11px var(--body); color: var(--ink2); white-space: nowrap; }
.contract .reroll { margin-left: auto; font: 400 13px var(--game); background: var(--gold); color: var(--edge); border: 2px solid var(--edge); border-radius: 10px; padding: 2px 8px; cursor: pointer; }
.boss { padding: 6px 10px; border-radius: 12px; background: #4a1c3a; border: 2px solid var(--edge); font: 400 14px var(--game); color: #ffd6e6; text-align: center; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Dieux ---------- */
.gods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.god { position: relative; background: var(--panel); border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge); border-radius: 14px;
  padding: 5px 8px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.god.turn { outline: 3px solid var(--gold); }
.god .face { grid-row: 1 / 3; font-size: 28px; line-height: 1; }
.god b { font: 400 16px var(--game); }
.god .trait { font-size: 11.5px; color: var(--ink2); line-height: 1.2; }
.god .meta { grid-column: 1 / 3; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 3px; font-size: 12px; color: var(--ink2); }
.void { font: 700 11px var(--body); padding: 1px 6px; border-radius: 8px; background: var(--bg2); border: 1px solid rgba(255, 255, 255, .15); }
.seen { grid-column: 1 / 3; display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }

/* ---------- Table ---------- */
.table { position: relative; flex: 1; min-height: 140px; border-radius: 22px; border: 3px solid var(--edge);
  background: radial-gradient(circle at 50% 50%, #2a6a5a, #1a3f3c 70%); box-shadow: inset 0 0 40px rgba(0, 0, 0, .45); }
.slot { position: absolute; }
.slot.p-me { left: 50%; bottom: 10px; transform: translateX(-50%); }
.slot.p-pos { left: 12%; top: 12px; } .slot.p-her { right: 12%; top: 12px; }
.slot.win .card { box-shadow: 0 0 0 4px var(--gold), 0 0 26px rgba(255, 201, 60, .8); }
.lead { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 400 15px var(--game); color: rgba(255, 255, 255, .55); text-align: center; pointer-events: none; }
.mine { position: absolute; left: 10px; bottom: 8px; font: 400 13px var(--game); color: rgba(255, 255, 255, .75); }
#toast { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 400 28px/1.1 var(--game); color: #fff; text-align: center;
  -webkit-text-stroke: 6px var(--edge); paint-order: stroke fill; pointer-events: none; opacity: 0; transition: opacity .2s; width: 92%; }
#toast.on { opacity: 1; animation: pop .35s; } #toast em { font-style: normal; color: var(--gold); }
.tools { display: flex; gap: 8px; }
.tools:empty { display: none; }
.tool { flex: 1; font: 400 15px var(--game); color: #fff; border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge); border-radius: 12px;
  padding: 6px 8px 8px; background: linear-gradient(#a3542a, #6d3216); cursor: pointer; }
.tool:disabled { opacity: .4; cursor: default; } .tool.on { outline: 3px solid var(--gold); }

/* ---------- Cartes ---------- */
.card { position: relative; width: 56px; height: 82px; border-radius: 10px; background: #fbf5e6; border: 3px solid var(--edge);
  box-shadow: 0 4px 0 var(--edge); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--edge); }
.card .v { font: 400 32px/1 var(--game); color: var(--c); -webkit-text-stroke: 2px var(--edge); paint-order: stroke fill; }
.card .s { font-size: 19px; line-height: 1; margin-top: 2px; }
.card .c1 { position: absolute; top: 3px; left: 5px; font: 400 13px var(--game); color: var(--c); }
.card.mini { width: 26px; height: 34px; border-width: 2px; border-radius: 6px; box-shadow: 0 2px 0 var(--edge); display: inline-flex; vertical-align: middle; margin: 0 2px; }
.card.mini .v { font-size: 15px; -webkit-text-stroke: 1px var(--edge); } .card.mini .s { font-size: 10px; margin: 0; } .card.mini .c1 { display: none; }
.hand-wrap { position: relative; padding-top: 30px; }
.hint { position: absolute; top: 0; left: 0; right: 0; text-align: center; font: 400 13.5px/1.15 var(--game); color: var(--gold); }
.hand { display: flex; justify-content: center; padding: 0 4px 4px; min-height: 100px; align-items: flex-end; }
.hand .card { margin: 0 -9px; cursor: pointer; transition: transform .15s, filter .15s; }
.hand .card.off { filter: brightness(.55) saturate(.6); cursor: default; }
.hand .card.sel { transform: translateY(-18px) scale(1.06); z-index: 2; box-shadow: 0 4px 0 var(--edge), 0 0 0 3px var(--gold); }
@media (max-width: 370px) { .hand .card { width: 48px; height: 74px; margin: 0 -10px; } .hand .card .v { font-size: 28px; } }

/* ---------- Fiches ---------- */
#sheet { position: fixed; inset: 0; z-index: 5; background: rgba(6, 8, 20, .8); display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet { width: 100%; max-width: 440px; max-height: 100%; overflow: auto; touch-action: pan-y; background: var(--panel); border: 3px solid var(--edge);
  box-shadow: 0 6px 0 var(--edge); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.sheet h2 { margin: 0; font: 400 26px/1.1 var(--game); color: var(--gold); text-wrap: balance; }
.sheet p { margin: 0; } .muted { color: var(--ink2); font-size: 14px; }
.label { margin: 2px 0 -4px !important; font: 600 12px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); text-align: left; }
.btn { font: 400 18px var(--game); color: #fff; border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge); border-radius: 14px;
  padding: 10px 14px 12px; cursor: pointer; background: linear-gradient(#5b4a8f, #3d2f6e); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.gold { background: linear-gradient(#ffe07a, var(--gold) 50%, #d18d0c); color: var(--edge); }
.btn.red { background: linear-gradient(#ff6b6b, #e8364f); }
.btn.ghost { background: var(--bg); }
.btn small { display: block; font: 600 12px var(--body); opacity: .85; }
.row { display: flex; gap: 10px; } .row .btn { flex: 1; }
.recap { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; }
.recap b { font: 400 18px var(--game); text-align: right; }
.board { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.board li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 8px 12px; background: var(--bg); border-radius: 10px; text-align: left; }
.board li.me { outline: 2px solid var(--gold); } .board b { font: 400 16px var(--game); color: var(--gold); }
.pseudo { display: flex; gap: 8px; }
.pseudo input { flex: 1; min-width: 0; min-height: 48px; font: 600 16px var(--body); color: var(--ink); background: var(--bg); border: 2px solid var(--edge); border-radius: 12px; padding: 8px 10px; touch-action: auto; }

/* ---------- Tutoriel en diapositives ---------- */
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -18px; touch-action: pan-x; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; padding: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.slide .demo { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 110px; background: radial-gradient(circle, #2a6a5a, #1a3f3c 75%);
  border: 2px solid var(--edge); border-radius: 14px; padding: 8px; }
.slide .sp b { color: var(--gold); }
.dots { display: flex; justify-content: center; gap: 8px; } .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink2); opacity: .35; cursor: pointer; }
.dots i.on { opacity: 1; background: var(--gold); width: 22px; border-radius: 6px; }
.slide.on .fly { animation: flyin 2.4s infinite; } @keyframes flyin { 0% { transform: translateY(40px) scale(.6); opacity: 0; } 25%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
.slide.on .win .card { animation: glow 2.4s infinite; } @keyframes glow { 40%, 100% { box-shadow: 0 0 0 4px var(--gold), 0 0 22px rgba(255, 201, 60, .8); } }

/* ---------- Le chantier d'Argos (boutique) : jetons sur râteliers ---------- */
.purse { display: flex; justify-content: space-between; align-items: center; font: 400 18px var(--game);
  position: sticky; top: -18px; z-index: 3; margin: -18px -18px 0; padding: 12px 18px; background: var(--panel); border-bottom: 3px solid var(--edge); box-shadow: 0 4px 10px rgba(8, 5, 18, .5); }
.purse b { color: var(--gold); font-size: 24px; }
.camp-sub { font: 400 18px var(--game); color: var(--gold); } .camp-sub span { display: block; font: 13px var(--body); color: var(--ink2); margin-top: 2px; }
.keeper { display: flex; align-items: center; gap: 10px; justify-content: center; }
.keeper-face { font-size: 34px; }
.keeper-say { position: relative; background: #f6f0e4; color: var(--edge); font: 400 15px var(--game); padding: 7px 12px 8px; border-radius: 14px; border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge); }
.rack { position: relative; padding-bottom: 16px; text-align: left; }
.rack::after { content: ''; position: absolute; left: -4px; right: -4px; bottom: 0; height: 12px; border-radius: 6px; z-index: 0;
  background: linear-gradient(#a0622e, #6e3d17); border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge); }
.rack-label { font: 400 14px var(--game); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); margin-bottom: 8px; }
.rack-label small { font: 12px var(--body); text-transform: none; letter-spacing: 0; color: var(--ink); margin-left: 6px; }
.wares { position: relative; z-index: 1; display: flex; gap: 10px; justify-content: center; align-items: flex-end; padding-bottom: 18px; }
.ware { position: relative; flex: 1 1 0; max-width: 128px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 8px;
  padding: 10px 6px 20px; border-radius: 18px; border: 3px solid var(--edge); box-shadow: 0 5px 0 var(--edge); cursor: pointer; color: var(--ink);
  font: inherit; transition: transform .12s; background: linear-gradient(#4a3a82, #33275e); }
.ware:nth-child(odd) { transform: rotate(-2deg); } .ware:nth-child(even) { transform: rotate(2deg); }
.ware.k-use { background: linear-gradient(#a3542a, #6d3216); } .ware.k-live { background: linear-gradient(#2f8f63, #1c5c3f); } .ware.k-score { background: linear-gradient(#b8860b, #7a5506); }
.ware.sel { transform: translateY(-8px) scale(1.06) rotate(0); outline: 3px solid var(--gold); box-shadow: 0 10px 0 var(--edge), 0 0 24px rgba(255, 201, 60, .55); }
.ware.poor { filter: saturate(.45) brightness(.8); }
.ware-ico { font-size: 32px; line-height: 1; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: rgba(14, 9, 32, .35); border: 2px solid rgba(255, 255, 255, .18); }
.ware-name { font: 400 14px/1.05 var(--game); text-align: center; text-wrap: balance; }
.ware-fx { font: 600 11.5px/1.15 var(--body); text-align: center; color: #fff4d6; opacity: .92; text-wrap: balance; }
.coin { position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%); z-index: 2; min-width: 38px; height: 26px; padding: 0 8px;
  display: grid; place-items: center; font: 400 17px var(--game); color: var(--edge); border-radius: 13px; border: 3px solid var(--edge);
  background: radial-gradient(circle at 35% 30%, #fff1a8, #ffc93c 55%, #d18d0c); }
.ware.poor .coin { background: #6b6290; color: var(--ink2); }
.count { position: absolute; top: -8px; right: -6px; font: 400 13px var(--game); color: var(--edge); background: var(--green); border: 2px solid var(--edge); border-radius: 10px; padding: 1px 6px; }
.next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: 13px; color: var(--ink2); border-top: 2px dashed rgba(255, 255, 255, .12); padding-top: 10px; text-align: left; }
.next b { color: var(--ink); }
.shopnav { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: -18px; margin: 0 -18px -18px; padding: 10px 18px 18px;
  background: var(--panel); border-top: 3px solid var(--edge); box-shadow: 0 -4px 10px rgba(8, 5, 18, .5); z-index: 3; }
.pick-hint { color: var(--ink2); font: 400 15px var(--game); padding: 4px 0; }
.detail { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 2px solid var(--edge); border-radius: 12px; padding: 8px 10px; font-size: 13px; color: var(--ink2); text-align: left; }
.detail b { display: block; font: 400 16px var(--game); color: var(--gold); } .detail-ico { font-size: 28px; flex: none; }

/* ---------- Menu titre ---------- */
.title-screen { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 16px; text-align: center; max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 30px) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(20px, env(safe-area-inset-left, 0px));
  background: linear-gradient(rgba(10, 14, 31, .96), rgba(10, 14, 31, .6) 45%, rgba(10, 14, 31, .9) 70%, rgba(10, 14, 31, .98)); }
body.at-title .top, body.at-title .hud, body.at-title .gauges, body.at-title .contracts, body.at-title .tools, body.at-title .gods, body.at-title .mine, body.at-title .lead { visibility: hidden; }
.ts-logo h1 { margin: 6px 0 0; font: 400 clamp(46px, 13vw, 68px)/1 var(--game); color: var(--gold); -webkit-text-stroke: 4px var(--edge); paint-order: stroke fill; text-shadow: 0 7px 0 var(--edge), 0 0 40px rgba(255, 201, 60, .3); }
.ts-logo p { margin: 10px 0 0; font: 400 18px/1.25 var(--game); }
.ship { font-size: 58px; line-height: 1; display: inline-block; animation: sail 3s ease-in-out infinite; } @keyframes sail { 50% { transform: translateY(-6px) rotate(-3deg); } }
.ts-menu { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.ts-menu .btn.gold { font-size: 24px; padding: 12px 16px 14px; }
.ts-menu .btn.daily { background: linear-gradient(#ffb36b, var(--orange) 50%, #c9541a); }
.ts-menu .btn.ghost { background: var(--panel); }
.ts-row { display: flex; gap: 10px; } .ts-row .btn { flex: 1; font-size: 16px; padding: 9px 8px 11px; }
.ts-foot p { margin: 4px 0; } .ts-foot .record { font: 400 17px var(--game); } .ts-foot .record b { color: var(--gold); }
.ts-foot .version { font-size: 12px; color: var(--ink2); } .ts-foot a { color: var(--ink2); }
.update { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 20; display: flex; gap: 10px; align-items: center;
  background: var(--panel); border: 3px solid var(--edge); border-radius: 14px; padding: 8px 10px 8px 14px; box-shadow: 0 4px 0 var(--edge); font: 400 15px var(--game); }
.update button { font: 400 15px var(--game); background: var(--gold); color: var(--edge); border: 2px solid var(--edge); border-radius: 10px; padding: 4px 10px; }
@media (prefers-reduced-motion: reduce) { .ship, .contract.ko, #toast.on, .gauge[data-level="low"], .slide.on * { animation: none !important; } }
