@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Rajdhani:wght@400;500;600;700&display=swap');

/* Thème "Sillages & Sabords" — nuit océane profonde, or vieilli, parchemin. */
:root{
  color-scheme: dark;
  --bg-deep: #061620;
  --panel: rgba(10,26,36,.72);
  --line: rgba(150,180,160,.22);
  --ink: #d9e6df;
  --ink-bright: #f3ecd9;
  --muted: #7f9aa0;
  --label: #a8c2b0;
  --gold: #d9a441;
  --gold-deep: #a5761f;
  --sea: #1f6f8f;
  --danger: #d8503f;
  --warning: #e8c34b;
  --safe: #4bb383;
  --radius: 12px;
}

*{ box-sizing: border-box; }
html,body{
  margin:0; padding:0;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: 'Rajdhani', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overscroll-behavior: none;
}
h1,h2,h3,.display{
  font-family: 'Cinzel', 'Rajdhani', serif;
  font-weight: 800;
  letter-spacing: .10em;
  margin: 0;
}

@keyframes ss-glow{
  0%,100%{ box-shadow: 0 0 12px rgba(217,164,65,.25); }
  50%    { box-shadow: 0 0 24px rgba(217,164,65,.5); }
}

.btn{
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .08em;
  border: 1px solid rgba(217,164,65,.55);
  border-radius: var(--radius);
  padding: .85rem 1.5rem;
  background: linear-gradient(160deg, rgba(217,164,65,.24), rgba(165,118,31,.32));
  color: var(--ink-bright);
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, box-shadow .2s ease;
  box-shadow: 0 0 14px rgba(217,164,65,.2);
}
.btn:hover{ filter: brightness(1.15); box-shadow: 0 0 22px rgba(217,164,65,.4); }
.btn:active{ transform: scale(.96); }
.btn.danger{
  border-color: rgba(216,80,63,.6);
  background: linear-gradient(160deg, rgba(216,80,63,.28), rgba(150,40,30,.35));
  box-shadow: 0 0 14px rgba(216,80,63,.25);
}
.btn.danger:hover{ box-shadow: 0 0 22px rgba(216,80,63,.45); }
.btn.ghost{
  background: rgba(20,40,48,.7); border-color: rgba(150,180,160,.35); color:var(--label);
  box-shadow:none;
}
.btn:disabled{ opacity:.35; pointer-events:none; }

/* ---------- TV ---------- */
.tv-wrap{
  height:100vh; width:100vw;
  display:flex; flex-direction:column;
  background: radial-gradient(1200px 700px at 50% -10%, #0c2e3f 0%, #082131 45%, #061620 100%);
  color: var(--ink);
  overflow:hidden;
}
/* Bandeau du haut = les COÛTS DE CONSTRUCTION (plus de titre, plus de vent,
 * plus de numéro de manche : rien qui ne serve une décision). */
.tv-header{
  display:flex; align-items:stretch; justify-content:center; gap:.5rem;
  padding:.45rem 1rem;
  background: rgba(10,26,36,.8);
  border-bottom: 1px solid var(--line);
}
.cost-item{
  flex:1 1 0; min-width:0; text-align:center;
  padding:.3rem .55rem; border-radius:10px;
  background: rgba(9,18,28,.6); border:1px solid rgba(217,164,65,.28);
}
.cost-name{
  font-family:'Cinzel',serif; font-weight:700; font-size:.88rem;
  color:var(--gold); letter-spacing:.04em;
}
.cost-tier{
  font-size:.78rem; font-weight:700; color:var(--ink-bright); line-height:1.3;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* Fond illustré : dégradé sombre PAR-DESSUS l'image (empilement CSS : le
 * premier fond listé est le plus haut) pour garder le texte et les encarts
 * lisibles sans masquer l'illustration — juste assez pour que ça se détache. */
.lobby{
  flex:1; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:2.2rem; padding:2rem; overflow:hidden;
  background:
    linear-gradient(180deg, rgba(6,18,28,.5) 0%, rgba(6,18,28,.32) 40%, rgba(6,18,28,.62) 100%),
    url('/static/img/accueil_rush.png') center / cover no-repeat;
}
.lobby-top{ display:flex; align-items:center; justify-content:center; gap:3.5rem; }
.lobby .qr-box{
  background: rgba(10,26,36,.85);
  border:1px solid var(--line);
  padding:1.1rem; border-radius:var(--radius); text-align:center;
  animation: ss-glow 3.4s ease-in-out infinite;
  backdrop-filter: blur(3px);
}
.lobby .qr-box #qr-code{
  width:280px; height:280px; display:block;
  border-radius:8px; background:#f4e4c1; padding:8px;
}
.lobby .qr-box .url{ font-size:1rem; color:var(--muted); margin-top:.5rem; letter-spacing:.06em; }
.lobby .qr-box .code{
  font-family:'Cinzel',serif; font-weight:800;
  font-size:1.9rem; letter-spacing:.3em; color:var(--gold);
  margin-top:.3rem; text-shadow:0 0 14px rgba(217,164,65,.5);
}
.lobby .players-panel{
  min-width:340px; background: rgba(10,26,36,.72); border:1px solid var(--line);
  border-radius:var(--radius); padding:1.1rem 1.3rem; backdrop-filter: blur(3px);
}
.lobby .players-panel h2{
  font-size:1.1rem; letter-spacing:.16em; color:var(--label); margin-bottom:.9rem;
}

