/* mandat.css - styles for the "dirigeant" test page (events as small cards, two boards, a hand). */

.leaders { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 12px 0; }
.leader { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.leader.sel { border-color: var(--accent); background: var(--panel-2); }
.licon { font-size: 2rem; }
#startGame, #endTurn { width: 100%; margin: 14px 0; padding: 13px; font-weight: 700; background: linear-gradient(135deg, var(--accent), #5a8bff); border-color: transparent; }
.rules { margin: 8px 0 20px; color: var(--muted); }
.rules li { margin: 6px 0; }

.gbar { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; }
.hazard { background: #2a2140; border: 1px solid #4a3a7a; border-radius: 12px; padding: 8px 12px; margin: 6px 0 10px; font-size: .92rem; }
.gpanel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin: 6px 0; }
.gpanel-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wins { color: var(--gold); font-size: .9rem; }
.rrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rpill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: .92rem; }
.rpill.danger { border-color: var(--bad); color: var(--bad); }
.rpill.sup { margin-left: auto; }

.row { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 10px; min-height: 60px; }
.row.board { background: rgba(255,255,255,.02); border-radius: 12px; }
.row.board.mine { border: 1px dashed #343c5c; }
.empty { align-self: center; margin: 0 8px; }
.slot { flex: 0 0 150px; cursor: pointer; }

.gcard { position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.gcard.k-attacker { border-color: #8a2b3a; }
.gcard.k-producer { border-color: #2b7a4b; }
.gcard.k-mixed { border-color: #a0802c; }
.gcard.k-instant { border-color: #3a6ea0; }
.gcard.tapped { opacity: .55; filter: grayscale(.5); transform: rotate(2deg); }
.gcard.fresh { box-shadow: 0 0 0 2px var(--accent-2) inset; }
.gcard.dim { opacity: .5; }
.gimg { height: 70px; background: #1b2036 center/cover; }
.gbody { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 3px; }
.gname { font-weight: 700; font-size: calc(.88rem * var(--fit, 1)); line-height: 1.2; }
.gmeta { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.amp { color: var(--gold); }
.gkind { font-size: .78rem; }
.gfx { font-size: .76rem; color: #c8cee6; }
.cost { position: absolute; top: 6px; left: 6px; background: rgba(8,10,18,.85); border-radius: 99px; padding: 2px 8px; font-size: .82rem; font-weight: 700; }
.cost.no { color: var(--bad); }
.tag { position: absolute; top: 6px; right: 6px; background: rgba(8,10,18,.85); border-radius: 99px; padding: 2px 8px; font-size: .7rem; }

.log { background: #10131f; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: .84rem; max-height: 170px; overflow-y: auto; }
.log div { padding: 2px 0; color: var(--muted); }
.log .new { color: var(--text); }

.block-btn, #takeHit, #again { display: block; width: 100%; margin: 8px 0; text-align: left; }

.foe-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.foe { background: var(--panel); border: 2px solid var(--line); border-radius: 99px; padding: 7px 14px; cursor: pointer; }
.foe.sel { border-color: var(--accent); background: var(--panel-2); }
.srclink { position: absolute; bottom: 6px; right: 6px; background: rgba(8,10,18,.85); border-radius: 99px; padding: 2px 8px; font-size: .72rem; color: var(--accent-2); text-decoration: none; }
.gbody { padding-bottom: 26px; }
#restart { width: 100%; margin-bottom: 20px; }

/* ---- compact tiles (board + hand), face-to-face layout, detail sheet ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; padding: 6px 2px; min-height: 64px; align-content: start; }
.tiles.board { background: rgba(255,255,255,.025); border-radius: 12px; padding: 6px; }
.tiles.board.mine { border: 1px dashed #343c5c; }
.tiles.board.mine.choosing { border: 2px solid var(--good); background: rgba(74,222,128,.06); }
.tiles .empty { grid-column: 1 / -1; align-self: center; margin: 14px 8px; }
.tile { position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.tile.k-attacker { border-color: #8a2b3a; }
.tile.k-producer { border-color: #2b7a4b; }
.tile.k-mixed { border-color: #a0802c; }
.tile.k-instant { border-color: #3a6ea0; }
.timg { height: 36px; background: #1b2036 center/cover; }
.tname { font-size: calc(.68rem * var(--fit, 1)); font-weight: 700; line-height: 1.15; padding: 3px 4px 0; height: 2.4em; overflow: hidden; }
.tmeta { display: flex; justify-content: space-between; align-items: center; padding: 1px 5px 3px; font-size: .74rem; }
.tcost { position: absolute; top: 2px; left: 2px; background: rgba(8,10,18,.85); border-radius: 99px; padding: 0 6px; font-size: .68rem; font-weight: 700; }
.tcost.no { color: var(--bad); }
.tstate { position: absolute; top: 2px; right: 3px; font-size: .8rem; }
.tile.tapped { opacity: .5; filter: grayscale(.6); }
.tile.dim { opacity: .55; }
.tile.fresh { box-shadow: 0 0 0 2px var(--accent-2) inset; }
.tile.picked { outline: 3px solid var(--accent); outline-offset: 1px; }
.tile.blockable { border-color: var(--good); animation: glowgood 1.2s ease-in-out infinite; }
.tile.attacking { border-color: var(--bad); animation: glowbad .9s ease-in-out infinite; }
@keyframes glowgood { 50% { box-shadow: 0 0 10px 2px rgba(74,222,128,.7); } }
@keyframes glowbad { 50% { box-shadow: 0 0 12px 3px rgba(248,113,113,.85); } }

.versus { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px 0; padding: 6px 0; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); text-align: center; }
.versus span { font-weight: 700; letter-spacing: .08em; color: var(--gold); }
.versus small { color: var(--muted); font-size: .76rem; max-width: 95%; }
.alert { margin: 10px 0; padding: 10px 12px; background: #3a1a22; border: 2px solid var(--bad); border-radius: 12px; }
.alert .btn { display: block; margin-top: 8px; }
.hint { color: var(--muted); font-size: .85rem; margin: 8px 0 0; }
.logbox { margin: 10px 0; font-size: .82rem; color: var(--muted); }
.logbox div { padding: 2px 0; }

.screen.has-sheet { padding-bottom: 320px; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--panel); border-top: 2px solid var(--accent); padding: 12px 16px 16px; max-height: 66vh; overflow-y: auto; display: flex; gap: 14px; box-shadow: 0 -8px 24px rgba(0,0,0,.5); }
.sheet-x { position: absolute; top: 6px; right: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; z-index: 3; }
.sheet-card { flex: 0 0 170px; }
.sheet-card .gcard { height: auto; }
.sheet-card .gimg { height: 90px; }
.sheet-card .gfx { font-size: .8rem; }
.gflavor { font-size: .74rem; font-style: italic; color: var(--muted); margin-top: 2px; }
.sheet-act { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding-right: 26px; min-width: 0; }
.sheet-act .btn { width: 100%; padding: 12px; }
@media (max-width: 420px) { .sheet-card { flex-basis: 140px; } }

/* ---- targeting (instants that snuff out an event), date on the card ---- */
.alert.info { background: #1c2640; border-color: var(--accent-2); }
.tile.targetable { border-color: var(--gold); animation: glowgold 1s ease-in-out infinite; }
.tile.untargetable { opacity: .4; }
@keyframes glowgold { 50% { box-shadow: 0 0 12px 3px rgba(251,191,36,.8); } }
.gdate { font-size: .72rem; color: var(--muted); }

/* ---- 06/10: droit de réponse, étouffe, aléas par camp, deck builder ---- */
.tile.k-removal, .gcard.k-removal { border-color: #b8731f; }
.tile.k-response, .gcard.k-response { border-color: #8a5bd0; }
.hazard { line-height: 1.5; }
.hgood { color: var(--good); }
.hbad { color: var(--bad); }
.hzrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.hz { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2); text-align: center; }
.hz.good { border-color: var(--good); }
.hz.bad { border-color: var(--bad); }
.hz small { color: var(--muted); }
.hz span { font-size: .85rem; }
.deckok { color: var(--good); }
.deckno { color: var(--gold); }
.deckline { margin-top: 4px; }
.deckstats { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: .88rem; line-height: 1.6; }
.deckbtns { display: flex; gap: 8px; margin: 8px 0; }
.deckbtns .btn { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: var(--panel); border: 2px solid var(--line); border-radius: 99px; padding: 5px 12px; cursor: pointer; color: inherit; font: inherit; }
.chip.sel { border-color: var(--accent); background: var(--panel-2); }
.tile.indeck { outline: 3px solid var(--good); outline-offset: -1px; }
.decktiles { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.deckdone { width: 100%; margin: 14px 0; }
@media (max-width: 420px) { .hzrow { grid-template-columns: 1fr; } }

/* ---------- 06/10: collection, leader powers, story arcs ---------- */
.leader.locked { opacity: .55; cursor: default; filter: grayscale(.7); }
.collbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0; line-height: 1.5; }
.collbox .tag { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.testsw { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .9rem; cursor: pointer; }
.tile.locked { opacity: .38; filter: grayscale(.8); }
.tarc { position: absolute; right: 3px; top: 20px; font-size: .75rem; line-height: 1; filter: drop-shadow(0 0 2px #000); }
.garc { font-size: .8rem; color: #ffd27a; margin-top: 4px; }
.arcnow { color: #ffd27a; margin: 4px 0 0; }
.pwr { display: block; width: 100%; margin-top: 6px; text-align: left; font: inherit; font-size: .82rem; padding: 6px 10px; border-radius: 10px; border: 1px dashed #4b5375; background: transparent; color: var(--muted); }
.pwr.on { border: 1px solid #f5c542; color: #ffe08a; background: rgba(245,197,66,.08); }
button.pwr.on:not([disabled]) { cursor: pointer; animation: pwrpulse 1.6s ease-in-out infinite; }
@keyframes pwrpulse { 50% { box-shadow: 0 0 0 3px rgba(245,197,66,.25); } }
.reward { font-size: 1.1rem; font-weight: 700; color: #ffe08a; }
.warnline { display: inline-block; margin-top: 4px; color: #ffb86b; font-weight: 600; font-size: .9rem; }

/* ---------- 06/10: modes (mandat / flash) and the tutorial ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
.mode { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 10px 8px; color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.mode.sel { border-color: #f5c542; background: rgba(245,197,66,.12); }
.tutobox { display: flex; flex-direction: column; gap: 6px; background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.45); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.linkbtn { background: none; border: 0; padding: 0; color: #8ab4ff; text-decoration: underline; font: inherit; cursor: pointer; }
.coach { position: sticky; top: 0; z-index: 6; background: #14324a; border: 2px solid #4fb3ff; border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; box-shadow: 0 6px 18px rgba(0,0,0,.45); font-size: .92rem; line-height: 1.45; }
.coach p { margin: 4px 0; }
.coach-top { display: flex; justify-content: space-between; font-size: .8rem; color: #9fd3ff; }
.tile.glow { outline: 3px solid #4fb3ff; animation: tutoGlow 1.1s ease-in-out infinite; }
@keyframes tutoGlow { 50% { box-shadow: 0 0 16px 4px rgba(79,179,255,.85); } }


/* ---------- 07/10: the game board fits ONE phone screen (no page scroll) ---------- */
body.playing { overflow: hidden; }
body.playing .top { display: none; }
.screen.play { display: flex; flex-direction: column; gap: 4px; height: 100vh; height: 100dvh; max-width: 560px; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); box-sizing: border-box; overflow: hidden; }
.play > * { flex: none; margin-top: 0; margin-bottom: 0; }
.play .gbar { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; }
.play .hazard { position: relative; background: #2a2140; border: 1px solid #4a3a7a; border-radius: 10px; padding: 3px 8px; font-size: .74rem; line-height: 1.3; }
.play .hazard summary { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; list-style: none; }
.play .hazard summary::-webkit-details-marker { display: none; }
.play .hz-pop { position: absolute; left: 0; right: 0; top: 100%; z-index: 12; margin-top: 2px; background: #2a2140; border: 1px solid #4a3a7a; border-radius: 10px; padding: 8px 10px; font-size: .8rem; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.play .gpanel { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; padding: 4px 8px; border-radius: 10px; font-size: .82rem; }
.play .gpanel-top { gap: 6px; flex-wrap: nowrap; align-items: baseline; }
.play .wins { font-size: .72rem; }
.play .rrow { margin-top: 0; gap: 4px; flex-wrap: nowrap; }
.play .rpill { padding: 1px 7px; font-size: .78rem; white-space: nowrap; }
.play .rpill.sup { margin-left: 0; }
.play .pwr { display: inline-block; width: auto; margin: 0 0 0 auto; padding: 2px 8px; font-size: .72rem; white-space: nowrap; }
.play .tiles { padding: 4px; gap: 4px; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
.play .tiles.board { flex: 1 1 0; min-height: 56px; overflow-y: auto; grid-auto-rows: min-content; margin: 0; }
.play .tiles.hand { display: grid; grid-auto-flow: column; grid-auto-columns: 62px; grid-template-columns: none; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 4px; }
.play .tiles .empty { grid-column: 1 / -1; margin: 6px 6px; font-size: .78rem; }
.play .timg { height: 24px; }
.play .tname { font-size: calc(.6rem * var(--fit, 1)); padding: 2px 3px 0; height: 2.35em; }
.play .tmeta { padding: 0 4px 2px; font-size: .68rem; }
.play .tcost { font-size: .62rem; padding: 0 4px; }
.play .tarc { top: 14px; font-size: .65rem; }
.play .versus { margin: 0; padding: 2px 0; flex-direction: row; justify-content: center; }
.play .versus small { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play .alert { margin: 0; padding: 6px 10px; font-size: .8rem; line-height: 1.3; max-height: 36vh; overflow-y: auto; }
.play .alert .btn { margin-top: 4px; padding: 6px 10px; }
.play .coach { position: static; margin: 0; padding: 5px 10px; font-size: .78rem; line-height: 1.3; max-height: 30vh; overflow-y: auto; }
.play .coach .btn { padding: 5px 10px; margin-top: 2px; }
.play .gfoot { display: flex; gap: 6px; align-items: stretch; position: relative; }
.play #endTurn { flex: 1; width: auto; margin: 0; padding: 9px; }
.gmenu summary { list-style: none; cursor: pointer; padding: 9px 14px; }
.gmenu summary::-webkit-details-marker { display: none; }
.gmenu-pop { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 30; width: min(340px, 92vw); max-height: 55vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: .78rem; color: var(--muted); box-shadow: 0 -8px 24px rgba(0,0,0,.5); }
.gmenu-pop div { padding: 2px 0; }
.gmenu-pop .btn { width: 100%; margin-top: 8px; }
.gmenu-pop b { color: var(--text); }
.screen.play.has-sheet { padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
.play .sheet { max-height: 52vh; padding: 10px 12px 12px; }
.play .sheet-card { flex-basis: 128px; }
.play .sheet-card .gimg { height: 60px; }
.play .gpanel .pwr { margin-left: auto; }
.play .gpanel-top b { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 07/10: online duels (menu box, invitation window) ---------- */
.onlinebox { display: flex; flex-direction: column; gap: 8px; }
.onlineinput { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; color: inherit; font: inherit; min-width: 0; width: 100%; box-sizing: border-box; }
.onlinebox label { display: flex; flex-direction: column; gap: 4px; }
.onlinebox .deckbtns .onlineinput { flex: 2; text-transform: uppercase; letter-spacing: .15em; text-align: center; }
