/* ---------- Astrelyne — thème brun sombre & or ---------- */
:root {
  --bg: #1a1210;
  --panel: #2a1c15;
  --panel-2: #3a281c;
  --gold: #e8b64c;
  --gold-2: #f8dc8a;
  --gold-dark: #8a5a1c;
  --text: #f6e9d2;
  --muted: #b89c7a;
  --green: #5ec24b;
  --red: #ff5b5b;
  --font-title: 'Cinzel', Georgia, serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-body); font-weight: 600;
  overflow: hidden; user-select: none;
}
button { font-family: inherit; font-weight: 800; cursor: pointer; }
canvas { display: block; }

/* ---------- barre du haut ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; height: 58px; z-index: 20;
  display: flex; align-items: center; gap: 22px; padding: 0 18px;
  background: linear-gradient(#3b2416, #24160f); border-bottom: 2px solid #5a3a1c;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
}
body.in-battle #topbar { transform: translateY(-100%); transition: transform .3s; }
.logo { font-family: var(--font-title); font-weight: 800; font-size: 20px; letter-spacing: 1px; color: var(--gold-2); text-shadow: 0 2px 0 #6b3d0b, 0 0 14px rgba(255,190,80,.4); }
.logo span { color: #fff; }
.player { display: flex; align-items: center; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(232,182,76,.5); }
.pname { font-size: 13px; color: var(--gold-2); }
.plevel { font-size: 12px; color: var(--muted); }
.resources { margin-left: auto; display: flex; gap: 12px; }
.res {
  display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px; border-radius: 20px;
  background: linear-gradient(#1a100a, #120b07); border: 1px solid #5a3a1c; font-size: 15px; color: #fff;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.6);
}
.res small { color: var(--muted); font-size: 11px; }
.mute-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #5a3a1c; background: linear-gradient(#1a100a, #120b07); font-size: 16px; color: #fff; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.mute-btn:hover { border-color: var(--gold); }
#btn-help { font-family: var(--font-title); font-weight: 800; color: var(--gold-2); }
.res i, .ic { display: inline-block; width: 18px; height: 18px; vertical-align: middle; border-radius: 50%; }
.res.gem i, .ic.gem { background: radial-gradient(circle at 35% 30%, #c8ffd0, #21d05a 45%, #0a7a2c); clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); border-radius: 0; }
.res.gold i, .ic.gold { background: radial-gradient(circle at 35% 30%, #fff3b0, #f2b830 50%, #9a6a10); box-shadow: inset 0 0 0 2px rgba(0,0,0,.2); }
.res.matter i, .ic.matter { background: linear-gradient(135deg, #e6fbff, #7cf3ff 35%, #9c6bff 75%, #4a1fa8); clip-path: polygon(50% 0, 88% 22%, 88% 78%, 50% 100%, 12% 78%, 12% 22%); border-radius: 0; }
.loot.matter { border-color: #7cf3ff; }
.res.energy i, .ic.energy { background: radial-gradient(circle at 35% 30%, #d8f4ff, #3cb9ff 50%, #0c5fa8); clip-path: polygon(60% 0, 20% 55%, 45% 55%, 40% 100%, 80% 45%, 55% 45%); border-radius: 0; }

/* ---------- écrans ---------- */
.screen { position: fixed; inset: 58px 0 0 0; display: none; }
.screen.show { display: block; }
#screen-battle { inset: 0; }
.panel-screen { display: none; align-items: center; justify-content: center; padding: 18px;
  background: radial-gradient(ellipse at 50% 30%, #3a2618, #140d09 70%); }
.panel-screen.show { display: flex; }

.panel {
  position: relative; width: min(1100px, 100%); max-height: 100%; overflow: auto;
  background: linear-gradient(#3a2718, #241811); border: 3px solid var(--gold-dark); border-radius: 12px;
  box-shadow: 0 0 0 2px #3a2311, 0 0 0 5px var(--gold-dark), 0 20px 60px rgba(0,0,0,.7), inset 0 0 60px rgba(0,0,0,.5);
  padding: 22px 26px 26px;
}
.panel::before, .panel::after {
  content: ''; position: absolute; top: -8px; width: 60px; height: 10px; background: var(--gold); border-radius: 4px;
  box-shadow: 0 0 10px rgba(255,200,90,.6);
}
.panel::before { left: 40px; } .panel::after { right: 40px; }
.panel-title {
  font-family: var(--font-title); font-weight: 800; font-size: 26px; text-align: center; color: var(--gold-2);
  text-shadow: 0 2px 0 #4b2a0a, 0 0 18px rgba(255,190,80,.35); letter-spacing: 1px; margin-bottom: 6px;
}
.panel-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.panel-sub b { color: var(--gold-2); }
.close {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--gold); background: radial-gradient(circle at 40% 35%, #f8dc8a, #b8802a); color: #3b2210; font-size: 18px;
  box-shadow: 0 3px 8px rgba(0,0,0,.5);
}
.close:hover { filter: brightness(1.15); }

/* boutons */
.btn {
  padding: 12px 24px; border-radius: 10px; border: 2px solid #1b5c14; color: #fff; font-size: 16px;
  background: linear-gradient(#7dd65f, #3f9a2c 60%, #2e7a20); text-shadow: 0 1px 2px rgba(0,0,0,.6);
  box-shadow: 0 4px 0 #1e4d15, 0 6px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1e4d15; }
.btn:disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; transform: none; }
.btn.gold-btn { background: linear-gradient(#ffe08a, #e1a23a 60%, #a86f16); border-color: #6b4310; box-shadow: 0 4px 0 #6b4310, 0 6px 14px rgba(0,0,0,.4); color: #3b2210; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.btn.gem-btn { background: linear-gradient(#a7f0c0, #26b45a 60%, #147a3c); }
.btn .ic { width: 16px; height: 16px; }
.btn.ghost-btn { background: linear-gradient(#4a3a2a, #2a1c12); border-color: #5a3a1c; box-shadow: 0 4px 0 #1a100a, 0 6px 14px rgba(0,0,0,.4); color: var(--muted); }

.stars .star { color: #4a3a2a; font-size: 16px; text-shadow: none; }
.stars .star.on { color: #ffd54f; text-shadow: 0 0 6px rgba(255,200,60,.8); }

/* ---------- HUB ---------- */
#hub-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-buildings { position: absolute; inset: 0; pointer-events: none; }
.building {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; background: none; border: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff;
}
.building label {
  padding: 5px 16px; border-radius: 8px; background: linear-gradient(#5a3a1e, #2c1a0d); border: 2px solid var(--gold);
  font-size: 15px; text-shadow: 0 1px 2px #000; box-shadow: 0 3px 10px rgba(0,0,0,.6); cursor: pointer;
}
.building:hover label { filter: brightness(1.2); }
.building:hover .portal, .building:hover .arena-icon, .building:hover .altar { transform: scale(1.08); }
.portal {
  width: 110px; height: 140px; border-radius: 55px 55px 12px 12px; transition: transform .2s;
  background: radial-gradient(ellipse at 50% 60%, #dff6ff, #37b6ff 30%, #0d47a1 70%, #072b5e);
  border: 6px solid #d7a94a; box-shadow: 0 0 40px 8px rgba(60,180,255,.7), inset 0 0 30px rgba(255,255,255,.6);
  animation: pulse 2.4s ease-in-out infinite;
}
.arena-icon {
  width: 120px; height: 90px; border-radius: 60px 60px 8px 8px; transition: transform .2s;
  background: radial-gradient(circle at 50% 80%, #ff9800, #c62828 60%, #4a0d0d);
  border: 6px solid #d7a94a; box-shadow: 0 0 34px 6px rgba(255,120,40,.6); position: relative;
}
.arena-icon::after { content: '⚔'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; color: #ffe0b2; text-shadow: 0 2px 6px #000; }
.altar {
  width: 100px; height: 100px; border-radius: 50%; transition: transform .2s;
  background: radial-gradient(circle at 50% 40%, #fff6c8, #ffc107 35%, #7c4dff 75%, #2a1050);
  border: 6px solid #d7a94a; box-shadow: 0 0 40px 10px rgba(255,200,60,.6); animation: pulse 3s ease-in-out infinite;
}
.planet-icon {
  width: 104px; height: 104px; border-radius: 50%; transition: transform .2s; position: relative;
  background: radial-gradient(circle at 35% 30%, #e6fbff, #7cf3ff 22%, #7b5aa6 60%, #2a1a48);
  border: 6px solid #d7a94a; box-shadow: 0 0 36px 8px rgba(124,243,255,.5); animation: pulse 3.4s ease-in-out infinite;
}
.planet-icon::after { content: ''; position: absolute; left: -26px; right: -26px; top: 42%; height: 16px; border-radius: 50%; border: 4px solid rgba(255,230,160,.8); transform: rotate(-14deg); }
.building:hover .planet-icon { transform: scale(1.08); }
@keyframes pulse { 50% { filter: brightness(1.25); } }
.hub-team { position: absolute; inset: 0; pointer-events: none; }
.hub-hero { position: absolute; width: 100px; height: 160px; background: none; border: 0; border-radius: 50px; pointer-events: auto; cursor: pointer; }
.hub-hero:hover { background: radial-gradient(ellipse at 50% 90%, rgba(255,220,120,.35), rgba(255,220,120,0) 70%); }
.hub-nav {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 10px;
  padding: 8px 14px; border-radius: 16px; background: linear-gradient(#4a3320, #24160f); border: 2px solid var(--gold-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 86px; padding: 6px 0 4px; border-radius: 10px;
  border: 2px solid transparent; background: none; color: var(--text); font-size: 12px; transition: background .15s, transform .1s;
}
.nav-btn:hover { background: rgba(255,200,90,.12); border-color: var(--gold); transform: translateY(-2px); }
.ni { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 3px 8px rgba(0,0,0,.6); display: grid; place-items: center; font-style: normal; font-size: 22px; }
.ni.heroes   { background: radial-gradient(circle at 40% 35%, #8ec5ff, #1e5bb8); }
.ni.heroes::after   { content: '⚔'; }
.ni.campaign { background: radial-gradient(circle at 40% 35%, #b6ff9a, #2e7d32); }
.ni.campaign::after { content: '🗺'; }
.ni.summon   { background: radial-gradient(circle at 40% 35%, #ffe57f, #7c4dff); }
.ni.summon::after   { content: '✦'; }
.ni.arena    { background: radial-gradient(circle at 40% 35%, #ffab91, #b71c1c); }
.ni.arena::after    { content: '🏆'; }
.ni.planet   { background: radial-gradient(circle at 40% 35%, #b9f6ff, #6a4a8c); }
.ni.planet::after   { content: '🪐'; }
.ni.players  { background: radial-gradient(circle at 40% 35%, #b3e5fc, #283593); }
.ni.players::after  { content: '🌌'; }
.ni.replays  { background: radial-gradient(circle at 40% 35%, #f8bbd0, #6a1b9a); }
.ni.replays::after  { content: '🎬'; }

/* ---------- HÉROS ---------- */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.hero-card {
  position: relative; display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(#2a1a10, #1b110b); border: 2px solid #5a3a1c; transition: transform .15s, border-color .15s;
}
.hero-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.hero-card.in-team { border-color: #4caf50; box-shadow: 0 0 14px rgba(76,175,80,.35); }
.hero-card.locked { filter: grayscale(1) brightness(.55); cursor: default; }
.hc-portrait { position: relative; flex: 0 0 96px; border-radius: 10px; overflow: hidden; border: 3px solid var(--gold-dark); box-shadow: 0 4px 10px rgba(0,0,0,.6); }
.hc-portrait .lvl { position: absolute; top: 4px; left: 4px; background: #2e7d32; border: 2px solid #9ccc65; color: #fff; font-size: 13px; border-radius: 6px; padding: 0 6px; }
.hc-name { font-size: 18px; color: #fff; }
.hc-class { font-size: 13px; }
.hc-power { font-size: 14px; color: var(--gold-2); margin-top: 4px; }
.hc-lock { font-size: 12px; color: var(--muted); }
.badge { position: absolute; top: 8px; right: 8px; background: #2e7d32; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid #9ccc65; }

.panel-detail { width: min(860px, 100%); }
.hd-body { display: flex; gap: 26px; flex-wrap: wrap; }
.hd-portrait { flex: 0 0 260px; height: 300px; border-radius: 12px; background: radial-gradient(ellipse at 50% 80%, #4a3220, #1a110b 70%); border: 2px solid var(--gold-dark); box-shadow: inset 0 0 40px rgba(0,0,0,.6); }
.hd-stats { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.hd-class { font-size: 15px; color: var(--muted); }
.hd-desc { color: var(--muted); font-style: italic; font-size: 14px; }
.stat-row { display: grid; grid-template-columns: 80px 1fr 60px; align-items: center; gap: 10px; font-size: 14px; }
.stat-row i { display: block; height: 10px; border-radius: 5px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.stat-row b { text-align: right; color: #fff; }
.hd-ult { background: rgba(0,0,0,.3); padding: 10px 12px; border-radius: 8px; font-size: 14px; border-left: 3px solid var(--gold); }
.hd-actions { display: flex; gap: 12px; margin-top: auto; flex-wrap: wrap; }

/* ---------- CAMPAGNE ---------- */
.panel-map { width: min(1150px, 100%); }
.chapter-nav { display: flex; justify-content: center; align-items: center; gap: 18px; margin-bottom: 10px; }
.arrow { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); background: #3a2718; color: var(--gold-2); font-size: 24px; line-height: 1; }
.arrow:disabled { opacity: .3; cursor: default; }
.chapter-stars { color: #ffd54f; font-size: 18px; }
.map { position: relative; width: 100%; aspect-ratio: 2.1; min-height: 340px; border-radius: 12px; overflow: hidden; border: 3px solid var(--gold-dark); box-shadow: inset 0 0 60px rgba(0,0,0,.6); }
/* Chaque galaxie : espace noir teinté par sa nébuleuse */
#map-canvas { position: absolute; inset: 0; }
#map-nodes { position: absolute; inset: 0; }
.node {
  position: absolute; transform: translate(-50%, -50%); background: none; border: 0; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s;
}
.node canvas { width: 64px; height: 64px; border-radius: 50%; }
.node.boss canvas { width: 84px; height: 84px; }
.node label { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.55); white-space: nowrap; cursor: pointer; }
.node:hover { transform: translate(-50%, -50%) scale(1.08); }
.node.locked { filter: grayscale(.9) brightness(.75); opacity: .55; cursor: default; }
.node.locked:hover { transform: translate(-50%, -50%); }
.node.next canvas { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 26px 8px rgba(255,220,90,.7); } }

/* ---------- HISTOIRE DE LA PLANÈTE ---------- */
#screen-story { inset: 0; background: #020208; }
#story-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.story-box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  padding: 26px 34px 24px; border-radius: 14px;
  background: linear-gradient(rgba(20,12,8,.92), rgba(10,6,4,.94)); border: 2px solid var(--gold-dark);
  box-shadow: 0 0 0 4px rgba(0,0,0,.4), 0 30px 80px rgba(0,0,0,.8), inset 0 0 60px rgba(0,0,0,.5);
  animation: storyIn .5s ease-out;
}
@keyframes storyIn { from { opacity: 0; transform: translate(-50%, -46%); } }
.story-head { display: flex; align-items: center; gap: 22px; margin-bottom: 14px; }
#story-planet { width: 110px; height: 110px; flex: none; }
.story-galaxy { font-size: 13px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.story-title { font-family: var(--font-title); font-weight: 800; font-size: 34px; color: var(--gold-2); text-shadow: 0 2px 0 #4b2a0a, 0 0 18px rgba(255,190,80,.35); }
.story-text { font-size: 17px; line-height: 1.75; font-weight: 600; color: var(--text); min-height: 120px; }
.story-text p { margin: 0 0 4px; opacity: 0; transform: translateY(6px); transition: opacity .6s, transform .6s; }
.story-text p.on { opacity: 1; transform: none; }
.story-text p:last-child.on { color: var(--gold-2); font-style: italic; }
.story-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; position: sticky; bottom: -24px; padding: 12px 0; background: linear-gradient(rgba(12,7,5,0), rgba(12,7,5,.96) 35%); }

/* ---------- CARTE DE L'UNIVERS ---------- */
.map.universe { background: radial-gradient(ellipse at 50% 50%, #120a2a, #05030f 60%, #000); aspect-ratio: 2.2; }
#universe-canvas, #universe-nodes { position: absolute; inset: 0; }
.gnode {
  position: absolute; transform: translate(-50%, -50%); background: none; border: 0; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 0; transition: transform .2s;
}
.gnode canvas { width: 190px; height: 190px; animation: spin 90s linear infinite; }
.gnode:nth-child(even) canvas { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.gnode .gname { font-family: var(--font-title); font-weight: 800; font-size: 16px; color: var(--gold-2); text-shadow: 0 0 10px #000, 0 2px 0 #000; margin-top: -34px; white-space: nowrap; }
.gnode .gstars { font-size: 13px; color: #ffd54f; text-shadow: 0 0 8px #000; }
.gnode .gstars.done { color: #7CFC98; }
.gnode:hover { transform: translate(-50%, -50%) scale(1.08); }
.gnode.locked { filter: grayscale(1) brightness(.55); cursor: default; }
.gnode.locked:hover { transform: translate(-50%, -50%); }
.gnode.locked .gstars { color: var(--muted); }
.gnode.current .gname { color: #fff; }
.btn.small { padding: 6px 14px; font-size: 13px; }
/* ---------- REPLAYS ---------- */
.panel-replays { width: min(900px, 100%); }
.replay-opt { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; cursor: pointer; }
.replay-opt input { accent-color: var(--gold); width: 16px; height: 16px; }
.replay-player { display: none; margin: 0 auto 14px; max-width: 720px; border-radius: 12px; overflow: hidden; border: 3px solid var(--gold-dark); background: #000; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.replay-player.show { display: block; }
.replay-player video { display: block; width: 100%; }
.replay-list { display: flex; flex-direction: column; gap: 8px; }
.modal-top { z-index: 40; }
.replay-box { width: min(900px, 100%); }
.replay-box .replay-player { margin: 8px 0 0; max-width: none; }
.replay-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px;
  background: linear-gradient(#2a1c12, #1c120c); border: 2px solid var(--gold-dark); border-left-width: 6px;
}
.replay-row.win { border-left-color: var(--green); }
.replay-row.lose { border-left-color: var(--red); }
.replay-row.current { background: rgba(255,200,90,.12); border-color: var(--gold); }
.replay-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.replay-info b { color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replay-info small { color: var(--muted); font-size: 12px; }
.replay-result { min-width: 80px; text-align: center; font-size: 14px; }
.replay-result .lose { color: var(--red); font-weight: 800; }
.replay-row .btn.small { padding: 5px 12px; font-size: 13px; }
.panel-replays .hint { text-align: center; color: var(--muted); }

/* ---------- AIDE ---------- */
.panel-help { width: min(1000px, 100%); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.help-card {
  padding: 14px 16px; border-radius: 12px; background: linear-gradient(#2a1c12, #1c120c);
  border: 2px solid var(--gold-dark); box-shadow: inset 0 0 30px rgba(0,0,0,.4);
}
.help-card h3 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-family: var(--font-title); font-weight: 800;
  font-size: 17px; color: var(--gold-2); text-shadow: 0 2px 0 #4b2a0a;
}
.help-card h3 .ni { width: 34px; height: 34px; font-size: 16px; flex: 0 0 auto; }
.help-card p, .help-card ul { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--text); }
.help-card p:last-child, .help-card ul:last-child { margin-bottom: 0; }
.help-card ul { padding-left: 18px; }
.help-card b { color: var(--gold-2); }
.help-card .ic { width: 15px; height: 15px; margin: 0 1px; }
.cls-tank { color: #4fa3ff; font-weight: 800; }
.cls-guerrier { color: #ff7043; font-weight: 800; }
.cls-archer { color: #8bc34a; font-weight: 800; }
.cls-mage { color: #b388ff; font-weight: 800; }
.cls-soigneur { color: #ffd54f; font-weight: 800; }

@media (max-width: 700px) { .gnode canvas { width: 96px; height: 96px; } .gnode .gname { font-size: 12px; margin-top: -10px; } }

/* ---------- INVOCATION ---------- */
.panel-summon { width: min(900px, 100%); }
.summon-body { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; justify-content: center; }
#summon-canvas { border-radius: 50%; background: radial-gradient(circle, #2a1a30, #120b10 70%); border: 3px solid var(--gold-dark); }
.summon-text { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.summon-text p { color: var(--muted); font-size: 15px; margin: 0; }
.summon-result { min-height: 48px; font-size: 17px; }

/* ---------- MODALES ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.65); backdrop-filter: blur(3px); padding: 16px; }
.modal.show { display: flex; }
.modal-box {
  position: relative; width: min(680px, 100%); padding: 22px 26px 24px; border-radius: 12px;
  background: linear-gradient(#3a2718, #241811); border: 3px solid var(--gold-dark);
  box-shadow: 0 0 0 2px #3a2311, 0 0 0 5px var(--gold-dark), 0 20px 60px rgba(0,0,0,.8);
  animation: pop .25s ease-out;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.stage-stars { text-align: center; font-size: 22px; }
.stage-desc { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0 14px; }
.row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 8px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px solid #4a3018; }
.row > label { flex: 0 0 90px; color: var(--muted); font-size: 14px; }
.unit-row, .loot-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; }
.chip canvas { border-radius: 8px; border: 2px solid var(--gold-dark); }
.chip span { position: absolute; top: -6px; left: -6px; background: #1b5e20; color: #fff; font-size: 11px; border-radius: 6px; padding: 0 5px; border: 1px solid #8bc34a; }
.loot { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 16px; background: rgba(0,0,0,.4); border: 1px solid #5a3a1c; color: #fff; }
.loot-row.big .loot { font-size: 20px; padding: 8px 18px; }
.loot-row.big .ic { width: 24px; height: 24px; }
.hint { color: var(--muted); font-size: 14px; }
.stage-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.req { font-size: 16px; }
.req-missing { color: #ffb74d; font-size: 14px; }
.arena-rank { font-size: 15px; color: var(--gold-2); }

.result-box { text-align: center; width: min(520px, 100%); }
.result-title { font-family: var(--font-title); font-size: 40px; font-weight: 800; margin-bottom: 8px; }
.result-title.win { color: #ffd54f; text-shadow: 0 0 20px rgba(255,200,60,.7), 0 3px 0 #6b3d0b; }
.result-title.lose { color: #ff6b6b; text-shadow: 0 0 20px rgba(255,60,60,.5); }
.result-stars { font-size: 36px; margin-bottom: 10px; }
.result-stars .star { font-size: 36px; }
.result-loot { justify-content: center; margin-bottom: 18px; }
.result-actions { display: flex; gap: 12px; justify-content: center; }

/* XP */
.ic.xp { background: radial-gradient(circle at 35% 30%, #e8dcff, #9c6bff 50%, #4a1fa8); }
.hc-xp { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.hc-xp small { font-size: 11px; color: #b388ff; white-space: nowrap; }
.xpbar { height: 5px; border-radius: 3px; background: #1a0e08; overflow: hidden; width: 90px; }
.grid-section { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; margin-top: 6px; padding-bottom: 4px; border-bottom: 1px solid #5a3a1c; }
.grid-section b { font-family: var(--font-title); color: var(--gold-2); font-size: 17px; }
.grid-section span { color: var(--muted); font-size: 13px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #7c4dff, #b388ff); }
.loot.xp { border-color: #7c4dff; }
.levelups { width: 100%; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.levelups span { color: #ffd54f; font-size: 15px; text-shadow: 0 0 8px rgba(255,200,60,.6); animation: pop .4s ease-out; }

/* ---------- COMBAT ---------- */
#battle-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.battle-hud { position: absolute; inset: 0; pointer-events: none; }
.waves { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.flag { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: #777; background: radial-gradient(circle, #3a2a20, #1a110b); border: 2px solid #5a3a1c; }
.flag.cur { color: #ff5252; border-color: #ff5252; box-shadow: 0 0 14px rgba(255,60,40,.7); }
.flag.done { color: #ffd54f; }
.timer { position: absolute; top: 20px; right: 110px; font-size: 26px; color: #fff; text-shadow: 0 2px 4px #000; }
.timer.fatigue { color: #ffb74d; }   /* fatigue : les soins s'estompent */
.battle-side { position: absolute; right: 18px; bottom: 26px; display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.round-btn { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #6b4a1e; background: radial-gradient(circle at 40% 35%, #4a3320, #1a110b); color: #ddd; font-size: 15px; box-shadow: 0 4px 10px rgba(0,0,0,.6); }
.round-btn.auto.on { background: radial-gradient(circle at 40% 35%, #8bd96f, #2e7d32); border-color: #cfff9a; color: #fff; }
.portraits { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; }
.portrait { position: relative; width: 84px; padding: 5px; border-radius: 10px; background: linear-gradient(#4a3320, #1a110b); border: 2px solid var(--gold-dark); cursor: pointer; transition: transform .1s; }
.portrait canvas { width: 72px; height: 72px; border-radius: 6px; }
.portrait .hpbar, .portrait .enbar { height: 6px; margin-top: 4px; border-radius: 3px; background: #1a0e08; overflow: hidden; }
.portrait .enbar { height: 4px; margin-top: 3px; }
.portrait .hpbar i { display: block; height: 100%; background: linear-gradient(#8cf07a, #43a047); transition: width .15s; }
.portrait .enbar i { display: block; height: 100%; background: linear-gradient(#ffe57f, #ffb300); transition: width .15s; }
.portrait .ultbadge { display: none; position: absolute; top: -10px; right: -6px; background: #ffb300; color: #3b2210; font-size: 10px; padding: 1px 6px; border-radius: 8px; border: 1px solid #fff3c0; }
.portrait.ready { border-color: #ffd54f; box-shadow: 0 0 18px rgba(255,200,60,.9); animation: glow 1s ease-in-out infinite; }
.portrait.ready .ultbadge { display: block; }
.portrait.ready:hover { transform: translateY(-4px); }
.portrait.dead { filter: grayscale(1) brightness(.5); cursor: default; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; top: 80px; transform: translate(-50%, -20px); z-index: 50; opacity: 0; pointer-events: none;
  padding: 10px 22px; border-radius: 10px; background: #2a1c15; border: 2px solid var(--gold); color: #fff; font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6); transition: all .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: var(--red); }
#toast.good { border-color: var(--green); }

@media (max-width: 700px) {
  #topbar { gap: 10px; padding: 0 10px; }
  .logo { display: none; }
  .res { padding: 3px 10px 3px 5px; font-size: 13px; }
  .panel { padding: 16px 12px 18px; }
  .timer { right: 90px; font-size: 20px; }
  .portrait { width: 62px; } .portrait canvas { width: 50px; height: 50px; }
  .battle-side { bottom: 100px; }
}

/* ---------- PLANÈTE ---------- */
#planet-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#planet-plots { position: absolute; inset: 0; }
.plot {
  position: absolute; transform: translate(-50%, -88%); background: none; border: 0; border-radius: 40%; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.plot label {
  transform: translateY(calc(40px * var(--s, 1))); padding: 3px 12px; border-radius: 8px; background: rgba(20,12,36,.8); border: 1px solid #7b5aa6;
  font-size: 13px; white-space: nowrap; cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,.5);
}
.plot label small { color: #7cf3ff; }
.plot.empty label { color: #b9f6ff; border-style: dashed; }
.plot:hover { background: radial-gradient(ellipse at 50% 85%, rgba(124,243,255,.22), rgba(124,243,255,0) 65%); }
.plot:hover label { border-color: #7cf3ff; }
.stock {
  position: absolute; top: -6px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 16px;
  background: linear-gradient(#2e7d32, #1b5e20); border: 2px solid #9ccc65; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.5);
  animation: bob 1.6s ease-in-out infinite; cursor: pointer;
}
.stock.full { background: linear-gradient(#ff8f00, #c43e00); border-color: #ffe082; }
.stock .ic { width: 16px; height: 16px; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.planet-head {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
  padding: 8px 10px 8px 18px; border-radius: 14px; background: rgba(20,12,36,.75); border: 2px solid #7b5aa6; box-shadow: 0 6px 20px rgba(0,0,0,.5);
  max-width: calc(100% - 90px);
}
.planet-info { display: flex; flex-direction: column; min-width: 0; }
.planet-info b { font-family: var(--font-title); font-size: 20px; color: var(--gold-2); white-space: nowrap; }
.planet-info span { font-size: 12px; color: #b9a6d8; }
#screen-planet > .close { top: 16px; right: 16px; }
.plot-box { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.build-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.build-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px 14px; border-radius: 12px; text-align: center;
  background: linear-gradient(#2a1c30, #16101e); border: 2px solid #5a3a6c;
}
.build-card canvas { width: 150px; height: 130px; }
.build-card b { font-family: var(--font-title); font-size: 18px; color: var(--gold-2); }
.build-card span { font-size: 13px; color: var(--muted); min-height: 36px; }
.build-card small { font-size: 13px; color: #b9f6ff; }
.build-card .btn { margin-top: 4px; }
.plot-detail { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.plot-detail canvas { width: 220px; height: 190px; border-radius: 12px; background: radial-gradient(ellipse at 50% 80%, #3a2a5a, #140d20 70%); border: 2px solid var(--gold-dark); flex: none; margin: 0 auto; }
.plot-stats { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.plot-stats .row { margin: 0; }
.next-rate { color: var(--green); }
.full-tag { color: #ffb74d; }

/* ---------- COMPTE ---------- */
#player-box { cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 26px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
#player-box:hover { background: rgba(255,200,90,.08); border-color: #5a3a1c; }
#player-box.online .avatar { border-color: var(--green); box-shadow: 0 0 10px rgba(94,194,75,.6); }
.account-box { width: min(460px, 100%); }
.acc-tabs { display: flex; gap: 6px; margin: 6px 0 14px; padding: 4px; border-radius: 10px; background: rgba(0,0,0,.35); }
.acc-tabs button { flex: 1; padding: 8px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: 14px; }
.acc-tabs button.on { background: linear-gradient(#5a3a1e, #3a2412); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gold-dark); }
.acc-form { display: flex; flex-direction: column; gap: 12px; }
.acc-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.acc-form input {
  padding: 11px 12px; border-radius: 8px; border: 2px solid #5a3a1c; background: #140d09; color: var(--text);
  font: 700 16px var(--font-body); user-select: text; outline: none;
}
.acc-form input:focus { border-color: var(--gold); }
.acc-form small { color: var(--muted); font-size: 12px; }
.acc-form .btn { margin-top: 4px; }
.acc-msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: rgba(0,0,0,.35); border-left: 3px solid var(--gold); user-select: text; }
.acc-msg.bad { border-left-color: var(--red); }
.acc-msg.good { border-left-color: var(--green); }
.acc-msg a { color: #7cf3ff; }
.linkbtn { background: none; border: 0; padding: 0; color: #7cf3ff; text-decoration: underline; font-size: 14px; }
.acc-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid #5a3a1c; margin: 6px 0 10px; }
.acc-card div { display: flex; flex-direction: column; min-width: 0; }
.acc-card b { color: var(--gold-2); font-size: 17px; }
.acc-card span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.acc-online { color: var(--green) !important; white-space: nowrap; }
.acc-actions { display: flex; justify-content: center; }
.acc-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-save {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: 10px; text-align: center;
  background: linear-gradient(#2a1c12, #1c120c); border: 2px solid var(--gold-dark); color: var(--text);
}
.acc-save:hover { border-color: var(--gold); }
.acc-save b { color: var(--gold-2); font-family: var(--font-title); }
.acc-save span { font-size: 14px; }
.acc-save small { font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 480px) { .acc-choice { grid-template-columns: 1fr; } }

/* ---------- MOBILE ---------- */
@media (max-width: 700px) {
  .hub-nav { left: 8px; right: 8px; transform: none; justify-content: space-around; gap: 2px; padding: 6px 4px; bottom: 8px; }
  .nav-btn { width: auto; flex: 1; min-width: 0; font-size: 10px; padding: 4px 0 2px; }
  .ni { width: 36px; height: 36px; font-size: 17px; }
  .building { transform: translate(-50%, -50%) scale(.62); }
  .building label { font-size: 17px; }
  .building[data-go=universe] { left: 20% !important; top: 26% !important; }
  .building[data-go=arena]    { left: 78% !important; top: 24% !important; }
  .building[data-go=summon]   { left: 28% !important; top: 52% !important; }
  .building[data-go=planet]   { left: 74% !important; top: 50% !important; }
}
@media (max-width: 480px) {
  #topbar { gap: 6px; padding: 0 6px; }
  .pinfo { display: none; }
  #player-box { padding: 2px; }
  .avatar { width: 38px; height: 38px; }
  .resources { gap: 4px; }
  .res { padding: 2px 7px 2px 3px; font-size: 12px; gap: 4px; }
  .res i { width: 15px; height: 15px; }
  .res small { display: none; }
  .mute-btn { width: 30px; height: 30px; font-size: 13px; }
}
/* paysage sur téléphone : peu de hauteur */
@media (max-height: 500px) {
  .building { transform: translate(-50%, -50%) scale(.5); }
  .hub-nav { bottom: 6px; padding: 4px 8px; }
  .nav-btn { width: 64px; font-size: 10px; padding: 2px 0; }
  .ni { width: 32px; height: 32px; font-size: 15px; }
}
@media (max-width: 700px) {
  .panel-title { font-size: 20px; padding: 0 34px; }
  .close { width: 32px; height: 32px; font-size: 15px; top: 8px; right: 8px; }
  .modal-box { padding: 16px 14px 18px; }
  .story-box { padding: 18px 16px 16px; }
  .story-title { font-size: 26px; }
  .story-text { font-size: 15px; line-height: 1.6; }
  #story-planet { width: 80px; height: 80px; }
}
@media (max-width: 560px) {
  .map, .map.universe { aspect-ratio: .62; min-height: 0; }
}
/* combat en paysage sur téléphone : HUD compact */
@media (max-height: 500px) {
  .portrait { width: 58px; padding: 3px; } .portrait canvas { width: 50px; height: 50px; }
  .portraits { bottom: 8px; gap: 6px; }
  .round-btn { width: 46px; height: 46px; font-size: 12px; }
  .battle-side { bottom: 10px; right: 10px; gap: 6px; }
  .waves { top: 8px; } .flag { width: 32px; height: 32px; font-size: 15px; }
  .timer { top: 10px; font-size: 18px; right: 70px; }
}
/* téléphone en portrait : conseil de rotation pendant le combat */
@media (orientation: portrait) and (max-width: 700px) {
  #screen-battle::after {
    content: '⟳ Tourne ton téléphone pour mieux voir le combat'; position: absolute; left: 50%; top: 70px; transform: translateX(-50%);
    width: max-content; max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 10px; background: rgba(0,0,0,.7); border: 1px solid var(--gold-dark);
    color: var(--gold-2); font-size: 13px; text-align: center; pointer-events: none; animation: hintOut 6s forwards;
  }
}
@keyframes hintOut { 0%, 75% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (max-width: 700px), (max-height: 500px) {
  .planet-head { top: 8px; gap: 8px; padding: 6px 6px 6px 12px; max-width: calc(100% - 70px); left: 12px; transform: none; }
  .planet-info b { font-size: 16px; }
  .planet-info span { font-size: 11px; }
  #screen-planet > .close { top: 10px; right: 10px; }
}

/* ---------- LIENS LÉGAUX ---------- */
.legal-links { position: absolute; right: 12px; bottom: 6px; font-size: 11px; color: rgba(246,233,210,.55); pointer-events: auto; }
.legal-links a, .help-legal a, .acc-legal a, .acc-check a { color: #b9a6d8; }
.legal-links a:hover, .help-legal a:hover { color: var(--gold-2); }
.help-legal { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.acc-legal { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.linkbtn.danger { color: #ff8a80; }
.acc-check { flex-direction: row !important; align-items: flex-start; gap: 8px !important; font-size: 13px !important; line-height: 1.45; cursor: pointer; }
.acc-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--gold); flex: none; }
.btn.danger-btn { background: linear-gradient(#ff8a65, #d84315 60%, #a32a0b); border-color: #6b1a05; box-shadow: 0 4px 0 #6b1a05, 0 6px 14px rgba(0,0,0,.4); }
@media (max-width: 1100px) { .legal-links { display: none; } }

/* ---------- REPLAY EN COURS ---------- */
.replay-badge, .replay-exit { display: none; }
body.replay-mode .replay-badge {
  display: block; position: absolute; top: 18px; left: 18px; padding: 6px 14px; border-radius: 10px; pointer-events: none;
  background: rgba(106,27,154,.85); border: 2px solid #ce93d8; color: #fff; font-size: 15px; letter-spacing: 1px; text-transform: uppercase;
}
body.replay-mode .replay-exit { display: grid; place-items: center; position: absolute; top: 60px; left: 18px; pointer-events: auto; width: 48px; height: 48px; font-size: 18px; }
body.replay-mode #btn-auto { opacity: .5; pointer-events: none; }
body.replay-mode .portrait { cursor: default; }
.replay-team { font-size: 12px; color: #b9a6d8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replay-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) {
  .replay-row { flex-wrap: wrap; }
  .replay-info { flex-basis: 100%; }
  .replay-actions { margin-left: auto; }
}

/* ---------- GALAXIE DES JOUEURS ---------- */
.players-icon {
  width: 104px; height: 104px; border-radius: 50%; transition: transform .2s; position: relative;
  background: radial-gradient(circle at 50% 50%, #fff 0 4%, #b3e5fc 8%, #5c6bc0 30%, #283593 55%, #0d1030 75%);
  border: 6px solid #d7a94a; box-shadow: 0 0 36px 8px rgba(120,150,255,.5); animation: pulse 3.8s ease-in-out infinite;
}
.players-icon::before, .players-icon::after { content: ''; position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
.players-icon::before { width: 8px; height: 8px; left: 18%; top: 30%; }
.players-icon::after { width: 6px; height: 6px; right: 20%; bottom: 26%; }
.building:hover .players-icon { transform: scale(1.08); }
.panel-players, .panel-player { width: min(920px, 100%); }
.players-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.players-tools input { flex: 1; min-width: 180px; padding: 10px 12px; border-radius: 8px; border: 2px solid #5a3a1c; background: #140d09; color: var(--text); font: 700 15px var(--font-body); outline: none; user-select: text; }
.players-tools input:focus { border-color: var(--gold); }
.players-sort { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(0,0,0,.35); }
.players-sort button { border: 0; background: none; color: var(--muted); padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.players-sort button.on { background: linear-gradient(#5a3a1e, #3a2412); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gold-dark); }
.players-list { display: flex; flex-direction: column; gap: 8px; }
.player-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 10px; text-align: left; width: 100%;
  background: linear-gradient(#2a1c12, #1c120c); border: 2px solid var(--gold-dark); color: var(--text); transition: border-color .15s, transform .1s;
}
.player-row:hover { border-color: var(--gold); transform: translateY(-1px); }
.player-row.me { border-color: #7cf3ff; }
.player-row .rank { width: 30px; text-align: center; font-family: var(--font-title); color: var(--gold-2); font-size: 18px; }
.player-row canvas { width: 44px; height: 44px; flex: none; }
.pl-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pl-main b { font-size: 16px; color: #fff; }
.pl-main b small { color: #7cf3ff; font-weight: 700; }
.pl-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-stats { display: flex; gap: 14px; font-size: 14px; color: var(--gold-2); white-space: nowrap; }
.player-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pstat { padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid #4a3018; display: flex; flex-direction: column; }
.pstat b { color: var(--gold-2); font-size: 18px; }
.pstat span { color: var(--muted); font-size: 12px; }
#player-team .chip { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#player-team .chip em { font-style: normal; font-size: 11px; color: var(--muted); }
.player-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
a.btn { text-decoration: none; display: inline-block; }
.video-card figcaption a { color: #7cf3ff; }
#screen-planet.visit #btn-collect-all { display: none; }
#screen-planet.visit .plot { cursor: default; }
#screen-planet.visit .plot:hover { background: none; }
.acc-public { margin: 4px 0 12px; }
@media (max-width: 600px) {
  .player-row { flex-wrap: wrap; gap: 8px; }
  .pl-stats { width: 100%; justify-content: space-between; padding-left: 42px; font-size: 13px; }
}
@media (max-width: 700px) {
  .building[data-go=players] { left: 50% !important; top: 12% !important; }
}

/* ---------- VIDÉOS DES JOUEURS ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 6px 0 14px; }
.video-card { margin: 0; border-radius: 10px; overflow: hidden; background: #0c0806; border: 2px solid var(--gold-dark); border-top-width: 4px; }
.video-card.win { border-top-color: var(--green); }
.video-card.lose { border-top-color: var(--red); }
.video-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-card figcaption { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; background: linear-gradient(#2a1c12, #1c120c); }
.video-card figcaption b { color: var(--gold-2); font-size: 14px; }
.video-card figcaption small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.video-card .lose { color: var(--red); font-weight: 800; font-size: 13px; }
#player-videos-title[hidden], #player-replays-title[hidden] { display: none; }

/* ---------- Choix de la langue (js/i18n.js) ---------- */
.lang-picker { position: relative; display: flex; align-items: center; }
.lang-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #5a3a1c; background: linear-gradient(#1a100a, #120b07); padding: 0;
  display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.lang-btn:hover { border-color: var(--gold); }
.lang-btn svg { width: 20px; height: 14px; border-radius: 2px; display: block; }
.lang-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 150px; padding: 6px; border-radius: 10px;
  background: linear-gradient(#2a1c12, #1c120c); border: 2px solid #8a5a1c; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.lang-picker.open .lang-menu { display: flex; flex-direction: column; gap: 2px; }
.lang-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: #f6e9d2;
  font: 700 14px var(--font-body, sans-serif); cursor: pointer; text-align: left; }
.lang-menu button:hover { background: rgba(255,200,90,.1); }
.lang-menu button.on { color: #f8dc8a; background: rgba(255,200,90,.14); }
.lang-menu svg { width: 22px; height: 15px; border-radius: 2px; flex: none; }
@media (max-width: 600px) { .lang-btn { width: 30px; height: 30px; } .lang-btn svg { width: 17px; height: 12px; } }

/* ---------- Bouclier et raids ---------- */
.ic.shield { background: radial-gradient(circle at 35% 30%, #e6fbff, #5ad2ff 50%, #1f6fb0); clip-path: polygon(50% 0, 95% 15%, 88% 60%, 50% 100%, 12% 60%, 5% 15%); border-radius: 0; }
.shield-btn { background: linear-gradient(#5ad2ff, #1f7fc0 60%, #16609a); border-color: #0d3f66; white-space: nowrap; }
.shield-btn.off { background: linear-gradient(#ff8a65, #c62828); border-color: #6b1a05; }
#screen-planet.visit .shield-btn { cursor: default; }
.shield-panel { display: flex; flex-direction: column; gap: 12px; }
.shield-state { margin: 0; padding: 10px 14px; border-radius: 10px; font-weight: 800; }
.shield-state.on { background: rgba(90,210,255,.12); border: 1px solid rgba(90,210,255,.5); color: #bfefff; }
.shield-state.off { background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.5); color: #ffc9c9; }
.shield-offers { display: flex; gap: 10px; flex-wrap: wrap; }
.shield-help { margin: 0; padding-left: 20px; color: #cdb8e8; font-size: 13px; line-height: 1.5; }
.shield-panel h4 { margin: 4px 0 0; font-family: var(--font-title); color: var(--gold-2); }
.raid-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.raid-log li { padding: 8px 12px; border-radius: 8px; background: rgba(0,0,0,.3); border-left: 3px solid #5ec24b; font-size: 13px; }
.raid-log li.lost { border-left-color: #ff6b6b; }
.raid-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; margin: 10px 0 4px; padding: 10px 14px;
  border-radius: 10px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.12); }
.raid-box div { display: flex; flex-direction: column; gap: 2px; min-width: 200px; flex: 1; }
.raid-box span { font-size: 13px; color: #cdb8e8; }
.pl-shield { font-size: 12px; }
.loot.stolen { box-shadow: 0 0 0 2px rgba(255,200,90,.6); }
