/* Summit — styles de l'appli (CSS simple, sans framework) */
:root {
  --bg: #eef2f5;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #6b7785;
  --border: #d6dde4;
  --accent: #1f6f5c;
  --danger: #c0392b;
  --radius: 10px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.4; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
a { color: var(--accent); }

.site-header { background: #17324a; padding: .6rem 1rem; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.15rem; }
.container { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.narrow { max-width: 560px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.stack label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.scroll-x { overflow-x: auto; }

input[type=text], select, input[type=number] { font: inherit; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
input[type=number] { width: 3.5rem; text-align: center; }

.btn { font: inherit; display: inline-block; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--border); background: #f7f9fb; color: var(--text); cursor: pointer; text-decoration: none; }
.btn:hover { background: #e9eef3; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: .1rem .5rem; }
form.button_to { display: inline; }

.flash { padding: .6rem 1rem; border-radius: 8px; }
.flash.notice { background: #e3f4ec; }
.flash.alert, p.alert { background: #fde8e6; color: var(--danger); padding: .4rem .7rem; border-radius: 6px; }

.badge { font-size: .7rem; background: #e3e8ee; border-radius: 99px; padding: .05rem .45rem; margin-left: .25rem; vertical-align: middle; font-weight: 600; }
.badge.you { background: var(--accent); color: #fff; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--player, #999); margin-right: .35rem; vertical-align: middle; }
.seat-list .dot { background: inherit; }
.seat-list { list-style: none; padding: 0; }
.seat-list li { padding: .3rem 0; }

/* --- salle --- */
.share { display: flex; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.share label { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.share input { width: 100%; }
.hero-picker { border: 1px solid var(--border); border-radius: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.hero-option { display: flex !important; flex-direction: row !important; gap: .5rem; align-items: flex-start; font-weight: normal !important; padding: .4rem; border-radius: 6px; cursor: pointer; }
.hero-option:has(input:checked) { background: #e3f4ec; }
.hero-option small { display: block; color: var(--muted); }

/* --- barre de statut --- */
.status-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; }
.status-list { display: flex; flex-wrap: wrap; gap: .75rem; list-style: none; margin: 0; padding: 0; }
.status-list small { color: var(--muted); margin-left: .25rem; }
.winners { text-align: center; background: #fff8e1; }

/* --- pastilles de couleur --- */
.chip { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .8rem; color: #fff; background: #999; margin: .1rem 0; }
.chip--recrues { background: #9b59b6; }
.chip--sponsors { background: #4a1a7a; }
.chip--experience { background: #f07c1b; }
.chip--sherpas { background: #3cc6d8; color: #102a30; }
.chip--harnais { background: #8a8f98; }
.chip--relais { background: #1e88e5; }
.chip--assistance { background: #222; }
.chip--polyvalence { background: linear-gradient(90deg, #e53935, #fb8c00, #fdd835, #43a047, #1e88e5, #8e24aa); color: #111; text-shadow: 0 0 3px #fff; }
.chip--blanc { background: #fff; color: #333; border: 1px solid #999; }

/* --- tuiles SVG --- */
.cordee-svg { width: 100%; height: auto; display: block; }
.tile-svg { width: 70px; height: auto; display: block; }
.tile-outline { fill: none; stroke: #333; stroke-width: 1.5; stroke-linejoin: round; }
.tile-outline.hero { stroke: #c9a227; stroke-width: 4; }
.wedge--blanc { stroke: #bbb; stroke-width: .5; }
.edge-label { font-size: 9px; text-anchor: middle; fill: #fff; font-weight: 600; pointer-events: none; }
.edge-label.dark { fill: #222; }
.tile-value-bg { fill: #fff; stroke: #333; stroke-width: 1; }
.tile-value-bg.hero { fill: #fff3c4; stroke: #c9a227; stroke-width: 2.5; }
.tile-value { font-size: 13px; font-weight: 700; text-anchor: middle; fill: #111; pointer-events: none; }
.connection-marker { stroke: #fff; stroke-width: 2.5; }
.lost-cross { stroke: #c0392b; stroke-width: 6; stroke-linecap: round; }
.tile.selected .tile-outline { stroke: #ff006e; stroke-width: 5; }

/* --- constructeur de cordée --- */
.hand { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.hand-tile { background: none; border: 2px solid transparent; border-radius: 8px; padding: 2px; cursor: pointer; }
.hand-tile:hover { border-color: var(--accent); }
.hand-tile .tile-svg { width: 100px; }
.strip { min-height: 80px; padding: .3rem; background: #f7f9fb; border-radius: 8px; cursor: pointer; }

.toolbar { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.toolbar[hidden] { display: none; }
.summary { margin: .5rem 0; }

/* --- activation --- */
fieldset { border: 1px solid var(--border); border-radius: 8px; }
legend { font-weight: 600; padding: 0 .3rem; }
.activation fieldset label { display: inline-flex; flex-direction: column; margin-right: .8rem; font-weight: normal; }
.buy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem; }
.counter { display: flex; align-items: center; gap: .3rem; }
.counter .chip { min-width: 6.5rem; text-align: center; }
label.checkbox { display: block; font-weight: normal; }

/* --- cordées révélées --- */
.revealed { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1rem; }
.revealed-item h3 small { color: var(--muted); font-weight: normal; }

/* --- montagne --- */
.mountain-svg { width: 100%; min-width: 640px; height: auto; display: block; }
.mountain .cell { fill: #f4f6f8; stroke: #b9c3cc; stroke-width: 1; }
.mountain .cell.above-zone { fill: #e8eef3; }
.mountain .cell.zone { fill: #f6c6c0; stroke: #c0392b; }
.mountain .cell.summit { fill: #fff3c4; }
.cell-label { font-size: 10px; text-anchor: middle; fill: #445; }
.zone-sample { display: inline-block; width: .8rem; height: .8rem; background: #f6c6c0; border: 1px solid #c0392b; vertical-align: middle; }
.mountain-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; list-style: none; padding: 0; margin: .3rem 0 0; font-size: .9rem; }
.legend { font-size: .85rem; margin: .3rem 0 0; }

/* --- résultat de manche --- */
.last-round summary { cursor: pointer; }
.dice { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.die { background: #f7f9fb; border: 1px solid var(--border); border-radius: 6px; padding: .1rem .4rem; }
table { border-collapse: collapse; width: 100%; margin: .5rem 0; font-size: .9rem; }
th, td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }

/* --- plateaux des joueurs --- */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.player-board { background: var(--card); border: 1px solid var(--border); border-top: 5px solid var(--player); border-radius: var(--radius); padding: .8rem; }
.player-board.me { box-shadow: 0 0 0 2px var(--player); }
.player-board header p { margin: 0 0 .4rem; }
.board-top { display: flex; gap: .6rem; align-items: flex-start; }
.hero-tile { width: 80px; flex-shrink: 0; }
.powers { list-style: none; padding: 0; margin: 0; font-size: .85rem; color: var(--muted); }
.powers li { margin-bottom: .3rem; }
.powers li.active { color: var(--text); }
.powers li.active strong { color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin: .6rem 0; text-align: center; }
.stats dt { font-size: .75rem; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.track-row { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; font-size: .8rem; }
.track-label { width: 5.5rem; color: var(--muted); flex-shrink: 0; }
.boxes { display: flex; gap: 3px; flex-wrap: wrap; }
.box { width: 1.2rem; height: 1.2rem; border: 1px solid #aab; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; color: #889; }
.box.on { background: #8a8f98; border-color: #666; }
.box.green { background: #d8f0dc; }
.box.pos { outline: 2px solid var(--player); outline-offset: 1px; font-weight: 700; color: var(--text); background: #fff3c4; }
.recrues { display: flex; gap: 6px; flex-wrap: wrap; }
.recrue { display: inline-flex; border: 1px solid #c9b3d6; border-radius: 4px; overflow: hidden; }
.recrue .face { width: 1.05rem; text-align: center; font-size: .7rem; color: #aaa; }
.recrue .face.current { background: #9b59b6; color: #fff; font-weight: 700; }

@media (max-width: 600px) {
  .container { padding: .5rem; }
  .card { padding: .7rem; }
  .hand-tile .tile-svg { width: 64px; }
  .share { flex-direction: column; align-items: stretch; }
}
