a.button { text-decoration: none; display: inline-block; }
.game-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(400px, 1fr) 330px; }
.game-side-panel { overflow-y: auto; border-left: 1px solid var(--line); }
.side-section-title { margin: 18px 0 12px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--gold); font-size: 9px; letter-spacing: 1.8px; font-weight: 700; }
/* Le numéro de tour vit à droite du titre « Joueurs » (l'ancien bandeau d'outils est supprimé). */
.panel-tour { color: var(--muted); font-size: 10px; letter-spacing: 1px; white-space: nowrap; border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; }
/* Nom de la carte, zoom et « Ajuster » : groupe déplaçable entre le pied de page et le bandeau. */
.map-infos { display: inline-flex; align-items: center; gap: 10px; }
.game-map-name { color: var(--gold); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.topbar-map-slot { display: inline-flex; align-items: center; }
.topbar-map-slot .map-infos { margin: 0 14px; }
.statusbar-flex { flex: 1; }
.map-statusbar .tool { border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--text); padding: 2px 8px; font-size: 9px; cursor: pointer; white-space: nowrap; }
.map-statusbar .tool:hover { border-color: var(--gold-dark); color: var(--gold); }
.map-statusbar .icon-button { width: 22px; height: 22px; font-size: 12px; line-height: 1; color: var(--muted); }
#game-zoom { min-width: 36px; text-align: right; }
/* Ligne d'état au-dessus du Commandement : badge de phase + messages d'action (IA). */
.command-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 16px; }
.command-heading .phase-badge { padding: 4px 10px; font-size: 9px; white-space: nowrap; }
/* Le texte d'état (Tour de X…) n'est jamais tronqué : il passe sur la ligne suivante quand
   le panneau est étroit — le badge du minuteur ayant réduit l'espace disponible. */
