/* Frenchy Swarm - thème « Frenchy » : contours bleu nuit, dorures, rubans, police Baloo 2 (SIL OFL 1.1) */
@font-face { font-family: 'Baloo2'; src: url('../fonts/baloo-2.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }
:root {
  --ink: #1a1230; --night: #0f0d1e; --night2: #2c2a5e; --gold0: #fff4b8; --gold1: #ffc94a; --gold2: #c46a12;
  --blue0: #3f8bff; --blue1: #1b2a7a; --red0: #ff5a5f; --red1: #b3122a; --cream: #fff4d0; --dim: #aab0d8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--cream); overflow: hidden;
  font-family: Baloo2, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-weight: 600; overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 11px; padding: max(18px, env(safe-area-inset-top)) 20px max(56px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 38%, rgba(44, 42, 94, 0.55), rgba(15, 13, 30, 0.9) 70%); overflow-y: auto; text-align: center; }

/* Logo : même recette que Frenchy World (or dégradé + gros contour + ruban bleu) */
.logo { width: min(86vw, 380px); height: auto; overflow: visible; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35)); margin-bottom: 2px; }
.logo .t1 { font: 800 96px Baloo2, system-ui, sans-serif; letter-spacing: 1px; }
.logo .t2 { font: 800 40px Baloo2, system-ui, sans-serif; letter-spacing: 10px; }
h2 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: 1px; color: var(--gold1); line-height: 1.05;
  text-shadow: -3px 0 var(--ink), 3px 0 var(--ink), 0 -3px var(--ink), 0 3px var(--ink), -2px -2px var(--ink), 2px -2px var(--ink), -2px 2px var(--ink), 2px 2px var(--ink), 0 6px 0 var(--ink); }
.tag { margin: 0; color: var(--dim); font-size: 15px; max-width: 340px; line-height: 1.3; }
.stats { margin: 4px 0 6px; display: flex; gap: 8px; justify-content: center; }
.chip { background: rgba(18, 12, 40, 0.85); border: 3px solid var(--gold1); outline: 2px solid var(--ink); border-radius: 999px; padding: 2px 14px; font-size: 20px; font-weight: 800; color: var(--cream); }
.how, .ver { margin: 2px 0 0; color: var(--dim); font-size: 13px; }
.row { display: flex; gap: 10px; }

