/* Parties : liste, import, détail et analyse. */

/* ---------- Liste ---------- */
.gm-hero-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-running { margin-top: 10px; padding: 0 4px; gap: 10px; }
.gm-spin { width: 18px; height: 18px; border-width: 2px; flex: none; }
.gm-how .card { display: flex; flex-direction: column; gap: 8px; }
.gm-step { font-size: 36px; line-height: 1; color: var(--gold); }
.gm-filters { flex-wrap: wrap; align-items: center; }
.gm-filters .seg { margin-left: auto; flex-wrap: wrap; }
.gm-filters .seg .faint { font-weight: 600; margin-left: 3px; }
.gm-section + .gm-section { margin-top: 24px; }
.gm-section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.gm-list { display: flex; flex-direction: column; gap: 8px; }
.card.click.gm-row { display: grid; grid-template-columns: 5px 56px minmax(0, 1fr) auto auto; grid-template-areas: "res mini main state score"; align-items: center; column-gap: 14px; padding: 10px 16px 10px 10px; }
.gm-row .res { grid-area: res; align-self: stretch; width: 100%; border-radius: 3px; }
.gm-mini { grid-area: mini; width: 56px; }
.gm-mini .mini-board { border-radius: 5px !important; }
.gm-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gm-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.gm-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.gm-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-state { grid-area: state; }
.gm-score { grid-area: score; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 64px; }
.gm-score .num { font-size: 24px; line-height: 1; }
.gm-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; }
.card.click.gm-accounts { display: flex; align-items: center; gap: 14px; }
@media (max-width: 640px) {
  .card.click.gm-row { grid-template-columns: 5px minmax(0, 1fr) auto; grid-template-areas: "res main score" "res state score"; row-gap: 6px; }
  .gm-mini { display: none; }
  .gm-state { justify-self: start; }
  .gm-filters .seg { margin-left: 0; }
}