.command-status { flex: 1 1 140px; font-size: 10px; color: var(--muted); min-width: 0; white-space: normal; line-height: 1.45; }
.game-players { display: flex; flex-direction: column; gap: 8px; }
.player-card { position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 10px 9px; background: #111713; border: 1px solid var(--line-soft); border-left: 3px solid var(--player-color); border-radius: 5px; }
.player-card { transition: transform .15s ease; }
.player-card.current {
    transform: translate(-8px, 0px);
    border: 4px solid var(--player-color);
    background:
        linear-gradient(115deg, transparent 42%, color-mix(in srgb, var(--player-color) 18%, transparent) 50%, transparent 58%) 0 0 / 300% 100% no-repeat,
        #ffffff10;
    background-position: 140% 0, 0 0;
    animation: player-current-shine 4.5s linear infinite, player-current-glow 2.4s ease-in-out infinite;
}
.player-card.current img { width: 56px; height: 56px; }
@keyframes player-current-shine {
    from { background-position: 140% 0, 0 0; }
    to { background-position: -160% 0, 0 0; }
}
@keyframes player-current-glow {
    0%, 100% { box-shadow: 0 3px 10px #0007, 0 0 12px color-mix(in srgb, var(--player-color) 30%, transparent); }
    50% { box-shadow: 0 6px 16px #0008, 0 0 26px color-mix(in srgb, var(--player-color) 60%, transparent); }
}
.player-card img { width: 46px; height: 46px; object-fit: cover; border: 2px solid var(--player-color); border-radius: 50%; }
.player-card strong { display: block; font-family: Georgia, serif; font-weight: 400; font-size: 15px; }
.player-card small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 1px; }
.player-stats { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 7px; font-size: 10px; color: #bdc7bf; }
.player-bonus { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; font-size: 9px; color: #c8b273; }
.player-bonus span { flex: 0 0 auto; background: #d1b46a14; border: 1px solid #d1b46a33; padding: 2px 6px; border-radius: 3px; }
.player-bonus.lost { color: #97a097; }
.player-bonus.lost span { background: #8a938a12; border-color: #8a938a33; }
.player-ai { color: var(--gold); }
.game-log-toggle { position: relative; width: 100%; margin: 20px 0 0; padding: 12px 2px 6px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--gold); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.game-log-toggle:hover { color: #e7cf8f; }
.game-log-chevron { transition: transform .2s; font-size: 10px; }
.game-log-toggle[aria-expanded="true"] .game-log-chevron { transform: rotate(90deg); }
.game-log-toggle.has-new::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); position: absolute; right: 20px; top: 15px; }
.game-logs { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; font-size: 10px; color: var(--muted); line-height: 1.45; }
.game-logs[hidden] { display: none; }
.log-entry { padding-left: 8px; border-left: 1px solid var(--line); }
.log-entry time { display: block; color: #67756b; font-size: 8px; }
.phase-badge { border: 1px solid var(--gold-dark); color: var(--gold); border-radius: 20px; padding: 7px 12px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
/* Compte à rebours du minuteur de tour (parties en ligne) : badge à côté de la phase.
   Urgent (< 10s) : rouge et pulsation. */
.turn-timer { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--gold-dark); color: var(--gold); border-radius: 20px; padding: 4px 10px; font-size: 10px; white-space: nowrap; }
.turn-timer strong { font: 700 12px Georgia, serif; min-width: 24px; text-align: center; }
.turn-timer[hidden] { display: none; }
.turn-timer.urgent { border-color: #a33; color: #ff8a7a; animation: turn-timer-pulse 1s ease-in-out infinite; }
@keyframes turn-timer-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 92, 77, .55); } 50% { box-shadow: 0 0 10px 2px rgba(239, 92, 77, .55); } }
.reinforcement-banner { padding: 12px; background: #d1b46a12; border: 1px solid var(--gold-dark); border-radius: 4px; color: var(--gold); margin-bottom: 14px; text-align: center; }
.reinforcement-banner strong { display: block; font: 26px Georgia, serif; }
.action-content h3 { font: 18px Georgia, serif; margin: 4px 0 12px; }
.action-content .field select, .action-content .field input { font-size: 11px; }
.order-box { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.player-card.eliminated { opacity: .55; }
.player-card.eliminated img { filter: grayscale(1); }
.player-card.eliminated strong { text-decoration: line-through; color: var(--muted); }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.card-chip { border: 1px solid var(--line); background: #111713; color: var(--text); padding: 6px 10px; border-radius: 4px; font-size: 10px; cursor: pointer; }
.card-chip:hover { border-color: var(--gold-dark); }
.card-chip.selected { border-color: var(--gold); background: #d1b46a1f; color: var(--gold); }
.card-chip.joker { border-style: dashed; }
.order-target { padding: 9px; background: #111713; border-left: 2px solid var(--gold); margin-bottom: 12px; }
.order-target.target { border-left-color: var(--danger); }
.order-target strong, .order-target span { display: block; }
.order-target span { color: var(--muted); font-size: 10px; margin-top: 4px; }
.probability-box { padding: 14px; background: #111713; border: 1px solid var(--line); text-align: center; border-radius: 5px; margin: 12px 0; }
.probability-box strong { display: block; font: 30px Georgia, serif; color: var(--gold); }
.probability-box span { color: var(--muted); font-size: 10px; }
.probability-box small { display: block; margin-top: 6px; color: #8e9b91; font-size: 9px; line-height: 1.45; }
.combat-bonuses { display: flex; justify-content: space-between; margin-top: 7px; color: #b9c4bb; font-size: 9px; }
.phase-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.combat-result { margin-top: 15px; }
.dice-round { background: #111713; border: 1px solid var(--line-soft); padding: 9px; border-radius: 4px; margin-top: 6px; font-size: 10px; }
.dice-values { display: flex; justify-content: space-between; gap: 8px; }
.dice-values span { color: var(--muted); }
.dice-values strong { color: var(--text); }
.map-tooltip { position: absolute; z-index: 10; width: 280px; pointer-events: none; background: #111713f2; border: 1px solid #6c785f; border-radius: 5px; box-shadow: 0 8px 30px #000a; padding: 13px; font-size: 13px; }
.map-tooltip strong { display: block; font-family: Georgia, serif; color: #f0e7cd; margin-bottom: 5px; font-size: 16px; }
.map-tooltip > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 9px; }
.tooltip-bonuses { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.tooltip-bonuses span { background: #ffffff08; padding: 7px 4px; text-align: center; font-size: 11px; border-radius: 3px; }
.tooltip-bonuses.cartoon { display: flex; gap: 7px; }
.tooltip-terrain { display: block; color: #f0e7cd; font-family: Georgia, serif; font-size: 13px; margin-bottom: 7px; }
.tooltip-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; font-weight: bold; font-size: 13px; border: 1px solid; }
.tooltip-chip svg { flex: 0 0 auto; }
.tooltip-chip.attack { color: #ff9d8f; border-color: #ef6f6c66; background: #ef6f6c14; }
.tooltip-chip.defense { color: #9fc4f0; border-color: #7fa8d966; background: #7fa8d914; }
.tooltip-chip.reinforcement { color: #a8d9a0; border-color: #8fc98f66; background: #8fc98f14; }
.map-tooltip:has(.tooltip-bonuses.cartoon) { width: auto; min-width: 0; padding: 9px; }
.tooltip-warning { color: #e5a399 !important; margin-top: 7px; }
.setup-dialog { width: min(1050px, 96vw); }
/* Hauteur gérée par la flexion (colonne du dialogue) et non par un calc : la bannière
   « Partie en pause » réduit l'espace disponible sans rogner le bas de la mise en page. */
.setup-layout { display: grid; grid-template-columns: 1fr 245px; flex: 1 1 auto; min-height: 0; }
.setup-layout > .dialog-body { overflow-y: auto; min-height: 0; }
.current-game { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 22px; background: #d1b46a12; border-bottom: 1px solid var(--gold-dark); color: #cfd6cf; font-size: 11px; }
.current-game[hidden] { display: none; }
.current-game strong { color: var(--gold); }
.current-game-actions { display: flex; gap: 8px; }
.current-game-actions .button { padding: 6px 11px; font-size: 10px; }
.saved-games { border-left: 1px solid var(--line); padding: 20px 15px; overflow-y: auto; }
.saved-games h3 { font: 19px Georgia, serif; margin: 5px 0 15px; }
.saved-game { display: block; width: 100%; text-align: left; background: #111713; border: 1px solid var(--line-soft); padding: 10px; border-radius: 4px; margin-bottom: 7px; cursor: pointer; }
.saved-game:hover { border-color: var(--gold-dark); }
.saved-game strong, .saved-game span { display: block; }
.saved-game span { color: var(--muted); font-size: 9px; margin-top: 5px; }
.saved-game-row { position: relative; }
.saved-game-row .saved-game { padding-right: 28px; }
.saved-game-delete { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; color: #d79a90; cursor: pointer; }
.players-title { font: 18px Georgia, serif; margin: 8px 0 12px; }
.setup-player-row { display: grid; grid-template-columns: 24px minmax(0, 1.5fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 60px; gap: 7px; align-items: center; margin-bottom: 7px; }
.setup-player-row > * { min-width: 0; }
.setup-player-row input, .setup-player-row select { padding: 8px; font-size: 11px; width: 100%; }
.setup-player-row select { text-overflow: ellipsis; }
.setup-player-row input[type="color"] { width: 60px; height: 34px; padding: 2px; }
.player-slot { color: var(--gold); text-align: center; }
.player-moves { display: none; gap: 4px; }
#setup-players.manual-order .setup-player-row { grid-template-columns: 24px minmax(0, 1.5fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 60px 56px; }
#setup-players.manual-order .player-moves { display: inline-flex; }
.player-move { flex: 1 1 0; padding: 6px 0; font-size: 10px; line-height: 1; cursor: pointer; background: #2a332c; border: 1px solid var(--line); border-radius: 4px; color: var(--gold); }
.player-move:hover { background: #39443b; }
#setup-players.manual-order .setup-player-row:first-child .player-move[data-move="up"],
#setup-players.manual-order .setup-player-row:last-child .player-move[data-move="down"] { visibility: hidden; }
.map-capacity { color: var(--muted); padding: 9px 0; font-size: 11px; }
.conquest-bar { position: absolute; left: 50%; bottom: 34px; translate: -50% 0; z-index: 20; width: min(650px, 92%); padding: 13px 18px 12px; border: 2px solid var(--gold-dark); border-radius: 15px; background: #101813ed; box-shadow: 0 8px 25px #0009; color: var(--text); animation: conquest-bar-in .25s cubic-bezier(.2, .9, .3, 1.2) both; }
.conquest-bar[hidden] { display: none; }
.conquest-bar-heading { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.conquest-bar-heading span { color: var(--gold); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; }
.conquest-bar-heading strong { font: 18px Georgia, serif; }
#conquest-summary { margin: 4px 0 8px; color: var(--muted); font-size: 10px; text-align: center; }
.conquest-controls { display: grid; grid-template-columns: 62px minmax(120px, 1fr) auto; align-items: center; gap: 15px; }
.conquest-count { width: 58px; height: 58px; display: grid; place-items: center; border: 3px solid #f5df9c; border-radius: 50%; background: #73572a; color: #fff4cf; font: bold 32px Georgia, serif; box-shadow: 0 4px 0 #352711; }
.conquest-slider-wrap { min-width: 0; }
#conquest-quantity { width: 100%; height: 24px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
#conquest-quantity::-webkit-slider-runnable-track { height: 10px; border: 2px solid #080d0a; border-radius: 8px; background: #2b382f; }
#conquest-quantity::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -11px; appearance: none; border: 3px solid #fff0b8; border-radius: 50%; background: var(--gold); box-shadow: 0 3px 0 #4b3919; }
#conquest-quantity::-moz-range-track { height: 8px; border: 2px solid #080d0a; border-radius: 8px; background: #2b382f; }
#conquest-quantity::-moz-range-thumb { width: 23px; height: 23px; border: 3px solid #fff0b8; border-radius: 50%; background: var(--gold); box-shadow: 0 3px 0 #4b3919; }
.conquest-range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.conquest-remaining { margin: 7px 0 0; color: var(--gold); font-size: 10px; text-align: center; }
@keyframes conquest-bar-in { from { opacity: 0; transform: scale(.75) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
body.game-busy #game-canvas { cursor: wait; }

/* Le hub (play.php) charge aussi editor.css, qui fige body en overflow:hidden pour son
   workspace plein écran — inadapté aux écrans qui dépassent (accueil avec messagerie). Le
   défilement de page est rétabli ici, sans toucher à l'éditeur. */
body[data-view] { overflow: auto; }
.tooltip-debug { margin-top: 9px; padding-top: 8px; border-top: 1px dashed #4a5548; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #d7ded7; }
.tooltip-debug-title { color: #d1b46a; font-size: 8px; letter-spacing: 1.5px; font-weight: 700; }
.tooltip-debug small { color: #7d8a80; font-size: 9px; }
.tooltip-debug strong { color: #f0e7cd; }

.combat-outcome { position: fixed; top: 62px; left: 50%; translate: -50% 0; z-index: 1800; width: min(560px, 85vw); padding: 22px 26px; border: 4px solid #9b3f35; border-radius: 18px; background: #fff0c5; color: #2b2118; box-shadow: 8px 8px 0 #0007; text-align: center; pointer-events: none; animation: combat-outcome-pop 2.3s both; }
.combat-outcome[hidden] { display: none; }
.combat-outcome.resisted { border-color: #39765a; }
.combat-outcome strong { display: block; color: #9b3f35; font: 30px Georgia, serif; }
.combat-outcome.resisted strong { color: #39765a; }
.combat-outcome p { margin: 10px 0; font: 19px Georgia, serif; }
.combat-outcome small { font-weight: 700; color: #655343; }
@keyframes combat-outcome-pop { 0% { opacity: 0; transform: scale(.2) rotate(-5deg); } 12% { opacity: 1; transform: scale(1.15) rotate(2deg); } 20%, 82% { opacity: 1; transform: scale(1) rotate(-1deg); } 100% { opacity: 0; transform: scale(.95) rotate(0); } }
.turn-splash { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, #17231de8 0%, #050a07f5 75%); animation: turn-splash-fade 1.9s both; }
.turn-splash[hidden] { display: none; }
.turn-splash-content { width: min(900px, 90vw); padding: 38px 20px; border-top: 1px solid var(--turn-player-color, var(--gold)); border-bottom: 1px solid var(--turn-player-color, var(--gold)); text-align: center; animation: turn-splash-zoom 1.9s cubic-bezier(.16, .8, .25, 1) both; }
.phase-toast { position: fixed; top: 16px; left: 50%; z-index: 1900; display: flex; gap: 12px; align-items: baseline; max-width: min(92vw, 720px); padding: 9px 22px; border: 1px solid var(--gold); border-radius: 999px; background: #101a14f0; box-shadow: 0 6px 24px #000a; pointer-events: none; animation: phase-toast-life 1.6s ease both; }
.phase-toast[hidden] { display: none; }
.phase-toast strong { color: var(--gold); font: 15px Georgia, serif; letter-spacing: 1px; white-space: nowrap; }
.phase-toast span { color: #cfc6ae; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-toast.zoom { animation: phase-toast-zoom 2.2s cubic-bezier(.16, .8, .25, 1) both; }
@keyframes phase-toast-life { 0% { opacity: 0; transform: translate(-50%, -16px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -10px); } }
@keyframes phase-toast-zoom { 0% { opacity: 0; transform: translate(-50%, 0) scale(.3); } 14% { opacity: 1; transform: translate(-50%, 0) scale(1.12); } 26%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, 0) scale(.92); } }
.player-exchange { display: inline-block; margin-left: 5px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: #101a14; font-size: 9px; font-weight: bold; letter-spacing: .04em; animation: player-exchange-blink 1.1s ease-in-out infinite; }
@keyframes player-exchange-blink { 50% { opacity: .5; } }
.game-mode-plaque { position: absolute; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 30px; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); background: linear-gradient(180deg, #1a241dbb, #101a14cc); pointer-events: none; }
.game-mode-plaque[hidden] { display: none; }
.game-mode-plaque strong { color: var(--gold); font: 15px Georgia, serif; letter-spacing: 3px; text-transform: uppercase; }
.game-mode-plaque span { color: #b9c4b3; font-size: 10px; letter-spacing: .06em; }
.turn-splash-round { display: block; color: var(--turn-player-color, var(--gold)); font-size: 12px; letter-spacing: 5px; text-transform: uppercase; }
.turn-splash-title { display: block; margin: 12px 0; color: #f5ead0; font: clamp(42px, 7vw, 92px) Georgia, serif; text-shadow: 0 5px 35px #000; }
.turn-splash-subtitle { display: block; color: var(--gold); font: clamp(19px, 2.5vw, 32px) Georgia, serif; letter-spacing: 2px; }
.turn-splash.victory-splash { background: radial-gradient(circle, #34245eea 0%, #050a07f7 78%); animation-duration: 4.2s; }
.victory-splash .turn-splash-content { position: relative; z-index: 2; animation-duration: 4.2s; }
.victory-splash .turn-splash-title { color: #fff0a8; text-shadow: 0 0 24px #f6c45388, 0 5px 35px #000; }
.victory-fireworks { position: absolute; inset: 0; overflow: hidden; }
.victory-fireworks[hidden] { display: none; }
.firework-spark { position: absolute; left: var(--left); top: var(--top); width: 8px; height: 8px; border-radius: 50%; background: var(--spark-color); box-shadow: 0 0 12px var(--spark-color); animation: firework-explode 1.45s ease-out var(--delay) infinite; }
@keyframes firework-explode { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.8); } }
@keyframes turn-splash-zoom { 0% { opacity: 0; transform: scale(.3); } 16% { opacity: 1; transform: scale(1.14); } 28%, 76% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes turn-splash-fade { 0% { opacity: 0; } 10%, 78% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .turn-splash-content { animation-name: turn-splash-fade; } }
@media (max-width: 1150px) { .game-layout { grid-template-columns: minmax(350px, 1fr) 285px; } }
@media (max-width: 1000px) { .game-map-name { display: none; } }

/* Infobulles d'aide (data-tooltip) et icône d'information des cartes. */
/* Au-dessus de toutes les surcouches du jeu (combat-outcome 1800, phase-toast 1900, turn-splash 2000). */
.game-tooltip { position: fixed; z-index: 2100; max-width: 280px; background: #111713f2; border: 1px solid #6c785f; border-radius: 5px; box-shadow: 0 8px 30px #000a; padding: 10px 12px; font-size: 11px; line-height: 1.5; color: #cfd6cf; pointer-events: none; }
.info-dot { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--gold-dark); background: transparent; color: var(--gold); font: 700 10px Georgia, serif; cursor: help; vertical-align: 2px; margin-left: 6px; padding: 0; }

/* Zone repliable « Détails de l'attaque » du panneau de commandement. */
.order-details { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 2px; }
.order-details summary { cursor: pointer; color: var(--muted); font-size: 11px; padding: 7px 0; user-select: none; list-style: none; }
.order-details summary::before { content: '▸ '; color: var(--gold); }
.order-details[open] summary::before { content: '▾ '; }
.order-details summary:hover { color: var(--gold); }

/* Vainqueur : couronne au-dessus de la photo et halo doré sur la carte joueur. */
.player-card.winner { border-color: var(--gold); box-shadow: 0 0 18px #f6c45344, inset 0 0 22px #f6c45314; }
/* Sélecteur renforcé : sans la classe sur le <img>, la règle générique .player-card img
   (46px, bordure, rond) s'appliquerait à la couronne. */
.player-card img.player-crown { position: absolute; top: -13px; left: 18px; width: 32px; height: 32px; object-fit: contain; border: 0; border-radius: 0; transform: rotate(-8deg); filter: drop-shadow(0 3px 4px #000c); z-index: 2; pointer-events: none; }


/* === Authentification, accueil et mode en ligne ============================================ */

.user-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold); font-size: 12px; background: #ffffff08; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Badge administrateur : identifie un compte admin connecté (classe partagée avec GameConnect). */
.admin-badge { color: var(--gold); font-size: 12px; }
/* Le badge du compte est un bouton (renommage du pseudo au clic) : même allure, curseur d'action. */
button.user-chip { cursor: pointer; font: inherit; }
button.user-chip:hover { border-color: var(--gold-dark); background: #d1b46a18; }
/* Compteur de joueurs connectés, dans la barre de titre (tous les écrans de play.php) :
   centré entre la marque et les actions — en flux flex, il était masqué dès que la fenêtre
   rétrécissait. */
.online-count-chip { position: absolute; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.online-count-chip strong { color: var(--gold); font-size: 12px; }
/* Champ de bataille : la plaque de mode est centrée et le space-between repoussait le chip
   sous elle. Ancrage fixe juste après la marque — entre MEDIEVAL RISK et la plaque. */
.online-count-chip.in-game { left: 280px; right: auto; transform: none; }

.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, #1c2a20 0%, #0c120e 70%); padding: 24px; }
.auth-card { width: 400px; background: #131a15f2; border: 1px solid #6c785f; border-radius: 10px; box-shadow: 0 20px 60px #000c; padding: 28px; }
.auth-card .auth-mark { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); color: var(--gold); font: 700 18px Georgia, serif; margin-bottom: 14px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; color: #ece5cf; }
.auth-card > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.auth-error { margin: 0; padding: 9px 12px; border: 1px solid #a04434; border-radius: 5px; background: #a0443422; color: #f0a08e; font-size: 12px; }
.auth-switch { margin: 16px 0 0; text-align: center; }

.home-screen, .online-screen { min-height: 100vh; display: flex; flex-direction: column; }
.home-layout { flex: 1; display: grid; grid-template-columns: 1fr 330px; gap: 20px; padding: 22px; align-items: start; }
/* Colonne principale : les 3 modes en haut, les parties en cours dessous — l'espace sous les
   cartes n'est plus perdu, parties et statistiques vivent chacunes dans leur panneau. */
.home-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
/* Rangée sous les 3 modes : parties en cours, salles en attente et messagerie côte à
   côte, à gauche des stats ; repli en colonne quand l'espace manque. */
.home-sub-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.home-games-panel, .home-messages-panel, .home-game-chats-panel { padding: 16px; min-width: 0; }
.home-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
/* Les 3 portes du jeu : chacune a son univers coloré (dégradé teinté + liseré), un sprite
   de tuile en filigrane ancré dans l'art du jeu et un médaillon glyph. Le filigrane s'anime
   au survol pour inviter le clic. */
.home-mode { position: relative; overflow: hidden; display: block; min-height: 185px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; transition: border-color .18s, transform .18s, box-shadow .18s; }
.home-mode::before { content: ''; position: absolute; right: -30px; bottom: -38px; width: 200px; height: 200px; background-position: center; background-repeat: no-repeat; background-size: contain; opacity: .45; filter: drop-shadow(0 10px 18px #000c); transform: rotate(-8deg); transition: opacity .22s, transform .22s; pointer-events: none; }
.home-mode:hover::before { opacity: .85; transform: rotate(-3deg) scale(1.07); }
.home-mode.local { background: linear-gradient(160deg, #2b1f0ecc 0%, #151009 55%), radial-gradient(120% 90% at 15% 0%, #d5a83b2e, transparent 60%); border-color: #6b5426; }
.home-mode.local::before { background-image: url('../Tiles/hexPlainsCastleFortified00.png'); }
.home-mode.online { background: linear-gradient(160deg, #12233acc 0%, #0d1520 55%), radial-gradient(120% 90% at 15% 0%, #4f83c233, transparent 60%); border-color: #2e4d75; }
.home-mode.online::before { background-image: url('../Tiles/hexMountainCastle00.png'); }
.home-mode.editor { background: linear-gradient(160deg, #17301bcc 0%, #0f1a11 55%), radial-gradient(120% 90% at 15% 0%, #65a66f2b, transparent 60%); border-color: #3c5c40; }
.home-mode.editor::before { background-image: url('../Tiles/hexDirtCastle00_green.png'); }
.home-mode .eyebrow, .home-mode h2, .home-mode p { position: relative; z-index: 1; }
.home-mode .mode-glyph { position: absolute; z-index: 1; top: 16px; right: 16px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; font-size: 21px; background: #0007; box-shadow: inset 0 0 0 1px #ffffff22, 0 4px 10px #0008; }
.home-mode.local .mode-glyph { color: #e8c96a; }
.home-mode.online .mode-glyph { color: #8fb8e8; }
.home-mode.editor .mode-glyph { color: #9fd0a4; }
.home-mode:hover { transform: translateY(-2px); box-shadow: 0 12px 32px #0009; }
.home-mode.local:hover { border-color: var(--gold); box-shadow: 0 12px 32px #0009, 0 0 24px #d5a83b33; }
.home-mode.online:hover { border-color: #6f9fd8; box-shadow: 0 12px 32px #0009, 0 0 24px #4f83c233; }
.home-mode.editor:hover { border-color: #8fae7c; box-shadow: 0 12px 32px #0009, 0 0 24px #65a66f33; }
.home-mode h2 { margin: 6px 0 8px; font-size: 19px; color: #ece5cf; }
.home-mode p { margin: 0; max-width: 78%; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
/* Colonne latérale de l'accueil : réservée aux statistiques, étirée sur toute la hauteur
   disponible de la grille. */
.home-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; align-self: stretch; }
.home-stats-panel { padding: 16px; flex: 1; }
/* Le container des messages défile seul (la page ne bouge pas). Un SEUL plafond : celui du
   fil ouvert a été retiré — des scrolls imbriqués rendaient le bouton d'envoi inaccessible. */
.home-messages { display: flex; flex-direction: column; gap: 8px; max-height: min(480px, 60vh); overflow-y: auto; padding-right: 4px; }
.home-stats .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #ffffff06; }
.stat strong { display: block; font-size: 22px; color: #ece5cf; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.win strong { color: #9fd08a; }
.stat.loss strong { color: #e08a7a; }
.stat.abandon strong { color: #c9a44a; }
.home-subtitle { margin: 10px 0 6px; font-size: 13px; color: var(--gold); }
.opponent-list { list-style: none; margin: 0; padding: 0; }
.opponent-list li { display: flex; justify-content: space-between; padding: 5px 2px; border-bottom: 1px dashed var(--line); font-size: 12px; color: #cfd6cf; }
.opponent-count { color: var(--muted); }
.home-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.home-game { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff06; color: inherit; text-decoration: none; }
.home-game:hover { border-color: var(--gold); }
.home-game-name { font-weight: 700; color: #ece5cf; font-size: 13px; }
.home-game-offline { color: #e0a83c; font-size: 14px; line-height: 1; cursor: help; margin-left: 6px; vertical-align: -1px; }
.home-game-meta { font-size: 11px; color: var(--muted); }
/* « En pause » : partie en ligne dont aucun joueur humain n'a de navigateur ouvert —
   statut discret, différent du badge de visibilité. */
.home-game-status.paused { color: #b8a06a; border-bottom: 1px dotted #b8a06a88; }
.home-game-badge { align-self: flex-start; margin-top: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
/* Rangée de badges des parties en ligne : « En ligne » (nature) + « Privée »/« Publique »
   (visibilité), côte à côte. */
.home-game-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.home-game-badge.online { color: #8fb6e0; border-color: #8fb6e066; }
.home-game-badge.private { color: #d8b46a; border-color: #d8b46a66; }
.home-game-badge.public { color: #8fce9a; border-color: #8fce9a66; }

.online-layout { flex: 1; display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding: 22px; align-items: start; }
.online-public, .online-mine { padding: 16px; }
.online-join-code { display: flex; gap: 8px; margin-bottom: 14px; }
.online-join-code input { flex: 1; }
.online-list { display: flex; flex-direction: column; gap: 10px; }
.online-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff06; color: inherit; text-decoration: none; }
a.online-item:hover { border-color: var(--gold); }
.online-item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.online-item-main strong { color: #ece5cf; font-size: 14px; }
.online-item-main span { font-size: 11.5px; color: var(--muted); }
.online-host { color: #a8b6c9; }
.online-item-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.online-host-offline { color: #e0a83c; font-size: 16px; line-height: 1; cursor: help; }
.online-slots { font-size: 12px; color: var(--gold); border: 1px solid #f6c45344; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
@media (max-width: 1000px) { .home-layout, .online-layout { grid-template-columns: 1fr; } .home-sub-columns { grid-template-columns: 1fr; } }

/* Salle d'attente affichée sur la carte (partie en ligne non démarrée). */
.waiting-panel { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: #0a0f0bd9; }
.waiting-panel[hidden] { display: none; }
.waiting-card { width: 460px; max-width: calc(100% - 40px); background: #131a15f5; border: 1px solid #6c785f; border-radius: 10px; box-shadow: 0 20px 60px #000c; padding: 24px; }
.waiting-card h2 { margin: 4px 0 6px; font-size: 21px; color: #ece5cf; }
.waiting-code { font-size: 13px; color: var(--muted); }
.waiting-code strong { color: var(--gold); letter-spacing: .18em; font-size: 15px; }
.waiting-players { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.waiting-player { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--player-color); border-radius: 6px; padding: 8px 12px; background: #ffffff06; }
.waiting-player span:last-child { color: var(--muted); font-size: 11.5px; }
.waiting-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--player-color); box-shadow: 0 0 8px var(--player-color); }
.waiting-player span.waiting-offline { color: #e0a83c; font-size: 14px; line-height: 1; cursor: help; margin-left: auto; }

/* Messagerie de l'accueil (joueurs ↔ administrateurs) : fil en bulles, conversations
   repliables pour l'admin, badge des messages non lus. */
.messages-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #a33; color: #fff; font-size: 10px; font-weight: 700; vertical-align: middle; }
.messages-badge[hidden] { display: none; }
.home-messages { display: flex; flex-direction: column; gap: 8px; }
.msg-conversation { border: 1px solid var(--line); border-radius: 8px; background: #ffffff05; }
.msg-conversation summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 12px; color: #ece5cf; }
.msg-conversation[open] summary { border-bottom: 1px solid var(--line); }
.msg-meta { color: var(--muted); font-size: 10px; display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.msg-date { color: #8fa392; }
.msg-channel { border: 1px solid var(--gold-dark); color: var(--gold); border-radius: 999px; padding: 1px 8px; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.msg-count { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; background: #ffffff08; white-space: nowrap; }
.msg-unread { color: #ff8a7a; font-weight: 700; }
.msg-thread { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.msg-bubble { max-width: 85%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff08; }
.msg-bubble small { display: block; font-size: 9px; color: var(--muted); margin-bottom: 3px; }
.msg-bubble p { margin: 0; font-size: 12px; line-height: 1.5; color: #dfe5da; white-space: pre-wrap; word-break: break-word; }
.msg-bubble.mine { align-self: flex-end; border-color: var(--gold-dark); background: #d1b46a14; }
.msg-reply { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-top: 1px dashed var(--line); }
.msg-reply textarea { width: 100%; resize: vertical; background: #0d120c; border: 1px solid var(--line); border-radius: 6px; color: inherit; padding: 8px; font: inherit; font-size: 12px; }
.msg-reply .button { align-self: flex-end; }

/* Rubrique « Parties en attente de joueurs » de l'accueil : cartes compactes (créateur,
   âge, infos principales), badge doré de remplissage de la salle. */
.home-waiting-panel { padding: 16px; }
.home-waiting { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.home-game-badge.waiting { align-self: flex-start; border: 1px solid var(--gold-dark); color: var(--gold); border-radius: 999px; padding: 2px 8px; font-size: 10px; }

/* Cas des salles où l'on participe déjà / complètes (rubrique « en attente » de l'accueil). */
.home-game-badge.mine { align-self: flex-start; border: 1px solid #6f9fd8; color: #9fc3ef; border-radius: 999px; padding: 2px 8px; font-size: 10px; }
.home-game-badge.full { align-self: flex-start; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 2px 8px; font-size: 10px; }
.home-waiting-game.disabled { opacity: .55; }

/* ─── Panneaux sur le fond d'écran ────────────────────────────────────────────
   --panel-solid (100 % = rendu d'origine) est posée en style inline sur <body> par
   play.php (préférence du compte) et pilotée par le curseur « Panneaux transparents »
   du dialogue Fond d'écran (aperçu en direct, home.js). Les zones à fond gris sombre
   passent par un color-mix : l'image de fond transparaît quand la valeur descend.
   Sans fond d'écran, la transparence révèle le fond body (--bg), quasi identique. */
.panel, .dialog { background: color-mix(in srgb, var(--panel) var(--panel-solid, 100%), transparent); }
.topbar, .tool-toolbar { background: color-mix(in srgb, #151c18 var(--panel-solid, 100%), transparent); }
.player-card { background: color-mix(in srgb, #111713 var(--panel-solid, 100%), transparent); }
.waiting-card { background: color-mix(in srgb, #131a15f5 var(--panel-solid, 100%), transparent); }
input, select, textarea { background: color-mix(in srgb, #111713 var(--panel-solid, 100%), transparent); }
.game-chat-panel { background: color-mix(in srgb, #101813 var(--panel-solid, 100%), transparent); }

/* Fond d'écran du hub : image plein cadre sous tout, voile sombre pour la lisibilité des
   panneaux par-dessus. La transparence du body n'est activée QUE si un fond est présent. */
body.has-wallpaper { background: transparent; }
.wallpaper { position: fixed; inset: 0; z-index: -2; background: center / cover no-repeat; }
/* Voile assombissant réglable (--wallpaper-veil, curseur du dialogue Fond d'écran) : à 0
   l'image est pure, à 1 quasi opaque. Dégradé allégé pour laisser respirer l'image. */
.wallpaper-veil { position: fixed; inset: 0; z-index: -1; opacity: var(--wallpaper-veil, .45); background: radial-gradient(120% 100% at 50% 0%, #0d130fa0 0%, #0d130fd8 70%, #0d130fe8 100%); }

/* Champ de bataille : sans fond d'écran, le container garde son fond à points (editor.css) ;
   avec un fond d'écran, les points, le fond opaque du container et celui de son parent
   .map-workspace (#101612, editor.css) sont retirés pour laisser transparaître l'image sous
   et autour de la carte — le canvas est transparent hors du monde dessiné. Une légère teinte
   sombre reste posée pour garder un peu de contraste sous la map. */
body.has-wallpaper #game-shell .map-workspace { background: transparent; }
body.has-wallpaper #game-canvas-container { background-color: #0d130f40; background-image: none; }

/* Galerie du dialogue de choix du fond d'écran. */
.wallpaper-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.wallpaper-choice { position: relative; display: block; padding: 0; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.wallpaper-choice img { display: block; width: 100%; height: 84px; object-fit: cover; }
.wallpaper-choice.selected { border-color: var(--gold); box-shadow: 0 0 12px #d5ad4566; }
.wallpaper-choice .wallpaper-choice-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 8px; font-size: 9px; color: #ece5cf; background: #0d130fd9; text-align: left; }
.wallpaper-choice.default-choice img { object-fit: none; background: #10160f; }

/* Tableau de gestion des comptes (dialog admin de l'accueil). */
.admin-users-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.admin-users-table th { text-align: left; padding: 6px 8px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-users-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.admin-users-table tr.admin-user-inactive td { opacity: .55; }
.admin-users-count { text-align: center; font-weight: 700; }
.admin-users-password { display: flex; gap: 5px; }
.admin-users-password input { min-width: 90px; padding: 5px 7px; font-size: 10px; }
.admin-users-password .button { flex: 0 0 auto; padding: 5px 9px; font-size: 10px; }
.admin-star { color: var(--gold); }
.admin-users-list { max-height: 55vh; overflow: auto; }
.admin-stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 8px; }
/* Bandeaux compacts des stats admin : valeur + libellé en ligne, au lieu des grandes tuiles
   du stats-grid de l'accueil (pensé pour la colonne latérale, il se pile en colonne ici). */
.admin-stats-strip { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 11px; border: 1px solid var(--line-soft); border-radius: 5px; background: #111713; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.admin-stats-strip strong { color: var(--text); font-size: 13px; margin-right: 3px; }
.admin-stats-strip .strip-online strong { color: #a8d9a0; }

/* ─── Page d'accueil publique (index.php) ───────────────────────────────────
   Carte posée sur le fond d'écran par défaut (voile un peu plus marqué que le
   hub pour la lisibilité du texte de présentation). */
.landing-body { min-height: 100vh; display: grid; place-items: center; padding: 26px 16px; }
/* Panneau sombre translucide derrière tout le contenu : l'image reste visible en bordure,
   le texte gagne un fond uniforme qui le détache du décor et le rend net. */
.landing { width: min(720px, 94vw); text-align: center; color: var(--text); padding: 34px 34px 26px; border-radius: 14px; background: #0a0f0cb8; box-shadow: 0 12px 60px #000b; }
.landing-brand { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.landing-brand .brand-mark { width: 46px; height: 52px; font-size: 16px; }
.landing-brand strong { display: block; font-family: Georgia, serif; letter-spacing: 2px; font-size: 15px; }
.landing-brand span:last-child { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.landing h1 { font-family: Georgia, serif; font-size: clamp(30px, 6vw, 46px); margin: 0 0 10px; color: #ece5cf; text-shadow: 0 3px 18px #000c; }
.landing-tagline { margin: 0 auto 16px; max-width: 560px; color: var(--gold); font-size: 14px; }
.landing-description { margin: 0 auto 22px; max-width: 580px; color: #c4cdc5; font-size: 13px; line-height: 1.65; }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.landing-feature { padding: 14px 10px 12px; border: 1px solid var(--line-soft); border-radius: 7px; background: #111713e0; }
.landing-feature .mode-glyph { font-size: 24px; }
.landing-feature h2 { margin: 7px 0 5px; font-family: Georgia, serif; font-size: 14px; color: #ece5cf; }
.landing-feature p { margin: 0; color: #b7c1b8; font-size: 11px; line-height: 1.5; }
.landing-free { margin: 0 0 20px; font-size: 12px; color: #d3dad4; }
.landing-free strong { color: var(--gold); }
.landing-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.landing-actions .button { padding: 13px 30px; font-size: 14px; border-radius: 6px; text-decoration: none; }
.landing-actions .button.ghost { border-color: #637168; color: var(--text); }
.landing-foot { margin: 0; color: #a8b3aa; font-size: 10px; }
@media (max-width: 560px) { .landing-features { grid-template-columns: 1fr; } }

/* ─── Tchat public de la partie en ligne ──────────────────────────────────── */
/* Saisie fixe dans le pied de page (parties en ligne uniquement) : position absolue centrée,
   indépendante du flux — les infos de survol des cases (à sa gauche) changent de largeur à
   chaque survol et feraient bouger un élément en flux. Messages de 100 caractères max. */
.map-statusbar { position: relative; }
.game-chat-form { position: absolute; left: 50%; transform: translateX(-50%); bottom: 3px; display: flex; align-items: center; gap: 6px; width: min(440px, 60%); margin: 0; z-index: 5; }
.game-chat-form[hidden] { display: none; }
.game-chat-form .icon-button { flex: 0 0 auto; width: 24px; height: 24px; font-size: 13px; }
.game-chat-form input { flex: 1; min-width: 0; height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 12px; background: #0d130f; color: var(--text); font-size: 11px; }
.game-chat-form input:focus { outline: none; border-color: var(--gold-dark); }
.game-chat-form input::placeholder { color: var(--muted); }
.game-chat-send { flex: 0 0 auto; height: 24px; padding: 0 12px; font-size: 10px; }

/* Bulles BD au-dessus du héros de l'émetteur : calque plein écran sans interaction,
   repositionné à chaque frame (zoom, glisser de carte, tweens de caméra). */
.game-chat-bubbles { position: absolute; inset: 0; z-index: 18; pointer-events: none; overflow: hidden; }
.game-chat-bubble { position: absolute; max-width: 210px; padding: 8px 12px; border: 2px solid #2a2118; border-radius: 14px; outline: 3px solid var(--bubble-color, #d5ad45); background: #f5eedae8; color: #241c10; font-size: 12px; font-weight: 600; line-height: 1.35; text-align: center; translate: -50% calc(-100% - 16px); box-shadow: 0 5px 14px #0008; animation: game-chat-bubble-in .22s cubic-bezier(.2, .9, .3, 1.3) both; }
/* Queue de bulle pointant vers le héros. */
.game-chat-bubble::after { content: ''; position: absolute; left: 50%; bottom: -11px; translate: -50% 0; border: 6px solid transparent; border-top: 9px solid var(--bubble-color, #d5ad45); }
.game-chat-bubble::before { content: ''; position: absolute; left: 50%; bottom: -6px; translate: -50% 0; border: 4px solid transparent; border-top: 7px solid #f5eeda; z-index: 1; }
@keyframes game-chat-bubble-in { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }

/* Panneau de tous les messages : zone semi-transparente par-dessus la carte, calée entre
   la carte et le panneau ROYAUMES/COMMANDEMENT (bord droit de la zone carte). */
.game-chat-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; z-index: 25; width: min(320px, 78%); display: flex; flex-direction: column; padding: 10px 12px; border: 2px solid var(--gold-dark); border-radius: 12px; background: #101813d9; box-shadow: 0 8px 25px #0009; color: var(--text); backdrop-filter: blur(3px); }
.game-chat-panel[hidden] { display: none; }
.game-chat-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.game-chat-history { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 3px; }
.game-chat-line { display: flex; align-items: flex-start; gap: 7px; padding: 5px 8px; border-radius: 8px; background: #0d130fa6; font-size: 11px; line-height: 1.4; }
.game-chat-line small { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: 9px; padding-top: 1px; }
.game-chat-line-body { display: flex; flex-direction: column; min-width: 0; }
.game-chat-line-body strong { color: var(--chat-color, var(--gold)); font-size: 10px; }
.game-chat-line-body span { overflow-wrap: anywhere; }
/* Pastille de couleur du joueur (panneau de partie et bulles des archives de l'accueil). */
.game-chat-dot { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: var(--chat-color, #d5ad45); box-shadow: 0 0 0 2px #00000030; }
.msg-bubble .game-chat-dot { margin: 0 4px 0 0; width: 8px; height: 8px; }
/* Zone « Conversations de parties » de l'accueil : reprise du style accordéon de la messagerie. */
.home-game-chats-panel[hidden] { display: none; }
/* Même contrat que la messagerie : la zone défile seule (scrollbar), la page ne bouge pas. */
.home-game-chats { display: flex; flex-direction: column; gap: 8px; max-height: min(480px, 60vh); overflow-y: auto; padding-right: 4px; }
/* Retrait d'une conversation de SON flux : bouton discret dans l'en-tête de l'accordéon. */
.game-chat-delete { flex: 0 0 auto; width: 22px; height: 22px; margin-left: 6px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer; }
.game-chat-delete:hover { color: #ffb3a8; border-color: #a33; background: #a33226; }