/* Boutons chunky */
.btn { appearance: none; position: relative; cursor: pointer; min-width: 250px; padding: 12px 22px 14px; border-radius: 18px;
  font: 800 21px Baloo2, system-ui, sans-serif; letter-spacing: 1px; color: #fff; line-height: 1.1;
  border: 4px solid var(--ink); background: linear-gradient(180deg, var(--blue0), var(--blue1));
  box-shadow: 0 6px 0 #0d1450, 0 8px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.35);
  text-shadow: -2px 0 var(--ink), 2px 0 var(--ink), 0 -2px var(--ink), 0 2px var(--ink), -1px -1px var(--ink), 1px -1px var(--ink), -1px 1px var(--ink), 1px 1px var(--ink); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #0d1450, 0 3px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.35); }
.btn.primary, .btn.gold { background: linear-gradient(180deg, #fff1a6, var(--gold1) 45%, #e9891a); box-shadow: 0 6px 0 #9a4e0a, 0 8px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.6); }
.btn.primary { font-size: 28px; padding: 14px 26px 16px; }
.btn.primary:active, .btn.gold:active { box-shadow: 0 1px 0 #9a4e0a, 0 3px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.6); }
.btn.red { background: linear-gradient(180deg, var(--red0), var(--red1)); box-shadow: 0 6px 0 #6e0a1a, 0 8px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.35); }
.btn.small { min-width: 0; font-size: 16px; padding: 8px 16px 10px; border-radius: 14px; border-width: 3px; background: linear-gradient(180deg, #6a6fa8, #3b3f78);
  box-shadow: 0 4px 0 #20224a, 0 6px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.3); }
.btn.gold.small { background: linear-gradient(180deg, #fff1a6, var(--gold1) 45%, #e9891a); box-shadow: 0 4px 0 #9a4e0a, 0 6px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.btn.ad small { font-size: 14px; font-weight: 600; opacity: 0.9; }
.btn:disabled { filter: grayscale(0.85) brightness(0.7); transform: none; }

/* Boutique */
.gold { font-size: 30px; font-weight: 800; color: var(--gold1); text-shadow: -2px 0 var(--ink), 2px 0 var(--ink), 0 -2px var(--ink), 0 2px var(--ink), 0 4px 0 var(--ink); }
#shopList { width: min(440px, 100%); display: flex; flex-direction: column; gap: 9px; }
.item, .card { border: 4px solid var(--ink); border-radius: 18px; background: linear-gradient(180deg, #3a3880, #25234f); box-shadow: 0 4px 0 var(--ink), inset 0 0 0 2px var(--gold1), inset 0 3px 0 rgba(255, 255, 255, 0.12); }
.item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; }
.item .info { flex: 1; min-width: 0; }
.item .nm { font-size: 19px; font-weight: 800; color: var(--gold0); line-height: 1.05; }
.item .ds { font-size: 13px; color: var(--dim); line-height: 1.1; }
.item .pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 12px; height: 8px; border-radius: 4px; background: #15122e; border: 1.5px solid var(--ink); }
.pips i.on { background: linear-gradient(180deg, var(--gold0), var(--gold1)); }
.item .btn { min-width: 92px; }

/* Choix de niveau */
#cards { width: min(440px, 100%); display: flex; flex-direction: column; gap: 13px; }
.card { display: flex; align-items: center; gap: 13px; text-align: left; padding: 12px 14px; width: 100%; color: var(--cream); font: inherit; cursor: pointer;
  background: linear-gradient(180deg, #4b3f9a, #2a2660); animation: pop 0.35s cubic-bezier(.2, 1.4, .4, 1) both; }
.card:nth-child(2) { animation-delay: 0.07s; } .card:nth-child(3) { animation-delay: 0.14s; }
.card:active { transform: scale(0.97); }
.card:disabled { filter: brightness(0.7); }
.card .ic { font-size: 36px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4b8, #e9a21f); border: 3px solid var(--ink); flex: none; }
.card .tx { display: flex; flex-direction: column; min-width: 0; }
.card .nm { font-size: 21px; font-weight: 800; color: var(--gold0); line-height: 1.05; }
.card .ds { font-size: 14px; color: var(--dim); line-height: 1.1; }
.card .lv { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--ink); background: linear-gradient(180deg, var(--gold0), var(--gold1)); border-radius: 999px; padding: 1px 10px; border: 2px solid var(--ink); white-space: nowrap; }
@keyframes pop { from { transform: scale(0.6) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin: 2px 0 6px; padding: 10px 16px; border: 4px solid var(--ink); border-radius: 18px; background: linear-gradient(180deg, #3a3880, #25234f); box-shadow: 0 4px 0 var(--ink), inset 0 0 0 2px var(--gold1); }
.statgrid div { color: var(--dim); font-size: 13px; letter-spacing: 1px; font-weight: 700; }
.statgrid b { display: block; color: var(--cream); font-size: 28px; line-height: 1; letter-spacing: 0; }
.statgrid .g b { color: var(--gold1); }

textarea#saveCode { width: min(420px, 100%); background: #15122e; color: var(--cream); border: 4px solid var(--ink); box-shadow: inset 0 0 0 2px var(--gold1); border-radius: 14px; padding: 10px; font: 12px/1.3 ui-monospace, Menlo, monospace; resize: none; -webkit-user-select: text; user-select: text; }

#pauseBtn { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; width: 46px; height: 46px; border-radius: 14px; z-index: 5; color: var(--cream); font: 800 15px Baloo2, sans-serif;
  border: 4px solid var(--ink); background: linear-gradient(180deg, var(--blue0), var(--blue1)); box-shadow: 0 3px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 30; max-width: 86vw; text-align: center; font-size: 16px; font-weight: 700; padding: 8px 18px;
  background: linear-gradient(180deg, #3a3880, #25234f); border: 4px solid var(--ink); box-shadow: 0 4px 0 var(--ink), inset 0 0 0 2px var(--gold1); border-radius: 16px; color: var(--cream); }
#adMock { position: fixed; inset: 0; z-index: 40; background: #101018; display: flex; align-items: center; justify-content: center; }
#adMock .adbox { text-align: center; display: flex; flex-direction: column; gap: 22px; align-items: center; color: var(--dim); }
#bannerMock { position: fixed; left: 0; right: 0; bottom: 0; height: 50px; z-index: 6; background: #1a1a24; color: var(--dim); display: flex; align-items: center; justify-content: center; font-size: 12px; border-top: 1px solid #2a2a3a; }

.hint { max-width: 320px; font-size: 14px; line-height: 1.25; color: var(--cream); border: 3px dashed var(--gold1); border-radius: 14px; padding: 8px 12px; background: rgba(255, 201, 74, 0.08); }
.hint b { color: var(--gold1); }
body.standalone .hint { display: none !important; }

.btn small { display: block; }
.modeopt { width: min(360px, 92vw); }
.modeopt small { font-size: 15px; font-weight: 600; opacity: 0.95; margin-top: 2px; text-shadow: none; color: var(--ink); }
.btn.red.modeopt small, .btn.modeopt:not(.gold) small { color: #fff; text-shadow: -1px 0 var(--ink), 1px 0 var(--ink), 0 -1px var(--ink), 0 1px var(--ink); }
#pauseMsg { max-width: 330px; font-size: 18px; color: var(--cream); }
/* Grand texte : tout l'interface en plus gros (pour les yeux fatigués) */
body.big .screen { zoom: 1.12; }
body.big #menu svg { max-width: 78%; height: auto; }
body.big #pauseBtn { width: 60px; height: 60px; font-size: 20px; }
body.big #toast { font-size: 20px; }

.legal { font-size: 14px; margin: 6px 0 0; text-align: center; }
.legal a { color: var(--cream, #fff4d6); opacity: 0.85; }