/* ---------- Feuille d'import ---------- */
dialog.sheet.imp { max-width: min(600px, calc(100vw - 24px)); }
.imp-head { display: flex; align-items: center; gap: 12px; }
.imp-head .display { flex: 1; font-size: 30px; }
.imp-tabs, .imp-plats { display: flex; width: 100%; margin-top: 14px; }
.imp-tabs button, .imp-plats button { flex: 1; }
.imp-plats { margin-top: 12px; }
.imp-plats button[aria-pressed="true"] { background: var(--gold); color: #120e04; box-shadow: none; }
.imp-search { display: flex; gap: 8px; margin-top: 10px; }
.imp-search .input { flex: 1; min-width: 0; }
.imp-search .btn { min-height: 46px; }
.imp .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px rgba(229,72,77,.6); }
.imp-err { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--red-text); }
.imp-box { margin-top: 12px; padding: 14px; }
.imp-box p { margin-top: 4px; line-height: 1.45; }
.imp-title { display: block; font-size: 15px; font-weight: 700; color: var(--ivory); }
.imp-found { box-shadow: inset 0 0 0 1.5px rgba(61,255,160,.45); }
.imp-found .imp-title { font-size: 16px; margin-top: 4px; }
.imp-drop { margin-top: 14px; width: 100%; min-height: 150px; padding: 16px; border-radius: 14px; border: 1.5px dashed rgba(212,175,55,.45); background: transparent; color: var(--ivory); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.imp-drop:hover, .imp-drop.drag-on { background: rgba(212,175,55,.06); border-color: var(--gold); }
.imp-drop b { font-size: 15px; }
.imp-pgn { margin-top: 12px; min-height: 160px; max-height: 320px; }
.imp-foot { display: flex; align-items: center; gap: 9px; margin-top: 16px; font-size: 12.5px; }
.imp-foot svg { flex: none; }

/* ---------- Détail d'une partie ---------- */
.page.gd { max-width: 1240px; }
.gd-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.gd-top .icon-btn { flex: none; color: var(--ivory); }
.gd-title { min-width: 0; }
.gd-title h1.display { font-size: clamp(30px, 4vw, 44px); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-title .meta { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 28px; align-items: start; }
/* L'échiquier tient dans la hauteur de l'écran et reste visible pendant qu'on parcourt le panneau. */
.gd-left { position: sticky; top: 20px; width: 100%; max-width: min(720px, max(320px, calc(100vh - 230px))); justify-self: center; }
.gd-left .board-wrap { max-width: none; }
.gd-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.gd-player { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 4px 2px; min-width: 0; }
.gd-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gd-sw { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.gd-sw.white { background: var(--ivory); }
.gd-sw.black { background: #0b0b0b; box-shadow: inset 0 0 0 1.5px #c9a64a; }
.gd-score { font-size: 22px; line-height: 1; }
.gd-eval { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.gd-evalbar { flex: 1; height: 8px; border-radius: 4px; background: #0b0b0b; box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
.gd-evalbar i { display: block; height: 100%; background: var(--ivory); transition: width .25s; }
.gd-evalword { min-width: 150px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--text2); }
.gd-nav { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.gd-nav .icon-btn { flex: 1; width: auto; height: 46px; color: var(--ivory); }
.gd-nav .icon-btn[disabled] { opacity: .4; cursor: not-allowed; }
.gd-at { flex: 1.3; text-align: center; font-size: 18px; color: var(--meta); white-space: nowrap; }

.gd-status .row { gap: 8px; }
.gd-status.done { background: #100f0c; box-shadow: inset 0 0 0 1px var(--gold-ring); }
.gd-sum { margin-top: 8px; line-height: 1.5; }
.gd-small { margin-top: 8px; font-size: 13px; line-height: 1.45; }
.gd-pct { font-size: 22px; line-height: 1; color: var(--ink); }
.gd-bar-faint > i { background: var(--faint); }
.gd-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.gd-acc div { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border-radius: 10px; background: var(--raised); }
.gd-acc b { font-size: 24px; font-weight: 400; line-height: 1; }
.gd-color .choice { gap: 12px; }

.gd-sheet .section-head { margin-bottom: 8px; }
.gd-sheet h3.display { font-size: 22px; }
.gd-keys { margin-left: auto; }
@media (pointer: coarse) { .gd-keys { display: none; } }
.gd-moves { position: relative; display: grid; grid-template-columns: 38px 1fr 1fr; gap: 2px 4px; max-height: 260px; overflow: auto; padding: 2px; overscroll-behavior: contain; }
.gd-num { padding: 6px 0 0 4px; font-size: 12.5px; color: var(--faint); }
.gd-mv { text-align: left; border: 0; background: none; padding: 5px 8px; border-radius: 6px; color: var(--ivory); font-weight: 600; font-size: 14px; cursor: pointer; }
.gd-mv:hover { background: var(--raised); }
.gd-mv.na { color: var(--faint); }
.gd-mv.at { background: var(--gold); color: #120e04 !important; }
.gd-mv.empty { color: var(--faint); cursor: default; }
.gd-mv.empty:hover { background: none; }

.gd-curve { position: relative; margin-top: 10px; padding-bottom: 8px; cursor: pointer; }
.gd-curve svg.spark { height: 96px; }
.gd-tick { position: absolute; bottom: 0; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; pointer-events: none; }
.gd-cursor { position: absolute; top: 0; bottom: 8px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--gold); pointer-events: none; }
.gd-lbl { position: absolute; left: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); pointer-events: none; }
.gd-lbl.top { top: 0; }
.gd-lbl.bot { bottom: 12px; }

.gd-moments .section-head { margin-bottom: 2px; }
.gd-moments h3.display { font-size: 22px; }
.gd-moment { padding: 13px 0 12px; border-top: 1px solid var(--hair); }
.gd-moments .section-head + .gd-moment { border-top: 0; }
.gd-moment.on { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; background: rgba(212,175,55,.06); }
.gd-foot { text-align: center; font-size: 12px; line-height: 1.45; }

@media (max-width: 1000px) {
  .gd-layout { grid-template-columns: 1fr; gap: 18px; }
  .gd-left { position: static; max-width: 640px; }
}
@media (max-width: 640px) {
  .gd-evalword { min-width: 0; }
  .gd-top { gap: 10px; }
}