/* Encarts de règles : même famille visuelle que les panneaux du jeu (fond
 * sombre translucide, liseré or), avec un flou léger pour se détacher du
 * fond illustré tout en le laissant deviner derrière. */
.lobby-info{ display:flex; gap:1.3rem; max-width:1180px; width:100%; }
.info-card{
  flex:1; min-width:0;
  background: rgba(9,18,28,.68); backdrop-filter: blur(4px);
  border:1px solid rgba(217,164,65,.32); border-radius:var(--radius);
  padding:1rem 1.2rem; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.info-card h3{
  font-size:1rem; color:var(--gold); letter-spacing:.03em; margin-bottom:.5rem;
  text-shadow:0 0 10px rgba(217,164,65,.3);
}
.info-card p{
  margin:0; font-size:.88rem; line-height:1.45; color:var(--ink);
}
.opt-row{ margin-top:1rem; display:flex; gap:1rem; align-items:center; flex-wrap:wrap; }
.opt-row label{ color:var(--label); font-weight:600; letter-spacing:.04em; font-size:.98rem; }
.player-chip{
  display:flex; align-items:center; gap:.7rem;
  background: var(--panel); border:1px solid var(--line);
  border-radius:9px; padding:.5rem .85rem; margin-bottom:.45rem;
  font-size:1.05rem; font-weight:600; color:#cfe0d8;
}
.dot{ width:13px; height:13px; border-radius:3px; flex:none; }

/* Arène en 3 colonnes :
 *   gauche  = aide de jeu figée (actions, ressources, comptoir)
 *   centre  = plateau, surmonté du strict minimum (chrono + phase)
 *   droite  = état VIVANT (Boss + équipages) */
.arena-layout{ flex:1; display:flex; overflow:hidden; }
.arena-stage{
  flex:1; display:flex; flex-direction:column; overflow:hidden;
  padding:8px 12px 12px; min-width:0;
}
/* Conteneur dédié au canvas : c'est LUI que resize() mesure, la barre du haut
 * ne doit donc pas être comptée dans sa hauteur. */
.stage-canvas{
  flex:1; min-height:0; display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
#arena-canvas{ display:block; }
.stage-top{
  flex:none; display:flex; align-items:center; justify-content:center;
  gap:1.2rem; padding:.1rem 0 .5rem;
}
.stage-timer{
  font-family:'Cinzel',serif; font-weight:800; font-size:1.6rem;
  letter-spacing:.1em; color:var(--gold); text-shadow:0 0 16px rgba(217,164,65,.4);
}
.stage-timer.low{ color:#ff7a5b; animation: ss-glow 1s ease-in-out infinite; }

.sidebar{
  width:258px; flex:none; background: rgba(10,26,36,.75);
  border-left:1px solid var(--line); padding:.9rem 1rem; overflow-y:auto;
}
/* Volontairement étroite : c'est de la place rendue au plateau. Les légendes
 * sont assez courtes pour tenir. */
.sidebar.left-panel{
  width:226px; border-left:0; border-right:1px solid var(--line); padding:.9rem .8rem;
}

/* Légende des actions (colonne gauche) */
.legend-list{ display:flex; flex-direction:column; gap:.38rem; }
.legend-row{ display:flex; align-items:flex-start; gap:.42rem; }
.legend-ico{ font-size:1rem; width:1.35em; flex:none; text-align:center; }
.legend-text{ display:flex; flex-direction:column; line-height:1.18; min-width:0; }
.legend-text b{ color:var(--gold); font-size:.85rem; font-weight:700; letter-spacing:.02em; }
.legend-text em{ color:var(--label); font-style:normal; font-size:.75rem; }

/* Carte du Boss (colonne droite) */
.boss-card{
  background: rgba(216,80,63,.12); border:1px solid rgba(216,80,63,.5);
  border-radius:var(--radius); padding:.7rem .8rem; margin-bottom:1.1rem;
}
.boss-card .boss-name{ font-size:1.05rem; margin-bottom:.45rem; }
.boss-card .boss-hp-bar{ height:15px; }
.boss-card .boss-hp-text{ margin-top:.3rem; font-size:.85rem; }
.boss-note{
  margin-top:.5rem; font-size:.78rem; line-height:1.3; color:#e7cfc9;
  border-top:1px solid rgba(216,80,63,.3); padding-top:.4rem;
}

/* Pastilles d'état dans le roster */
.badge{ font-size:.95rem; margin-left:.15rem; }
.roster-card.targeted{
  background: rgba(216,80,63,.14); border-radius:8px;
  box-shadow: inset 0 0 0 1px rgba(216,80,63,.5);
}
.sidebar h3{ font-size:.85rem; letter-spacing:.18em; color:var(--label); margin:1.15rem 0 .6rem; font-weight:700; }
.sidebar h3:first-child, .sidebar > div:first-child + h3{ margin-top:.2rem; }
.roster-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:.4rem .1rem; font-size:1rem; font-weight:600;
  border-bottom:1px solid rgba(150,180,160,.14); color:#cfe0d8;
}
.roster-row.offline{ opacity:.4; }
.cargo-bar, .hp-bar{
  width:56px; height:8px; border-radius:4px; overflow:hidden;
  background: rgba(255,255,255,.1); flex:none;
}
.cargo-fill{ display:block; height:100%; background: var(--gold); }
.hp-fill{ display:block; height:100%; background: var(--safe); }

.combat-feed{ font-size:.85rem; color:var(--muted); }
.combat-feed div{ padding:.2rem 0; border-bottom:1px solid rgba(150,180,160,.1); }

/* Roster TV en cartes (coque + cale + détail des ressources) */
.roster-card{
  padding:.5rem .1rem; border-bottom:1px solid rgba(150,180,160,.14);
}
.roster-card.offline{ opacity:.4; }
.roster-top{ display:flex; align-items:center; justify-content:space-between; }
.roster-name{ display:flex; align-items:center; gap:.4rem; font-weight:700; font-size:1rem; color:#cfe0d8; }
.roster-name .dot{ width:12px; height:12px; }
.roster-bars{ display:flex; gap:.5rem; margin:.35rem 0 .25rem; }
.roster-bars .hp-bar, .roster-bars .cargo-bar{ flex:1; width:auto; }
.roster-cargo{ font-size:.85rem; color:var(--label); font-weight:600; display:flex; justify-content:space-between; }
.roster-cale{ color:var(--gold); }

/* Légende ressources (le guide du Comptoir est passé dans le bandeau du haut) */
.res-legend{ font-size:.9rem; color:#cfe0d8; font-weight:600; display:flex; flex-direction:column; gap:.25rem; }
.res-legend .res-ico{ display:inline-block; width:1.5em; }

/* ---------- Boss (Acte 2) ---------- */
.boss-layout{ flex:1; display:flex; overflow:hidden; }
.boss-stage{
  flex:1; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:1.6rem; padding:1.6rem; overflow-y:auto;
}
.boss-image{
  max-width:min(46vh, 420px); max-height:46vh; object-fit:contain;
  filter: drop-shadow(0 8px 26px rgba(216,80,63,.5));
  animation: ss-glow 3.4s ease-in-out infinite;
}
.boss-hp-panel{ width:100%; max-width:560px; text-align:center; }
.boss-name{
  font-size:1.4rem; letter-spacing:.1em; color:var(--ink-bright);
  margin-bottom:.6rem; text-shadow:0 0 14px rgba(216,80,63,.4);
}
.boss-hp-bar{
  width:100%; height:22px; border-radius:999px; overflow:hidden;
  background: rgba(255,255,255,.1); border:1px solid var(--line);
}
.boss-hp-fill{
  height:100%; background: linear-gradient(90deg, #d8503f, #e8834b);
  transition: width .3s ease;
}
.boss-hp-text{ margin-top:.4rem; color:var(--label); font-size:.95rem; font-weight:700; }

.zone-lanes{ width:100%; max-width:640px; display:flex; flex-direction:column; gap:.7rem; }
.zone-lane{
  border-radius:var(--radius); padding:.7rem 1rem; min-height:64px;
  border:1px solid var(--line); background: rgba(10,26,36,.55);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.zone-lane.rouge{ background: rgba(216,80,63,.16); }
.zone-lane.orange{ background: rgba(217,164,65,.16); }
.zone-lane.verte{ background: rgba(75,179,131,.14); }
.zone-lane.hors{ background: rgba(150,180,160,.08); }
.zone-lane.telegraphed{
  border-color: var(--warning); box-shadow: 0 0 18px rgba(232,195,74,.5);
  animation: ss-glow 1.2s ease-in-out infinite;
}
.zone-lane-label{ font-size:.8rem; letter-spacing:.14em; color:var(--label); font-weight:700; margin-bottom:.4rem; }
.zone-lane-tokens{ display:flex; flex-wrap:wrap; gap:.4rem; min-height:26px; }
.zone-token{
  padding:.25rem .6rem; border-radius:999px; font-size:.85rem; font-weight:700;
  color:#0c1a12; text-shadow:none;
}
.zone-token.active-turn{ outline:3px solid var(--gold); box-shadow:0 0 14px rgba(217,164,65,.6); }
.zone-token.eliminated{ opacity:.5; text-decoration:line-through; color:#c9d4dc; }

.active-turn-row{ background: rgba(217,164,65,.1); border-radius:8px; }

.gameover-layout{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:1.6rem; text-align:center;
}
.gameover-layout h1{ font-size:2.4rem; color:var(--gold); text-shadow:0 0 22px rgba(217,164,65,.5); }
.ranking-list{
  list-style:none; padding:0; font-size:1.4rem; font-weight:700; color:var(--ink-bright);
}
.ranking-list li{ padding:.4rem 0; }
.gameover-actions{ display:flex; gap:1rem; }

/* ---------- Mobile ---------- */
.phone-wrap{
  min-height:100dvh; display:flex; flex-direction:column;
  background: radial-gradient(700px 500px at 50% -10%, #0c2e3f 0%, #082131 45%, #061620 100%);
}
.phone-header{ padding:.85rem 1rem; text-align:center; background: rgba(10,26,36,.8); border-bottom:1px solid var(--line); }
.phone-header .title{ font-size:1.2rem; letter-spacing:.14em; color:var(--gold); }
.section{ padding:1rem; }
.field{
  width:100%; padding:.85rem 1rem; font-size:1.1rem;
  border-radius:var(--radius); border:1px solid rgba(150,180,160,.35);
  background: rgba(20,40,48,.8); color:var(--ink-bright);
  font-family:'Rajdhani',sans-serif; font-weight:600; margin-bottom:.8rem;
}
.field:focus{ outline:none; border-color:var(--gold); box-shadow:0 0 12px rgba(217,164,65,.3); }
.color-preview{ width:38px; height:38px; border-radius:8px; border:2px solid rgba(255,255,255,.35); }

.control-area{
  display:flex; flex-direction:column; align-items:center; gap:1.1rem;
  padding:1.2rem 1rem 2rem; flex:1; justify-content:flex-start;
  overflow-y:auto;
}

.loot-choices{ display:flex; flex-direction:column; gap:.5rem; }
.loot-choices .btn{ width:100%; }

.port-sub{
  margin:.9rem 0 .4rem; font-size:.8rem; letter-spacing:.1em; font-weight:700;
  color:var(--label); text-transform:uppercase; text-align:left;
}
.market-grid{ display:flex; flex-wrap:wrap; gap:.45rem; justify-content:center; }
.btn.mini{ padding:.45rem .7rem; font-size:.82rem; letter-spacing:.02em; }

.upgrade-empty{ color:var(--label); font-size:.85rem; text-align:center; padding:.4rem .2rem; line-height:1.35; }
.upgrade-row.col{ flex-direction:column; align-items:stretch; gap:.3rem; }
.upgrade-desc{ color:var(--label); font-size:.78rem; font-weight:500; line-height:1.25; }
.upgrade-foot{ display:flex; align-items:center; justify-content:space-between; gap:.6rem; }

/* Pavé hexagonal 6 directions (E/NE/NW/W/SW/SE), disposé en anneau autour
 * d'un centre neutre — mêmes proportions que le d-pad 4 directions des
 * autres jeux, adapté à la géométrie à 6 voisins. */
.hexpad{
  display:grid;
  grid-template-columns: repeat(4, 74px);
  grid-template-rows: repeat(3, 74px);
  gap:8px; justify-content:center;
}
.hexpad button{
  font-size:1.5rem; font-weight:700; border-radius:12px;
  border:1px solid rgba(150,180,160,.3);
  background: rgba(20,40,48,.85); color:var(--gold);
  touch-action:none; transition: background .1s, box-shadow .15s;
}
.hexpad button:active{
  background: rgba(217,164,65,.22); border-color:var(--gold);
  box-shadow:0 0 18px rgba(217,164,65,.5); transform:scale(.95);
}
.hexpad.cooldown button{ opacity:.4; pointer-events:none; }
.hexpad .nw{ grid-column:2; grid-row:1; }
.hexpad .ne{ grid-column:3; grid-row:1; }
.hexpad .w{ grid-column:1; grid-row:2; }
.hexpad .mid{
  grid-column:2/4; grid-row:2; display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:1.6rem;
}
.hexpad .e{ grid-column:4; grid-row:2; }
.hexpad .sw{ grid-column:2; grid-row:3; }
.hexpad .se{ grid-column:3; grid-row:3; }

.status-pill{
  padding:.4rem 1.1rem; border-radius:999px;
  font-size:.85rem; letter-spacing:.12em; font-weight:700;
  background: rgba(75,179,131,.18); border:1px solid rgba(75,179,131,.6);
  color:var(--safe);
}

.cargo-row{ display:flex; gap:.6rem; flex-wrap:wrap; justify-content:center; }
.cargo-chip{
  display:flex; align-items:center; gap:.35rem;
  padding:.3rem .7rem; border-radius:999px;
  background: rgba(20,40,48,.85); border:1px solid rgba(150,180,160,.3);
  font-weight:700; font-size:.95rem;
}
.hp-chip.low{ border-color: rgba(216,80,63,.7); color: var(--danger); }
/* Rangée "niveaux du navire" : mêmes pastilles que .cargo-chip, en plus discret
 * (texte plus petit) — ce n'est qu'un rappel de lecture, pas une action. */
.levels-row .cargo-chip{ font-size:.82rem; font-weight:600; padding:.25rem .55rem; opacity:.9; }
.levels-row.mini .cargo-chip{ font-size:.74rem; padding:.2rem .45rem; }

.harvest-panel{
  width:100%; max-width:280px; padding:1rem;
  border-radius:var(--radius); border:1px solid rgba(217,164,65,.4);
  background: rgba(20,40,48,.85); text-align:center;
}
.harvest-title{ font-weight:700; letter-spacing:.04em; margin-bottom:.7rem; color:var(--ink-bright); }
.harvest-timer{ color:var(--label); font-size:.9rem; margin-bottom:.8rem; }

.upgrade-list{ display:flex; flex-direction:column; gap:.6rem; }
.upgrade-row{
  display:flex; align-items:center; justify-content:space-between; gap:.6rem;
  padding:.5rem .6rem; border-radius:10px; background: rgba(9,18,28,.6);
  text-align:left;
}
.upgrade-name{ font-weight:700; font-size:.95rem; }
.level-pips{ color:var(--gold); letter-spacing:.1em; margin-left:.3rem; }
.upgrade-cost{ color:var(--label); font-size:.82rem; flex:1; text-align:right; margin-right:.4rem; }
.upgrade-row .btn{ padding:.5rem .8rem; font-size:.82rem; flex:none; }

.act2-actions{
  display:grid; grid-template-columns:1fr 1fr; gap:.7rem;
  width:100%; max-width:280px;
}
.act2-actions .btn{ padding:.9rem .5rem; font-size:.92rem; }
.fer-toggle{
  display:flex; align-items:center; gap:.5rem; color:var(--label); font-size:.9rem; font-weight:600;
}
.fer-toggle input{ width:18px; height:18px; accent-color: var(--gold); }

.toast{
  position:fixed; left:50%; bottom:1.4rem; transform:translateX(-50%);
  padding:.7rem 1.2rem; border-radius:999px;
  background: rgba(20,40,48,.95); border:1px solid var(--gold);
  color:var(--ink-bright); font-weight:700; text-align:center;
  box-shadow: 0 0 20px rgba(217,164,65,.35);
  transition: opacity .3s ease;
}

/* ---------- Nouveautés Rush ! (météo, trésor, Acte 2 simultané) ---------- */
.arena-stage{ position:relative; }
.phase-banner{
  font-weight:700; letter-spacing:.08em; font-size:1rem;
  padding:.3rem .9rem; border-radius:999px;
}
.phase-banner.decision{ color:#bfe0ee; background:rgba(75,140,200,.18); }
.phase-banner.resolution{ color:#ffd7cf; background:rgba(216,80,63,.22); }
.regen-alert{
  position:absolute; bottom:14px; left:50%; transform:translateX(-50%);
  background: rgba(216,80,63,.9); color:#fff; font-weight:700;
  padding:.5rem 1rem; border-radius:999px; box-shadow:0 0 22px rgba(216,80,63,.6);
  animation: ss-glow 1.1s ease-in-out infinite;
}

/* Téléphone — bandeau vent + phases Acte 2 */
.pill-row{ display:flex; gap:.6rem; align-items:center; }
.wind-pill{
  padding:.4rem .9rem; border-radius:999px; font-weight:700; font-size:.9rem;
  background: rgba(75,140,200,.16); border:1px solid rgba(120,190,220,.5); color:#bfe0ee;
}
.status-pill.status-danger{
  background: rgba(216,80,63,.2); border-color: rgba(216,80,63,.7); color:#ffd7cf;
}

.queue-box{
  width:100%; max-width:300px; padding:.7rem; border-radius:var(--radius);
  background: rgba(9,18,28,.7); border:1px solid rgba(150,180,160,.25);
}
.queue-title{ font-weight:700; font-size:.85rem; letter-spacing:.06em; color:var(--label); margin-bottom:.5rem; }
.queue-list{ display:flex; flex-direction:column; gap:.4rem; }
.queue-note{ margin-top:.5rem; font-size:.78rem; line-height:1.25; color:var(--gold); }
.queue-item{
  border:1px solid rgba(217,164,65,.5); background:rgba(217,164,65,.14);
  color:var(--ink-bright); border-radius:8px; padding:.5rem .7rem;
  font-weight:700; font-size:.9rem; text-align:left; cursor:pointer;
}
.queue-item:active{ transform:scale(.97); }

.act2-palette{
  display:grid; grid-template-columns:1fr 1fr; gap:.55rem;
  width:100%; max-width:300px;
}
.act2-palette .pal-btn{ padding:.75rem .5rem; font-size:.85rem; letter-spacing:.02em; }

/* ---------- Rose des Vents (contrôleur mobile Acte 1) ---------- */
.rose-pad{
  display:grid;
  grid-template-columns: repeat(4, 82px);
  grid-template-rows: repeat(3, 76px);
  gap:8px; justify-content:center;
}
.rose-btn{
  font-family:'Cinzel', serif; font-weight:700; font-size:1.05rem; letter-spacing:.04em;
  border-radius:14px; border:1px solid rgba(217,164,65,.5);
  background: linear-gradient(160deg, rgba(217,164,65,.2), rgba(165,118,31,.28));
  color:var(--ink-bright); touch-action:none;
  transition: background .1s, box-shadow .15s, transform .06s, opacity .15s;
}
.rose-btn:active{
  background: rgba(217,164,65,.3); border-color:var(--gold);
  box-shadow:0 0 18px rgba(217,164,65,.5); transform:scale(.94);
}
/* Grisé mais toujours cliquable (retour haptique d'erreur au tap). */
.rose-btn.disabled{ opacity:.25; filter:grayscale(.7); }
.rose-btn:disabled{ opacity:.25; pointer-events:none; filter:grayscale(.7); }
.rose-pad.cooldown .rose-btn{ opacity:.4; pointer-events:none; }
.rose-btn.nw{ grid-column:2; grid-row:1; }
.rose-btn.ne{ grid-column:3; grid-row:1; }
.rose-btn.w{ grid-column:1; grid-row:2; }
.rose-center{ grid-column:2/4; grid-row:2; display:flex; align-items:center; justify-content:center; }
.rose-btn.e{ grid-column:4; grid-row:2; }
.rose-btn.sw{ grid-column:2; grid-row:3; }
.rose-btn.se{ grid-column:3; grid-row:3; }
.rose-hex{
  width:96px; height:96px; display:flex; align-items:center; justify-content:center;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: radial-gradient(circle at 50% 40%, rgba(30,80,110,.9), rgba(8,26,38,.95));
  border:0; box-shadow: inset 0 0 0 2px rgba(217,164,65,.5), 0 0 16px rgba(217,164,65,.25);
}
.rose-hex img{ width:72%; height:72%; object-fit:contain; transition: transform .25s ease; }
.rose-hex .rose-ship-fallback{ font-size:2.4rem; transition: transform .25s ease; }
/* Variante Acte 2 : même pavé, un peu resserré pour laisser la place à la
 * file d'actions et à la palette sous l'écran. */
.rose-pad.act2{ grid-template-columns: repeat(4, 68px); grid-template-rows: repeat(3, 62px); }
.rose-pad.act2 .rose-btn{ font-size:.92rem; border-radius:12px; }
.rose-pad.act2 .rose-hex{ width:78px; height:78px; }
.rose-pad.act2 .rose-hex .rose-ship-fallback{ font-size:2rem; }

/* ---------- Nappes d'Algues (mobile) ---------- */
.algae-warning{
  width:100%; max-width:300px; text-align:center;
  padding:.5rem .8rem; border-radius:10px; font-weight:800; letter-spacing:.08em;
  color:#0d1f0d; background:linear-gradient(160deg, #7ee06a, #226e2d);
  border:1px solid rgba(120,200,110,.8); box-shadow:0 0 18px rgba(60,150,60,.5);
  animation: ss-glow 1.1s ease-in-out infinite;
}
/* Filtre sombre/vert sur la Rose des Vents quand on est empêtré. */
.rose-pad.in-algae{ filter: brightness(.6) sepia(.5) hue-rotate(55deg) saturate(1.6); }
.rose-pad.in-algae .rose-hex{ box-shadow: inset 0 0 0 2px rgba(120,200,110,.8), 0 0 20px rgba(60,150,60,.6); }

/* ---------- Tempête, Atoll, Pillage, Réparation (refonte Acte 1) ---------- */
/* TV — bandeau de rétractation du plateau */
.storm-chip{
  display:flex; align-items:center; gap:.4rem;
  padding:.3rem .8rem; border-radius:999px; font-weight:700; font-size:.95rem;
  background: rgba(60,80,120,.22); border:1px solid rgba(140,170,210,.5); color:#c9d8ea;
}
.storm-chip.imminent{
  background: rgba(216,80,63,.28); border-color: rgba(216,80,63,.8); color:#ffd7cf;
  animation: ss-glow .8s ease-in-out infinite;
}
.res-legend em{ color:var(--muted); font-style:normal; font-size:.82em; }

/* Mobile — bandeau tempête (préavis puis alerte critique dans le brouillard) */
.storm-warning{
  width:100%; max-width:300px; text-align:center;
  padding:.5rem .8rem; border-radius:10px; font-weight:800; letter-spacing:.06em;
  color:#e7f0fb; background:linear-gradient(160deg, rgba(60,90,140,.9), rgba(20,35,60,.95));
  border:1px solid rgba(140,175,215,.7);
}
.storm-warning.critical{
  color:#fff2ee; background:linear-gradient(160deg, #d8503f, #7a2418);
  border-color: rgba(255,140,110,.9); box-shadow:0 0 18px rgba(216,80,63,.55);
  animation: ss-glow .9s ease-in-out infinite;
}
/* Rose des Vents : case embrumée (mortelle) / éperonnage possible */
.rose-btn.danger{
  border-color: rgba(216,80,63,.8);
  background: linear-gradient(160deg, rgba(216,80,63,.32), rgba(40,55,80,.5));
  color:#ffd7cf;
}
.rose-btn.ram{
  border-color: rgba(232,176,75,.95);
  background: linear-gradient(160deg, rgba(232,176,75,.42), rgba(150,90,20,.45));
  box-shadow:0 0 16px rgba(232,176,75,.45);
}
.rose-btn.ram::after{ content:' 💢'; }
.rose-pad.in-storm .rose-hex{
  box-shadow: inset 0 0 0 2px rgba(216,80,63,.85), 0 0 22px rgba(216,80,63,.55);
}

/* Mobile — panneau de réparation prioritaire au Port Franc */
.repair-panel{
  margin-bottom:.8rem; padding:.7rem; border-radius:10px;
  background: rgba(75,179,131,.12); border:1px solid rgba(75,179,131,.6);
}
.repair-panel .harvest-title{ margin-bottom:.4rem; color:#bfeeda; }
.repair-panel .harvest-timer{ margin-bottom:.6rem; }
.repair-grid{ display:flex; gap:.45rem; justify-content:center; flex-wrap:wrap; }
.repair-grid .btn{ padding:.55rem .8rem; font-size:.82rem; }
/* Améliorations verrouillées tant que la coque n'est pas pleine */
.upgrade-row.locked{ opacity:.35; filter:grayscale(.7); }
.upgrade-empty.locked-note{ color:var(--warning); font-weight:700; }

/* Île de bordure épuisée (le gisement est mort pour de bon) */
.hidden{ display:none !important; }
