/* ─── FRONT MINI v2 — interface (mobile d'abord, iPhone) ─── */
:root {
  --bg: #1d1f17; --panel: rgba(28, 30, 22, 0.86); --panel2: rgba(46, 48, 36, 0.92); --line: rgba(255, 240, 200, 0.12);
  --text: #f4ecd8; --muted: #b9ae94; --amber: #f2c14e; --amber2: #e0a42a; --red: #ff5a4f; --red2: #c0392b; --green: #7bd66b;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app { position: fixed; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.hidden, .off { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
svg { fill: currentColor; }
.glass { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ─── Boutons ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; font-size: 16px; color: var(--text);
  transition: transform .08s ease, background .15s ease, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--amber), var(--amber2)); color: #2a1f05; border-color: rgba(0,0,0,.15); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(255, 90, 79, .45); }
.btn.big { width: 100%; min-height: 54px; font-size: 18px; }
.btn:disabled { opacity: .45; }
.btn.file { position: relative; overflow: hidden; }
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 15px;
  display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.round svg { width: 22px; height: 22px; }
.pill { height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(192, 57, 43, .9); color: #fff; font-weight: 800; font-size: 15px; border: 1px solid rgba(255,255,255,.2); }

/* ─── Barres ─── */
.topbar { position: absolute; top: calc(var(--sat) + 8px); left: calc(var(--sal) + 10px); right: calc(var(--sar) + 10px);
  display: flex; align-items: center; gap: 8px; pointer-events: none; z-index: 3; }
.topbar > * { pointer-events: auto; }
.grow { flex: 1; }
.stat { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border-radius: 21px; background: var(--panel);
  border: 1px solid var(--line); font-size: 17px; font-variant-numeric: tabular-nums; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.stat b { font-weight: 800; }
.stat.res { padding: 0 12px 0 8px; }
.stat.res i { font-style: normal; font-size: 21px; line-height: 1; }
.rv { display: flex; flex-direction: column; gap: 3px; min-width: 50px; line-height: 1; }
.rv b { font-size: 16px; }
.cap { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.cap s { display: block; height: 100%; width: 0; background: var(--amber); text-decoration: none; transition: width .3s; }
.stat.res.full .cap s { background: var(--red); }
.stat.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.1); } }
.stat.timer { flex-direction: column; justify-content: center; gap: 0; line-height: 1.05; min-width: 74px; }
.stat.timer small { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.ministars { font-size: 15px; letter-spacing: 1px; color: rgba(255,255,255,.2); }
.ministars .on { color: var(--amber); }

.subbar { position: absolute; top: calc(var(--sat) + 58px); left: calc(var(--sal) + 10px); right: calc(var(--sar) + 10px);
  display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; z-index: 3; }
.subbar > * { pointer-events: auto; }
.chip { height: 30px; padding: 0 10px; border-radius: 15px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 4px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-variant-numeric: tabular-nums; }
.chip.raid { color: #ffd6cf; }
.chip.raid.soon { background: rgba(192, 57, 43, .9); color: #fff; animation: blink 1s infinite; }
.chip.warn b { color: var(--red); }
@keyframes blink { 50% { opacity: .55; } }

.bottombar { position: absolute; left: calc(var(--sal) + 12px); right: calc(var(--sar) + 12px); bottom: calc(var(--sab) + 12px);
  display: flex; align-items: flex-end; gap: 10px; pointer-events: none; z-index: 3; }
.bottombar > * { pointer-events: auto; }
.cta { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 88px; height: 76px; border-radius: 22px;
  background: linear-gradient(180deg, var(--amber), var(--amber2)); color: #2a1f05; box-shadow: 0 8px 22px rgba(0,0,0,.35);
  border: 2px solid rgba(255,255,255,.25); font-weight: 800; }
.cta .ic { font-size: 28px; line-height: 1; }
.cta span:last-child { font-size: 13px; }
.cta.red { background: linear-gradient(180deg, #e2574c, #a8291f); color: #fff; }
.cta:active { transform: scale(.96); }
.cta.dot { position: relative; }
.cta.dot::after { content: ""; position: absolute; top: 6px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--red); }

/* ─── Étiquettes 3D (bulles de récolte, minuteurs) ─── */
#labels, #popups { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.lbl { position: absolute; left: 0; top: 0; will-change: transform; }
.bubble { pointer-events: auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: radial-gradient(circle at 50% 30%, #fffbe9, #f2c14e 70%); border: 2px solid #fff; box-shadow: 0 5px 14px rgba(0,0,0,.4);
  animation: bob 1.5s ease-in-out infinite; }
.bubble.fuel { background: radial-gradient(circle at 50% 30%, #f1fff4, #5cc96d 70%); }
.bubble.full { box-shadow: 0 0 0 3px var(--red), 0 5px 14px rgba(0,0,0,.4); }
@keyframes bob { 50% { translate: 0 -5px; } }
.tchip { padding: 3px 8px; border-radius: 10px; background: rgba(20, 22, 16, .86); color: #ffe7a6; font-size: 12px; font-weight: 800;
  white-space: nowrap; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tchip.train { color: #c9f3c2; }
.pop { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 16px; color: var(--amber); text-shadow: 0 1px 0 #000, 0 0 6px rgba(0,0,0,.6); white-space: nowrap; will-change: transform, opacity; }
.pop.fuel { color: #8be39a; }
.pop.bad { color: var(--red); }
#hurt { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 30px rgba(255, 40, 30, .5); opacity: 0; transition: opacity .35s; z-index: 2; }
#hurt.on { opacity: 1; transition: none; }

/* ─── Raid ─── */
.banner { position: absolute; top: calc(var(--sat) + 60px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  padding: 8px 18px; border-radius: 16px; background: rgba(170, 38, 28, .92); border: 1px solid rgba(255,255,255,.25); box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 3;
  pointer-events: none; text-align: center; }
.banner b { font-size: 15px; letter-spacing: 1px; animation: blink 1.2s infinite; }
.banner span { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ─── Bataille ─── */
.bname { position: absolute; top: calc(var(--sat) + 58px); left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 12px;
  background: rgba(20,22,16,.7); font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; pointer-events: none; z-index: 3; }
.deploybar { position: absolute; left: calc(var(--sal) + 88px); right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 10px); z-index: 3; }
.dcards { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.dcards::-webkit-scrollbar { display: none; }
.dcard { position: relative; flex: 0 0 64px; height: 78px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dcard img { width: 48px; height: 48px; object-fit: contain; }
.dcard b { position: absolute; top: 3px; right: 6px; font-size: 14px; font-weight: 900; text-shadow: 0 1px 2px #000; }
.dcard small { font-size: 10px; font-weight: 700; color: var(--muted); }
.dcard.sel { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber) inset; background: rgba(90, 76, 30, .92); }
.dcard.empty { opacity: .35; filter: grayscale(1); }
.strike { position: absolute; left: calc(var(--sal) + 12px); bottom: calc(var(--sab) + 14px); width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #c0392b, #7d1d14); border: 2px solid rgba(255,255,255,.25); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); z-index: 4; }
.strike svg { width: 30px; height: 30px; fill: #fff; transform: rotate(-30deg); position: relative; z-index: 1; }
.strike i { position: absolute; inset: -2px; border-radius: 50%; background: conic-gradient(rgba(10,10,10,.72) calc(var(--cd, 0) * 1turn), transparent 0);
  font-style: normal; display: grid; place-items: center; font-weight: 800; font-size: 15px; z-index: 2; color: #fff; }
.strike em { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 800; background: rgba(20,22,16,.9);
  padding: 1px 6px; border-radius: 8px; white-space: nowrap; z-index: 3; }
.strike.armed { outline: 3px solid var(--amber); outline-offset: 3px; animation: pulse 1s infinite; }
.strike.poor em { color: var(--red); }
@keyframes pulse { 50% { outline-color: transparent; } }
.hint { position: absolute; left: 50%; top: calc(var(--sat) + 104px); transform: translateX(-50%); padding: 10px 16px; border-radius: 14px;
  background: rgba(192, 57, 43, .92); font-weight: 700; white-space: nowrap; pointer-events: none; z-index: 5; }

/* ─── Feuilles ─── */
.sheet { position: absolute; left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 8px);
  max-width: 620px; margin: 0 auto; border-radius: 22px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 12px 40px rgba(0,0,0,.45); padding: 12px; z-index: 6;
  animation: up .18s ease-out; max-height: calc(100% - var(--sat) - var(--sab) - 110px); overflow-y: auto; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0 2px; }
.sheet-head > b { font-size: 17px; }
.sheet-head .x { margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 15px; }
.sheet-head img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.sheet-hint { margin: 8px 4px 0; color: var(--muted); font-size: 13px; min-height: 1.2em; }
.tabs { display: flex; gap: 3px; background: rgba(0,0,0,.25); border-radius: 12px; padding: 3px; flex: 1; min-width: 0; }
.tabs button { flex: 1; padding: 7px 4px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--amber); color: #2a1f05; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cards.scrollx { display: flex; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cards.scrollx::-webkit-scrollbar { display: none; }
.cards.scrollx .card { flex: 0 0 108px; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; border-radius: 16px;
  background: var(--panel2); border: 1px solid var(--line); min-width: 0; transition: transform .08s, border-color .15s; }
.card img { width: 58px; height: 58px; object-fit: contain; }
.card .n { font-size: 12.5px; font-weight: 700; line-height: 1.1; text-align: center; max-width: 100%; min-height: 2.2em; display: flex; align-items: center; }
.card .c { font-size: 13px; font-weight: 800; color: var(--amber); white-space: nowrap; }
.card .s { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.15; }
.card .cnt { position: absolute; top: 5px; right: 7px; font-size: 11px; font-weight: 800; color: var(--muted); }
.card.poor .c { color: var(--red); }
.card.locked { opacity: .5; }
.card.locked img { filter: grayscale(1); }
.card:active { transform: scale(.96); }
.tname { display: flex; flex-direction: column; min-width: 0; }
.tname b { font-size: 17px; }
.tname small { color: var(--amber); font-weight: 700; font-size: 13px; }
.tstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 4px 6px 12px; font-size: 14px; }
.tstats div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.tstats span { color: var(--muted); }
.tstats b em { color: var(--green); font-style: normal; }
.tstats .full { grid-column: 1 / -1; color: var(--muted); border: 0; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 0; min-width: 120px; flex-direction: column; gap: 0; line-height: 1.15; padding: 6px 10px; min-height: 52px; }
.actions .btn small { font-size: 12px; font-weight: 700; opacity: .85; }
.actions .btn.poor small { color: #8c1d14; }
.actions .btn:not(.primary).poor small { color: var(--red); }
.prog { position: relative; height: 26px; border-radius: 13px; background: rgba(0,0,0,.35); overflow: hidden; margin: 0 4px 10px; }
.prog i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--amber2), var(--amber)); transition: width .25s linear; }
.prog span { position: relative; display: block; text-align: center; line-height: 26px; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.qhead { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 4px 6px; font-weight: 700; font-size: 14px; }
.qhead small { color: var(--muted); font-weight: 600; }
.queue { display: flex; gap: 6px; overflow-x: auto; min-height: 58px; padding: 2px; scrollbar-width: none; }
.queue::-webkit-scrollbar { display: none; }
.queue .empty { color: var(--muted); font-size: 13px; align-self: center; padding: 0 4px; }
.qi { position: relative; flex: 0 0 54px; height: 54px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
.qi img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.qi .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--green); }
.qi .del { position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; border-radius: 50%; background: rgba(192,57,43,.95); color: #fff; font-size: 10px; font-weight: 900; line-height: 18px; text-align: center; }

/* ─── Placement ─── */
.placebar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 12px); display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0,0,0,.45); z-index: 6; animation: up .18s ease-out; }
.pbtn { width: 56px; height: 56px; border-radius: 50%; font-size: 24px; font-weight: 900; flex: none; }
.pbtn.ok { background: var(--green); color: #0f2a0a; }
.pbtn.ok:disabled { opacity: .35; }
.pbtn.no { background: var(--red2); color: #fff; }
.pbtn.rot { background: rgba(255,255,255,.12); width: 44px; height: 44px; font-size: 20px; }
.pinfo { display: flex; flex-direction: column; align-items: center; min-width: 120px; max-width: 46vw; text-align: center; line-height: 1.2; }
.pinfo b { font-size: 15px; }
.pinfo small { font-size: 12px; color: var(--amber); font-weight: 700; }

.toast { position: absolute; left: 50%; top: calc(var(--sat) + 100px); transform: translate(-50%, -10px); width: max-content; max-width: min(92vw, 520px);
  padding: 11px 16px; border-radius: 14px; background: rgba(20, 22, 16, .92); border: 1px solid var(--line); font-weight: 600; font-size: 15px;
  text-align: center; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 20; line-height: 1.3; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─── Écrans ─── */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--sat) + 20px) calc(var(--sar) + 18px) calc(var(--sab) + 20px) calc(var(--sal) + 18px); z-index: 10;
  background: linear-gradient(180deg, rgba(20,22,15,.4), rgba(20,22,15,.78)); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.title { justify-content: space-between; background: linear-gradient(180deg, rgba(20,22,15,.55) 0%, rgba(20,22,15,0) 35%, rgba(20,22,15,0) 55%, rgba(20,22,15,.8) 100%); }
.logo { text-align: center; margin-top: 4vh; }
.logo .badge { width: 54px; height: 54px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(180deg, var(--amber), var(--amber2)); color: #3a2a06; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.logo h1 { margin: 0; font-size: clamp(44px, 13vw, 76px); font-weight: 900; letter-spacing: 2px; line-height: .95;
  text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.4); }
.logo h1 span { display: block; color: var(--amber); font-size: .62em; letter-spacing: 10px; }
.logo p { margin: 8px 0 0; color: #fff3d6; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; font-size: 13px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.menu { width: min(100%, 360px); display: flex; flex-direction: column; gap: 10px; }
.foot { color: var(--muted); font-size: 12px; margin: 10px 0 0; text-align: center; }
.title .btn:not(.primary) { background: rgba(20, 22, 15, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel { width: min(100%, 560px); max-height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 10px; }
.panel.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.panel.narrow { width: min(100%, 380px); text-align: center; }
.panel h2 { margin: 0; font-size: 24px; }
.panel h3 { margin: 10px 0 0; font-size: 16px; color: var(--amber); }
.phead { display: flex; align-items: center; gap: 10px; }
.back { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 28px; line-height: 1; padding-bottom: 4px; flex: none; }
.armyrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(0,0,0,.22); font-size: 13px; color: var(--muted); }
.armyrow .u { display: flex; align-items: center; gap: 1px; font-weight: 800; color: var(--text); font-size: 14px; }
.armyrow img { width: 30px; height: 30px; object-fit: contain; }
.armyrow .tot { margin-left: auto; font-weight: 700; }
.armyrow .lv { margin-left: 2px; padding: 0 4px; border-radius: 6px; background: var(--amber); color: #2a1f05; font-size: 10px; font-weight: 900; }
.levels { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lvl { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); text-align: left; width: 100%; }
.lvl .num { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; font-weight: 900; font-size: 20px;
  background: linear-gradient(180deg, #e2574c, #a8291f); color: #fff; }
.lvl .info { flex: 1; min-width: 0; }
.lvl .info b { display: block; font-size: 16px; }
.lvl .info small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.lvl .info .lt { color: var(--amber); font-weight: 700; }
.lvl .st { color: var(--amber); font-size: 17px; letter-spacing: 1px; white-space: nowrap; }
.lvl .st .off { color: rgba(255,255,255,.18); }
.lvl.locked { opacity: .45; }
.lvl.locked .num { background: #444; color: #999; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; }
.row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.toggle { width: 58px; height: 34px; border-radius: 17px; background: #555; position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(24px); }
.seg { display: flex; background: rgba(0,0,0,.25); border-radius: 12px; padding: 3px; }
.seg button { padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--amber); color: #2a1f05; }
.muted { color: var(--muted); margin: 0; font-size: 14px; line-height: 1.4; }
.small { font-size: 12px; }
.help { background: rgba(0,0,0,.2); border-radius: 14px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.help summary { color: var(--text); font-weight: 700; cursor: pointer; }
.help ol, .help ul { padding-left: 18px; margin: 8px 0 0; line-height: 1.45; }
.help li { margin-bottom: 4px; }
.help b { color: var(--text); }
.mlist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mitem { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: var(--panel2); font-size: 13px; }
.mitem b { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: #555; color: #ddd; text-transform: uppercase; }
.tag.pack { background: var(--green); color: #0f2a0a; }
.rot { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.1); font-weight: 800; }
.stars { font-size: 46px; letter-spacing: 6px; color: var(--amber); text-shadow: 0 4px 14px rgba(0,0,0,.4); line-height: 1.1; }
.stars .off { color: rgba(255,255,255,.15); }
.stars span { display: inline-block; animation: star .4s backwards; }
.stars span:nth-child(2) { animation-delay: .25s; }
.stars span:nth-child(3) { animation-delay: .5s; }
@keyframes star { from { transform: scale(2.4); opacity: 0; } }
.endstats { display: flex; justify-content: center; gap: 18px; color: var(--muted); margin-bottom: 2px; font-size: 13px; flex-wrap: wrap; }
.endstats b { display: block; color: var(--text); font-size: 20px; }
.loot { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.loot span { padding: 6px 12px; border-radius: 12px; background: rgba(0,0,0,.25); }
.loot .neg { color: var(--red); }

/* ─── Chargement ─── */
#loading { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 40%, #3a3a28, #15160f); transition: opacity .4s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading p { color: var(--muted); font-weight: 600; margin: 0; }
.spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--amber); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { width: 180px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s; }

/* Paysage : barres plus compactes */
@media (orientation: landscape) and (max-height: 500px) {
  .stat { height: 38px; font-size: 15px; }
  .round { width: 40px; height: 40px; }
  .subbar { top: calc(var(--sat) + 52px); }
  .cta { width: 76px; height: 64px; border-radius: 18px; }
  .cta .ic { font-size: 23px; }
  .sheet { max-width: 600px; padding: 10px; max-height: calc(100% - 64px); }
  .card img { width: 46px; height: 46px; }
  .logo { margin-top: 0; }
  .logo h1 { font-size: 46px; }
  .title { flex-direction: row; align-items: center; justify-content: space-around; }
  .menu { width: 300px; }
  .foot { position: absolute; bottom: calc(var(--sab) + 6px); left: 0; right: 0; }
  .banner { top: calc(var(--sat) + 8px); }
  .bname { top: calc(var(--sat) + 52px); }
  .deploybar { left: auto; width: min(66vw, 560px); }
  .hint { top: calc(var(--sat) + 60px); }
  .toast { top: calc(var(--sat) + 56px); }
}
@media (max-width: 360px) {
  .stat.res { padding: 0 9px 0 6px; }
  .rv { min-width: 44px; }
  .card .n { font-size: 11px; }
  .card img { width: 46px; height: 46px; }
  .cards.scrollx .card { flex-basis: 96px; }
}

/* ── v3 : espions, attaque libre, paliers de missions ── */
.spybtn { position: absolute; left: calc(var(--sal) + 12px); bottom: calc(var(--sab) + 92px); width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55); background: rgba(28,34,30,.82); font-size: 26px; display: grid; place-items: center; z-index: 6; }
.spypanel { position: absolute; left: calc(var(--sal) + 74px); bottom: calc(var(--sab) + 84px); display: flex; flex-direction: column; gap: 6px; z-index: 7;
  background: rgba(24,28,26,.9); padding: 10px; border-radius: 14px; min-width: 200px; box-shadow: 0 6px 22px rgba(0,0,0,.35); }
.spypanel .sp-head { color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.spypanel .btn { text-align: left; }
.pill.next { background: #2f6fa8; color: #fff; margin-right: 6px; }
.freecard { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(135deg, #3a4a2c, #26301d); color: #fff; }
.freecard .lg { font-size: 30px; }
.freecard .info { flex: 1; display: flex; flex-direction: column; }
.freecard .info small { opacity: .8; font-size: 12px; }
.tierhead { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .65; margin: 10px 4px 4px; }
.clockchip { font-variant-numeric: tabular-nums; }

/* Bandeau d'événement (zombies, convoi, production doublée) */
.evbanner { position: absolute; top: calc(var(--sat) + 104px); left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: auto;
  display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border-radius: 14px; max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, rgba(36,30,22,.92), rgba(22,18,13,.92)); border: 1px solid rgba(255,214,140,.35);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); color: #fff; animation: evIn .35s ease-out; }
.evbanner .ev-ic { font-size: 24px; line-height: 1; }
.evbanner b { display: block; font-size: 13px; }
.evbanner small { display: block; font-size: 11.5px; opacity: .82; white-space: nowrap; }
.evbanner .btn { padding: 7px 12px; font-size: 13px; min-height: 0; }
@keyframes evIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-height: 500px) { .evbanner { top: calc(var(--sat) + 94px); } }

/* Cinématiques : bandes noires, titres, HUD masqué */
.cinebox { position: fixed; inset: 0; z-index: 40; pointer-events: auto; touch-action: none; }
.cinebox.hidden { display: none; }
.cinebox .cbar { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height .45s ease; }
.cinebox .cbar.top { top: 0; } .cinebox .cbar.bot { bottom: 0; }
html.cine .cinebox .cbar { height: 11vh; }
.cinebox .ctext { position: absolute; left: calc(var(--sal) + 22px); bottom: calc(11vh + 14px); max-width: min(78vw, 620px); color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.65); opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.cinebox .ctext.show { opacity: 1; transform: none; }
#cineKick { display: block; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #ffc94d; font-weight: 800; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
#cineTitle { display: block; font-size: clamp(22px, 5.4vw, 36px); font-weight: 800; line-height: 1.08; margin: 3px 0 5px; }
#cineSub { display: block; font-size: 14px; opacity: .92; }
.cinebox .cskip { position: absolute; right: calc(var(--sar) + 16px); bottom: calc(5.5vh - 8px); font-size: 12px; color: rgba(255,255,255,.7); opacity: 0; transition: opacity .4s .8s; }
html.cine .cinebox .cskip { opacity: 1; }
html.cine [class*="only-"], html.cine #labels, html.cine #toast, html.cine .sheet { opacity: 0 !important; pointer-events: none !important; transition: opacity .3s; }
.cinebox::before { content: ''; position: absolute; left: 0; right: 0; bottom: 11vh; height: 42%; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.18) 55%, transparent); }
html.cine .cinebox::before { opacity: 1; }

/* Niveau d'expérience et gemmes */
.lvlbadge { position: relative; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; border: 2px solid rgba(255,214,120,.85);
  background: radial-gradient(circle at 50% 35%, #3b6fd8, #1d3a86); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.lvlbadge b { font-size: 17px; line-height: 1; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.lvlbadge .xpbar { width: 30px; height: 4px; border-radius: 3px; background: rgba(0,0,0,.45); margin-top: 4px; overflow: hidden; }
.lvlbadge .xpbar s { display: block; height: 100%; width: 0; background: #8ff0a0; text-decoration: none; transition: width .4s; }
.ndot { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #ff4d3d; border: 2px solid #fff; }
.ndot.hidden { display: none; }
.stat.gem { border: 0; color: #fff; cursor: pointer; padding-right: 6px; }
.stat.gem b { font-size: 15px; font-weight: 800; }
.stat.gem .plus { margin-left: 6px; width: 18px; height: 18px; border-radius: 6px; background: #3fbf5a; color: #fff; font-weight: 900; font-size: 14px; line-height: 18px; text-align: center; }
.gembtn { margin-left: auto; border: 0; border-radius: 10px; padding: 6px 10px; font-weight: 800; font-size: 12.5px; color: #fff; background: linear-gradient(180deg, #44c96a, #2a9a4a); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.gembtn.hidden { display: none; }
.btn.gem { background: linear-gradient(180deg, #44c96a, #2a9a4a); color: #fff; border-color: rgba(0,0,0,.15); }
.pghead { display: flex; align-items: center; gap: 14px; padding: 10px 4px 4px; }
.pghead .big { width: 60px; height: 60px; border-radius: 16px; font-size: 26px; flex: 0 0 60px; }
.pghead .info { flex: 1; } .pghead .info b { font-size: 17px; } .pghead .info small { display: block; opacity: .75; margin-top: 2px; }
.pgbar { height: 9px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px; }
.pgbar s { display: block; height: 100%; background: linear-gradient(90deg, #ffd25a, #ffb12e); text-decoration: none; }
.pgsec { margin: 16px 4px 8px; font-size: 15px; display: flex; align-items: baseline; gap: 8px; } .pgsec small { font-weight: 500; opacity: .65; font-size: 12px; }
.pglist { display: flex; flex-direction: column; gap: 8px; }
.pgitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.pgitem.ready { border-color: rgba(120,230,140,.6); background: rgba(70,180,90,.14); }
.pgitem .ic { font-size: 24px; width: 32px; text-align: center; }
.pgitem .tx { flex: 1; min-width: 0; } .pgitem .tx b { font-size: 14px; } .pgitem .tx small { display: block; font-size: 12px; opacity: .78; margin-top: 2px; }
.pgitem .st { color: #ffcc4d; letter-spacing: 1px; font-size: 13px; margin-left: 6px; } .pgitem .st .off { color: rgba(255,255,255,.25); }
.pgitem .btn { min-height: 38px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.pgitem .done { font-size: 12px; opacity: .6; white-space: nowrap; }
.gembal { text-align: center; font-size: 22px; margin: 6px 0 12px; } .gembal b { font-size: 28px; }
.gmshop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gmshop .btn { flex-direction: column; min-height: 66px; font-size: 13px; padding: 6px; } .gmshop .btn small { font-size: 11.5px; opacity: .9; }
.gmshop .wide { grid-column: span 3; }
.gmhint { font-size: 12.5px; margin-top: 12px; }

/* Cinématiques : vignettage, marqueur d'objectif (vraie cible), radar (vraies unités) */
.cinebox .cvig { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.42) 100%); }
html.cine .cinebox .cvig { opacity: 1; }
.cmark { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.cmark.hidden { display: none; }
.cmark i { position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; border: 2px solid rgba(255,70,60,.95); border-radius: 6px;
  clip-path: polygon(0 0, 30% 0, 30% 8%, 8% 8%, 8% 30%, 0 30%, 0 70%, 8% 70%, 8% 92%, 30% 92%, 30% 100%, 0 100%, 0 0, 100% 0, 70% 0, 70% 8%, 92% 8%, 92% 30%, 100% 30%, 100% 70%, 92% 70%, 92% 92%, 70% 92%, 70% 100%, 100% 100%, 100% 0);
  animation: cmark 1.2s ease-in-out infinite; box-shadow: 0 0 12px rgba(255,60,50,.5); }
.cmark span { position: absolute; left: 42px; top: -30px; white-space: nowrap; font: 800 11px/1.2 inherit; letter-spacing: .12em; color: #fff; background: rgba(160,20,15,.82); padding: 4px 7px; border-radius: 4px; }
@keyframes cmark { 0%, 100% { transform: scale(1); } 50% { transform: scale(.88); } }
.cradar { position: absolute; right: calc(var(--sar) + 16px); top: calc(11vh + 12px); width: 110px; height: 110px; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.cradar.hidden { display: none; }
.cradar canvas { width: 110px; height: 110px; transform: rotate(45deg); }
@media (max-width: 430px) {
  .lvlbadge { width: 40px; height: 40px; flex-basis: 40px; } .lvlbadge b { font-size: 15px; }
  .stat.gem .plus { display: none; } .stat.gem { padding: 0 9px; }
  .stat.res { padding: 0 9px 0 6px; } .stat.res i { font-size: 18px; } .rv { min-width: 40px; } .rv b { font-size: 14.5px; }
  .topbar { gap: 5px; }
}
.cmark.flip span { left: auto; right: 42px; }

/* ── v3.3 : composants, menu latéral, héros, appuis, alliance, pass, défense ── */
.stat.parts .cap s { background: #9fb7c9; }
@media (max-width: 430px) {
  .topbar.compact .stat.res { padding: 0 7px 0 5px; } .topbar.compact .stat.res i { font-size: 15px; } .topbar.compact .rv { min-width: 34px; }
  .topbar.compact .rv b { font-size: 13px; } .topbar.compact .stat.gem { padding: 0 7px; } .topbar.compact { gap: 4px; }
  .topbar.compact .lvlbadge { width: 36px; height: 36px; flex-basis: 36px; }
}
.sidemenu { position: absolute; left: calc(var(--sal) + 10px); top: calc(var(--sat) + 100px); display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.sbtn { position: relative; width: 52px; height: 52px; border-radius: 15px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--text); }
.sbtn span { font-size: 21px; line-height: 1; } .sbtn small { font-size: 9.5px; font-weight: 800; color: var(--muted); }
.sbtn:active { transform: scale(.94); } .sbtn.hidden { display: none; }
@media (orientation: landscape) and (max-height: 500px) { .sidemenu { top: calc(var(--sat) + 92px); flex-direction: row; } .sbtn { width: 46px; height: 46px; } }
/* bataille : appuis, énergie, vitesse */
.abar { position: absolute; left: calc(var(--sal) + 88px); bottom: calc(var(--sab) + 100px); display: flex; align-items: center; gap: 6px; z-index: 3; flex-wrap: wrap; max-width: calc(100% - 100px); }
.abar.hidden { display: none; }
.abar .energy { display: flex; align-items: center; gap: 3px; height: 44px; padding: 0 10px; border-radius: 22px; background: rgba(20, 40, 70, .9); border: 1px solid rgba(120, 200, 255, .35); color: #bfe6ff; }
.abar .energy i { font-style: normal; font-size: 17px; } .abar .energy b { font-size: 17px; font-weight: 900; min-width: 18px; text-align: center; }
.abtns { display: flex; gap: 5px; }
.ab { width: 46px; height: 46px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); }
.ab span { font-size: 18px; line-height: 1; } .ab small { font-size: 10px; font-weight: 800; color: #bfe6ff; }
.ab.poor { opacity: .5; } .ab.locked { opacity: .4; filter: grayscale(1); }
.ab.armed { outline: 3px solid #6fd0ff; outline-offset: 2px; animation: pulse 1s infinite; background: rgba(30, 70, 110, .95); }
.abhint { position: absolute; bottom: 52px; left: 0; white-space: nowrap; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 10px; background: rgba(20, 40, 70, .9); color: #dff3ff; }
.abhint.hidden { display: none; }
.pill.speed { background: rgba(40, 44, 34, .9); min-width: 52px; } .pill.speed.on { background: linear-gradient(180deg, #44c96a, #2a9a4a); }
.dcard.hero { border-color: rgba(255, 200, 70, .55); background: rgba(70, 58, 24, .92); }
.dcard.hero.ability { border-color: #ffd25a; box-shadow: 0 0 0 2px #ffd25a inset, 0 0 14px rgba(255, 210, 90, .5); animation: glow 1.4s infinite; }
.dcard.reinf { border-color: rgba(110, 160, 255, .6); background: rgba(30, 44, 80, .92); } .dcard .rf { font-size: 30px; line-height: 48px; }
/* héros */
.hrlist { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hrcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 210, 90, .07); border: 1px solid rgba(255, 210, 90, .22); flex-wrap: wrap; }
.hrcard.locked { opacity: .55; filter: grayscale(.7); }
.hrcard img { width: 72px; height: 72px; object-fit: contain; flex: none; background: rgba(0,0,0,.2); border-radius: 12px; }
.hrcard .tx { flex: 1; min-width: 170px; } .hrcard .tx b { font-size: 15px; } .hrcard .tx small { display: block; font-size: 12px; opacity: .8; margin-top: 3px; }
.hrcard .tx .lv { font-size: 12px; color: var(--amber); margin-left: 6px; } .hrcard .ab { all: unset; display: block; font-size: 12px; margin-top: 3px; color: #ffe2a0; }
.hrcard .hst { display: flex; gap: 10px; font-size: 12px; font-weight: 700; margin-top: 5px; }
.hacts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; } .hacts .btn { flex-direction: column; min-height: 46px; font-size: 13px; } .hacts .btn small { font-size: 11px; }
/* alliance */
.albody { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-top: 10px; }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; padding: 8px; border-radius: 14px; background: rgba(0,0,0,.22); }
.msg { align-self: flex-start; max-width: 85%; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: rgba(255,255,255,.09); font-size: 13px; }
.msg b { display: block; font-size: 11px; color: var(--amber); } .msg.me { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: rgba(70, 150, 255, .22); } .msg.me b { color: #9fd0ff; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; } .quick .chip { height: auto; padding: 6px 10px; text-align: left; }
.warhead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px; border-radius: 16px; background: linear-gradient(90deg, rgba(60,120,220,.25), rgba(200,60,50,.25)); text-align: center; }
.warhead b { display: block; font-size: 13px; } .warhead .sc { font-size: 24px; font-weight: 900; color: #ffd25a; } .warhead .vs { font-weight: 900; opacity: .7; }
.warhead small { grid-column: 1 / -1; font-size: 12px; opacity: .8; }
.btn.red { background: linear-gradient(180deg, #e2574c, #a8291f); color: #fff; }
.btn.danger { color: #ff8a80; }
/* pass de campagne */
.pshead { display: flex; align-items: center; gap: 12px; padding: 8px 2px; flex-wrap: wrap; }
.pshead .tx { flex: 1; min-width: 180px; } .pshead .tx b { font-size: 16px; } .pshead .tx small { display: block; font-size: 12px; opacity: .78; margin-top: 2px; }
.ptier { width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; font-weight: 900; background: linear-gradient(180deg, #ffd25a, #e0a42a); color: #2a1f05; line-height: 1; }
.ptier small { font-size: 11px; font-weight: 800; }
.pshead .btn { flex-direction: column; min-height: 52px; } .gold { font-weight: 900; color: #ffd25a; }
.pslist { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; -webkit-overflow-scrolling: touch; max-height: 56vh; }
.psrow { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; align-items: stretch; opacity: .6; } .psrow.reached { opacity: 1; }
.pnum { display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.08); font-weight: 900; }
.psrow.reached .pnum { background: var(--amber); color: #2a1f05; }
.pcell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: var(--text); font-size: 12.5px; font-weight: 700; text-align: center; }
.pcell small { font-size: 10.5px; opacity: .75; } .pcell.prem { background: rgba(255, 200, 70, .08); border-color: rgba(255, 200, 70, .25); }
.pcell.can { border-color: #6fe08a; background: rgba(70, 180, 90, .2); animation: glow 1.6s infinite; } .pcell.got { opacity: .45; }
/* défense */
.dfshield { display: flex; flex-direction: column; gap: 8px; } .shrow { display: flex; gap: 8px; flex-wrap: wrap; } .shrow .btn { flex: 1; flex-direction: column; min-height: 54px; font-size: 14px; } .shrow .btn small { font-size: 11px; }
.pgitem.lost { border-color: rgba(255, 90, 79, .35); background: rgba(192, 57, 43, .1); }
.gmshop .pgsec.wide { grid-column: span 3; margin: 10px 2px 0; }
#scrDefense .panel, #scrPass .panel, #scrAlliance .panel, #scrHeroes .panel { display: flex; flex-direction: column; overflow: hidden; }
#dfLog { overflow-y: auto; -webkit-overflow-scrolling: touch; }
@keyframes glow { 50% { filter: brightness(1.3); } }
/* carte du monde */
#scrMissions .phead .tabs { flex: 0 1 220px; margin-left: auto; }
.wmap { position: relative; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; max-height: calc(100vh - 210px); }
.wmap.hidden, .levels.hidden { display: none; }
.wsvg { display: block; width: 100%; height: auto; border-radius: 16px; }
.wnodes { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 100 / 170; }
.wnode { position: absolute; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f2c14e; color: #2a1f05; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); font-weight: 900; }
.wnode b { font-size: 15px; line-height: 1; } .wnode i { font-style: normal; font-size: 8px; letter-spacing: 0; line-height: 1; margin-top: 1px; color: #6b4b10; } .wnode i .off { opacity: .35; }
.wnode.done { background: #7bd66b; } .wnode.part { background: #f2c14e; } .wnode.open { background: #fff6d8; }
.wnode.cur { box-shadow: 0 0 0 4px rgba(255, 90, 70, .7), 0 3px 8px rgba(0,0,0,.35); animation: glow 1.2s infinite; }
.wnode.locked { background: #6b6e66; color: #ddd; border-color: #9a9c95; width: 36px; height: 36px; }
.wnode.outpost { border-radius: 12px; width: 50px; height: 50px; } .wnode.outpost span { font-size: 22px; line-height: 1; }
.wnode.outpost.foe { background: #c0392b; border-color: #ffd2cc; } .wnode.outpost.held { background: #3d7a3a; border-color: #c8f5c0; }
.wnode.outpost em { font-style: normal; font-size: 9px; color: #fff; font-weight: 800; }
.wlegend { font-size: 12.5px; text-align: center; margin: 8px 0 0; color: var(--muted); }
.sbtn.sset { display: none; }
@media (max-width: 430px) {
  .topbar.compact #btnOpenSettings { display: none; }
  .topbar.compact ~ .sidemenu .sbtn.sset { display: flex; }
  .topbar.compact .stat { height: 38px; }
}
#scrGems .panel { overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (orientation: portrait), (max-width: 560px) {
  .abar { left: auto; right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 104px); flex-direction: column; flex-wrap: nowrap; max-width: none; gap: 6px; }
  .abtns { flex-direction: column; gap: 6px; }
  .abar .energy { height: 40px; padding: 0 8px; }
  .ab { width: 44px; height: 44px; }
  .abhint { bottom: auto; top: -34px; left: auto; right: 0; }
}
span.dim { opacity: .28; } .lvl .st .dim, .stars .dim, .pgitem .st .dim { opacity: 1; color: rgba(255,255,255,.2); } .wnode i .dim { opacity: .35; }
.freerow { margin: 0 0 8px; } .freerow .freecard { margin: 0; }
@media (max-width: 430px) {
  .subbar { gap: 5px; flex-wrap: nowrap; }
  .subbar .chip { padding: 0 8px; font-size: 12.5px; white-space: nowrap; }
  .subbar .chip .tlab { display: none; }
}
/* listes défilantes dans les panneaux en colonne (sinon le contenu est coupé sans défilement) */
#scrAlliance .albody, #scrHeroes .hrlist, #scrDefense #dfLog, #scrPass .pslist { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#scrPass .pslist { max-height: none; }
#scrDefense .panel { overflow-y: auto; }
/* barre du haut en bataille : tient sur un iPhone en portrait */
#bPct { white-space: nowrap; }
@media (max-width: 430px) {
  #topBattle { gap: 5px; }
  #topBattle .stat { padding: 0 9px; }
  #topBattle .stat.timer { min-width: 58px; }
  #topBattle .pill { height: 38px; padding: 0 11px; font-size: 13.5px; }
  #topBattle .pill .tlab { display: none; }
  #topBattle .pill.speed { min-width: 40px; }
  #bStars { font-size: 12px; }
}
.chip { white-space: nowrap; }
/* en ligne : réglages, discussion, dons, classement */
.netbox .row { gap: 10px; }
.netbox .inl, .inl { display: flex; gap: 6px; align-items: center; flex: 1; justify-content: flex-end; }
.inl input, .chatform input { min-width: 0; flex: 1; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--text); font: inherit; font-size: 15px; }
#lkForm { margin: 4px 0 10px; }
.netbox .code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 2px; font-size: 17px; color: var(--amber); user-select: all; -webkit-user-select: all; }
.netbox .ok { color: var(--green); font-size: 14px; }
.chatform { display: flex; gap: 6px; }
.chatform .btn { min-height: 40px; }
.msg.sys { align-self: center; background: transparent; font-size: 12px; opacity: .7; text-align: center; }
.pgitem.req { flex-wrap: wrap; border-color: rgba(110,160,255,.4); }
.pgitem .donate { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.pgitem .donate .btn { flex-direction: column; min-height: 42px; padding: 0 10px; font-size: 12.5px; } .pgitem .donate .btn small { font-size: 10.5px; opacity: .8; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #777; margin-left: 4px; vertical-align: middle; } .dot.on { background: var(--green); }
.tplist { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; min-height: 0; }
#scrTop .panel { display: flex; flex-direction: column; overflow: hidden; }
.pgitem .ic.rank { font-weight: 900; font-size: 18px; }
.netbox .stack { display: flex; flex-direction: column; gap: 6px; padding: 6px 2px 4px; }
.netbox .stack .inl { justify-content: flex-start; width: 100%; }
.netbox form .btn { flex: 0 0 auto; min-height: 40px; padding: 0 14px; }
#netWrap { margin-bottom: 6px; }
/* guide des nouveautés */
.panel.news { text-align: center; gap: 12px; display: flex; flex-direction: column; }
.nwtop { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber); }
.link { background: none; border: 0; color: var(--text); opacity: .7; font: inherit; font-size: 14px; padding: 8px; text-transform: none; letter-spacing: 0; cursor: pointer; }
.nwcard { min-height: 260px; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: nwIn .25s ease-out; }
.nwcard h3 { margin: 0; font-size: 21px; }
.nwcard p { margin: 0; font-size: 15px; line-height: 1.45; opacity: .9; }
.nwicon { font-size: 54px; width: 92px; height: 92px; display: grid; place-items: center; border-radius: 28px; background: radial-gradient(circle at 35% 30%, rgba(255,200,90,.35), rgba(255,160,40,.08)); box-shadow: inset 0 0 0 1px rgba(255,200,90,.35); }
.chip.lock, .chip.ok { font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 99px; }
.chip.lock { background: rgba(255,255,255,.08); color: var(--muted, #aaa); }
.chip.ok { background: rgba(80,200,120,.16); color: var(--green); }
.nwdots { display: flex; gap: 6px; justify-content: center; }
.nwdots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); transition: width .2s; }
.nwdots i.on { width: 20px; border-radius: 4px; background: var(--amber); }
.nwbtns { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 8px; }
.nwbtns .btn { min-height: 48px; }
#btnNews.wide { width: 100%; margin: 4px 0 8px; }
@keyframes nwIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.spot { position: relative; z-index: 5; animation: spotPulse 1.1s ease-in-out 5; }
@keyframes spotPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,190,60,0); } 50% { box-shadow: 0 0 0 6px rgba(255,190,60,.75); } }
@media (prefers-reduced-motion: reduce) { .nwcard, .spot { animation: none; } .spot { box-shadow: 0 0 0 4px rgba(255,190,60,.75); } }
.nwbtns #nwGo.hidden + #nwNext { grid-column: span 2; }
